Programming Nazi

In the USA programmers earn more money than average workers. But the difference is not huge. It can be twice as much. Not outrageous. It seems that there is a (wrong) perception in the USA that programming is difficult and hence these eggheads deserve a better pay.

But the situation is different in developing countries where offshore programming is flourishing. The difference between the salaries of a young programmer and a young engineer can be 10 fold: $300 vs. $3000 a month. While it’s great that at least some people can earn decent money, I see some negative side effects. Some of these young well-off professionals are starting to believe that they belong to a higher caste, and regular people who didn’t learn programming are losers.

This is is not something I came up with out of the blue. I’m following the blogosphere in some of such offshore countries, and people openly make these statements. Here’s a comment that I’ve received to one of my blogs:

“People who work in the supermarkets are not capable of anything else. Only inadequate people can work there for a long time. A decent person will not keep this low paid job – he’ll find a way to earn more doing something else. Instead of working for pennies in supermarkets they can learn programming and make a decent living”.

In another article a programmer asks,”Please share your experience in finding love? Is it easy for you to pick up girls because of your high salary?”

IMO, this kind of mentality is really bad. You have to respect people even if they don’t know how to program computers.

There are lots of great people who like working in a supermarket or a post office. They will never become programmers and don’t have to be! Ideally, people should do the work they like. It may not be easy, but during a day a person can work at a cash register, and in the evening play violin in the philharmonic orchestra.

I realize, that the labor in the USA is more expensive than in most of the developing countries, and a cashier can make a living just by keeping one job. But considering yourself creme de la creme of society just because you know how to write if-statements is not only wrong, but dangerous. Being any nazi is dangerous both for a society and for the nazi.

Applied Adapter Design Pattern

Design patterns in software are pretty often explained in a boring dry language that works as a sleeping pill (yes, I’m talking about that white book). The Head First Design Patterns tries to make the process of learning designer pattern funner, but IMO the Head First books you can’t see the forest for the trees. Future technical books should be short, fun to read, and up to the point. In today’s world Wikipedia often gives you a decent answer in a street language without too many words. For example, here’s how Wikipedia defines the Adapter:

The adapter pattern is a design pattern that translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface.

photo
While teaching object-oriented programming, I tell my students that objects in programming represent objects from the real world. One of the examples is an adapter for a traveler.

Recently, I ran into another real-world example of the Adapter pattern, which may resonate well with my students. I’m talking about bras. Take a typical situation, your girlfriend wears large cup sizes, but if one manufacturer labels them as 36DD, the other calls them 36G or even 36FF (devaluation in action).

This is where the Adapter would help. Software developers at HerRoom.com applied this pattern (they called it Universal Cup Sizing).
bra And now, when you’ll be shopping for the gift for the upcoming Mother’s Day, just visit this site, enter the size and brand of one of her existing undergarments and get the universal cup size. Shopping for bras was never that easy, thanks to the Adapter pattern!

Offtopic. Twenty years ago, when I arrived to the USA and went to a large home improvement and construction store asking for bra, they were surprised and tried to politely direct me to a different store. The thing is that bra in Russian means a lamp hanging on the wall (see http://bit.ly/Rr0g8g).

The best computer speakers

Last week I was vacationing in Asia. Our resort had a bar right on the Indian Ocean, and there was this DJ from Holland who played great music compilations via high quality speakers. I decided that it’s time to upgrade the sound in my office too. After a quick research I’ve ordered a pair of AudioEngine5+. When I returned back to the US, the box from Amazon was waiting by the door.

I hooked up these speakers – they’re simply amazing. It’s hard to believe that you can get this power and clarity right on your desk from your computer. Thirty years ago I was into Hi-Fi sound. I was an audiophile. Over the years I decided that my ears can’t hear all these high and low frequencies, and there was no reason to spend money on sound – I spend most of my time in my home office in front of the computer. My small computer speakers by Bose were OK. Besides, why bother if all these inexpensive earphones with 20Hz-20kHz range can deliver good sound. Wrong! These speakers deliver THE sound especially if you’ll play a CD with good instrumental orchestra music like Richard Clayderman, Fausto Papetti, or James Last.

For the computer speakers they are large though – you need to have a large desk, which I do. This is how my desk looks today:

SONY DSC

Don’t get mislead by the voice processor – I use it for the external mike only. The speakers are connected to the headphone output of your computer. Ignore the dumb bells too – I don’t workout.

Warning: If you like boosted base, you’ll need to purchase additional subwoofer, which can be easily connected with provided wires. But I’m not sure if I want it. At 50 watts per channels they will work well for my pool parties too.

The long story short: I give Audioengine5+ speakers 5+ on the scale of 1 to 5.

The Cover and the Epilogue of the Upcoming Book

Our publisher sent us for approval the image of a cover of the upcoming book on Web development. We were told that the name of the bird is Roseate Spoonbill. Why they decided that Roseate Spoonbill should be associated Web development will remain a mystery. I guess, since the beak of this birdy is pointing at the word “Web”, the customer of the book store should think to himself, “Hmm, I have no idea what kind of bird this is and I don’t know how to develop for the Web. Let me buy this book!” In the unlikely event that you’re also not overly familiar with Roseate Spoonbill, please refer to THE SOURCE.

cover

But this cover pales in comparison with the book epilogue. This book is about HTML5, and one would expect some drum roll and fanfares praising HTML5. Here’s what the current version of the book epilogue reads:


Epilogue

Even though this book is about HTML5, the authors would rather work with compiled languages that produce applications to run in virtual machines. Such software platforms are more productive for development and more predictable for deployment. While writing this book we were often arguing about pros and cons of switching to HTML5, and so far we are concerned that the HTML/JavaScript/CSS platform is not ready for developing of the enterprise applications just yet. We live in the era when amateurs feel comfortable creating Web sites and that JavaScript provides flexibility and customization the Access and Excel provided in the old good PC times.

Till this day Microsoft Excel is the most popular application among business users in the enterprises. They start the application locally, it has a local storage that enables work in the occasionally-connected scenarios. Both the data and the code are physically located close to the user’s heart. Microsoft Excel allows the users to have her own little pieces of data and amateurish-but-working-code (a.k.a. formulas) very close and personal. Right on the desktop. No need to ask these IT prima donnas for favors. No dependencies on the connectivity or some mysterious servers being slow or down. The most advanced business users even learn how to operate MS Access database to further lessen the dependency on IT.

But there is only so much you can do with primitive tools. Visual Basic was “JavaScript” of the nineties – it had similar problems, but nevertheless had huge followings. Now the same people are doing JavaScript. If we don’t break this cycle by adopting a common to all browsers VM, we are doomed for going through the generation after generation of underpowered crap. We wrote this book to help people with understanding of what HTML5 applications are about. But make no mistakes – the world of HTML5 is not a peachy place in the future preached by educated and compassionate scientists, but rather a nasty past that is catching up bringing the mob with it.

Most likely the publisher won’t let this epilogue to finish the book, and this blog will remain the only place this text will be published. Amen, bro!

Technical evangelists in IT

If you’ll ask me, “What would be a job you always wanted but never got”, I’d answered, “A Technical Evangelist for a large corporation”. I know how to do it, I like travel, I like meeting new people, and I can convince the IT crowd that the software I believe in is good to have. But. I know many great software developers who are working as technical evangelists for various companies, and I don’t like little tiny things they have to do.

Now I’m watching a recorded presentation of a person I know and respect. He presents a software of his company and compares it with another way of doing the same thing. His slide reads “Our product runs fast, but their product runs faster”. And this is why I never became a technical evangelist working for a corporation. I still can afford to say what I really want to say: “The product A is slow, and the product B is fast”.

This is not to blame technical evangelists that are always on the road working hard to feed their families. I will continue attending their presentations. But I really like the fact that I can afford to say what I really want to say.

e-Commerce with Hybris: 10 Million Product Catalog?

Last month a prospective customer called our office.
“We know that you have a team of software developers that build e-commerce applications with Hybris software. Can you help us with developing our online store?”
“Sure we can – we have a solid expertise in developing e-commerce applications with Hybris software”.
“But our store will have pretty large catalog: ten million products”.
“We didn’t have a chance to develop online stores that have more than a million products. We know how to approach such a project to minimize your risk, but so far we didn’t deploy such an application in production.”

After this conversation we’ve never heard from this person again. We know why: he was looking for another answer like, “Sure, we did it before and will do it again!” This is not to say that creating a responsive online store with 10M products is not possible with Hybris, but we didn’t do it. In any online store product catalogs have to be indexed from time to time. For example, a store needs to add a new line of products. How much time is required to re-index a store with 10M with Hybris software? How about importing of the CSV product data and synchronization? We simply don’t know.
Hybris does several passes over these IMPEX to resolve referential integrity, in fact – many passes. In may take a day and finish or a day and break/start over. Then either SOLR (Lucene) or Endeca full text search index will need to be built. Then, there is a task of synchronizing the staging catalog with its production version. Indexing of itself is not Hybris specific, but the import and synch are. Hybris has yet to show that it’s a high performing solution and publish the appropriate case studies.

In fact, if you do not provide indexing information, importing of a mere half million records may never finish on Hybris server. We do not have any metrics of the synchronization process yet, but the good news is that Hybris is build on Java servers and careful clusterization, cacheing, and fine-tuning of the database will produce acceptable solution to large inventories. Wall Street application written im Java handle huge amounts of data in timely fashion. But Wall Street managers understand that they have to hire the right people. Large-scale e-Commerce projects have the same level of complexity.

We’d be happy to set up a lab (parallel merging while loading, finding deltas, proper Java clustering, stress tests) with the appropriate hardware and create a pilot to answer these questions and to optimize the process to get rid of the bottle necks, but this prospect customer is gone.

What will happen next? I’ll tell you: the deja vu of IT consulting. Some brave salesman of another consulting company will explain to this customer that working with large product catalogs is their bread and butter and will get this project. Six months down the road the customer will see a lot of hours billed to the project and detailed explanations of “unforeseen circumstances” followed by new promises.

We’ve seen this scenario several times – it doesn’t depend on the technology in use. Today it’s e-commerce, but six years ago I wrote a blog about a similar scenario, but that time it was about redesigning a portal for a major publisher. Software developers hate working on such projects. They don’t know that the customer has these unrealistic expectations because of some over-promising salesman.

What’s the moral of this story? We value a moral dimension to consulting, which costs us dearly.

Starting XAMPP Apache from Aptana IDE

In the first five chapters of the upcoming book on Web development we use Aptana IDE. It’s free, easy to use, has a simple internal Web server, and is Eclipse based. All this makes it a perfect IDE for teaching Web development with HTML and JavaScript. While working on a jQuery.ajax() code sample for the upcoming book, I wanted to show how to make an AJAX POST request to the server side script with the manual form serialization. Since knowledge of Java is not a requirement for reading this book, I found myself in an unfamiliar territory of using PHP.

Disclamer: I’m not a PHP developer, and have no intention to become one.

I just needed a simple script that would echo the data it received. Writing such a script is not a rocket science, but now I need a Web server that would support PHP, which means pretty much any server other than the toy one that comes with Aptana.

xampp_UI

OK, I’ve installed the XAMPP package that includes Apache Web Server and supports PHP. It comes with a nice little UI with the buttons to start stuff. It’s shown on the right and can turn on/off Apache, MySQL, and FTP with a click of a button, which is perfect solution for everyone, but me. Remember, I want to do it from Aptana, and not from and external UI panel. But first things first, let me check that my PHP script even works under Apache.

This part went through fine. I created an Aptana project right under the document root of Apache, which is the htdocs folder, put there helloworld.php, html, JavaScript – he whole shebang. Then I opened the Web browser, paster the URL there, and it worked like a charm – I’m da man!

But the fact that I had to leave Aptana bothered me and I decided to configure an external Web server in this IDE. I did similar thing in Eclipse and Apache Tomcat a million times, but this is different – I needed to start a prepackaged Apache Web server from XAMPP.

First, I learned how to do this from a command line in the Terminal Window (I use MAC OS):

To start apache do this: sudo /Applications/XAMPP/xamppfiles/xampp startapache

To stop apache do that: sudo /Applications/XAMPP/xamppfiles/xampp stopapache

But I knew it wouldn’t be that easy to do from the IDE, casu when I do stuff as a sudo user, I get a command line prompt to enter the admin’s password. OK, let’s try and see what happens. Right-click on the Aptana’s project, then Run Configurations, then the link Configure next to the “Use selected server”. Then I’ve entered everything about my Apache Web server:

ApacheServer_Aptana

Aptana has created the Servers view with this server entry, but when I tried to start the server by clicking on the green play button it gave me this error: “no tty present and no askpass program specified”. I knew it! Aptana doesn’t know where to ask for the sudo’s password!

How can I turn this stupid password off? Google helped – there is a system file /etc/sudoers that has to be edited to allow certain users to sudo without being bothered with the password. Can’t edit it – not enough permissions. That’s an easy one. The unix command chmod works fie on Mac. Being a lazy person I did sudo chmod 777 sudoers. It did the job, but it was a mistake – stay tuned. Opened the file, figured out that I need to uncomment one line and specify my ID with the NOPASSWD option.

OK, but the warning in this file reads “# This file MUST be edited with the ‘visudo’ command as root. Failure to use ‘visudo’ may result in syntax or file permission errors that prevent sudo from running.” Uuuh, getting dangerous, nice! I still remember a couple of vi commands – did the editing in the Terminal window, saved the file… and got the error message that the “/etc/sudoers is mode 0777, should be 0440 “. Man, that was my laziness with chmod 777. Let me change it to 440. Not that easy now! It doesn’t allo me to change the permissions back. Am I screwed or what? Did a backup to my external disk last week – shouldn’t be difficult to recover the original file sudoers.

But let me google first – it helped again – was there a life before Google? Some kind soul suggested to run Disk Utility, which has a button “Repair Disk Permissions”. It repaired a bunch of files including this one keeping my corrections intact.

Voila! Now I can start my Apache Web Server without leaving Aptana IDE by clicking on the Play button in the Servers view! Great! But how to stop it? Eclipse IDE has a red little square next to Play? The right-click menu doesn’t exist in the Servers view in Aptana Studio 3 IDE – I guess their developers are as lazy as I am. I’m not going to continue my research though. Nough! If anyone knows how to stop the server started from Aptana IDE – please do let me know.

Will speak at the Java Conference in Ukraine

Will make two presentations at two-day conference JEEConf in my home town Kiev, Ukraine at the end of May. It’s going to be the largest event for Java developers (about 1000 attendees). I’ve participated in this conference last year, and will go there again with pleasure. Below are the descriptions of my two talks.

1. Surviving as a professional software developer

Last year I made a presentation on how to become a professional software developer (it’s in Russian). This presentation is a sequel. Yakov will present his no-BS point of view on how enterprise IT shops live and operate. He’ll talk about communication skills, bad attitude, the team work, those stupid and useless IT managers, and how the life is unfair if young prodigies have to debug old and poorly-written code. This is not a technical presentation.

2. Speed up your Web applications with HTML5 WebSockets

HTML5 specification includes the communication protocol WebSockets, which is getting more and more popular in the Wall Street real-time Web applications. WebSockets API is include in the upcoming Java EE 7 specification. WebSocket offers solution to the problems of latency, scalability and performance associated with HTTP based solutions like polling, long-polling and HTTP-streaming. Online auctions, financial trading applications, and multi-player games can benefit from implementing WebSockets. This session starts with a brief overview of traditional HTTP protocols followed by covering of how WebSockets works. You’ll see how using WebSockets removes the overhead of heavy HTTP request and response headers. Finally, we’ll review the code of the Web application, where WebSockets is used for the data exchange between HTML-based front end and the latest build of the Java server GlassFish 4.

Java is Better Than JavaScript

Tоday I was participating in a discussion on one Java forum – the question was if Java is easy or difficult programming language to learn. IMO, Java is not difficult to lear, to teach, and to use. It’s a strongly-typed compiled language with tools that help you out to identify most of the error before you even run the program.

While participating in this discussion I was writing code in a different programming language called JavaScript, which gave me a chance to illustrate that lots of things Java developer take for granted, while there are people who work in a more hostile environment called JavaScript.

I had a working program, and decided to add JavaScript handler function to illustrate HTML form submission with jQuery for our upcoming book. I’ve been writing this code in Eclipse-based IDE called Aptana. I’ve added this handler for the submit event to a Donation form:

$('#donate-form-container').submit(function(){
  var formData = $(this).serialize();
  console.log("The Donation form is serialized: " + formData);
  returm false;  
});

Ran the program – it rendered the Web page, HTML looks fins, but nothing worked. IDE didn’t give any errors. Started a browser debugger – Firebug. Now I’ll going to put a breakpoint in this newly added function and find the problem. How hard could it be? I’ve added just this little fragment to a working program. Easy Peasy.

Oops. Where is my main.js? Nowhere to be found. Only jQuery script is available.

s1

Was my main.js even downloaded? Let’s check the Network tab. Yes, it’s here:

s2

After applying deductive reasoning (as in Sherlock Holmes stories) I figured out that the script has arrived to the browser, which instead of adding it to the DOM, showed a middle finger without explaining why. As any normal person, I started to to find who someone else to blame. May be this Firebug is buggy and just doesn’t want to show my nice script? Tried Chrome with Developer Tools – same story. The script arrived, got the finger and I have nothing to debug.

Well, there is no one else to blame. Let me just re-read my own code. Man, I misspelled the word return and wrote “returm false;” instead, which deserves a capital punishment. Changing m to n did the trick, and now both Chrome and Firefox are happy to add my JavaScript code to DOM.

What’s the moral of this story:
1. Java developers should know that they take lots of things for granted and should not complain that their life is difficult!
2. The fact that it takes less code to write Hello World program in JavaScript doesn’t mean that it’s an easy programming language. Don’t trust me? Watch this.

Fired 15% and Don’t Feel Bad

Back in 2006 I was resigning from a large IT consulting firm to become a partner in a newly created company Farata Systems. During my resignation meeting with a top manager of that firm I asked if he could give me any advice with the new company. He said, “I’ve been managing hundreds of IT people and learned an important lesson – don’t try to hire only the best and the brightest. There are lots of people of various level of expertise in our industry, and they can do the job”.

Since then, I’ve been doing a lot of interviewing and hiring. Our software engineers successfully work on various IT consulting projects as well as on our own software product development. The vast majority of our people work for us for years, which is very impressive given the fact that many of them work remotely from Eastern Europe, where software developers are in high demand. But last year we’ve fired about the half of newly hired contractors. We’ve fired about 15% of people working for our company.

All of them were good software developers. But they were not good enough. When a new hire joins the team working on a project he needs some time to learn the codebase and the tooling. But we expect a person to become productive within 3-4 weeks. If this doesn’t happen, this person becomes a burden for the team. Not only he doesn’t deliver, he requires other team members’ time. We simply can’t afford this. Firing costs us dearly, but we prefer giving such people two-week notices and start hiring again. We want the best and the brightest.

You may say, “You don’t know how to interview people to weed out those that are not a good fit.” It’s not that easy. We are not Google – a dream company to work for. We don’t have candidates camping out by our doors with job applications. We pay better than others, but this is not good enough in the offshoring countries, where many developers would rather work for half pay as employees of the large body shops than as remote contractors. I don’t blame them, but this is a reality we have to deal with.

Unfortunately, the fact that the candidate did well during a couple of phone interviews doesn’t mean that he is a good fit. During the interviews we don’t ask questions like “How many piano tuners live in San Francisco.” We don’t ask to demonstrate hands-on knowledge of algorithms from the book by Donald Knuth. We just need people who care about their profession and know a specific set of software tools.

You’ll be surprised, but even if a person demonstrates good understanding of a certain technology this doesn’t mean that he will be able to apply this knowledge in a real project. If a technical job interview doesn’t work, what does? We started using a new hiring technique: try and buy. This is not about hiring people as contractors and then offering full time employment to those who quality. We offer remote software developers who successfully passed phone interviews to start working on our projects part time without leaving their current employer.

If a person wants to work for us, he can find 40-60 hours to commit for working on our project just for one month. After that, we’ll either make an offer or say, “Sorry”. We pay for this time even if the person didn’t prove to be a good fit for us. It’s less expensive for our company and less stressful for the developers.

We are a software boutique and can afford to hire the best. This worked for us in the past and it will work in the future.