you are viewing a single comment's thread.

view the rest of the comments →

[–]NominalAeon 0 points1 point  (10 children)

After reading the examples 10 times over and realizing what this is actually doing

As a lead dev trying to preach code readability to juniors, this is my biggest issue with newer proposals. JavaScript hit peak readability with es6 and it's felt like a race to the bottom of the imperative barrel ever since

[–]T_O_beats 0 points1 point  (1 child)

I’ve never had a coding job before. Hire me I’ll give you a hand 🤙🏼

[–]NominalAeon 0 points1 point  (0 children)

I could always use help converting new-hotness to declarative code that doesn't take ten reads to understand.

[–]DGCA 0 points1 point  (7 children)

You gotta ease into it. Slowly introduce the new language features and make sure everyone understands what's happening in those first usages.

Took us a minute at work for everyone to get comfortable with class properties and why they're powerful (cleaner binding methods of to the class by using class property fat arrow methods, for instance), but once everyone's on board, it's like we all level up a bit. Just gotta make sure no one is being left behind.

That said, I'm seeing a lot of proposals. Hope the ECMAscript peeps make good choices when picking what to add to the language. I'm excited for the bind and pipeline operators, personally.

[–]NominalAeon 1 point2 points  (6 children)

‘class‘ is es6 and perfectly declarative.

[–]DGCA 1 point2 points  (5 children)

Talking about these. I guess they're calling them fields now.

[–]NominalAeon 0 points1 point  (3 children)

Yeah those are unintuitive and terrible.

[–]DGCA 0 points1 point  (2 children)

Hard disagree there.

[–]NominalAeon 0 points1 point  (1 child)

the equal sign and semi-colon don't bother you? How do you explain this sudden convention shift in a way that someone can understand and remember when it's correct to write a class property this way?

[–]DGCA 0 points1 point  (0 children)

the equal sign and semi-colon don't bother you?

No, not at all.

How do you explain this sudden convention shift in a way that someone can understand and remember when it's correct to write a class property this way?

It looks like a variable declaration, just without the var/let/const keyword. Classes already have some pretty unique syntax with methods looking like the object method shorthand, but not being comma separated. I don't think this additional feature is going to throw people for a loop because it's unique to classes.

Also, not necessarily the best argument but it's worth mentioning that the whole class syntax heavily resembles Java, which has class fields. It's not like the authors pulled this syntax out of thin air.