Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Secrets of the JavaScript Ninja: is pure JS still worthwhile?

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Congratulations on the new edition of your book, I've had my eye on the old one for a while!

I think I'm correct in assuming that your book deals with pure JavaScript, devoid of any frameworks? Would you say that it's still worthwhile pursuing JavaScript in its pure form for practical uses, given all the choices such as CoffeeScript and, where concered with browser applications, frameworks such as AngularJS?

I hope the answer is 'yes' as I've kind of fallen in love with the simplicity and power of JavaScript since I started using it in earnest over the past 2-3 years.

Thanks,
Chris.
 
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course. One cannot race cars in the Indy 500 without first understanding basic driving skills and car mechanics, right?

When writing code using JS frameworks, it's more important than ever to really understand the fundamentals of JavaScript as these frameworks sit atop a strong foundation of advanced JavaScript concepts. Taking AngularJS as your example, anyone not familiar with the functional aspects of JavaScript and closures will either become quickly confused, or write code that's not using the framework to its best advantage.

With regards to transpiled languages like CoffeScript, those are converted to JavaScript for execution, so it behooved programmers to understand how JS works as it informs how the transpiled language works. Some have even called JavaScript the 'assembler language of the web".


 
Christian Peacock
Ranch Hand
Posts: 35
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,

Yes, very good point.

Do you think though that plain JavaScript will remain a popular choice for the developer? Because understanding the underpinnings of e.g. Windows development in the C language was considered important once, but I think I'm correct in saying that almost everyone moved on from C to higher level (and individually more obscure) technologies, built on top of C in most cases, after a relatively short time.

I suppose my question might be better put as "Why do you think someone ought to choose pure JS?" (assuming that you do of course).

Chris.
 
Bear Bibeault
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I prefer to write in pure JavaScript myself. Some of the reasons are obvious from my response above. Another reason is that I don't "trust" (maybe not quite the right word) the longevity of the transpiled languages. CoffeeScript, for example, seemed to have all the buzz a few years ago, but now, not so much. Everyone I personally know who used it has moved on (either back to JS, or to TypeScript) and lament the fact that they have CoffeeScript projects to maintain in a language in which they no longer have an interest.

In fact, I do work for a client who has some large CoffeeScript projects set up by a contractor who has moved on, and now he's having trouble finding people to work on them.

TypeScript seems to be getting a lot of buzz now, particulate in light of Angular2, but it remains to me seen if it will stand the test of time or not.

So, for me, sticking with JavaScript just seems to make sense.

Anyone's mileage may vary, and I urge developers to explore and see what works best for them. But for me, JS makes the most sense, at least for the time being.

 
Christian Peacock
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's exactly what I wanted to hear! Personally, I too would rather stick with JavaScript.

Your experience of a contractor leaving behind projects with more obscure technologies rings very familiar...
 
Author
Posts: 10
7
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to pitch in. My last couple of projects are in Typescript (even non-angular2 ones). Adding types significantly eases my development process, and I find it immensely helpful that I can rely on code completion, rename a field without worry, or jump to some definition.
With the exception of additional typings, Typescript doesn't change that much; it's still JavaScript and even the generated code is quite readable.
But, even if they suddenly stop developing Typescript, I'm pretty sure that it wouldn't be a big deal to make a transpiler that would remove the additional fluff and leave only ES6 code.

Josip
 
Christian Peacock
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Josip. I think if the uptake of Typescript was huge compared to any other JavaScript-based technologies there would be a case for using it over pure JavaScript for me.
 
Bear Bibeault
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christian Peacock wrote:think if the uptake of Typescript was huge compared to any other JavaScript-based technologies there would be a case for using it over pure JavaScript for me.


This is exactly my approach for now. If I get the feeling that TypeScript is going to enjoy both a healthy longevity (unlike CoffeeScript which seems to be fizzling) and a huge upswell in community, it would be something I'd consider adopting.

Or, of course, if someone offers me a boatload of money to learn it.  
 
Bear Bibeault
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another thought about TypeScript: I do like that its approach seems to be extending JavaScript rather trying to replace it with something completely different.

Languages such as CoffeeScript seemed to have the approach "I hate JavaScript so I'm gonna invent something completely different". This approach never had any appeal for me.
 
author
Posts: 85
5
PHP
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:
..."trust" (maybe not quite the right word) the longevity of the transpiled languages



I am with you when it comes to CoffeeScript, etc. But what about transpilers that just work with ES6 and beyond, e.g. Babel, transpiling new standard syntax of the language, or almost-certainly-standard-to-be?

I admit I found it awkward at the beginning to use stuff like arrow functions, but now having to type function all the time feels... so... boring
 
Bear Bibeault
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stoyan Stefanov wrote:I am with you when it comes to CoffeeScript, etc. But what about transpilers that just work with ES6 and beyond, e.g. Babel, transpiling new standard syntax of the language, or almost-certainly-standard-to-be?


For me, too new for the jury to be in.
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic