3 ms·
>"And this is why Javascript can be such an awful language." To be fair, this is breaking Javascript and that is something you could do in other languages, for
by pmelendez 13y ago
>"And this is why Javascript can be such an awful language."
To be fair, this is breaking Javascript and that is something you could do in other languages, for instance here is a similar version for C++:
http://pastebin.com/seySfpku http://pastebin.com/seySfpku
- mncolinlee 13y agoPedantry aside... are you really going to defend Javascript's core method of function handling as good design by using the C function pointer as an example? On some level, defending JS using C is like saying you can also make a souffle by instead cooking the chicken with the egg still inside it. Both JS and its bad paradigms came from C. You don't arrive at good design by showing that other people also got it wrong.
- pmelendez 13y agoI think you are missing my higher point. I am not defending JS or C++ for that matter (please note that I was not using C), but the fact that giving enough time you can break most languages to do something silly, in which case I don't blame the tool but the people using it.
- j2kun 13y agoNow do it in Haskell.
- userbinator 13y ago> #define int INT This makes it somewhat obvious that you can't change how basic types work in C++. On the other hand, JS's dynamicity makes for some interesting situations, as seen here. I wouldn't consider it "awful" but it's certainly a language with more "deep complexity" than appears at first glance.