DEV Community

Cover image for Sometimes It's The Details
Tim Myers
Tim Myers

Posted on • Edited on

2 2

Sometimes It's The Details

Sometimes switching to a new language or framework doesn't mean that you have to make a vast shift in your thinking. In almost every language the concepts are the same it's just the syntax that people get hung up on.

I've been using JavaScript, (specifically React), daily for like 4 years and I've grown accustomed to the "loosey" nature of JavaScript.

For example,

let disabled = true;

if(disabled){
  // you can just do this.
}
Enter fullscreen mode Exit fullscreen mode

You're relying on the fact that disabled can be either true or falsey. So you don't have to check disabled for null and undefined and false and empty, etc.

In most languages you have to make those checks explicit.

if (disabled != null && disabled != true && TypeOf(disabled) == bool)
Enter fullscreen mode Exit fullscreen mode

So learning the quirks of your particular language is the real trick. Loops work the same conceptually in almost every language.

Thanks for reading and that's all y'all.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

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

Okay