Cogman
Lifer
- Sep 19, 2000
- 10,286
- 147
- 106
Interesting or not, at the end of the day all your "interesting stuff" would be presented using javascript, css and html.
I see these markups and scripts as something you just have to use. I have no disdain for them or love for them. Maybe I have not work long enough with them to understand the hatred(this would be especially true of JS).
Yes, you have to do work with these languages. My point was more that these languages don't constitute web work. Generally, the server feeding these techs is much more complex and a much larger portion of the development process. The listed techs are fine when they are used for what they do best, display data. It is when you try and use them to do more advanced stuff that things get hairy quick.
Now, why the hatred.
HTML. Meh, I don't HATE html myself. It is a little bit kludgy, but for what it does it is pretty powerful. The biggest issue I have with HTML is the standards comittee that defines it. They take FOREVER to define anything. Take a look at the mess that is HTML5, the unstandard standard or "living" standard. It is basically the W3 saying "we don't know what we want to put here, so we'll just hack at it forever".
CSS. Pretty much the same as HTML. Not a lot of hatred for it, it just takes forever for the standards committee to move forward with it. As a consequence we are in this weird fractured state with CSS3 implemention varying widely from browser to browser.
Javascript. This is where most of my hatred is. Javascript is an AWFUL language. The only thing worse than javascript is its zealots who find no fault with it. What is wrong with it? Lets start
Prototypes. The most powerful and dangerous javascript feature. Imagine that you could take a well defined object and rewrite one of the functions on that object to suite your needs ("Hmm, Array.split doesn't work like I want it to... I'll redefine it!" or "These regexes are weak, I'll make a new one!"). Yeah, it is as terrible as it sounds. There is absolutely no protection provided by the language, everything is up for grabs when it comes to re-writing things.
Scoping. Javascript is filled with scope problems. Take a look at how this behaves in a callback situation, or how local variables are handled in a callback situation. It is very strange to say the least.
Global Variables by default. Holy hell this was a bad design decision. How do you make a global variable in javascript? Simple, just don't include "var" in front of your variable... Yeah, it is as bad as it sounds. Imagine that you misspelled a variable name for whatever reason, javascript is so friendly that it will go out and make a new variable for you and then proceed to put it into the global scope...
2 different equality operators. In javascript there is == and ===. == tries to make the two objects "fit" together before saying they are in equal while === will only say two objects are equal if they are of the same type. It leads to fun situations where "1" == 1 but "1" !== 1. You generally never want to use the == operator.
No such thing as an integer. In javascript all numeric values are floating points. Integer operations are so incredibly common in software development that one has to wonder what pipe the javascript creator was smoking when he decided to make it float by default. Hell, even having integers by default would be an improvement over the current "floats only" situation.
This ends in fun situations for both the javascript interpreters and code writers. You have to do things like Math.floor(65 / 3) to get the value you really care about. This also makes things like cryptography incredibly awkward.
Modules aren't really supported. To do any sort of large scale programming, code modularization is a must. Well, javascript doesn't natively support it, at all. You end up don't weird stuff with 3rd party tools to make things more modular. On top of that, because of HTTP limitations, you generally have to rely on the same tools to shove all of your javascript into 1 or 2 files.
Function signatures are only suggestions. Yeah, pretty messed up. You have a function that takes 0 parameters but the caller gave you seven? No problem! Javascript doesn't assume that the caller meant some other function, it just happily trots along trying to execute things.
The W3 standards committee and browser adoption. Javascript COULD be a nice language some day, but the standards committee takes forever and a half to do anything interesting. On top of that, you have one of the major browser player, MS, who has chosen a pretty terrible update strategy for their browsers. Why are there still IE6 and 7 users? Because MS tied it very strongly into the OS and refuses to do work to backport newer browsers to their older OSes (Yes, it would be hard, but that is their own fault). Until they abandon this strategy, we are going to see issues with this for IE8, 9, 10, 11, and all future IE versions. Issues where someone is running a supremely old browser and they can't go to a newer one.
I personally hope that Dart takes off as a language. There is a lot of FUD around it, and a good portion of it spread by javascript zealots. It would be a good step in the right direction for correcting the wrongs of the past.
