DEV Community

Cover image for JS Dialect Rant
Joey Mink
Joey Mink

Posted on

JS Dialect Rant

I spent a lot of time at my last job writing JavaScript. We had a set version of node, we had our dependencies more-or-less steady, and we put our heads down and coded. I left feeling like I knew JavaScript! Wheee!

Then I got started with React at my next job. Cool sh*t, no doubt. But ES5 components led to ES6 class-based components. When I tried to consume that ES6 code I would get invalid keyword errors on things like class and import. Huh? transpile it with Babel! Oh, okay...

Then I got into mobx (<- totes dig it!), with all it's decorators and what not (oh Java, I do miss you a little). But when I tried to run that code, I'd get errors about @ being totally uncool. Babel to the rescue!

stage-0, stage-1, transform-decorators-legacy, ...

Woah. WTF language am I writing in now? Some quick duckduckgoes imply that I'm using proposed JavaScript syntax that hasn't even been approved yet. When I look at the code running in the browser, it's all translated into, what I think is, ES5 (which is also es2015?). Okay, enough trivia, there's work to do! It's transpiling successfully? Good, head down...

Anyhoo, I 💕 the functional programming experience JavaScript continues to offer, and I love that the code is so portable in this browser/electron world. But seriously, you need a guru to fully understand:

  1. the state of the JS language
  2. the dialect you're writing in
  3. the translations that babel is performing (and how to configure it)
  4. interpreting the translation when debugging at runtime

Wowzers. I write JS, you may write JS, but I bet yours and mine look a helluvalot different. And I bet my code can't be pasted into your codebase without syntax errors. And to me, that's just kinda like ... woah.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay