Live data from Hacker News

New WebKit Features in Safari 13.1

webkit.org

1–10 of 60 posts

Re: New WebKit Features in Safari 13.1

#5
On a side note, I find crazy this obsessive-compulsive behavior to use `const` everywhere in modern JS codebase (even in Webkit now).

It solves really no problem (I mean, Python, Ruby and almost all other programming languages are doing fine without preventing against variable reassignment, and we can still reassign function parameters and object properties in JS).

So much brain power wasted on this useless thing.

Also using `const` everywhere is semantically misleading and ugly. It's not what you would expect in 99% of other programming languages out there.

Re: New WebKit Features in Safari 13.1

#7
post #5

On a side note, I find crazy this obsessive-compulsive behavior to use `const` everywhere in modern JS codebase (even in Webkit now). It solves really no problem (I mean, Python, Ruby and almost all other programming languages are doing fine without preventing against variable reassignment, and we can still reassign function parameters and object properties in JS). So much brain power wasted on this useless thing. Al…

Immutability has been pretty hot of late, though still controversial. There are several popular languages which encourage or even force immutability (Elixir, Clojure). What sold me on the idea was Rich Hickey's talk, "The Value of Values": https://www.youtube.com/watch?v=-6BsiVyC1kM

I look at it as mostly a safety net: I'd rather use const by default, unless I have a good reason to be able to mutate the variable. (To flip it around: what problem does being mutable-by-default solve?) 9 times out of 10, I don't need to change the value for the lifecycle of the function; and often if I do, the code is cleaner anyway if I use an immutable pattern (such as `const foo = bar.map()` rather than `for(x in bar) foo.push()`). Thanks to the magic of Merkle trees, we can generally make fresh pointers without it costing much memory overhead.

Re: New WebKit Features in Safari 13.1

#8
post #5

On a side note, I find crazy this obsessive-compulsive behavior to use `const` everywhere in modern JS codebase (even in Webkit now). It solves really no problem (I mean, Python, Ruby and almost all other programming languages are doing fine without preventing against variable reassignment, and we can still reassign function parameters and object properties in JS). So much brain power wasted on this useless thing. Al…

It's part of type enforcement for me (note: I do my work in typescript); if you never intend to redefine it, make it a const, then you'll get an error if you try to redefine it later.

performance-wise, const is also around 20% faster than var, and usually faster than let (you can test it yourself: https://jsperf.com/let-vs-var-performance/67).

Edit: I forgot (because I always just write `const` anyway), but TSLint/VScode also default to bothering you to use const if you define a let/var and never re-define it.

Re: New WebKit Features in Safari 13.1

#9
> These improvements are available to users running watchOS 6.2 [...]

I would like more information about Safari being available on Apple Watch.

Normally I'd think it's inclusion was an accident or oversight, but it's mentioned at both the top and the bottom of the article.

Re: New WebKit Features in Safari 13.1

#10

At least I think WebRTC was mentioned, been dying for more fixes to issues.

Apple has intentionally crippled WebRTC for years to stifle FaceTime competition and drive up dev costs by forcing native app development. The video chat startup I co-founded in 2015 was impacted.

https://docs.house.gov/meetings/JU/JU05/20190716/109793/HHRG...

Post reply on HN