CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Author Topic: Using strict  (Read 490 times)

durango_d

  • Full Member
  • ***
  • Posts: 124
  • Karma: +1/-0
Using strict
« on: 8 Nov 2020, 03:38:33 am »
Hi,

should i be using strict at the top of all my js files?

Code: [Select]
"use strict";
Squeeze it Harley! Don't yank it!  It's not your D...!  Squeeze it !

Jason Knight

  • Administrator
  • Hero Member
  • *****
  • Posts: 1054
  • Karma: +188/-1
    • CutCodeDown -- Minimalist Semantic Markup
Re: Using strict
« Reply #1 on: 13 Nov 2020, 09:06:20 am »
It does theoretically improve code execution, so that's a plus. It also makes a lot of "legacy" JavaScript invalid, that's a plus too...

But some of it is pedantic crap, reeking of the petty "I'm too stupid to use this so nobody else should be allowed to".

Take a classic construct like "with" which is classic object handling Object Pascal, Ada, and C++ developers have used for decades without problems, but that apparently JavaScript programmers are "too stupid" to use.

Which I find pretty insulting, telling people they're too stupid to use something. More insulting and degrading than an entire 80 foot trailer filled with Lenny Bruce jokes.

I actually need to sit down and make a test case to see if there is actually a performance benefit. If that claim is false, I'd say skip it as it reeks of arbitrary and ignorant choices created by people who probably shouldn't be programming in the first place.

That might be a good topic for an article on Medium.
We are all, we are all, we are all FRIENDS! For today we're all brothers, tonight we're all friends. Our moment of peace in a war that never ends.

 

SMF spam blocked by CleanTalk

Advertisement