Things I Learnt The Hard Way - Optimization Is For Compilers

Let say you need more performance on your application. You may be tempted to look at your code and think "How can I keep this same logic and still remove a few cycles, so things seem to go faster?" Well, if you want performance, you need to change your logic.

Read more...

Things I Learnt The Hard Way - Organize Your Code by Data/Type, Not Functionality

A lot of projects assume that you'll put things with the same functionality in the same place, no matter what data they deal with. This makes things harder to break apart later.

Read more...

Things I Learnt The Hard Way - One Commit Per Change

When working with source control tools, keep one change per commit. Avoid bundling more than one change in a single commit just to "save time".

Read more...

Things I Learnt The Hard Way - Always Use A Version Control System

"This is my stupid application that I just want to learn something" is not even a good excuse to not use a version control system.

Read more...

Things I Learnt The Hard Way - Debuggers Are Overrated

I heard a lot of people complaining that code editors are bad 'cause it's hard to attach a debugger. I'd claim that this vision is wrong.

Read more...

Things I Learnt The Hard Way - Shortcuts Are nice, But Only In The Short Run

A lot of languages/libraries/frameworks add a way to make things shorter, reducing the number of things you need to type.

But, later, that will bite you and you'll have to remove the shortcut and do the long things.

Read more...

Things I Learnt The Hard Way - Logs Are For Events, Not User Interface

Two things in one: First of all, when using logging, use it to log events, not for user interfaces; second, log events in a machine readable way, not necessarily an human readable format.

Read more...

Things I Learnt The Hard Way - Resist The Temptation Of Easy

Sure that IDE will help you with a ton of autocomplete stuff and let you easily build your project, but do you understand what's going on?

Read more...

Things I Learnt The Hard Way - Start Stupid

One way to get away from the IDE is to "start stupid": Just get the compiler and get an editor (ANY editor) with code highlight and do your thing: Code, build it, run it.

Read more...

Things I Learnt The Hard Way - Always Use Timezones With Your Dates

No matter if the date you're receiving is in your local timezone and you'll display it in your timezone, sooner or later, the fact that you ignored there was a timezone behind that date will hurt you.

Read more...