DEV Community

Kevin Naidoo
Kevin Naidoo

Posted on • Updated on

JavaScript - a big no no!

If you are a web developer, there is no escaping JavaScript. It's the language of browsers. Regardless of whatever language you learn for your backend, you still need to learn JavaScript.

JavaScript is a great language. In the early days of the web, it was primarily (and still is actually) used to add event handling and rich dynamic features to static pages. Features such as sliders, popups, fancy navigation menus etc.

I love JavaScript and have been writing it for ions. TypeScript makes things even better and cleaner.

I however, do not recommend JavaScript as a first language for beginners.

Fundamentals are important

While TypeScript does bring in the much needed structure that JavaScript was lacking for some time, most beginners I have spoken to just deep dive into React, Vue, Next and so forth.

In your first year of programming, you should not worry about implementing stuff. You should first learn architectural and design patterns such as MVC, SOLID, Singleton and so forth.

Technology changes. When I started programming, languages such as C#, C/C++, Python, PHP and Java were the norm and popular. JavaScript back then was thought of as a niche language - it was seen as a sort of "glue" for web pages.

The point I am trying to make is that technology will change over time. For example, React is now popular but in 10 years time, something else will come; perhaps some sort of AI framework or tool.

You know what hasn't changed much? Design patterns. If you take an overall look at systems built today, we are still using design patterns from the 70s, 80s and 90s.

The fundamental core concepts are still as valuable as they were in the 90s and even more so today as apps scale to meet the complex modern demand.

JavaScript abstraction

Speak to most JavaScript junior developers and the thing they grapple with the most is state , hydration errors, trying to customise a component like a table or select or something to that effect. It takes them hours to reach the same level of customisation you can get by just using normal HTML and plain old JS or perhaps something similar to alpine.

The JavaScript frameworks of today introduce too many layers which can distract you from learning core fundamentals.

Once you have a good level of experience, by all means go ahead and use whatever framework or tool you want. However, if you still in the early stages of your programming journey, then this can become a problem because this abstraction will inadvertently cause you to gloss over what is actually happening under the hood.

Dependency on 3rd party services

This is not exclusive to JS developers however it's quite common in the JS/TypeScript world.

In today's modern world there's a SAAS or NPM package for everything. Developers are sometimes be too eager to just buy a sub and implement an API or pull an NPM package.

Nothing wrong with this approach from a time perspective. Nobody wants to re-invent the wheel all the time and in a business context, engineering overhead with a custom solution can be costly.

In the long term, you may end up in a company or role where performance or cost matters or perhaps for some reason using a 3rd party tool is not an option and you will need to engineer a solution on your own. Learning about what's happening under the hood will be an invaluable tool in your toolbox and generally make you a better developer.

One example is OpenAI. Everyone is talking about chatGPT, and machine learning. A common approach is just to buy a sub and implement their API.

How many people actually read up and try to understand what transform models are and how to build a simple model from scratch?

One language to rule them all

Yes, JavaScript/TypeScript in both the frontend and backend does make things a lot easier, and not switching context all the time does make your workflow a lot faster.

With that being said, you should not be tied to one way of thinking or one language, or one framework. You should learn how to solve problems, and then use the right tool.

Example, if you dealing with machine learning - at this point in time, Python is the best language for this task. If you working with some windows API's for office, then C# is probably the best language to use.

Languages that are good for beginners

I strongly recommend C# or Java, even though I don't write C#/Java often and prefer Golang, PHP, Python etc...

C#, and the Microsoft certifications out there are really good resources that teach you important engineering fundamentals. Same applies to Oracle certifications.

It will take you much longer to get a solid grasp or build anything of value using C#/Java initially, however the skills you learn here will be invaluable as you mature as developer.

C#/Java, are also C dialects. Meaning that most C based languages follow the same rules (think semi colons, curly brackets etc...). Migrating your skills to PHP, Dart, Swift and JavaScript will be much easier.

C & C++ - also good options however for web developers. We generally don't need to be that close to bare metal for 99.9% of the tasks we do.

Conclusion

I am sorry if this seems to hate on JS developers - not my intention at all. My goal is to simply drive home the importance of why and not what.

I feel we focus more on framework X and package Y, instead of how does this tool actually work under the hood.

JavaScript is very easy to work with, and therefore tends to abstract these concepts away - which can be a problem in the long term.

Top comments (1)

Collapse
 
artydev profile image
artydev • Edited

I however, do not recommend JavaScript as a first language for beginners.

As long as they don't work in frontend development, it's ok ☺️