Ivano Di Gese
Aug 27 · 5 min read
Photo by Esteban Lopez on Unsplash

Ever since JavaScript has improved and become the most popular language, it has been crucial for developers to keep in mind at least five essential key concepts.

Today, JavaScript is the most trending language, and Python, even if it keeps growing, just follows the developers’ interest.


1. The Application Context

JavaScript can be used to develop almost anything, really. There is a big variety of contexts where JavaScript can belong, and it typically defines the way you use and apply this technology to that purpose.

Yes, the language remains the same and the syntax as well, but once you know the common patterns and key concepts, you must be able to master the context and the frameworks you need to realize your product.

If you use Electron, you must be able to handle installations, dependencies, and hardware support. If you use Ionic, you need a good knowledge of mobile device hardware, layers, and display screen resolutions and portability, as well as key differences that separate iOS from Android. So even if the language is the same, frameworks and tools change a lot, and the first thing you have to keep in mind is your application context in its entirety. You can see yourself how different JavaScript is when applied to mobile software, desktop software, and simple DOM scripting.

Here’s a little recap of what you can realize using JavaScript:

Desktop apps: using Electron

Hybrid mobile apps: using Ionic or others like OnsenUI

Web apps (front end): using jQuery, Vue, Angular, React, and more

Network services and daemons, Web apps (back end), Microservices, and almost anything: using NodeJS

Games: using Unity

Embedded apps: using dedicated tools


2. ECMAScript Versions and Frameworks

JavaScript has improved a lot, and there are many different standards that lead to different Javascript versions. Keep in mind that, depending on your context, the language specs you must base your development on could change. Browsers are weird software, and you can’t pretend to code anything on everything unless you provide polyfills and other supporting systems. Most frameworks using Typescript instead give you more freedom to code without worrying about support because they use Rx and polyfills to make the thing work, like in Angular. Knowing differences between pure JavaScript (sometimes called “Vanilla”), jQuery, Angular, TypeScript, and ECMAScript versions could require some time to feel comfortable.


3. Use the Best IDE, Always

Since JavaScript development has become more and more complex, you can’t code with UltraEdit, BBEdit, Atom, or Sublime. These tools are useful, simple, and great until you start developing something bigger. If you code in NodeJS, Angular, React, or Ionic, these text editors become pretty useless very soon as they just don’t fit the goal. So, what should I use? I’ve been using WebStorm and JetBrains products for a long time, but I recently switched to Visual Studio Code, which is great, lightweight and, believe it or not, available for Windows, Mac, and even Linux. Wow.

Anyway, my best advice is always to trust and enjoy the IDE that’s good for you and that you’re comfortable with, so feel free to choose any with a decent debugger, lint and syntax helpers, Git and versioning support, and visual tools. Remember, the IDE you choose to code with is your best friend, and the amount of time it could save countless time for you.


4. Organize Your Code and Handle Errors; You’re Not DOM-Scripting!

We passed years of our professional career using JavaScript only to DOM-script web pages.

I still remember my first approach with JavaScript while I was trying to animate the status bar text in my browser window … I feel like a dinosaur today.

Today, Javascript is way more complex and powerful, and it’s a good programming language to use. It has some small negative features, like bad support for objects manipulation and management, which often forces you to struggle with prototypes and other weird things, but it’s so versatile and lightning-fast to code after a while that we can accept the compromise.

But the worst idea you could have would be to use JavaScript as if it were years ago. It’s always important to code with a good design concept and not to hurry. If you want to use JavaScript at a higher professional level, you can’t avoid it. You can’t write JavaScript like you would while coding your jQuery scripting routine. Your application deserves more and you do too. If you don’t start coding with a good design pattern, you’ll never get better at JavaScript; you’ll keep DOM-scripting forever.

In addition to organizing code and correctly using design patterns, don’t forget to handle errors. I’ve experienced a lot of web pages where errors are just thrown and never handled, in most cases causing your jQuery logic to freeze and stop working. In a real and complex application, this kind of problem is way more serious. In a mobile app, it would make the app completely stop working unless your framework automatically provides a fallback. In a desktop application or a NodeJS application, it would have the same behavior, and you can’t allow your app or daemon to stop working for an unhandled error.

The best way to handle JavaScript errors is quite simple: implement try-catch blocks and eventually create custom classes to represent your custom exceptions, then throw them as needed.


5. Use JavaScript’s Superpowers If You Can

As said before, JavaScript has improved a lot, and you’re not DOM-scripting. That’s why you should use the latest ECMAScript features and Rx-supported operators to code faster and improve code readability and flexibility. You can manipulate and manage asynchronous code using Promises and Observables, and you’re encouraged to do so since they’re not hard to apply, and they provide great improvements and possibilities. If your platform support is compliant, you can even use web workers, SQLite interfaces, dependency injection, modularization, and a lot more. It’s a shame not to base your application on advanced techniques, since their support is good on many platforms and contexts, improving the native JavaScript technology power.

Conclusions

Improving your Javascript knowledge is something you can’t avoid and it definitely worth it. The “same old” Javascript is gone and a good Front end developer must enjoy and start incorporating new techniques, libraries and stuff. Get up and place some sugar on JavaScript then and your coding will be more fun and more powerful. If you don’t even know what an Observable is, you’ll never be considered a good and modern JavaScript developer, maybe not even by yourself!

Better Programming

Advice for programmers.

Ivano Di Gese

Written by

Passionate IT skills on the run: keep calm, do your stuff and code better

Better Programming

Advice for programmers.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade