Hacker News new | ask | show | jobs
by kanatohodets 4592 days ago
Interesting to think about the sorts of cultural markers that other languages have. Maybe this is just another way of saying 'code smell', but there must be similar elements for JS/Ruby/Python (for example) where it the code isn't strictly 'wrong' (or even debatably wrong), but is still clearly indicative of a particular cultural approach towards coding in that language.

Like overriding Array.prototype.push in JS - it might be just fine, but I tend to pause and re-evaluate my attitude towards the code when I see that going on, because it's a very different approach to coding in JS than I personally use.

2 comments

I tend to see much clearer indicators in JavaScript code. Global variables? Lots of functions outside any closure? Old skool js coder ahead.

You can also tell javascript only programmers a mile off. Anonymous functions everywhere? Functions have multiple concerns? Use 'var aFunction = function()'? Mono linguist and spaghetti code ahead.

A lot more JS coders could benefit from adding "use strict" to their code too. It's frankly amazing it isn't used more.
Honestly, in practive it falls short and doesn't do nearly enough. :(
True. It does far too little at compile time. I don't understand why. Maybe we need a "use compile strict" ;)
In Ruby, using explicit "returns" or ternary operators can be a hint that someone is newer to Ruby. On the other hand, using symbol-to-proc syntax indicates some experience (I.e. list_of_objects.map(&:method))