3 ms·
This is one of the reasons why I grew to really love function overloading, especially in combination with pattern matching (I learned both first with Clojure, p
by mercer 9y ago
This is one of the reasons why I grew to really love function overloading, especially in combination with pattern matching (I learned both first with Clojure, perhaps, but have only become comfortable with them now with Elixir). I can often avoid if/then statements altogether! It's also interesting how error handling becomes much less of an issue.
I do a lot of javascript programming, and it's often quite frustrating to not have these and other features available. While I by no means hate Javascript, I have to admit I feel a bit silly about being defensive about it in the past. I just didn't know what I was missing, or didn't see what the big deal was.
- chatmasta 9y agoYou can approximate method overriding in JavaScript by overriding the prototype method value and calling .apply on the original from inside the new one.
- wutbrodo 9y ago> While I by no means hate Javascript, I have to admit I feel a bit silly about being defensive about it in the past. I just didn't know what I was missing, or didn't see what the big deal was. I'm glad to hear a perspective like this. I'm fortunate enough to not come across too many people like this, but I'm always utterly baffled by people who get defensive about the smallest complaints about Javascript (of which there are many valid ones that have nothing to do with irrational hatred).
- mercer 9y agoHa, well, not to get too defensive about my past defensiveness, this was at a time where the irrational hatred was constant and unrelenting. Some time after the 'Javascript: The Good Parts' book, but before all the ES6 goodies. Just a few weeks ago I had some badstalgia when I mentioned I did front-end development to someone. He responded with a rant about how real programmers don't use javascript, and how it was written in ten days, and so on. But yes, I'm happy to have largely stepped away from the language wars. I occasionally join the #javascript channel on IRC and it's truly astounding how much of the conversation is just people attack or defending javascript passionately, and for very silly reasons.
- wutbrodo 9y ago> Ha, well, not to get too defensive about my past defensiveness, this was at a time where the irrational hatred was constant and unrelenting. Some time after the 'Javascript: The Good Parts' book, but before all the ES6 goodies. Yea, it's a crappy feedback loop, where unfairness on either side leads to people being even more strident in their position[1]. > He responded with a rant about how real programmers don't use javascript, and how it was written in ten days, and so on. Ugh yea, that's exactly the kind of person I'm talking about. I may be dismissive about JS as a language, but the idea that "real" devs don't use it is ridiculous. [1] though I admit I can't really relate to people taking their choice of programming language personally. To quote pg, "keep your identity small"