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, (speci…


This content originally appeared on DEV Community and was authored by Tim Myers

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.
}

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)

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.


This content originally appeared on DEV Community and was authored by Tim Myers


Print Share Comment Cite Upload Translate Updates
APA

Tim Myers | Sciencx (2021-04-07T23:03:21+00:00) Sometimes It’s The Details. Retrieved from https://www.scien.cx/2021/04/07/sometimes-its-the-details/

MLA
" » Sometimes It’s The Details." Tim Myers | Sciencx - Wednesday April 7, 2021, https://www.scien.cx/2021/04/07/sometimes-its-the-details/
HARVARD
Tim Myers | Sciencx Wednesday April 7, 2021 » Sometimes It’s The Details., viewed ,<https://www.scien.cx/2021/04/07/sometimes-its-the-details/>
VANCOUVER
Tim Myers | Sciencx - » Sometimes It’s The Details. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/07/sometimes-its-the-details/
CHICAGO
" » Sometimes It’s The Details." Tim Myers | Sciencx - Accessed . https://www.scien.cx/2021/04/07/sometimes-its-the-details/
IEEE
" » Sometimes It’s The Details." Tim Myers | Sciencx [Online]. Available: https://www.scien.cx/2021/04/07/sometimes-its-the-details/. [Accessed: ]
rf:citation
» Sometimes It’s The Details | Tim Myers | Sciencx | https://www.scien.cx/2021/04/07/sometimes-its-the-details/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.