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, 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 49 times)

durango_d

  • Jr. Member
  • **
  • Posts: 98
  • 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: 523
  • Karma: +90/-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.
Sorrow hides well in your shell. A fellow man with hurt to spare.
Dear one, here I am to share the fear. An act of kindness, without an amen.
Come in, the fire's warm. Burn the rope and dance some more.

 

Advertisement