Don’t (only) focus on the code

Every developer aspires to create great things, but often the most important issue is not just the quality of your code, but many other and obscure things that are setting you back from achieving your and your company’s goals.

You should write good, well tested code, which doesn’t have to be perfect, but merely good enough. I know that some of the purists will get mad but that is often the case. As the saying goes, Perfect is the enemy of good enough. I won’t go into the quality of the code anymore, because I believe you, as most of the programmers do, write good enough code. What you should focus on is something completely different.

There are three things that you can do while working for a company or consulting for a client:

  • Create value
  • Reduce expenses
  • Both of the above

Ultimately I want you to always think of the ROI (Return On Investment), for either your employer, your client, or yourself in the end. If you steer away from that focal point, and start procrastinating on delivering the product, because the code, design, or copy is not perfect, you will never ship it. Also, if you are not embarrassed by your first release, you have shipped too late.

Now, think long and hard, what situations call for further improving the quality of your code to stick them in the three categories mentioned above? Testing and refactoring bad code will improve future maintainability, which reduces expenses in the long run. Optimising for performance and making the application faster can bring you more clients and earn more money. Optimising workflows will cut the time needed for the end-user to finish a unit of work faster, which reduces expenses per unit of work, allowing them to do more in the same amount of time, or to work less.

Automation is a nice thing to have, but unnecessary in the beginning. If the product that you are creating succeeds, and you start spending a lot of time on processes that should be automated, please automate them, and delegate the execution to someone else. But don’t do it before it really starts to hurt, because you are wasting your (and the company’s) precious time.

Understanding how and why the software does what it does should be the main thing for you to learn about. I agree that you can be some level III programmer in an enterprise behemoth, really detached from the process, being fed with your daily or weekly tasks through some project planning tool and not really knowing how the sausage is made. Maybe you are one of the Dark Matter Programmers, and aren’t really ambitious to move up, and that is also OK. I know people that are in the same situation as you are, happy with the work they are doing. Although I consider this approach highly insecure and uncertain for the long run, it is practical for the present, for them.

If you are focusing on the process, and eliminating the obstacles to reach one of the three points mentioned above (create value, cut expenses, both of them), then your software will be better in the long run. In that process you stop being just a programmer that is easily replaceable, and start being a true business consultant, with a unique set of skills.

As an example, there is a process that each end user has to do to make one widget. It includes going through 10 different screens, and entering a dozen parameters on each screen to produce the widget. Creating any type of widget generally takes 10 minutes Although the company makes different types of widgets, let’s say that one widget accounts for 80% of the sales, and all others for only 20%. Optimising the code in this situation does nothing, because the code has to produce a variety of widgets, and unless it’s really messed up, you should leave it alone.

Optimising the process on the other hand is something completely different. Especially if we have a situation like I mentioned above. I really love the Pareto principle, and try to use it all the time, applying it to any situation will allow you to focus on the stuff that really maters and ignore/drop the stuff that doesn’t.

How do we apply it to the above example? Let’s call the widget that accounts for 80% of the sales The Golden Goose. All widgets have around 100 properties you can set while creating them, but 95 of them are the same for each Golden Goose. So why bother entering and checking each one for a process that happens 80% of the time. Optimising the process from 10 screens and 100 parameters that takes at least 10 minutes and allows for a lot of human error, to one screen and 5 parameters, which reduces the widget preparation time to only one minute will drastically increase the user productivity, allow them to push out more widgets in the same time.

By focusing on the business and not only on the task at hand, you will stand out among your peers. There is no difference whether you are an employee, a freelancer or a consultant, your customers will generally have more respect for someone who looks at the bigger picture, and speaks their language. You can do yourself a big favour and read a couple of business books. It is a very big chance that you work for one, so why not invest a couple of hours in understanding how businesses work. It is a very small chance that those hours are spent in vain. If you don’t know there to start, The Personal MBA by Josh Kaufman is really great, and I can’t recommend it more.

The LinkedIn experiment

If you are an engineer you probably don’t see much use from LinkedIn as a service. It is full of recruiters, who can be very annoying from time to time. You can choose to link people you have worked with, went to school with, or know from one source or another. Aside from this fact, I didn’t see that much use in LinkedIn. So I decided to run a small experiment. No, I won’t give them access to my email or something stupid like that, but I’ll do my best to use the site as it was intended to.

I’m not really hoping to gain anything from it, aside from maybe a new connection or two. I know I’ll get spammed like there is no tomorrow, and that was one of the reasons I killed my profile a couple of years ago. But this time I mean business.

I’ll do my best to post updates, link interesting articles, fill my profile with everything I can, and even leave a review or two. I’ve already started doing some of those things, and I’ll follow the plan at least till fall.

As I’ve previously mentioned, I don’t want anything. I’m not looking forward to getting spammed by recruiters, and I probably won’t be looking for new projects soon. I just want to see what can be done with it. I’m always open to finding new acquaintances and similar minded people. I was also considering joining (or starting) a mastermind group, and maybe LinkedIn can provide some help with that.

If I don’t get anything out of this small experiment, and I sincerely doubt that I won’t, I believe it will be a small amount of time well spent. I’ll surely write a post about my results in a couple of months.

Understanding the Ember run loop

All of the Ember.js internal code, and most of the stuff you write while creating an Ember.js app runs with the help of the run loop. It is used to batch, order and reorder jobs in a way that is optimised for efficiency. I didn’t notice it’s existence before I ran into problems with the JavaScript setTimeout function callbacks and when manually running async calls to the API.

How Ember run loop works

If you’ve read any of the productivity books out there, they all state that batching similar jobs is the key to success. Ember run loop works in a similar way. By running same or similar jobs at the same time, the browser doesn’t have to skip around from task to task, which eases the burden on it, and if you change the same property a couple of times in the same loop cycle, it will only have to process the last change.

Jobs or tasks are scheduled into different queues, and the queues are processed by priority until they are empty.


Ember run loop consists of six queues
// => ["sync", "actions", "routerTransitions", "render", "afterRender", "destroy"]

Each one of these queues is responsible for some jobs batch that runs inside of it.

  • sync contains the binding synchronisation
  • actions is the general work queue, and the one that generally handles promises.
  • routerTranisitions contains transition jobs in the router
  • render contains the jobs that are associated with rendering the page and updating the DOM
  • afterRender runs after the DOM is complete, after all the render jobs have been executed. This is the perfect place if you want to update the DOM after it has been rendered.
  • destroy is responsible for destroying everything other objects or jobs have scheduled to destroy.


Ember run loop is really important when running tests in Ember. Ember raises errors in testing mode when we try to schedule work without the run loop.

When should you use the run loop

Strictly speaking, all non Ember api code should be wrapped inside an Ember run loop. That includes:

  • AJAX callbacks
  • DOM updates and event callbacks
  • Websocket callbacks
  • setTimeout and setInterval callbacks
  • postMessage and messageChannel event handlers

Be sure to wrap the callback body in the ember run loop and not the whole invocation. For example:

var controller = this;
socket.on('channel', function (data) {, function() {
    this.set(‘message’, data.message);

This fires an Ember run loop after the callback is executed, and the callback code will be executed at exactly the right moment.

Domain switch

If you are a somewhat regular reader, you have probably noticed that I’ve changed the domain name from to Maybe you didn’t notice it at all, kudos for that, because you have been redirected automatically. There were a few reasons for my decision, and I’ll try to sum it here. I won’t go much into details of how to do it, because you already have a lot of information on the Internet covering it. First to explain the babinho moniker. I’ve been using it for a lot of time now. It’s a nickname that dates back to the year 2000, and stems from the obsession with Brazilian football players way back then, when we all had similar nicknames. And mine just stuck around. I wanted to retire it for a long time already, but the more you are invested in something, the harder is it to move away from it. I decided to follow the advice given primarily by John Sonmez in his blogging course, but it is also suggested in many other places, and used by a lot of people I’m following and consider to be internet famous, at least in the small niche that I’m following, e.g. Nathan Barry. As this is a personal technical blog, I decided to go with my name and not some SEO optimised domain name. I believe that personal branding is the corner-stone for each developer, and something everyone, in the tech world or not, should work on as much as possible. There is no better way for you to stand behind your work by stating your name loud and clear. It is professional to the core, and gains you more respect than some childish moniker. It is the scariest thing you can do, because if you make a blunder people will know. But don’t obsess with it, because people rarely or even never remember other people’s blunders. And they will appreciate you more for trying and failing, than for not trying at all. I know that I stood behind that moniker for a really long time, and it has defined my work and sometimes my hobbies. I was not ashamed of my real name, but I just decided not to stand behind it. Going by a nickname was cool and hip, and somewhat unprofessional. Although I’m not saying you shouldn’t use some kind of an alias, especially if you are not allowed/afraid to write because of some repercussions (please do yourself a favour and change the job or the place you live as soon as possible), I am saying that you should use your own name when you engage in technical writing. If you are considering to write or are already writing about really controversial and dangerous stuff, then do everything needed to protect your identity, and be as anonymous as possible. I won’t go into details on how to do that, but there are many privacy oriented websites, so you just have to look around.

On continuous improvement

It is really hard starting something new. Just consider the first time you sat down at the computer to write a “Hello World!” program. Following the tutorial or whatever, you were able to copy/paste or type the code into some IDE or a REPL environment and run it. Then you decided to create “an application” and it was nothing like that Hello World example. Maybe you saw the video on How to create a blog in 15 minutes, and got hooked to this fancy new Ruby on Rails thing like I have. Regardless of the way you started, there is one constant in everything that you do.

If you do something consistently over a longer period of time, you will eventually get really good at it.

Consider blogging, or technical writing for example. Unless you were some kind of a teen writing prodigy, you can’t write that well. Especially if the school system you were a part of didn’t encourage creative writing. I struggled with essays and general writing throughout my school years. And I never thought that writing was a skill that everyone should have. After almost 6 years of on and off blogging, I believe writing to be a really necessary skill, and it really changes the way you express your self, and the way you convey ideas to other people.

Looking back at my posts from 2009, I can’t stop being sad for myself, because of the bad grammar, sentence construction, and even the notion of conveying ideas to people. But it got better over time. I used to struggle when writing 200-300 words in a blog post, and now a 500+ word blog post almost comes naturally.

Gradual improvement is a great thing, and if you hone your skill consistently, you will become an expert in what you do. I know I’m far away from being the next Seth Godin when it comes to writing, but I can try to improve with each post I write, and I can create a habit of writing every day.

You can do the same, choose a skill you want to improve, don’t set any goals or anything, just do it. If it’s writing, make a calendar entry each day and tell yourself to write e.g. 500 words that day. It can even be 100 words, creating a good habit is what matters most, not the amount of doing something.

Don’t set your goals too high, because you will never accomplish them, and you will loose the taste of all those small wins that come when you do get good at something, and realise that you have done something worthy.

There is a great app that I use, and it’s called Commit, and it is probably the best thing I could have done for me. This app, in addition to the Tiny Habits method by B.J. Fogg, was the cornerstone in most of my work.

It is hard to force yourself to sit down and write a 2000+ words blog post, but it is pretty easy to sit down and write 500 words. If you struggle with 500, start with 100. It won’t take you more than a couple of minutes accomplishing that goal, and if you really like what you are writing about, you can always continue. It’s the sitting down (or standing up at a desk) and starting that counts. Make that your daily habit.

You can always do more than the minimum, but set a realistic minimum that you can do each day. And your skills will improve. Of course, they will improve faster if you do it more, but don’t overdo it, because if you burn out, it will be really hard to start again.