Other languages you should learn

body language

At first glance, this tweet in response to my previous post looks like a simple joke. But it’s actually true the more you think about it.

Understanding body language is important because software engineering is more about dealing with people than with software itself: almost all failed software projects are due to people problems (e.g. management and client problems) instead of technology problems.

Here are some cases where knowing body language can make a difference:

  • A client asks for too many features under an impossible deadline – by gauging the client’s behavior, you can determine if she’s basically bluffing (to which you negotiate a compromise by reducing the scope) or if she’s really that stupid/sadistic (to which you drop the client for better ones).
  • A developer puts in too many hours into overtime – depending on the dev’s behavior, a good manager would determine if that dev is simply temporarily getting brownie points for a promotion or upcoming long vacation. On the other hand, it may also mean that that dev is incompetent to the point that he needs more hours to fix his crappy code. At the worst case, it may also mean that that dev is already at stage 2 – 3 of going into burnout.

Another non-technical language you need to learn is Basic English.

Go ahead, laugh. But then recall the last time you’ve seen a “plz send me teh codez” post in a public forum or a job posting full of misspellings and grammatical errors (a big warning sign) and you’ll quickly realize how important it is to have a good grasp of the English language.

Lack of proper written English skills is a somewhat widespread problem in the current generation, with the prevalence of text-speak and the fact that a lot of young people don’t join international community websites/forums/mailing lists/chat rooms. This can be a problem when they enter the corporate world, where semi-formal English is the lingua franca: I’ve even heard of stories of project managers re-writing some of the team members mail before sending them to their foreign counterparts because of their poor English.

Note that your English doesn’t need to be at the level of essayists or other professional writers. In fact, simple, direct to the point (but at the same time, polite) messages is much more effective at communicating to clients or team members when compared to long-winded messages full of highfaluting words. Doubly so when dealing with clients whose primary language isn’t English.

To wrap things up, I just realized that I wrote about a similar topic a few years ago. You don’t need to click that link, as the tl;dr is just the same thing I’ve been saying all the time: developers need to learn more than just coding.

What programming language should I learn?

I got to talk for DevCon again last Saturday at STI Makati. Instead of preparing a new talk, I just rehashed an old talk to save time. The new talk is also over at Slideshare.

Anyway, the point of this post is to answer a question posed to me by a student in the Q&A portion of the talk:

Anong programming language ang dapat naming pag-aralan?
(What programming language should we learn?)

Here’s a question I wouldn’t want to hear answered by someone else (i.e. someone who’s also invited to talk to students). The question itself may seem simple, but unless you’ve seen how the industry works as a whole, you’ll probably give a wrong answer.

The traditional answer I don’t want to hear is to give a suggested list of languages based on market demand.

Simply put, this is bullshit. This is the same sort of bullshit that pressures our youth to take nursing courses even though they’re just in it for the money, money that they probably won’t get due to the eventual over-supply of nurses.

So for the student’s question, I gave two answers:

Programming language and platform choice doesn’t matter, because for the most part it’s a business decision.

Yes, I’m talking about steaks and strippers. In a large company, you may be initially hired to work on a single language, but eventually there will be a time where the company will make a business decision to shift technologies, whether due to market pressure or due to a new client. If you focus too much on a language, you will not be prepared for the change and you may end up getting fired or demoted.

In smaller companies or in a freelance setting, language still doesn’t matter, though for another reason: the client will not care about the language as long as you deliver the product.

This leads to the other answer:

Focus on the fundamentals, not on the language/platform.

A common mistake among fresh grads is that they’re confident they know language A or platform B because they were able to make their school projects or theses while at the same time not having their fundamentals down pat. Not only does this make them inflexible in terms of learning new languages, it also makes their work brittle and sloppy.

In other words, a student who has 4 years of school “experience” in Java is nothing compared to a developer who just had learned Java a month ago but has solid fundamentals in OOP.

You might say “Screw learning, I’m just in this for the money!”. But the fact is, there’s this thing called the Python Paradox: developers who are passionate enough to learn more than their peers often end up in higher-earning and less-stressful jobs.

Bottom line: There is no “best” language that you need to learn in order to earn a lot of money. However, if you have good fundamentals, learning the language and platform that the market needs will be much easier for you.

Web Developer Interview Questions

Earlier this week, I had to interview a bunch of applicants for a web developer role. The idea is to filter out those who aren’t really experienced as the job asks for people with at least 6 months of experience.

Anyway, below is the test I gave them. I don’t feel like giving something like it again in the future (it’s pretty crappy IMHO) so I think it would be a good idea to share it instead of just throwing it away.

Determine whether the statements below are true or false. Be prepared to explain your answer.

  1. A primary key can be composed of multiple columns.
  2. When you have two tables in a parent-child relationship (i.e. one table has a foreign key referring to the other table) deleting a parent record will delete all child records of that record.
  3. Escaping special characters is the best way to avoid SQL injection.
  4. You can undo UPDATE and DELETE changes to the database.
  5. The VARCHAR data type can be used to save space when used over CHAR.
  6. When using an RDBMS, normalization must be done for all tables.
  7. Indexes speed up database actions.
  8. Foreign keys are usually indexed.
  9. Many-to-many relationships are implemented via junction/join tables.
  10. Some HTML elements have been deprecated in favor of CSS.
  11. The <strong> element can be used interchangeably with the <b> element.
  12. Under strict XHTML rules, <br> is not a valid usage of the line break element.
  13. The href attribute of the anchor element only accepts relative and absolute links.
  14. The image tag is a block element.
  15. When a form is submitted, the submitted data is derived from only the input elements inside the form.
  16. Multiple elements can have the same id attribute.
  17. Web servers serve content at port 443.
  18. A web server can identify if a client has visited the website before.
  19. POST is idempotent.
  20. A browser redirect can be initiated by a response with an empty body.
  21. In JavaScript, the var keyword is optional when declaring variables so it can be omitted in all cases.
  22. You must specify a function name when declaring JavaScript functions.
  23. Ajax will prevent you from performing other actions until the Ajax action is completed.
  24. You are limited to using XML in Ajax.
  25. You cannot change the values of a class variable.
  26. Constructors are instance methods.
  27. Polymorphism refers to the ability to define functions to have different behaviors depending on the passed arguments.
  28. High cohesion and loose coupling can improve coding speed.
  29. You can combine the features of two classes via inheritance.
  30. Encapsulation is primarily used for security reasons.

Answers below the cut.

Continue reading “Web Developer Interview Questions”

Starting a “professional” Rails app with Haml, Rspec, Devise, and Web App Theme

Update 2: This tutorial is way out of date. If you want to create a modern (ie. 2015) app, please use a generator like RailsBricks.

Update: Tutorial for Rails 3.1 here!

crud screen

Every Rails developer knows how to create a Rails app. It’s easy as

rails new APP-NAME-HERE

But how many know how to create an app from scratch that looks good enough to sell to clients i.e. with slick design, authentication, authorization, and all that? Sure, there are tutorials out there that cover those components, but most of them cover them only in isolation from each other. A quick tutorial containing multiple components at a time would be a valuable resource to anyone planning to start a new app.

As the resident dilettante in these parts, I’ve decided to create such a tutorial based on a recent demo I made for a prospective client.

This post will discuss how to create a Rails 3 application that looks good enough to sell to clients (of course, YMMV) while still having components found in “professional” apps. This tutorial will cover the following:

  • Andrea Franz’s web-app-theme gem – I only recently found out about this theme generator gem. Had I discovered this sooner, I might not have made “I hate web design” a catchphrase. Basically this gem generates themes for your web app (hence the name). The demo and the list of available themes can be found on this page. The main downside to this gem is the lack of tutorials on the net about it. Hopefully this post will give people an idea what to expect with the gem.
  • Devise – our authentication module. Authlogic‘s fine, but I find Devise’s approach less obtrusive.
  • Haml – replaces Erb. Not perfect (e.g. screws up with inline a tags) but the drastic decrease in code makes passing it up difficult.
  • Rspec – replaces Test::Unit. Only setup will be covered in this post, actual usage is left to the reader.
  • will_paginate – gem for pagination. Everybody uses it, so what the hell…

Rest of the tutorial is below the cut.

Continue reading “Starting a “professional” Rails app with Haml, Rspec, Devise, and Web App Theme”

RailsFTW v0.4 released

Rails FTW

Following the release of Ruby1.9.2-p136 source and RubyInstaller, I’ve taken time to update RailsFTW accordingly. Head on over to http://railsftw.bryanbibat.net/ for the latest installer.

Aside from updating the patch level, I’ve also taken time to figure out how to build the mysql2 gem using MariaDB instead of MySQL. Less chance of lawsuits = more fun for us.

As a bonus, here’s a screenshot of RailsFTW showing HAML, rspec, and Capybara working properly on Windows:

ANSICON FTW