Twitter | Search | |
David Mark Clements
Principal Architect Author of Node Cookbook,
2,641
Tweets
271
Following
1,631
Followers
Tweets
David Mark Clements 10h
Yes I’ve also found this - I’ve also found trying to be strictly immutable in general yields little benefit for most use cases.
Reply Retweet Like
David Mark Clements 11h
Replying to @getify @r_ricard and 4 others
Oh yeah - I mean more regarding server side and client side dev. We’ll have to transpiled for production for a long time I’m sure
Reply Retweet Like
David Mark Clements 11h
Replying to @r_ricard @getify and 4 others
But the use case is immutable (or “expected unchanged”) objects - so for the use case it wouldn’t be a problem. The point of JS is its dynamic typing with JIT optimisation - ie that’s what hidden classes are for
Reply Retweet Like
David Mark Clements 11h
Replying to @r_ricard @getify and 4 others
I appreciate the efforts to continue to improve JS, my vitriol is against new syntax based on the (previously necessary but no longer) pain new syntax has caused - rather than against the fine people working to improve the language ✌🏼
Reply Retweet Like
David Mark Clements 11h
Replying to @r_ricard @getify and 4 others
No I agree - doesn’t have to be a library. The implementation of of a util function can take advantage of engine details (eg hidden classes) where libraries can’t. Just avoid adding new syntax - the long term costs outweigh the short term benefits.
Reply Retweet Like
David Mark Clements 12h
Replying to @r_ricard @getify and 4 others
Speaking of hidden classes, why not use a util function that can use hidden classes to deep equality checks on normal objects. That would be huge, and no new syntax.
Reply Retweet Like
David Mark Clements 12h
Replying to @r_ricard @getify and 4 others
If a side benefit is helping another community sure, but that shouldn’t be a primary factor
Reply Retweet Like
David Mark Clements 12h
Replying to @r_ricard @getify and 4 others
finding a way to get to O(n) for deep equality checks without syntax extension (or with the most minimal possible) is highly valuable. It’s not just about learning, we need to stop transpiling as an industry.
Reply Retweet Like
David Mark Clements 12h
Replying to @r_ricard @getify and 4 others
In my opinion, typed system mindfulness belongs in strongly typed languages. Let’s not make javascript into typescript.
Reply Retweet Like
David Mark Clements 12h
Replying to @r_ricard @getify and 4 others
That’s a fair reason. I don’t believe the trade off is acceptable. The ecosystem is in syntax fatigue, and will be for some time. The more syntax we accept, the harder it is for js engine maintainers to optimise already existing parts beyond spec compliancy.
Reply Retweet Like
David Mark Clements 12h
Replying to @r_ricard @getify and 4 others
Oh ok apologies - deep quality checks can also be done with a util function. If we can avoid adding extra syntax we should. This can be avoided
Reply Retweet Like
David Mark Clements 12h
Also can you imagine how frustrating it would be for those learning the language, after you’ve explained `arguments` isn’t an array and `class` isn’t classical, to reveal `with` that should be avoided isn’t this other `with`. All could be avoiding with util functions.
Reply Retweet Like
David Mark Clements 12h
Iterating shallow data structures to equality check values is a basic util function - it still doesn’t need new syntax. I don’t see the purpose of `with` I’m possibly missing something there but it does seem like you don’t need new syntax to do that either.
Reply Retweet Like
David Mark Clements Aug 16
Been through the looking glass for a long time. Mad hatter is president and Cheshire Cat was just murdered
Reply Retweet Like
David Mark Clements Aug 16
No Proto chain: Object.create(null) No functions: Proxy - use a set trap that throws or filters typeof function The capabilities are already there, we don’t need more syntax.
Reply Retweet Like
David Mark Clements Aug 16
Please - do not allow unnecessary additional syntax. None of this is required: Object.freeze is fine if you want immutable data. If there’s some weird edge case that this solves, add an option to freeze. Let’s stop bloating the language with unnecessary new concepts
Reply Retweet Like
David Mark Clements Aug 15
Replying to @bitandbang
Another reason to use https:// instead of git:// remotes
Reply Retweet Like
David Mark Clements Aug 14
Cooool! Glad that you’re getting the message out there. Ask it turns out that template strings can make for faster SSR (see esx readme etc)
Reply Retweet Like
David Mark Clements Aug 14
Replying to @bitandbang @DKundel
Instead of making it native, we should be migrating away from it. The generic primitive is already there (template strings).
Reply Retweet Like
David Mark Clements Aug 14
If you mentally shift on the concept of “one thing” it doesn’t violate. It’s fractal. If you wanted you could test each line of asm, and call an asm line “one thing”. Point is, what’s the most useful definition of “the atom” for the use case. For node, I think module/microservice
Reply Retweet Like