Home >Web Front-end >Front-end Q&A >Why JavaScript is the next (or first) programming language you should learn

Why JavaScript is the next (or first) programming language you should learn

伊谢尔伦
伊谢尔伦Original
2016-11-23 11:10:441508browse

I’ve been asked many times what programming language I should learn if I was just getting started, and the answer has to be JavaScript, and here’s why:

The easiest development environment

I believe the biggest barrier for people getting into programming is actually All other aspects related to writing code. The fact that you can write code faster (at least when you start learning) is a win in my book. Everyone has access to a web browser, which means everyone now also has access to a simple development environment. If you are using Chrome on Mac, press the shortcut key cmd-opt-j. That brings you to the console, and now you can start writing JavaScript and manage the web pages you see. really not bad. There are also a large number of online editors and tools, such as CodePen and JSFiddle, which allow you to build a more complete development/testing/prototyping environment in the browser.

 Easy

 When you start out, JavaScript makes writing code really easy, which is very effective. Define a function and call it. Write a loop. Ignore the DOM (in fact, almost completely ignore the web) and only care about simple logic and code. Start creating objects and arrays. The OO model in JS is a little weird (especially with classes and inheritance), but okay, you need to be flexible, if you want to be a developer anyway. Once you master the basics, you can go deeper and discover all the power of JavaScript.

  Flexible

Another aspect discussed before is that JavaScript is also super flexible (as is the argument). Once you can control an image or a menu from a few functions embedded directly in a Sctipt tag in a web page, then soon you can move on to complex single pages with many files, larger object/class-like structures, and applications and entire more complex, fully architected web applications. Now that it is so tightly integrated with the DOM and the browser, JavaScript actually scales better to meet larger challenges and can be a perfect match for web applications.

  Web-native

There are enough talented mobile app developers to make you believe that apps are the future, and I still believe that open web technology is the key to the future. Giving it some time, we almost wrote all the mobile apps in HTML/JS and deployed the packaged apps to the mobile phone. I think this is basically inevitable. Learning web development is crucial. No matter what language you primarily work in, you need to have a basic understanding of it, because no matter how hard we try, you end up manipulating CSS, tweaking some HTML tags, etc. That's not going to go away immediately, I don't think so.

 Inevitable

  Almost to the end, but mainly due to the evolution of thoughts and deployment of other aspects. I actually consider this the really important reason why you should learn JavaScript. Here's the trade-off - if you develop something for the web, you end up writing JavaScript. This is inevitable. You can do it with server-side languages ​​(PHP, Python, Ruby). Sometimes, the payload is passed to the browser, and if you want to do something interesting on the remote side, you're going to have to use JavaScript. So if you have to learn, why not optimize the process (perhaps using JS in more places, not less).

 Lightweight (browser/server/native)

Since we have things like Node.js, JavaScript has transcended browsers. Not only can you write server-side JS (so you can develop front-end and back-end web applications in JS), but you can also package it into a distributable desktop application using something like node-webkit, or use PhoneGap to package it into a mobile application for any platform app. There is currently no other language that is so lightweight.

 Toolchain

 If the above reasons aren’t enough, the proliferating JavaScript community has a real long way to go in the next few years when it comes to developer toolchains. We may not have an integrated, one-stop approach like Xcode used by Mac developers, but we have tools like Grunt and Gulp to build your own resource pipeline. Every well-known code editor supports JavaScript syntax highlighting and prompts. We don't need the build process like other languages, so we can be more calm. There are also a bunch of testing tools; from unit testing to functional testing, the use is completely simulated Browser users.

So anyway – there’s never been a better time to start learning programming, and if you want to get started, I recommend starting with JavaScript. Start simple and work your way up. Look at the source code. Go to Github. And go crazy about it.

 Original address: why-javascript-is-the-next-or-first-programming-language-you-should-learn


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn