jasoncoon,
@jasoncoon@leds.social avatar

OK I have to admit this argument for using let over const for most cases in JavaScript/TypeScript almost has me convinced.
I'm sure I'm going to continue to prefer const, but I see the point.
Video argument: https://www.epicweb.dev/talks/let-me-be

claudius,
@claudius@darmstadt.social avatar

@jasoncoon
I don't read this as an argument against const tbh. And similar discussions have happened in other languages as well. In ruby it became common to also call "freeze" on constants. (Haven't done a lot of ruby lately, not sure how this has progressed)

Const is partly about the guarantee, but (IMO) also partly about communicating intent to a fellow programmer.

sldrant, (edited )
@sldrant@mastodon.social avatar

@claudius @jasoncoon I see the point though, and for me the issue is const doesn't for far enough for objects, as they're still mutable, just not reassignable.
Read only types are often rare, and usually only apply to lists etc (and even then, it's the list, not the object in it), so making the binding const doesn't really do all that much there

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • everett
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • ethstaker
  • GTA5RPClips
  • Youngstown
  • slotface
  • osvaldo12
  • kavyap
  • InstantRegret
  • tester
  • megavids
  • tacticalgear
  • khanakhh
  • mdbf
  • cubers
  • Durango
  • Leos
  • cisconetworking
  • anitta
  • modclub
  • normalnudes
  • provamag3
  • JUstTest
  • lostlight
  • All magazines