Login
Theme: Light Dark

Why is it a mistake to use JavaScript for everything from web development to desktop applications?

Tagged:

Home - Quora Link

So, there are three languages you have to learn to build a web page. Javascript, which you’ve already mentioned, is used to script events and in some cases to build the markup.

CSS is a stylesheet language used for presentation and styling.

HTML is a markup language used for structure.

In order to get a web application working, you also need a backend server application and a database to store data in. The database will be interacted with using a query language (most of the time SQL) and the server application will use a general purpose programming language.

Javascript can be used as a general purpose programming language and can even generate HTML. There exist wrappers that even let you generate SQL using Javascript. CSS, however, is a different beast. Styling is entirely too complicated to be described well using a general purpose programming language.

So sure, it’s conceivable to just use one language. But I think it would be silly and you’d lose a lot of flexibility by artificially restricting your stack for such a dumb reason. The other languages didn’t just go away, all you’re doing is hiding them behind Javascript.

See, you’re still going to have to learn how HTML works. Otherwise when your fancy generators don’t quite work for you, it’s going to be really painful debugging them. Ditto for your database libraries.

You should learn how other languages work and how to do basic things with them because if you don’t, you’re going to come crying to somebody like me when you’ve spent six hours trying to center a div, or when you’ve introduced a SQL injection vulnerability into your server application and your site keeps getting hacked.