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: Elementals 4 planning, should I break bad stuff entirely?  (Read 98 times)

Jason Knight

  • Administrator
  • Sr. Member
  • *****
  • Posts: 379
  • Karma: +51/-1
    • CutCodeDown -- Minimalist Semantic Markup
What I mean is something like innerHTML which should be avoided. It's possible to overload it with defineProperty so that I could make the setter throw an error halting all scripting.

I was considering doing so if the Element is attached to a live BODY so that you can only innerHTML on unattached fragments.

This would break how JavaScript "normally" works and break compatibility with a lot of off-the-shelf scripts... ON PURPOSE because if such methodology is used said scripts are probably incompetent shite that shouldn't be allowed to run in the first damned place.

Is this a bad idea given it will alienate a lot of existing developers, or should I press on trying to implement this as a wake-up slap across the face to such dev's with a wet trout?



There are a number of "bad" features in JavaScript I'm tempted to just disable outright.
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.

coothead

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +7/-0
  • I smile benignly
    • coothead's stuff ~ an eclectic collection
Re: Elementals 4 planning, should I break bad stuff entirely?
« Reply #1 on: 10 Jul 2020, 06:24:34 am »
<offtopic>

If anyone is wondering about that image, then I can tell you that
it was taken, just down the road from me, at Teddington Lock on
the river Thames in London, England in 1972.

Further reading:-


</offtopic>

coothead
« Last Edit: 10 Jul 2020, 12:40:31 pm by coothead »
~ the original bald headed old fart ~

John_Betong

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +2/-1
    • The Fastest Joke Site On The Web
Re: Elementals 4 planning, should I break bad stuff entirely?
« Reply #2 on: 10 Jul 2020, 09:43:13 am »
Invalid link, YouTube alternative:

https://youtu.be/T8XeDvKqI4E
Retired in the City of Angels where the weather suits my clothes

coothead

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +7/-0
  • I smile benignly
    • coothead's stuff ~ an eclectic collection
Re: Elementals 4 planning, should I break bad stuff entirely?
« Reply #3 on: 10 Jul 2020, 12:54:50 pm »
</offtopic>
Hi there John,

thank you for letting me know that I had
made a typing error in the 2nd link.

It has now been rectified.

</offtopic>

coothead
~ the original bald headed old fart ~

mmerlinn

  • Junior Member
  • *
  • Posts: 37
  • Karma: +1/-0
  • Nutcake
Re: Elementals 4 planning, should I break bad stuff entirely?
« Reply #4 on: 11 Jul 2020, 10:05:40 am »
I guess the big question is how many devs will adopt E4 and change their ways or just avoid it because those devs will avoid "broken E4" because they are too lazy to learn and implement it.

If few devs adopt E4, then the question becomes whether it is worth pursuing.

People in general HATE to be FORCED to do anything so trying to enforce a better way MAY be like shooting yourself in the foot.

Personally, I hate anything without a rigid structure simply because such things ALWAYS bite me in the ass at the WORST possible time.
The soul purr pus of a spell cheque cur is two valley date hour ignore ants.

Jason Knight

  • Administrator
  • Sr. Member
  • *****
  • Posts: 379
  • Karma: +51/-1
    • CutCodeDown -- Minimalist Semantic Markup
Re: Elementals 4 planning, should I break bad stuff entirely?
« Reply #5 on: 11 Jul 2020, 04:18:23 pm »
People in general HATE to be FORCED to do anything so trying to enforce a better way MAY be like shooting yourself in the foot.
That mimics my thoughts on it, one of the whole ideas of Elementals was to NOT change how the underlying language works, and to just provide missing functionality, expand what can be done, and to provide more useful DOM creation tools.

It's the sort of thing that's made "use strict" and the Content Security Policy have slow adoption... or in the case of the latter people disabling so many parts of the CSP it defeats the point of enabling it.

Locking off "bad" parts of JavaScript goes against the very first objective. Best I can hope for is to just keep screaming at people "STOP USING THAT CRAP!"

It's just something I realized I COULD do, but the more I think about it the more I realize I SHOULDN'T. There are a LOT of things you "can do" that you really shouldn't.

-- edit -- I also think the experience why my most recent client coloured my opinion. I HATE going into someplace like a banking portal and finding gaping security holes... like innerHTML being used on user-input data.

Or in this case, their loading a WYSYWYG editor for their contact form that also accidentally hooked the login form for some derpy password formatting validation... with innerHTML.
« Last Edit: 11 Jul 2020, 06:48:00 pm by Jason Knight »
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