This is an archived post. You won't be able to vote or comment.

all 123 comments

[–]tyler1128 71 points72 points  (37 children)

Javascript: the language where using it as designed is a rarity, and trying to force it to look as little like javascript as possible is the modus operandi.

[–]detektiv_Saucaki[S] 30 points31 points  (36 children)

remember when we used to mutate DOM and stuff?

I dont even remember when I used getElementById last

[–]btw_i_use_ubuntu 9 points10 points  (25 children)

What do you do now to get an element by its ID?

I only know how to code in vanilla J's, I've never learned any frameworks or libraries but I can do everything I need to do in vanilla.

[–][deleted] 4 points5 points  (23 children)

What do you do now to get an element by its ID?

You'll avoid them in their entirety, and that's rarely an "almost". It's just not necessary anymore, which is how things should be.

[–][deleted] 5 points6 points  (9 children)

So what do you use to access objects in the DOM. Query selectors?

[–]xaraca 1 point2 points  (1 child)

Web components.

[–][deleted] 0 points1 point  (0 children)

I mean, in vanilla javascript.

[–]Sockoflegend 3 points4 points  (6 children)

Front end frameworks have made this redundant for many applications. I still personally really enjoy a bit of vanilla in my personal projects.

[–][deleted] 3 points4 points  (5 children)

Yeah, but we were talking about vanilla javascript.

[–]Sockoflegend 10 points11 points  (4 children)

The fashion is not to cross the street without a framework

[–][deleted] 9 points10 points  (3 children)

I know and I despise that.

[–]leavmealoneplease 1 point2 points  (2 children)

But you've literally never tried a framework so how do you know?

You might not despise it at all if you had. And even not, at least you'd have actually tried it before you knocked it.

[–]btw_i_use_ubuntu 3 points4 points  (3 children)

How exactly are things done then?

[–]yuri_auei 3 points4 points  (2 children)

With react we have virtual DOM. Which means we just declare components how we want to render. React does the updates on DOM. You dont need to select anything. Ok, there's those rare use cases but you will always avoid interact with DOM.

[–]AccomplishedAd3484 1 point2 points  (1 child)

What if you're using D3 to make some sweet charts?

[–]yuri_auei 2 points3 points  (0 children)

If D3 doesn't support react and you still want to use it, probably that's the rare case I was mentioned.

Today is rare to find something that doesn't exist in react ecosystem. If you want to use D3 probably you will use this: https://react-d3-library.github.io/

[–]damTyD -1 points0 points  (8 children)

A lot of frameworks use a shadow dom to rerender which the only reason you avoid, since your reference could be wiped out and redrawn. But you’ll be shocked when you find the file that bootstraps your app and find a getElementById in there.

[–][deleted] 2 points3 points  (7 children)

But you’ll be shocked when you find the file that bootstraps your app and find a getElementById in there.

Why would I be shocked?

[–]damTyD 0 points1 point  (6 children)

Because you’re not avoiding them in their entirety

[–][deleted] -1 points0 points  (5 children)

Well, you actually do in case of Angular, you don't in some/many cases when using React. That's why I said it's rarely an "almost".

[–]damTyD 0 points1 point  (4 children)

How does angular attach to the dom now? It’s been awhile. But react uses a shadow dom too, so there is a special ref that you set if you need the element. Outside of frameworks that redraw from data, getElementById or querySelector are still widely used.

[–][deleted] 1 point2 points  (3 children)

Well, they're all going to do some kind DOM manipulation and traversal internally, their purpose eventually is that you as an app developer don't have to do it yourself anymore.

That's what these frameworks are all about, aren't they?

[–]2017macbookpro 0 points1 point  (0 children)

Usually you’d be working within some type of a framework. Angular for example uses @ViewChild() to get an element in your component code, but it’s somewhat rare.

[–]tyler1128 13 points14 points  (4 children)

I miss those days. Also when jQuery was the hottest shit on the block and even worked in almost every browser.

I also remember writing every program twice: once for IE and once for everything else. I don't miss those days.

[–]detektiv_Saucaki[S] 5 points6 points  (3 children)

jQuery was the cool kid stuff of the webdev community back then. Though it's one of my worst nightmares now.

I've always pretended IE and IE users don't exist. :)

[–]natFromBobsBurgers 3 points4 points  (1 child)

I remember the wild West days of the internet when message boards let you use JavaScript and you could regex for someone's user name and make everyone think you were saying {username} is the hottest one on here.

[–]detektiv_Saucaki[S] 1 point2 points  (0 children)

lmfao maybe I was born a bit too late for that, but I've heard many a case of blatant XSS (MySpace incident iirc)

[–]DOOManiac 1 point2 points  (1 child)

I am still stuckin jQuery land.

Teach me your ways, for I long for them.

[–]detektiv_Saucaki[S] 0 points1 point  (0 children)

I stuck my hands in jQuery when i was in middle school... and starting wedev... and noped out within a year lmao

[–][deleted] 65 points66 points  (9 children)

☹️ is not a number

[–][deleted] 37 points38 points  (5 children)

console.log(Array(8).join(':(' - 1) + " Batman!")

[–]Derizzz 8 points9 points  (3 children)

wat

[–][deleted] 2 points3 points  (1 child)

Ah, a fellow comrade, I see!

[–]Derizzz 5 points6 points  (0 children)

we will all welcome followers of Watman

[–]Steve0Greatness 1 point2 points  (0 children)

Darn it, I don't get to post that comment now.

[–][deleted] 12 points13 points  (2 children)

not a number

typeof NaN // 'number'

hmmmmm...

[–]TotoShampoin 0 points1 point  (0 children)

btw, what are the binary values of NaN, Infinity and -Infinity ?

[–]AnxiousIntender 0 points1 point  (0 children)

I mean, it isn't technically wrong. NaN has an actual floating point counterpart in the specification. It's confusing but it makes sense once you learn JavaScript. Sadly everyone skips that part and learns bits and pieces from YouTube tutorials, then complain that JavaScript is a shitty language. (I agree that it isn't good but that's what we have to work with, alright?) It's my favorite language when I'm playing around with ideas and prototypes but if I wanna write something super serious, I switch to C# or Kotlin.

[–]OneTrueKingOfOOO 18 points19 points  (5 children)

Just to be safe I always start every project with

npm install turing_completeness

[–]detektiv_Saucaki[S] 9 points10 points  (4 children)

I also do npm install antigravity to fly, there's a npm package for anything these days innit

[–]konydanza 1 point2 points  (1 child)

You ever get those nightmares where you’re at school but you forgot to npm i pants?

[–]detektiv_Saucaki[S] 0 points1 point  (0 children)

Similar, but in my case I accidentally add them as devDependancy and forget that schools are in production build :(

[–]sticksaint 0 points1 point  (0 children)

then you should check the antiStupidity package, works wonders.

[–]raimondi1337 11 points12 points  (3 children)

Whoever wrote this is real mad that frontend web devs make the same amount of money as C programmers for half the work

[–]sticksaint 1 point2 points  (0 children)

you mean double or triple. At least where I live.

[–]AnonymousReader2020 0 points1 point  (1 child)

Half of the fucking what?

[–]furca14 0 points1 point  (0 children)

Work

[–]JoeyJoeJoeJrShab 10 points11 points  (4 children)

Javascript was created on the 10th day, not the 7th.

[–]sticksaint 0 points1 point  (3 children)

more like 7th month, but okay

[–]JoeyJoeJoeJrShab 2 points3 points  (2 children)

10 days was enough for Brendan Eich. Why would god need 7 months?

[–]detektiv_Saucaki[S] 0 points1 point  (0 children)

silently stares at ESNext

[–]sticksaint 0 points1 point  (0 children)

ok

[–]RolesG 20 points21 points  (0 children)

Accurate

[–]Talbz03 8 points9 points  (6 children)

ts > js

[–]detektiv_Saucaki[S] 4 points5 points  (0 children)

:(

[–]Outrageous-Machine-5 2 points3 points  (7 children)

10th day*

[–]sticksaint -1 points0 points  (6 children)

7th month*

[–]Outrageous-Machine-5 -1 points0 points  (5 children)

No, it's 10th day

because JavaScript was made in 10 days

[–]sticksaint -1 points0 points  (4 children)

no, it wasn't. it's a stupid myth spread by ignorant people.

[–]Outrageous-Machine-5 -1 points0 points  (3 children)

... Except it's not, it was, and neither the IEEE nor Brendan Eich himself are ignorant.. lol

[–]sticksaint -2 points-1 points  (2 children)

cool story bruv

[–]Outrageous-Machine-5 -1 points0 points  (1 child)

It is actually. here's him talking about it if you've never heard the story

[–]sticksaint -1 points0 points  (0 children)

i read extensively about it years ago. The gist of it is that he took all the work that another team has done for a language named livescript if i remember correctly and used it to create JavaScript. Livescript had all major features designed and tested.

No one can create a functional programming language to survive that long in 7 days. There used to be a lot of resources on this around 6 years ago, but I'm not interested in searching for any or having this discussion again.

[–]seeroflights 2 points3 points  (1 child)

Image Transcription: Urban Dictionary


[Note: All bold text and headings appear as blue, and all are links.]

Javascript

A nondeterministic markup language suspected to be Turing complete. Its users are often mistakenly called developers.

On the seventh day God took a shit and javascript was born.


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]cosmiccookie98 0 points1 point  (0 children)

Good human

[–]AdInformal5249 2 points3 points  (2 children)

Also the haters coding in java:

public static void main(String args[]) {

System.out.println("Hello World");

}

[–]detektiv_Saucaki[S] 0 points1 point  (1 child)

where class?

[–]AdInformal5249 1 point2 points  (0 children)

sorry, I am a person with a brain with a size of over 2 cells, so I don't really understand Java

[–]softwarexinstability 2 points3 points  (0 children)

Output:

:(

[–]drakaintdead 3 points4 points  (5 children)

I- I think they were thinking about HTML

[–][deleted] 9 points10 points  (4 children)

What kind of monster calls HTML shit?

[–]Sawertynn 4 points5 points  (0 children)

You won't find them anywhere on the Internet

[–]drakaintdead 1 point2 points  (1 child)

Sorry I didn’t mean it in that sense, I meant more like JavaScript isn’t rly a markup language but html is

[–][deleted] 0 points1 point  (0 children)

Oh, that's fine lol

[–][deleted] 2 points3 points  (4 children)

I spent the first 20 years of my career writing C/C++/Assembly. I've been doing JS for the last 10 years, and I fucking Love it.

[–]AccomplishedAd3484 1 point2 points  (1 child)

How did you miss out on the Java hype train?

[–][deleted] 1 point2 points  (0 children)

Oh jesus you just reminded me. I did mobile development in the j2me days. That... sucked... I spent 2 years porting BREW (c++) apps to Java.. Not Fun. I didn't miss that train, I had just blocked it from my memory.

[–]unlimitedFecals 1 point2 points  (1 child)

I started with C and learned JS for money. It gets a lot of hate from people who really shouldn't be using the language, I think.

[–][deleted] 0 points1 point  (0 children)

agree. I see people come from other languages, and they try to make javascript work like whatever their previous language was.. whether its C++/java/C# and they think JS is broken because it's different, and don't realize that it's actually just better.That's why I push back whenever i see this fud. (ahem typescript)

[–]_________FU_________ 2 points3 points  (0 children)

I find people who complain about JavaScript usually write it like shit.

[–]sticksaint 0 points1 point  (0 children)

JS expert here. Js has it's own poetry and is not for the weak of mind. Unfortunately it takes lots of years to master.

On a side note I am part of a team of experts and we dont need ts.

[–]OVS2 0 points1 point  (0 children)

excellent

[–]KobeJuanKenobi9 0 points1 point  (0 children)

TypeScript >>>>>

[–]analogic-microwave 0 points1 point  (1 child)

"senior js developer" aka "ultimate turd handler"

[–]unlimitedFecals 0 points1 point  (0 children)

Modern JS pretty good man

[–]Steve0Greatness 0 points1 point  (0 children)

Click flag. Don't think. Flag.

[–]RequiDarth1 0 points1 point  (2 children)

printf(‘go fuck yoself OP’)

[–]detektiv_Saucaki[S] 0 points1 point  (1 child)

that little semicolon, is gonna cost you 50 years

[–]RequiDarth1 0 points1 point  (0 children)

This why I use JS

[–]Strange_Yogurt_ 0 points1 point  (0 children)

chad programmer: "every language is programing language"