Category Archives: Javascript

One Liners and Overengineering

Sometimes being a developer is hard work

And that is because you have to study and understand the code other people write. Now, this has many aspects in terms of understanding. There are many people who write code. Some of them are good at it, some are not. It all comes down to two categories in my opinion.

“I’m bored of this thing” people

These people  write code just enough to finish the feature. Not very descriptive code, just enough to get the job done, nothing more. Their variables are often misunderstood, they do not have the proper names or sometimes they have a twofold meaning. Something like:


Their code structure nonetheless is pretty much the same like :

function addOrSubtract ($addOrSubtract, $firstOperand, $secondOperand)

if ($addOrSubtract == '+') {

  return $firstOperand + $secondOperand;

else {

  return $firstOperand - $secondOperand;


Their tests also are somehow like the above example. They tend to irrationally use the same structure, using the “feature” of loosely typed languages.

One Liners

Now these people I love. They are trying to do the same thing with the above people, only, they delve into it. They are bored also at first, but when they see that their code can be optimized, they are “one-lining-em”. They do not use the wrongly inferred type as the above people, and their code is “a mystery” yet “it gets the thing done” in one line. Supreme elegance in my opinion.

example :

[]$$("*"),function(a){"1px solid #"+(~~(Math.random()*(1<<24))).toString(16)

Now these One Liners are writing the best optimized code.

The above line was taken from this guy’s blog who explains the exact function of what it does. It is amazing how much you can learn by just one line of code.

What it does is to apply a single pixel outline to all the elements of a page, randomized with a different color. Simply paste the above line in your browser’s console and see what happens. The purpose of this line is to debug your css layout in the page.

If you have a look at the above page you will see that this line is taken from a simple gist and there are a lot of people who are suggesting revisions on how to write that single line.

I will conclude by saying that programming

is something that is quite complex at times. People who do it for a long period, tend to do the above things in order to “escape” the routine of writing plain code. Over-engineering and trying different things (in all the acceptable frameworks of programming, like optimization, maintainability, debug free code) is something that is being constantly done, to keep oneself from doing something different even if one does not have the capability of doing so.

What I mean is that, after you have seen all the technologies, you have used all the “regular path” ways of a construct, you are always trying to do something in a different – peculiar way so as to “escape” the straight-forward, more “boring”, more “effort consuming” way.

And believe me, I have seen this from many, many people that are indeed very good engineers.

After all, Lazy people make the best inventors…
Doing a thing as simple as touching one's left ear, could prove quite complex...
Doing a thing as simple as touching one’s left ear, could prove quite complex…

Anger! Unlimited, Unmetered ANGERRRR!

Developer Anger!

Developers often face situations where logic bends. Now this happens quite a few times. Suppose we have an equation with factors that the outcome of this equation is the “bending logic”.

The first factor, and larger at times is the client input. “Yes, we know we asked for that, but now things have changed, so we have to change it” , “What? I did not ask for a red line drawn with a blue pen!” and so on. More on that at The Expert.

The second factor is the programming language we are using. And that is the point were we stand for now.  Third and fourth factors is experience and capability but those are irrelevant on each person so, we wont be discussing them now.


Quite recently I stumbled upon this interesting site :

Turns out that this guy: @abestanway is parsing repos from github and records each curse in the commit log message. A commit log message is a message we developers use when we are completing a project/code snippet/change/bug in the code of a system we are using.

This guy, took it to another step also. He gathered data and created a presentation, showing the languages with the most curses. He even created graphs of the most cursed and least cursed language:

Curses / Language
Curses / Language

As you can see, Javascript is the first. Undoubtedly this language is the most widely used, so it makes sense for it to have the most curses (and yeah many other stuff you already know like changeling scopes and other Javascript shitty stuff).

He also created graphs with the most used curses:

See that Fuck prevails all!!
See that Fuck prevails all!!

Next, he compared the Most Cursed languages with the most used languages in Github. You can have a look at all the above from the relevant video :

Therefore :


To conclude he points out that the more the curses, the better the code…

Awesome Flappy Bird in Braille with HTML5

Got tired of losing in Flappy Bird?

Flappy Bird

I mean ok, its not enought that the guy (who made like 50K EUR/day) decided to give up on the game, the game was a fluke also.

Flappy bird looks dangerously close to Nintendos Mario in many ways but okay, lets face it guys, you should have thought it.

To continue also my trolling experience as usual, I have found anawesome URL Flappy bird by this guy : thomas_baudon and developed by this guy  Alexandre G.-Raymond

Html5 . replace history and a lil’ JS and voila, Awesome Flappy  bird Braille was born!!

Just use the right arrow, and go for it !!!

My score sucks as in the original :)
My score sucks as in the original :)