r/javascript • • Apr 09 '19

Kyle Simpson: I’ve Forgotten More JavaScript Than Most People Ever Learn

https://medium.com/@amsterdamjs/kyle-simpson-ive-forgotten-more-javascript-than-most-people-ever-learn-3bddc6c13e93
98 Upvotes

44 comments sorted by

100

u/Neurotrace Apr 09 '19

the == operator is actually more powerful and more useful in our programs than ===, and in fact, usage of == should be preferred and === should only be a last option.

You can pry === from my cold dead hands. I fully understand the rules for coercion and the way that the type system works. That's exactly why I never use ==.

48

u/SoInsightful Apr 09 '19

== is good for one thing and one thing only: checking if something null or undefined (with == null).

If you're intentionally using weird type coercions to compare values, your code is probably smelly and confusing.

38

u/thisguyfightsyourmom Apr 09 '19

This

Kyle is wicked knowledgeable, no doubt

I’ve always found people that brag about their esoteric knowledge of JS write god awful code—usually to prove they know more than others

21

u/[deleted] Apr 09 '19

I tend to see those devs as intermediates on the verge of senior, when trivia knowledge of the language starts to become a detriment to your code. This type of thinking leads someone to using the ~ operator with an indexOf (when includes didn't exist) and then 6 months later no one has any idea what that bit of code does.

70

u/thisguyfightsyourmom Apr 09 '19

I worked with a dude who did a lot of this shit

When he left, I learned his style (masturbatory FP) & got decent at refactoring it

He tried to recruit me to his next gig for a few years

Once he left, I took the job & was able to decipher his shit they’d been struggling with

He is now recruiting me to his next gig, and I’ve established a rapport with his new boss

I’m going to make a career of decleverfication of this one dude’s code

10

u/noOneCaresOnTheWeb Apr 09 '19

That's hilarious.

Do you have any methods for identifying the good code vs the esoteric code?

12

u/thisguyfightsyourmom Apr 09 '19

It’s all subjective

I go by whether my coworkers understand it after I’ve been confused by it

That’s the only standard that really matters—readability for the maintainers

4

u/[deleted] Apr 09 '19

I'd argue you generally shouldn't be writing code that could be either null or undefined (alongside T). The remaining instances are so rare that I'd prefer just to check against those values explicitly rather than rely upon obscure, error-prone (from the dev perspective) language features.

20

u/SoaringRocket Apr 09 '19

With you. Such a claim needs to come along with a good chunk of explanation.

I don't even want to know what the rules are for coercion. In my mind, you shouldn't be comparing two values that are not of the same type.

1

u/msgur Jul 31 '19

If you know that the two values are the same type, then == does the exact same thing as ===. So aren't you making the case to use == ?

The following is the actual ECMAScript spec for the abstract operator (==):

If Type(x) is the same as Type(y), then

  1. Return the result of performing Strict Equality Comparison x === y.

0

u/[deleted] Apr 09 '19

[deleted]

0

u/[deleted] Apr 09 '19

[deleted]

4

u/[deleted] Apr 09 '19

You can pry static typing from my cold, dead hands.

11

u/[deleted] Apr 09 '19

That's only because he's the kind of developer who thinks knowing the (many) intricacies of JS is more important than knowing how to use the language well.

1

u/tchaffee Apr 15 '19

Source? I've never heard him say something that prioritizes language knowledge over using the language well.

27

u/jingalings Apr 09 '19

Considering the amount of people in the world, that’s probably true for me too, and I’m a novice

18

u/Panron Apr 09 '19 edited Mar 21 '24

I'm removing all my contributions in protest to reddit's bull-headed, hostile 3rd-party API pricing policy in June, 2023.

If you found this post through a web search, my apologies.

9

u/ggiga90 Apr 09 '19

Crazy that people find programmers patronising and arrogant, huh?

21

u/punio4 Apr 09 '19

/r/iamverysmart material right there

21

u/Lekoaf Apr 09 '19

I stopped reading after ”JavaScript Theologian”. Really? Why on earth do we need to borrow words from religion to describe a javascript programmer? Ridiculus.

11

u/brokenURL Apr 09 '19

That basically tells me arrogant, stubborn, and dogmatic. I know a theologian studies religion and isn't necessarily a religious zealot, but any attempts at making favorable comparisons to cults rustles my jimmies.

0

u/[deleted] Apr 09 '19

[deleted]

1

u/Lekoaf Apr 10 '19

I’ll confess that I didn’t know the meaning of that word. English is not my first language. :)

16

u/[deleted] Apr 09 '19

Sometimes I forget jQuery is a thing. Does that count?

24

u/The_Kvist Apr 09 '19

Better forget it forever

2

u/FearAndUnbalanced Apr 09 '19

Why is it still added to asp.net core templates?

3

u/shadamedafas Apr 09 '19

People don't like change.

3

u/[deleted] Apr 09 '19

Specially .net people.

6

u/[deleted] Apr 09 '19

Not sure why you were downvoted, but I gave you an upvote.

jQuery does some amazing things, but most all of it can be done in vanilla JS now. No reason to load an entire library and add page weight when you can write specific code that you need with vanilla JS.

7

u/The_Kvist Apr 09 '19

This! Exactly this is it. I think the people who downvoted me are the usual jQuery fanboys who don't even dare to think outside of the box (and thanks for the upvote, btw).

The reason I don't like it that much is because it's so overused that people tend to use it for everything they have no real solution to or even worse, for things it was not made for. This tends to lead to a culture of building your application on hacks and workarounds which can leave its ugly trails throughout a whole company.

I get that jQuery is a really accessible framework and easy to get things done with and all of that stuff but let's face the facts, understanding, maintaining and debugging middle to large scale applications using it is a serious pain in the backside, as from some point on, you basically can never ever tell for sure what exactly is happening.

The worst part of it is, that for many people the solution to problems with jQuery is simply to simply throw more jQuery at it, hacking their way around problems without actually solving them and creating processes of a complexity that's gradually harder and harder and less. And heck, why evenbother to understand anything when you just can make it work with jQuery.

And for all the people who hate on me for this rant-ish post, please visit jQuery's GitHub page and realize:

- It has been on v3.3.1 since January 2018

- Only about 80 commits have been made since then (that's about 5, maybe 6 per month), most of them are dependency updates, tests and minor fixes, no real sign of a v3.3.2

- Their last blog post was made in August 2018

- Get over it, accept that technologies come and go and don't use something just because you've always done it that way. JavaScript is so powerful today, you can save yourself a lot a time and frustration if you just do it the vanilla way.

4

u/noOneCaresOnTheWeb Apr 09 '19

My arguments for it have been:

  1. Not having to deal with different browsers not working sometimes(Edge)

  2. Not redoing work that's already been done by the community.

  3. Focusing on the application we need rather than the UI.

Do you have any counterpoints? Just trying to learn not trying to start a philosophical debate.

We have a dev that insists on handwriting a js GUI for an internal tool that doesn't need to look all that great. It really slows down the whole project.

6

u/[deleted] Apr 09 '19
  1. Sounds like you just need some polyfills. These can then be removed once browser support improves without rewriting your code.

  2. The language itself has already developed good, more lightweight alternatives, as have the community at large.

  3. Why not just use React, Vue, etc?

5

u/MoTTs_ Apr 09 '19

You're describing bad programmers, not a bad library. Your wrath is pointed at the wrong target.

2

u/[deleted] Apr 09 '19

I'd argue there's no justification for using it in a new project today (short of supporting <IE9... shudder). It's bad in that context, and often deployed by bad devs.

0

u/benihana react, node Apr 09 '19

Not sure why you were downvoted

cause the whole "hurrr no jquery" thing is dumb and contrived hipster shit. we as an industry realized 5 years ago it's not necessary when we started switching to react in large numbers. we also realized it's annoying when people (it's mostly dudes who have been programming for a few years and don't even realize why we needed jquery in the first place) shit on jquery out of nowhere.

5

u/[deleted] Apr 09 '19

Didn't Kyle announce that he was leaving the Speaker circuit like, 4 years ago at Fluent Conf?

5

u/semarj Apr 09 '19

I say this in all honesty and not to boast: I’ve forgotten more JS than most people ever learn.

lmao wat. perhaps his javascript is better than his english. He might need to look up the word "boast"

3

u/Mael5trom Apr 10 '19

It’s likely an accurate statement, given the amount of research he’s had to do for his books. I do know that in my interactions with him, he is a humble person, in my experience.

4

u/jeremy1015 Apr 09 '19

Stopped reading the answers and started skimming the questions after the second or third. This entire article is one big advertisement for a conference, his book, more advertising for the conference, and a reminder he has some Kickstarter going.

8

u/BBQLays Apr 09 '19

Clearly did stop reading. You saw the word "Kickstarter" and assumed he was plugging one? It was in reference to the YDKJS Kickstarter that was 6 years ago and about his book (that's available for free) that he's most known for.

I don't particularly like the guy that much, but make more of an effort before just trashing the interview.

5

u/jeremy1015 Apr 09 '19

Yes, I clearly did stop reading as I made explicitly clear in my response, even to the point of saying I was skimming the questions.

The Kickstarter may have referred to an old one he did but that does not change the fact that the article was primarily an ad for that Amsterdam conference (which I considered going to a couple of months ago, to be fair).

-27

u/threeO8 Apr 09 '19

Well JavaScript is a fairly forgettable language 😂

13

u/[deleted] Apr 09 '19

Unless you want to write code that runs on the most prevalent computing platform in existence.

0

u/threeO8 Apr 10 '19

Well people apparently opted for trump too.

1

u/[deleted] Apr 10 '19

I don't get the correlation

0

u/[deleted] Apr 09 '19

[deleted]

2

u/ForScale Apr 10 '19

will ever shave.

0

u/[deleted] Apr 09 '19

[deleted]

2

u/toastertop Apr 09 '19

If you actually read the article his pretty humble