DEV Community

Discussion on: Why Javascript of all languages?

Collapse
 
dmfay profile image
Dian Fay

It's not crude, it's different. Java's classic object orientation with static types makes up just one way of thinking about a problem space. It has its advantages: well-defined API contracts, clear separation of strata, operational consistency. The other side of that coin is that you have to do more up-front architectural planning, sacrifice flexibility especially on the micro scale, and just plain write a lot of code. For larger organizations with many teams working on the same code base, it's often worth it. For others, it just as often isn't.

JavaScript is a dynamically typed functional/object-oriented hybrid language with a prototypal model of inheritance. This makes it extremely flexible, and allows developers to express complex processes in much smaller volumes of code. However, it's much less formal than something like Java and therefore large projects easily get messy. Again, it works well in some contexts and poorly in others.

TypeScript and so forth are effectively a gamble: if static type checking is taken for granted, can a hybrid language with a prototypal inheritance model compete with classical object-oriented languages on their own turf? It's no accident TS came out of a huge organization like Microsoft rather than a ten-person startup.

Collapse
 
leoat12 profile image
Leonardo Teteo

Yes, like many things in the development world it depends on the use case, but it seems like Javascript is taking every aspect, there are some projects I've seen on Github that it is astonishing to me how they can keep everything in order with such complexity, one I've seen and I use a lot is Habitica, which is made 56% of Javascript. I even have to take a deeper look in some of these projects to learn how it is structured.