Ideas Into Software

Musings on writing code

History Is a Tree

I’m sure it happened to you too. Just remember. That horrible moment when you time-travelled using undo - to copy and paste that line you deleted twenty minutes ago but for some reason you really, really, need it now - and then you hit a key and insert a letter. And just like that, your way back is gone.

Foreign Key Naming in Sequelize and Postgres

Sequelize is a pretty nice ORM wrapper for Node.js. It keeps focus on writing JavaScript and helps avoid the annoying mental context-switch to SQL. And even though it's a somewhat leaky abstraction it makes a programmer more productive. And in this century, who doesn't like being more productive, huh? Now, speaking about leaky abstractions, there's one syntactic issue that

Const Is the New Var

We hear a lot of praise recently about the introduction of new cool features in ES6. One of those long awaited ones is the let keyword. And rightly so - it has saner scoping rules, does not hoist (I know, I know but let's ignore TDZs here) and generally does not “pollute” your function’s namespace as much as var.

Dear CoffeeScript

I’m leaving you. I'm sorry. All good things must come to an end. You introduced so many great ideas to the JS world (although you borrowed from elsewhere but...psst). Arrow functions. Destructuring. Comprehensions. I dare to say you made writing JavaScript code fun again. And my Kinesis keyboard and my wrist tendons will forever be grateful. But now

Coding tip: Testing Hapi plugins

Hapi plugins are a great way to break your web server up into isolated pieces of logic. When you structure your app with plugins you'll get easier code reusability, more maintainability and you'll become a happier, prettier person with better posture and beautiful complexion. However, there's one thing you should not do. And I see it done disturbingly often (not

Hapi - Inject with Mocha

Hapi is a very solid framework that makes writing maintainable and testable web servers so much easier than, say, Express, that I'm seriously considering flying to Los Gatos just to buy @eranhammer a beer. There's just this one thing bothering me. If you're using Mocha, no doubt you'll very soon come across #1299 - exceptions thrown in server.inject do