2. TypeScript, CoffeeScript, *Script have nothing to do with JS, this post is not about it.
4. If you're happy with any technology and it helps to archive the business goals - I can be only happy for that!
Big claim, isn't it? Well, I'm sure I have a right to say that. I've been
I'm a normal developer.
You cannot avoid JS
Yes, you can try but you won't be able to. As a cancer it's being integrated in everything - web, backend, databases, mobile and embedded systems.
Again, due historical reasons browsers don't have other options, suck it up, bite your tongue and write frontend. I know it's a hard work, thanks to people who doing that.
JS is cool on backend too
I hear that all the time, especially from newbie developers. They're claiming that JS is so simple to use so even backend can benifit.
There are dozens of tools have been created for backend - JVM/Java, RubyOnRails, Python and, I'm sorry, PHP.
So why do they think we deserve one more creature in our crowded backend zoo?
I'd like to go through most popular answers I've heard
JS is fast!
JS is modern language
Oh well. I want to share pain with you.
I'm sure you have heard about JS6, along with cool systax stuff they finally brought in classic datatypes - Map & Set. I hope dear reader know these are very basic data structures known to any developers(even to JS ones, I hope). I was really happy that finally I could use innovations dated back to 1970
You easily can do
[1, 2, 3, 4].map(i => i*10) because it's so normal nowadays, and, of course, JS clamed to be functional. But, apparently JS "architectors" don't think so. Althogh
Set has forEach method but doesn't have
I mean, WHY?! What held developers from doing that?
Map - it's simply not possible to map via
I was told that types slow down development. And I'm absolutely agree, if you write Hello World every day JS is hell faster to use. But sorry, I'm writing production code for medium and big sized applications, which are business critical.
One claims that JS is safe if you write tests. It's true, but why whould you write tests if compiller can prevent developer from obvilius mistakes? I mean, why? Why do you need to check input arguments for type(say, MongoId as object or string) if you expect only one type?
I'm sure it's easier to write
id: MongoId in the contract rather that cover that scenario in the dozens of tests(and still it will leak some usecases)
I love reckless approach of some JS developers - we have tests covered that - they say. Often I don't have tests I don't need - compiller won't allow me to run something which doesn't work
Again, I see zero reasons why you would run broken code, you should not be able to!!
JS is envolving all the time
Actully it's other way around. Because of the low learning curve we're having a lot of shit code outthere(same as PHP). Honestly it looks like there is a rally of producing another shit-framework.
While JS devs are bragging about production deployment of all-shinny-new library released yesterday world is shocking observing that. Why so? It might sound a bit conservative but production code supposed to work.
It's very easy to write code in JS
Yes, it's always easy to write code, but don't you write Programms and Applications? It's not that simple, and, if tool doesn't put constrains on you it's very difficult to keep consistency.
Think about writing code on the sheet of paper? It's very simple but never easy
If you're frontend developer - accept it, suffer and do your job. It's hard but very important.
If you're JS backend developer - stop bragging about that. It's not fine. Open your eyes as look around, world of programming is beatuful and got different tools, don't reinvent the wheel. I know you can do better.
Dude, do you use JS?
Of couse I do.
I'm just minimizing usage to keep mine nerve system for more pleasant experience.
Yes, I do write frontend (and do it well) when I have to, and yes, I do write prototypes on nodejs(but it never ever goes outside of prototype stage)
Why so angry?
Coz I'm sick of observing how JS is holding back whole software development ecosystem. As part of it I have my word.