Omar Al Kababji  Weird Thoughts From a Weird Mind...

 
Assuming you are a software developer, let me ask you a question, what do you do at work (except drinking coffee)? do you modify code written by others? or do you develop projects from scratch? either way this post is for you. For me Its almost 2 years that I adjust and modify pieces of code written by others (if I just could know where they live), anyway here is the story:

Your boss comes to your office holding a cup of coffee in his hand, and tells you about a new modification, we have to read some information from a .csv file and parse it (YEAAH finally something new to do), this is something that happens everyday, there is a problem and we have to solve it, but lets dig to see how this problem is solved by different programmers?

John, a programmer who is not a programmer (but sadly thinks he is), will consider reading a .csv file the end of the world (I don’t even know what the hell is a csv by the way), he will start spamming all the office asking how he could do it, he will get 10 different ways to solve it, and after wasting 20 days, and interrupting other coworkers during this period, its done... YES YOU CAN JOHN!!. We put John’s modification in a production environment, and we get a big fat NullPointerException, Why? on my PC worked... John its because you considered that the file should be in the directory:

     C:\Documents and Settings\Users\Dump John\Desktop\file.csv

And guess what, that path is written in the source code file, and to change it we need to checkout the project from the repository, change it, recompile it and deploy it again. JOHN take this advise, go find a job in McDonald, and leave programming for real programmers. 

Fred, the second programmer is one who knows everything, he has a 10+ programming experience, he read 15 books about design patterns, he collects certifications as collecting flowers, he used almost all java MVC and web development frameworks, he knows about good programming habits, ok ok you are good Fred, what is your solution? 
  • Create an IDataReader interface that will have a readData() and processData() methods (you have to program  for interfaces).
  • Create a class AbstractDataReader that implements IDataReader and adds many common methods, that will be used by our subclasses.
  • Heey now the file is .csv but in the future may change so lets create those classes CSVDataReader, TSVDataReader, XMLDataReader, DBDataReader, SocketDataReader, FTPDataReader, HTMLDataReader, that will handle almost every kind of file, and lets group text ones alone, and DB alone, so lets make them descendants of AbstractTextDataReader and DBAbstractDataReader.
  • We have DataReader’s for almost any type, but we have to be sure which one to use, so lets create a DataReaderFactory, that will determine the correct file reader and return a proxy to the correct IDataReader object (object factory & proxy pattern).
  • Yeeeeah I like the idea, go on Fred...
  • The way files are processed may change and its not good to put it in a source code file, lets create a proprietary workflow language that can be expressed in plain XML, and use a parser that will parse these commands, and transform them to java code.
  • Lets adapt the delegation design pattern too, I don’t know for what, but it sounds cool I want to use it.
  • Many DataReaders can be operating at the same time, so lets create a pool of IDataReader objects, and lets use Dependency Injection to inject those objects in the classes that will use them.
  • Should we use our own Dependency Injection framework? NO (we are reinventing the wheel) Spring framework provides it, lets integrate Spring in our solution.
  • Since threads are playing we need to put synchronization stuff, and having racing conditions is the last thing we want, this is a serious framework, its Fred’s framework.
  • Everything should be configurable, so lets put everything in .properties files, no wait lets store them in a database, so we can change them without the need to restart the application. 
  • Lets log all operations, and lets also provide a GUI application to manage the threads pool, logs, and configuration parameters. 
  • We should do everything with Aspect Oriented Programming (AOP) in mind, so we can add and remove layers of code without interference. 
  • Ok shut up Fred we got your point.
This is a perfect and nice solution Fred you are really a great programmer, I love your idea. I am not done please keep reading...

Finally Steve a duct tape programmer (as Joel Spolsky describes him in his post)  comes, Steve is just as the previous programmer Fred, but with one additional thing, HE USES THAT THING ON HIS SHOULDERS (yes the head), before even starting to work he asks one or more questions to his boss, to better understand the situation, and after talking with his boss. It is cut clear that those coming information will be only from a .csv file, and they will almost never change. So he decides to go simply with a simple class that reads a file and parse it and thats it. (of course he would make it a bit more flexible to small changes) and everything is done in, lets say... 4 hours? It could be even done in 2 hours.

Got it? No? ok lets continue... after two years both Fred & Steve changed companies (John was shoot by Steve, I told him to find a job in McDonald...), and you can’t reach them anymore, and guess what... a modification is needed. A new piece of information should be passed to the system, so the .csv file has some extra information now, and one additional step should be done when processing the file. And we need someone to do this modification... guess who?? Steve? No. Fred? No. 
I am the one who will do the modification.
In the first case I should waste my time navigating Fred’s framework, moving from one class to another, going up and down in the inheritance tree (Geeez Fred how many classes did you put there). Guys I just need to read a fucking .csv file and process it. 

Finally I get to the point where I can add the new parameter, now what? Oooh yes I have to add the new processing step, yes its easy I just have to validate the new parameter, but please give me one day to learn how the hell can I do it using Fred’s XML workflow language, that its not even working well.

Lets go back, what is the modification? add a parameter and process it. Why for something so easy I should spend so much time? because someone (Fred) who read design patterns thought its cool to do it in that way. Wrong Fred wrong, don’t complicate your life (and mine please) if its not necessary, your boss didn’t ask you to design a general DataReader module that will read everything, even what is written on your dirty pants, he just asked you to extract and process 4 parameters from a .csv file for God sake!! (just give me Fred’s new address).

The bottom line is simple, if you have to read a file just read it as Steve did, but if you need to develop a general data reader module then go Fred’s way, be intelligent, use your head, small things should remain small and simple, its not logical to create a 50 class framework to read a file that can be read in 10 lines of code. 


For me, the best solution was Steve solution, easy, simple, and fast. Have a nice day and remember what Alan Kay said:
Simple things should be simple, complex things should be possible

 
 
Last week I changed my Job, and started working in Rockwell Automation, after spending the last two years working in web development using Java. In this post I would like to share the worst moments in those years. Do you know all the theory we learnt in universities about Object Oriented, code reuse, encapsulation, cohesion, robust systems that don’t break because of a small change? I didn’t see anything of that, projects where started by unexperienced programmers who just heard that Java is Object Oriented without knowing what the hell does that mean.

Working on those spaghetti projects was very frustrating, but in the same time very challenging, it was amazing how some people managed to write indigestible code that makes you through up. This is my top 5 worst codes till now:

1. Do You Call This Validation?
Try to guess what this programmer is trying to do using this piece of code? exactly he is trying to validate the number of days in a month as a part of a bigger date validation method, if the month is 4,6,9,11 it should be 30 days, while if its 1,3,5,7,8,10,12 it should have 31 days, with a special consideration of month 2 and leap years.
Picture
Yes maybe the code is working, but can you read it easily? are you sure its bug free? in your opinion how many people out there needed to validate a date string? maybe something around 1000000 programmers right? Good, So don’t you think that there should be some magical method that will do this for you? What about trying to parse it with a DateFormat instance and catch an exception if something goes wrong? 

Whenever you are up to start coding something just stop and do this conversation with your self:

   yourself: Hi you.
   you: Hi yourself.
   yourself: do you think this operation is very common?
   you: Yes, I Think Date validation is done by many people...
   yourself: do you know something that will do it for you?
   you: No.
   yourself: ok, so ask master Google about “Java Date Validation”.
   you: oooh here is a ready solution, thanks yourself.
   yourself: you are welcome you, see you the next time, bye.
   you: bye yourself. 

2. Is This a Constructor?
Here a programmer wrote this constructor (I took the image using my iPhone), some of you may think yes its a big constructor but he used eclipse automatic code generation tools, NOO, in this constructor there was a tiny bug that I discovered, which made me conclude that this constructor was written by hand. (by the way this is only the top part of the constructor, its not complete).
Picture
For the programmer who wrote this constructor I have two questions, one, why the hell did you write this constructor by hand? two, do you think there is someone much crazier than you that will call a constructor with all that parameters? ok maybe there will be a 0.001% chance that this constructor is needed in that class. But writing it by hand? if I was a manager I would fire him, I don’t need programmers that waste 30 minutes for something that could be done in 1 second (and yet do it wrong).

3. The Power of Encryption
This one is really great, its clear that someone is trying disparately to encode a string. The problem is that this is not encoding, this is starting to become encryption somehow WTF!!. what about performance? how many times is the String parsed and parsed again? never heard about a StringBuilder or StringBuffer? couldn’t you read a bit about encoding before starting your own encoding solutions? guys all this makes our life difficult :(
Picture
4. Ever Heard About Data Integrity?
During my work I was located for 3 months on a project which was using a postgres database and till now everything was wonderful, the problem was that the people who created the database schema never heard about Data Integrity, Primary Keys, Foreign keys ...etc, working with that DB was like putting your data in a trash (it just accepts anything you put in it!!), come on man at least put primary keys for God sake!!

The nice excuse of not forcing data integrity was ... “we don’t need it, all DB access is done through Hibernate”, oooh really? so you are saying that Hibernate doesn’t need constraints? and you are so sure that there will be no other application in the future that will access the database directly? How the hell could you be so sure that you don’t have corrupted data if you don’t have constraints? 

After working on that project I soon realized that there was a lot of trash in the DB, orphan tuples, missing data ...etc. Take this advice, if you see someone using a database without forcing data integrity, and you have the power, just fire him and send him home, there are so many dump ass programmers in this field that we have to get rid of.

5. Best Comments Ever
Everybody should place comments in their code, its good to comment your code. YES!! but if your comments are not useful just don’t write them down and waste my time, how many times did you see something like this:

     //print the value of x if its bigger than 10
     if( x > 10 ) {
        System.out.println(x);
     }

Is this comment useful? I can already see that if x is greater than 10 it will be printed, I am a programmer who reads Java code faster than your comments, writing a comment like this one is an insult for programmers (Yes we know what is an IF statement), I don’t want to see those stupid comments in the code, its even a maintenance nightmare, later when the specification changes, and x should be printed when its greater than 9 instead of 10, I will have to change the code and the stupid comment too. What about this one:

     //the constructor
     public Person( ) {
         //some code
     }

Ok now lets talk seriously, we are Java developers, we are working on a serious project, do you think that someone needs your help, to tell him that, that was a constructor? if your answer is yes, fire him and you will save time and money. If you find comments like this do two things:

   1. Delete them.
   2. Try to locate the person who wrote them and shoot him.

These where the worst codes I ever seen, have you seen codes worst than those? please post them and lets all have fun :-)

 
 
After getting 90% in the SCJP certificate, I was more hungry for Java certifications, so I decided to take both the SCWCD and SCBCD exams, yes I prepared for both exams in parallel. Why? because my company offered to pay for the SCWCD, and I wanted to get certified as fast as possible and it seemed a bit strange to ask for the SCBCD in the same time, so I decided to buy it by my own, and ask for a refund later (which I didn’t have because I changed company after one week of my certification).
Picture
Since I work in the web development field, preparing for the SCWCD was not from zero, I already worked intensively with Servlets, JSPs, JSTL, and other stuff. For the SCBCD I already had a good experience with Hibernate and ORM technologies which helped a bit, but almost zero experience in EJB3 session beans, so preparing for the SCBCD required more time and attention.

Preparation
Again the first thing to do before starting your study is to know what is the exam about by reading the exam objectives, for both the SCWCD and SCBCD. Pay attention to the business component objectives because there is no complete book that will cover the whole exam material, so you will need to know what stuff to learn, from different sources.

Books to Read
The best book for the SCWCD exam is Head First Servlets & JSP known as HFSJ by Brayan Bashman, Kathy Sierra and Bert Bates. This book is really amazing, it introduces the material in a unique and entertaining way that will make you very enthusiast to read and learn more and more (In this book, Servlets talk with Application Servers, very funny and interesting conversations). There is a mock exam at the end of the book DON’T DO IT before reading the book once or twice, this mock exam is very close to the real one.

For the SCBCD the situation is different, When I did it there was no book dedicated for the exam, so I had to check more carefully the exam objectives and select appropriate chapters from different books, the books I studied for the exam are: 

    1. Enterprise JavaBeans 3.0.
    2. Manning: EJB3 in Action.
    3. Pro EJB3.

The first two books would be enough (I just skimmed the Pro EJB3), in addition to these books its highly recommended to read the Mikalai Zaikin study notes, read them after you finished reading at least one book.

Mockup questions
For the SCWCD the mock questions at the end of the HFSJ book are enough, but to get more confidence here are some links:

    1. JavaRanch Mock Exam
    2. JDiscuss 
    3. Marcus Green Exam 

for the SCBCD exam, I bought the EnthuWare exam simulator, I bought it because there was no complete book that covered the whole material (like the HFSJ for the SCWCD), so I wanted to be more confident. This simulator have something around 400 questions, do them all and you will pass the exam without problems.

Finally as the Java Programmer certification, if you have any question or any doubt just post it on the JavaRanch, there are dedicated forums for each exam.

What You Learned?
After getting certified what changed? the nice thing is that now I better know how to use the technology. But something more important is that now I know how it works from the inside, I know how the Application Server works with those J2EE components. In addition I got stronger web development architecting skills, I can build better and robust architectures for web applications, in addition to portable and distributable applications.

And finally as I mentioned they are other two lines in your CV that will help making you pass recruiters quality filter.

Whats Next?
I didn’t decided yet, but I was thinking of one or two Oracle certifications, but not right now. For now I just want to relax and have fun, no more certifications for 6 months :-)


Next: Worst 5 Code Snippets Till Now

 
 
In the latest Apple WWDC 2009 they mentioned that Snow Leopard will be shipping in September, but here it is shipping in the 28th of August as mentioned on the Apple official web site. did they plan for this from the beginning? Is it a marketing plan? is shipping snow leopard before Windows 7 another marketing plan? 

I don't know, but believe me there is nothing greater than shipping a product before its actual date, which is something very difficult in our field (Software Developers), and apple did a great job.
Picture

 
 
In the dates 08/2008 & 06/2009 I prepared and obtained some Java certifications, I got the Sun Certified Java Programmer (SCJP), the Sun Certified Web Components Developer (SCWCD), and finally the Sun Certified Business Components Developer (SCBCD). In this post I will talk about this experience and how I prepared for these exams.

Why Should I get certified?
This is an important question that you have to answer. For me getting a certification was important for two reasons:

     1. Its a paper proof for recruiters that you know the technology.
     2. You will gain a deeper understanding in the technology.

The most important is the first point, the IT market is full of competition, if you want to find a good job you have to show that you are better than others, and certifications help doing so. To apply for a job you normally send your CV to recruiters, which in turn filter good CVs from not that good CVs based only on what they see in your CV, your goal is to get your CV pass this filtering process and get called for an interview (where you will show them how you Rock).

Keep in mind that even if you have a certification it doesn’t mean you master that certification technology, working experience is important too. In the end Sun Microsystems will not make passing a certification exam impossible, this is business and if nobody is going to pass certification exams Sun will not sell exam vouchers. So keep in mind that having a certification is good, but not having a certification doesn’t mean you are not good. Bottom line: experience beat certification but certification is a plus.

SCJP Preparation
This is the first serious certification exam provided from Sun Microsystems, actually you can take another exam before SCJP named Sun Certified Java Associate (SCJA) in which you will get questions like:

     Q1. Java is a _______________ language. (A)Procedural, (B)Object Oriented, (C)Query.

So get started from SCJP and leave SCJA for marketing people that want to show their colleagues they know Java. Now lets get prepared for the SCJP exam.

Read the SCJP exam objectives
It’s very important to know what are the exam objectives in order to know what to study, and what not to study.
Picture
Study Book
The Best book is the Sun Certified Programmer for Java 5 by Katherine Sierra & Bert Bates known as K&B, this is the only book you will need to pass the exam, don’t waste your time reading from other books. The book is well structured, and provides a group of mock questions at the end of each chapter that will help you better understand the concepts. I read this book twice and I felt almost ready for the exam. (WAIT!! you need to do other stuff). 

Note: When I did the exam it was for Java 5, however future versions of Java will be available for sure, so you may find the same book for Java 6 (or even Java 11g. Will Oracle name the next version of Java like this?).

Mockup Questions
Its is very important to exercise on mock questions, I found the java inquisition exam simulator very helpful. It seems that inquisition questions are a bit tougher than the real exam, so if you score 70% in inquisition you will for sure pass the real exam (unless you got the 70% by luck). In addition the following links contain some useful questions:

   Java Beat
   Java Ranch Mock Questions 

You Don’t Understand Some Stuff?
If during your study you have some questions and need answers, visit the Java ranch forum, subscribe and post your questions there, you well get almost immediate feedback, they will help you a lot, I may answer some of your questions too ;-)

How Much Time Will I Need?
I hate this question, but its always asked. The answer is IT DEPENDS on you, if you have a good experience in Java and you are a fast learning guy you could prepare for the exam in 1 week, you may even pass the exam without studying if you are really good in Java (but do you have to Risk?). 

My suggestion is to read the entire K&B book provided above, and do the mock questions after each chapter, and based on your results decide wether you are ready or not.

How to Buy the Exam and Schedule it?
I recommend visiting the SCJP FAQ page in the Java Ranch, you will find many useful information about how to buy the exam voucher, schedule the exam with a prometric center, in addition to a group of links to online mock questions, and other SCJP experiences and success stories.

One final thing, if you search on the internet you will read a lot of successful stories about people who got certified, you will read that John studied 3 days only and got 100%, Mary studied 2 months, half an hour a day and got 98%, yes it is possible but keep in mind that people tend to share their success stories and hide their failures, reading a lot of successful stories around doesn’t mean that everyone passes the exam. You have to prepare well and do your best. 

Wish you Good Luck, in your own preparation.


Next: The Road to Java Certification 2

 
 
This browser war is between Mac users, should I use Firefox as my browser or Safari? Mac users disagree on which is better, however (fortunately) we all agree on one thing (Internet Explorer S**KS). Once I bought my first Mac I didn’t even considered Safari I just downloaded Firefox and used it, this happened because I was coming from a Windows platform and Firefox was my browser so I kept using my nice old browser.

However when Apple Safari 4.0 beta was available, I said I should give it a try, in the end I can’t judge about something without using it, besides trying will not kill me, so after using the beta version I liked everything about Safari except the tabs position which was too much on the top, however when Safari 4.0 was released the tabs came back to their original place and now I was satisfied with the design too.
So I decided to make some serious tests between Safari 4.0.3 and Firefox 3.5.2, the tests ran on my MacBook with the following specifications:
omar al kababji mac specs
Startup Time
For this test I restarted my MacBook to be sure applications are not cached, when I launched Safari on my MacBook its startup time took 1 bounce on the Dock, Firefox took 8 bounces, there is a big difference in startup time which I can’t explain, may be Mac OS does something for safari on startup (I don’t know). After closing both applications and trying to open them again they both took 1 dock bounce. 

CSS Rendering
For this test I used the CSS benchmark test. Safari completed it in 8 ms versus 39 ms for Firefox, without closing the page I did the test again, Safari time was still the same while Firefox took 22 ms. Since there was a change I decided to repeat it till Firefox gives me a constant result however I could not reach this point, but the fastest result was 12 ms. 

SunSpider Javascript Benchmark
This benchmark tests the core JavaScript language only, after completion it provides a detailed report, I took in consideration the total time to complete the test, Safari took 727.6 ms while Firefox took 1404.6 ms. This test allows you to compare the results of each browser and Safari was 1.93x as fast. 
Peacekeeper Javascript Benchmark
Although in the previous Javascript test Safari beat Firefox, I decided to try other Javascript tests, I found Peacekeeper. Safari scored 3153 points while Firefox got 1432 points. which makes safari 2.2x times faster. However it was mentioned in the website that Chrome 3.0.195 was even faster than both Safari and Firefox. (I will target Chrome in another post).
Picture
Acid 3 Test
This is one of the famous browser tests used to assure that a browser conforms to web 2.0 standards especially for DOM and JavaScript, Safari got 100% while Firefox got 93%.  (Man I am starting to love Safari).
Picture
V8 Benchmark Suite
Ok one final test to be more sure of my results, I found this V8 benchmark website, again Safari was faster than Firefox with 1894 points versus 270 points only. which means Safari was 7x times better than Firefox. is that possible!!
Picture
Summarizing the results of the different tests in the table bellow, its clear that on a MacBook machine, Safari beats Firefox in everything related to performance.
omar al kababji safari vs firefox
Ok this was performance but this is not the only factor for choosing a browser, the nice thing about Firefox is the huge number of plugins available, which allows you to extend your browser and add new functionalities, however - for me - the only plugin that I used on Firefox was Firebug which is a great tool used by many web developers to navigate the DOM of an HTML page, test CSS styles and find JavaScript errors. The pleasing information is that Apple understood this need for web developers, and provided a Develop menu similar in its functionality to Firebug, this menu is hidden by default but you could show it from the preferences panel.
Picture
This was my revision of Safari Vs Firefox, and I repeat, it was done on an MacBook, so performance results may be different on a PC machine. I will try to make a similar comparison between Safari & Chrome. 

What about Internet Explorer? Man please, Internet Explorer is the worst browser in the universe, its ugly, slow, and doesn’t respect web standards, the only reason its out there is to make Software Developers explode of anger because they have to test their web applications on it since it has a market share of nearly 68% (but thanks God it is continuing to lose market). So I will be waiting for the day IE dies...

Next: The Road To Java Certifications 1

 
 
If you are marketing some product over the World Wide Web, or doing some other activities - for example blogging - that can be subject to internet users judgment, its important to know if people are talking about you, if yes if they are talking positively or negatively, and even in which conversations you are involved. These are important information that you need to know to best accomplish your cyber activities. In this topic I provide some tools that will help you figure out these information.


Google Alerts
Google alerts is a free services offered by the internet giant, which notifies you by email or as an RSS feed about a specific query or topic you provide. For example you can monitor who is talking or mentioning your name all over the web. Using this services Google will send you periodic emails (daily, weekly or by occurrence) pointing you to the sites that are talking about you, there are six types of searches (News, Web, Blogs, Comprehensive, Videos and Groups).
Picture
Note that you can use Google operators for the search terms, for example to know if someone has provided a link to your website (www.you.com) you could use this search term (link:http://www.you.com).


Twitter
Twitter is a social website. This is a perfect place to listen to what people are saying about your company or product, you can even subscribe to an RSS feed of the search results. For example in 12/08/2009 my blog host (Weebly) was down and I couldn’t publish my new updates, trying to figure out what is happening I searched the Weebly keyword  and got those results shown below, where everybody was complaining that the service was down.
Picture
If you have a major product, and want to know what people are thinking about it, you could simply type your brand name in twitter and get real time information, or you could type your competitor product names and see if he is getting more positive feedback than you.


Technorati
Technorati is a blog search engine that lets you find out what people are saying about you within the blogosphere, The results can be available in RSS format, so you can subscribe to the various search results as well.
Picture
These where free services, there are other commercial tools that allow you to monitor yourself on the web, and show some analytical data the most popular are Radian6 and Trackur


Next: Safari or Firefox?

 
 
An important question that needs an answer. What is the perfect software development team? what is the perfect number of developers in a team? what kind of developers should they be? how should it be organized? of course this depends largely on the project size, in this post I target the perfect team for small or middle sized projects, so please don’t email me telling me that you can’t develop Windows XP with only 10 developers. 

But why do we need a team? If I work alone I will prevent all the overhead of communication between my team members, I will not waste my time explaining things to others, and I will have control on the whole project. My answer is, if you can do everything alone then go ahead, you don’t need a team and you will save time and money. Unfortunately in the real world there are deadlines to respect, you need many and different skills that are impossible to find in only one developer, and finally most projects are too large to be developed and tested before their deadlines by a single developer.

Ok, so you decided that your project needs a team... Lets get started. The first ingredient for the perfect team is its structure, there are two common team structures as Mike Gunderloy suggests in his book Coder to Developer, community of equals or hierarchal. In a hierarchal structure there will be a Manager that will guide the team, an experienced developer that controls a bunch of non-talented developers telling them what to do and how to do it, this structure is widely used because managers think (and I say managers not I) its more profitable, since they will extra-pay only the one talented developer, while the other developers will get low salaries. In my opinion this is the most stupid, unproductive, unpredictable, non robust, risky, and non profitable structure for the following reasons:

   1. Although by this structure you have more man force in your team, but this doesn't mean you will be more                productive, yes we are building something but building programs is not like building houses. From the book              The Mythical Man Month Frederick P. Brooks Says:

           “In one of their studies, Sackman, Erikson, and Grant were measuring performances of a group of experienced             developers. Within just this group the ratios between best and worst performances averaged about 10:1 on                 productivity measurements and an amazing 5:1 on program speed and space measurements! In short the                  $20,000/year programmer may well be 10 times as productive as the $10,000/year one”.

      Note that this is due the lack of talent and the overhead needed for communicating and organizing the large             number of programers, which is much smaller if your team consists of sharp developers. remember that its               better to build the system with as few minds as possible.

   2. Software quality. Unfortunately management quality measures are applied by looking at the software from the            outside (the running application), but what about the quality of your code? what if you need to add a new                  feature? will it be easy? will it introduce new bugs?  if you modify one module will this change cascade to the            other modules? This depends on how talented your developers are, great developers will write modular code,            respecting Object Oriented principles, while non-talented developers will write Spaghetti Code, full of bugs, and        difficult to maintain.

   3. High Risk. The hierarchal structure is used to save money (as managers think), which leads to hiring low salary          non talented developers, this introduces a high probability that they will dismiss as soon as they find a better            job with a higher salary, which if happens, and it will happen. You will have to hire a new developer, re-explain          everything to him and start all over again, and since the project code sucks is crappy; integration time will                  increase. What if it happens 10 days before your deadline?

These are the major reasons why I don’t advise the use of hierarchal structure, which sadly its the most adopted structure. The better choice (in my opinion & experience) is the community of equals which I prefer calling it a community of talents. In this structure you have a few number of talented, experienced great developers doing the job of 30-100 normal ones. In this structure its advisable to have different skills, for example a talented back-end developer, a talented front-end developer, a talented tester and so on. By this you can split your project to layers, with each developer working on his own layer. the benefits of this approach can be summarized as follows:

   1. Talented developers will write better, robust, almost bug free code. Code will become Lasagna Code instead of          Spaghetti Code (Lasagna is structured in layers, Spaghetti is a mess, got it?).
   2. Orthogonal code, where modifications in one layer will not effect other layers, your modules will be loosely                coupled.
   3. Versioning conflicts will decrease since there will be no two developers working on the same file, and this will            save a lot of time.
   4. Communication & organization time will decrease, meetings with the whole team participation will be possible.
   5. Finally since its a community of equals work will be even more fun.
Picture
This was about the team structure, but what about the number? this depends on your deadlines, my suggestion is to identify the major layers of your project, for example a typical java web application project can have the following layers:

   1. Persistence & Business layer, developed in EJB3
   2. Presentation Layer, for example in HTML or Flex 3.
   3. Control Layer, coordinating the communication between the presentation and business layers.
   4. Reporting module, which generates .pdf reports, for example using Jasper Reports.

Then depending on the deadlines hire an adequate number of talented developers for each layer, having in my mind that performance will not be multiplied by the number of developers since as more developers you add for each layer, the more communication time you will need.

Yes! you are right, where the hell is testing? Testing is something that every developer will do alone. Every developer will be writing his own unit tests for the modules he develops, however integration testing and stress testing testers can be added to the perfect team. Finally a team manager with programming experience is needed to interface between his team and customers.

This is my opinion about how I would structure and choose my perfect team, In this post I avoided as much as possible the term experienced developer and I used talented developer because having a 10 years experience doesn’t mean that you are a great developer, great developers are rear and difficult to find, they are those who understood what a C pointer is the first their professor explained it, they are those that can solve whatever problem you assign them, they are those who can switch from C++ to Java in 3 days, and this can be achieved by talent not experience, even though experience is helpful, in the end you need developers who are ready to learn new stuff if needed not people who will solve every single problem using a PL/SQL procedure because they passed the last 10 years doing only that.


Next: Do People Talk About You?

 
 
Everybody knows what is a computer trackpad, its that sensitive surface on your laptop that allows you to move the mouse cursor, click, double click, and sometimes scroll vertically and horizontally. In other words its that device used to provide a real mouse functionality.
Picture
I surfed the web searching for what a PC trackpad offers, and I got the following list:

   1. Move the mouse cursor.
   2. Effect single clicks by tapping on it or pressing the left button.
   3. Effect double clicks by pressing the right button.
   4. Scroll vertically by swiping on the right scroll strip.
   5. Scroll horizontally by swiping on the bottom scroll strip.
   6. Some different actions by tapping on one of the four corners.

And its exactly what a real mouse can do, move, click, and scroll. But what about this trackpad made of glass?
Picture
This is the latest Apple answer for what a trackpad can be and do, It is amazing how many things (Gestures for Mac users) can be done using this awesome piece of engineering. The great thing is the introduction of intelligence, this trackpad understands your finger gestures, depending on the way you pinch, rotate, or swipe and the number of fingers you use, this is a revolutionary idea that changed the way a trackpad is conceived, using this trackpad you can do the basic stuff I mentioned above, in addition:

   1. Right click by tapping the trackpad with two fingers.
   2. Scroll over the screen by moving two fingers on it, for example for a vertical scroll move two fingers from top to bottom.
Picture
   3. Rotate things (images, .pdf pages) by rotating two fingers on the surface of the trackpad.
   4. Zoom in and out, by making a pinch gesture, this is handy when you want to zoom in a .pdf page, or an image.
   5. Make a one page scroll if you swipe vertically using three fingers, I use this to move fast between .pdf pages.
   6. Navigation between different images, tabs, or forward/backward operations in safari by swiping with three                fingers horizontally, this gesture is overloaded in many applications, for example in Adium (a chat program) I            use it to switch between conversations.
   7. Show the desktop by swiping with four fingers to the top.
   8. Do an Expose operation by swiping with four fingers to the bottom.
   9. Switch between applications by swiping with four fingers left or right. 


Finally you can even input chinese characters using the trackpad, its clear that apple has expanded the number of things you can do using a trackpad, and this is thanks to their multi-touch technology first introduced in the iPhone. You can even customize your trackpad gestures using some applications one of them is named Multiclutch.

This is one of the reasons why I love Apple products.


Next: The Perfect Software Development Team

 
 
Today I faced a common Mac problem, I have lost my Bluetooth device, It disappeared from my menu bar and from my preferences pane, I didn’t panic because I remembered a friend of mine faced the same problem, however I didn’t remember how he managed to solve it, so I started with a machine reboot but it didn’t work, so I googled and found a group of suggestions:


VMware Fusion may be hiding your Bluetooth
I was pretty sure this was the problem since my VMware starts automatically as I boot. What I understood is that the Bluetooth device may disappear from your Mac because its being used by the virtual machine operating system, for example Windows XP, in other words only one OS can see your Bluetooth, so I cmd + Q’ued VMware but Bluetooth was still missing, I tried a restart but no Bluetooth (Damn it!).


Delete the file Library/preferences/com.apple.Bluetooth.plist
I didn’t find this exact file, I found a file named com.apple.Bluetooth-xxx.plist where xxx was a sequence of characters and numbers, I think this was a temporary file that got missed up somehow (don’t ask me how, It wasn’t me), after deleting this file I restarted the MacBook again and the bluetooth was still not there, so I moved to the next suggestion:


Repair your disk permissions
To do this I Opened Disk Utilities, please don’t ask me where it is, use spotlight, anyway after opening Disk Utilities I selected Macintosh HD and clicked Repair Disk Permissions, this operation took around 5 minutes, I restarted my MacBook AGAIN and this time Ta Daaa bluetooth is back.
Picture
I don’t know what the hell caused my Bluetooth to disappear, but its a common problem in the Mac community, and I didn’t like restarting my MacBook four times in 20 minutes. The strange thing is that almost every mac update contains something related to Bluetooth, may be this is the issue they are trying to fix, if this is true there is only one thing sure This Problem is Driving Mac Developers Crazy.

Oooh In case you are a PC users don't send me an email ... I WILL NOT SWITCH