Javascript Works

Javascript Works

Sigmund A.
Mark Essien in the HNG Internship Workspace

Mark's assertion that starting out with JavaScript (JS) puts you at a disadvantage next to PHP, Python, C is a flawed one.

2 of the 3 cited languages are dynamically-typed like JS. One of the strength of JS à la Node.js next to PHP & Python is the built-in support for event-driven programming. The event-driven pattern is one of the best suited approaches to solving the C10k problem.

Mark also drew up fallacious statistics on job availability for the programming languages. Most websites use WordPress, a PHP script. This may explain the huge gap in the statistics Mark cited. The best place to get statistics on the job market is the job market. The number of job postings citing the languages and average developer salary are better metrics.

The C-family languages—C, C++, C#—are best suited to different use-cases.

  • C for systems programming—operating systems and programming language implementations.
  • C++ for complex modular applications—games and browsers.
  • C# for Windows applications and services.

The common feature of these languages is the use of a static type system.

JS, PHP and Python are dynamically-typed languages. PHP has added more support for optional strict typing over the years.

About being more grounded, the imposition of static typing gives the C# or C++ learner the advantage. The greater benefit of static typing is the performance gain it offers. If static typing is a hard dependency, one can learn TypeScript which is a super-set of JS. Also, C# has built-in memory management via automatic garbage collection. So, it does not expose a beginner to the intricacies of memory management.

The backend-frontend delineation suggests a client-server model. The web fits into this model. Based on this, we should compare the programming languages on web programming.

I agree JS is a flawed language. Yet, it is a beautiful one. One reason JS beats PHP & Python is that it is web-centric. It was restricted to the browser until the advent of the Node.js runtime. Ryan Dahl designed Node.js for web programming with major focus on creating fast asynchronous web servers.

Node.js beats PHP & Python performance-wise. PHP recently closed the gap with optimizations introduced in PHP7. Yet, Node.js is faster. Node is faster because it uses Google's V8 engine which uses Just-in-time compilation.

To teach fundamentals, you should teach fundamentals concepts that are applicable across board. The choice of programming language matters less. A language does not offer complete fundamental knowledge by default. Most languages cited in this discourse are general-purpose programming languages. So, you can use them in a wide variety of domains despite most of them being best suited to fewer use-cases.

The learning process should not be one that stresses the learner the most or takes the hardest path. A beginner language should be moderately challenging for the learner. It should allow them easy access to the most important concepts in their learning domain. JS is as easy as it gets being a general-purpose dynamic programming language.

If the goal is to learn to be a full-stack web programmer, Javascript works.