When is the real need to use Javascript?

Asked

Viewed 102 times

-3

I’m new to the world of development, and I started with the Front-End. I’ve been looking to specialize in HTML, CSS and especially Javascript, but over time I’ve been realizing that with the advancement of these languages, and specifically CSS in its 3rd generation, it already does, alone, make several visual effects that were previously only possible with Javascript (a slider or any other kind of animation). In such a way, I still came across few situations where Javascript is really necessary, such as the opening of a modal or a form validation, for example. On what occasions is Javascript really necessary, and not just optional ? The language runs the risk of actually being replaced by CSS, or there are still a large number of cases where only JS can perform a task (whether a visual effect or not).

  • Javascript is for much more (but much :p) than working visual effects

  • Like what, exactly ? That’s my question...

  • Just take a little vertical look at the documentation to verify it. Data manipulation, action handling, so on

  • 1

    I understand what you have in mind in question. But the answers are numerous and basically CSS and Javascript fulfill different functions and cannot replace each other. An example of something you can’t do with CSS alone: (link).

  • @Sergio, thank you for the answer, I thank you for putting the question in hold, because really it is a question that can have as a response several opinions, but I was unaware of this rule of the forum. Thank you !

1 answer

1

No, javascript will never be replaced by CSS simply because it’s two different worlds. CSS is not a programming language.

Instead of talking, talking and talking here a lot of things and not passing my opinion, I’ll teach you a business: Enter any site (Facebook, for example) by Google Chrome. Press F12 to open the "Developer Tools". On the bar where you have the guides, at the end, click on the setup gear. Under GENERAL, check the "Disable Javascript" box and refresh the page. This will cause the site to be uploaded without javascript. I guarantee it won’t be a beautiful thing to see!

Javascript will serve so many things... Mainly because, because it is a programming language, it will allow chain commands in a procedural way. CSS does not.

When you start learning Javascript, you’ll see how important it is. Currently, all sites I develop have at least 4 script calls on and sometimes some internal yet.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.