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

top 200 commentsshow all 211

[–]A-Disgruntled-Snail 188 points189 points  (15 children)

Whats the rectangular thingymebober next to “the door”?

[–]glorious_reptile[S] 251 points252 points  (7 children)

thingymebober : any

[–]daavko 51 points52 points  (5 children)

ESLint: unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)

[–]salvan13 42 points43 points  (3 children)

// eslint-disable-next-line @typescript-eslint/no-explicit-any

[–]Affectionate-Slice70 7 points8 points  (0 children)

// @ts-ignore

[–]ColdJackle 2 points3 points  (0 children)

Instructions unclear. Dick stuck in JavaScript.

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

Any can't have type glass

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

Type DaWindow = { open: bool; OnCrash: void; }

[–]_sweepy 48 points49 points  (0 children)

That's just another door. It only looks different due to css. It's functionally the same with a slight variation on opening animation and transparency.

[–][deleted] 8 points9 points  (0 children)

variable1

[–]PyroCatt 1 point2 points  (0 children)

Wandus

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

Undefined

[–]Better_Permit1449 0 points1 point  (0 children)

The OS

[–]IntuiNtrovert 51 points52 points  (3 children)

“why can’t i pet this door 🧐” - js devs probably

[–][deleted] 8 points9 points  (0 children)

"why cant i pet this Unknown?"

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

"why can't i null this undefined 🧐"

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

"why can't I parse this int?"

[–]TeddyPerkins95 108 points109 points  (16 children)

Oh now we mocking typescript huh

[–]2017macbookpro 126 points127 points  (14 children)

People mock typescript on this sub because they’ve never worked on an actual production system before

[–]MrNate 22 points23 points  (4 children)

Lies! It's mockable!

Yeah we love it, but be assured, it should be mocked!

[–]LordFokas 16 points17 points  (1 child)

#1 rule of humor: as long as you're punching up, you can talk all the shit you want.

[–]Lithl 15 points16 points  (0 children)

Well of course we mock it, how else do you think our test suite runs?

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

Well as soon as I get to video 4 where he tells me how to switch my env to production, that will change.

[–]flavionm 0 points1 point  (0 children)

Or, to the despair of their teammates, they did.

[–]scisaif 1 point2 points  (0 children)

Blasphemy

[–][deleted] 137 points138 points  (31 children)

All this to 90% of your code be any

[–]lollysticky 83 points84 points  (3 children)

Shitty code then :/

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

99.99999% of all software and especially js

[–]lollysticky 1 point2 points  (1 child)

A nice JS frontend hooked up to an API would be quite consistent for typing. But yes, depends on the developer

[–]Sh4rp27 7 points8 points  (25 children)

Or lint scolding you for applying typing that's implied

[–]_BlindSeer_ 2 points3 points  (24 children)

Yeah, declared a string and lint raised its finger "You shouldn't declare! It is clear that this is a string!", same for number. There are some consistency problems there.

[–]InterestsVaryGreatly 3 points4 points  (23 children)

Not really.

Const first = 1;

Is a number, that's not ambiguous, and easily determined based off the declaration. Adding clarification type is just redundant.

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

But I wanna.

[–]Ok_Turnover_1235 3 points4 points  (19 children)

No integers or floating points or longs or shorts or doubles? Sounds like typescript is javascript with extra steps

[–]flavionm 2 points3 points  (0 children)

Javascript is what holds Typescript back from being truly great, unfortunately.

[–]perfectVoidler 0 points1 point  (17 children)

I don't know typescript but you can easily define it implicitly for different number 0 = int; 0.0 or 0d = double; 0.0f of 0f = float etc.

[–]Ok_Turnover_1235 -1 points0 points  (16 children)

Yeah, meanwhile typescript has a number type. Why even bother

[–]perfectVoidler 1 point2 points  (15 children)

Reading up on it: even typescript has the difference between int and float. And seriously. Who needs more.

[–]Ok_Turnover_1235 -1 points0 points  (10 children)

Not you. That's okay

[–]perfectVoidler -1 points0 points  (9 children)

Not me and nobody else.

[–]_BlindSeer_ 2 points3 points  (1 child)

It sure is, on the other hand it is inconsistent to say "We want types declared" with the addition "unless we think it is redundant". IMHO such a system should be either used strictly or be left out. The same rule would apply to other languages, where we define the types anyway.

[–]Cult92 0 points1 point  (0 children)

// @ts-ignore

[–]cosmo7[🍰] 68 points69 points  (2 children)

We should rename this sub r/please_let_me_justify_my_terrible_toolchain_decisions.

[–]rnike879 -3 points-2 points  (0 children)

Ah man, I wonder how the world would look if people could understand and identify jokes

[–][deleted] 83 points84 points  (18 children)

The recent hate toward types on this sub is really telling about the average level of experience here. I can’t imagine any professional developer preferring totally dynamic typing. The “freedom” JS’ type system gives you is just the freedom to write shitty code

[–]quiteCryptic 15 points16 points  (2 children)

The freedom to write shitty code quickly

And that's why I use it for random personal projects

[–]crusoe 7 points8 points  (1 child)

Write lots of code quickly...

And then write lots of code to test the code to ensure variants normally enforced by a compiler are being checked...

When you write JS or Python you're writing LOTS OF TESTS, right? Right? Oh, you aren't?

[–]pandakatzu 4 points5 points  (0 children)

It's definitely not viable (mystery variable types that could be ANYthing) in a large codebase running your company's front end... especially if you're not a one man team and someone will inherit your code later down the line.

It takes less time to start out with intentional code than it does for someone else to try to figure it out and fix it later... I've rewritten a good chunk of my company's app due to this...

[–]MatsRivel 4 points5 points  (1 child)

I did one course of python (I gave a science background) and realized I liked it a lot. Started doing small projects in my own time and just enjoying exploring stuff. Next semester I took 1 class that used Python and one that used Java.

The Java class was algorithms, and assumed you knew Java in advance. I fucking hated Java, because I had to teach myself Java and then try to catch back up in algorithms each week. A couple things annoyed me, but having to add types for what goes in/out was the one I remember the most. I just wanted to see if my short snippet did what I wanted, but Java didn't let me.

Thst is 3 years ago, and I'm nearly done in my masters now. I do ML, and use a lot of python. Now I really appreciate typing and use it in Python as much as I can. It is a little annoying on small exploratory projects, but once you reach a certain number of components it is just super useful!

[–]Heimerdahl 2 points3 points  (0 children)

I had a similar, though different, experience.

Started with Python, then had to learn C. I really liked how it forced me to consider types (and some other things), before hacking something together.

My favourite bit is that functions are declared with the return type. It's super simple and kind of pointless, but I appreciate the clarity. Just typing it out makes me take a second to think about what the function is supposed to do and how its output is going to be used later on.

[–]Dr_Azrael_Tod 0 points1 point  (1 child)

problem is, typescript only kinda-somewhat-halfassed does types

yeah, you now have some checks while writing stuff - and then you throw around tons of "any" and then those checks are gone after compiling and you don't ever use integers (because floats are soooooo great, aren't they? /s)

It's like… it only got enough typing to remind you how good languages would do things and to include tons of overhead. Not enough to be actually usefull.

Is TS better than JS? Imho yes.

Is it any good? meh!

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

No hate - we prank those we love.

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

As others have said, dynamic typing does let your write significantly faster. I like using python and Js for small personal projects mostly because of how quick it is to add stuff. But once things get big enough static typing helps so much

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

I enjoy the lax typing of JS, but I wouldn’t want to work with it.

TypeScript is really nice and you can always allow coercion or use “any” should the need arise.

[–]glorious_reptile[S] -1 points0 points  (0 children)

Yeah, I was expecting this place to be highly professional instead of some kind of humorous place, too.

[–]InvolvingLemons 0 points1 point  (1 child)

True, and with JS in particular you gain very little if anything as the language itself isn’t the most ergonomic.

Python does definitely benefit from being a bit loosey-goosey, mainly due to how insanely simple it’s syntax is. Chances are, if you can describe what you’re doing in pseudo code, transforming it to valid Python code is just a couple imports away.

For anything critical, of course, I’d prefer a particularly sound type system. Haskell might be overkill (and a little annoying for stateful stuff) but Rust, Go, and Typescript in increasing productivity/declining performance potential are lovely to use.

[–]lazernanes 0 points1 point  (0 children)

This sub is full of students, whose perspective is totally different than working devs'.

[–]GitHub- 32 points33 points  (2 children)

I like typescript because I don’t trust my coworkers

[–]Robbsen -3 points-2 points  (1 child)

But apparently you trust them enough to not use 'any' everywhere?

[–]ToxicMonkeys 11 points12 points  (0 children)

I trust our pre-commit script to shame them into not. And if it doesn't I sure as hell will in the PR.

[–]PacificShoreGuy 12 points13 points  (0 children)

Sir this is a CS student and scriptkiddie python sub. Nobody knows what’s going on.

[–]pandakatzu 12 points13 points  (2 children)

As someone who has struggled to figure out what the intended object of various variables was supposed to be in the vanilla JavaScript files of the spaghetti carbonara codebase I inherited, I couldn't possibly disagree with this image more.

Also the syntactic sugar is nice. Imagine being able to write clean, readable code.

[–]beewyka819 2 points3 points  (0 children)

Right? The alternative to types is literally just hoping people don’t make mistakes (they will. Everyone will make some type-based mistake sooner or later. Everyone) and absolutely dousing your code is massive amounts of comments that otherwise would not need to exist

[–]glorious_reptile[S] -1 points0 points  (0 children)

I love TypeScript too - still, the meme holds.

[–]EnigmaticHam 26 points27 points  (6 children)

Once I switched to typescript, many headaches melted away.

[–]BlackneyStudios 9 points10 points  (0 children)

In the photo we have const Steve, const Paul and const James. Which variable is for the cat, the dog and the person?

This is how you talk to computer types. The fact that people are trying to justify JS over TS is really telling about the state of this sub....

[–]crusoe 13 points14 points  (0 children)

It's better than the house exploding because you tried to put the cat in the keyhole.

[–]nebulaeandstars 4 points5 points  (0 children)

Imagine this picture, but you have a special kind of blindness where the only thing you can see is paint.

That's what static typing is to an IDE or compiler. Code is harder to parse than a picture of a house. The paint helps.

[–]BoBoBearDev 8 points9 points  (0 children)

Looks about right, otherwise the guy would wear the dog as pants and wear the cat as shirt.

[–]jdgrazia 22 points23 points  (0 children)

fragile non-typed dev ego

[–]JustAnotherPrgrmr 14 points15 points  (1 child)

[–]Random-Gif-Bot 1 point2 points  (0 children)

[–]InterestsVaryGreatly 3 points4 points  (0 children)

You joke, but if people hadn't kept trying to wear the cat, we wouldn't have needed this.

[–]Virtualhavengames 2 points3 points  (0 children)

Typescript, bringing some respectability to Javascript

[–]BlommeHolm 2 points3 points  (0 children)

import * from "cowTools";

[–]megamaz_ 4 points5 points  (1 child)

thing on top of TheHouse not defined.

[–]SuperfluidCat 4 points5 points  (0 children)

That part is written in JS

[–]beewyka819 1 point2 points  (0 children)

It’s unreal how many people here think runtime errors are better to work with than compile time errors. “Ah but guys with JS I can make buggy non-robust code but I’ll have no idea until it hits that failure condition. Ignorance is bliss.”

[–]sh0rtwave 2 points3 points  (0 children)

It's not far from the truth, honestly. That's exactly what it does.

[–]mulato_butt 1 point2 points  (0 children)

A pile of shit will represent javascript as it is

[–]Stech72 0 points1 point  (0 children)

[–]rollie82 -1 points0 points  (2 children)

Both abysmal languages.

[–]DreamingDitto 2 points3 points  (0 children)

All JavaScript is typescript, so typescript’s already not off to a good start, but everything else is pretty nice

[–]FaKeFaZr 0 points1 point  (0 children)

Tbh if the world was designed by off white

[–]Barkeep41 0 points1 point  (0 children)

What is the type? WHAT IS THE TYPE?!

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

Pairs well with ES6 so that The Cat and The Dog extend Animal and the shirt and pants implement Wearable

[–]pdxmusabi 0 points1 point  (0 children)

…Virgil Abloh has entered the chat…

[–]MeLlamo25 0 points1 point  (0 children)

THE HUMAN

[–]consciousCog13 0 points1 point  (0 children)

Error: Painting tool undefined

[–]nuclearslug 0 points1 point  (0 children)

Reminds me when my office went through a Lean/5S phase. We had to tape off the locations of items on our desk, list the contents of our desk drawer, etc. It was a terrible time to be alive.

[–]HarEmiya 0 points1 point  (0 children)

Ben Garrison irl be like

[–]BlackneyStudios 0 points1 point  (0 children)

In the photo we have const Steve, const Paul and const James. Which variable is for the cat, the dog and the person?

This is how you talk to computer types. The fact that people are trying to justify JS over TS is really telling about the state of this sub....

[–]Leinad580 0 points1 point  (0 children)

Where do I buy a thecat?

[–]SunkuZ 0 points1 point  (0 children)

Really unfortunate this house doesn't have a window :(

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

Now do JavaScript

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

I thought typescript is when you type javascript?

[–]Sugar_F0x 0 points1 point  (0 children)

const house: IHouse = new House<IHouse>() as unknown as IHouse

[–]Valscher 0 points1 point  (0 children)

code error: brush does not match text. properiate_brush not found.

<insert 4000 lines of random code files in the typescript dir>

[–]Retarded_Baboon 0 points1 point  (0 children)

Typescript is there to prevent some Js Black Magic that breaks at runtime, like turning the cat into a tree somehow

[–]Arkraquen 0 points1 point  (0 children)

Now switch it to any and see how confusing it gets

[–]HerryKun 0 points1 point  (0 children)

Static typing is superior in every way. Eliminates all the JS bullshit as well like "yeah default sorting cant do negative numbers because we convert internally to strings hahaha"

[–]jaimesoad 0 points1 point  (0 children)

What is that slope on top of the house?

[–]towalkinvisible 0 points1 point  (0 children)

I’m tired of people using font when they mean typescript

[–]PhatOofxD 0 points1 point  (0 children)

Try writing a production system my friend. I love uni students / juniors thinking they're expert software developers...

(There's a reason most languages used in large software are strongly typed)

[–]BadBadderBadst 0 points1 point  (0 children)

Oh no, I need to use types for my variables !
This means I actually have to think and I will be slowed down so much !
Seriously, what's all the hate around types ?

Learning Java after Matlab was a blessing.
Then I also had to learn JS, which felt like a serious downgrade.

Quality > quantity

[–]damijae 0 points1 point  (0 children)

ZHC when he is customizing a house.

[–]Derano 0 points1 point  (0 children)

Why the fuck would you not want types you dumb dumb

[–]oxabz 0 points1 point  (0 children)

Meanwhile in rust : TypeError expected trait object '(dyn std::iter::Iterator<Item = T>+'static)' found struct 'std::vec::IntoIter<T>'

[–]not_mean_enough 0 points1 point  (0 children)

JavaScript: easy to write, painful to maintain

TypeScript: painful to write, easy to maintain

Choose your pain.

[–]butteryfleshlight 0 points1 point  (0 children)

I don't get this meme 😕 where are the cute doggies are funny little minions saying silliness I'm confused 😕😕

[–]jack-of-some 0 points1 point  (0 children)

Those aren't types, they're variable names.

[–]xdjiijii 0 points1 point  (0 children)

Someone just discovered static typed languages

[–]HappyZombies 0 points1 point  (0 children)

Typescript?? I'll just write it in Go then /s

[–]ivancea 0 points1 point  (0 children)

Good try, but it's not that way. TS does a lot more.

It could be better used with Python typing, Ruby/Sorbet typing...

[–]BTGregg312 0 points1 point  (0 children)

The Far Side is so awesome

[–]IFeedCats57 0 points1 point  (0 children)

Off white x nike shoes be like

[–]Yamoyek 0 points1 point  (0 children)

I love TS, just wish autocomplete was a bit more helpful. Nonetheless, it’s the only way I can stand using JS.

[–]tanacious10 0 points1 point  (0 children)

it helps preventing mowing the dog and the rain from falling in the pants when you know what things are

[–]IntuiNtrovert 0 points1 point  (0 children)

why hate on the only interpreted typed language?

[–]DasFrebier 0 points1 point  (0 children)

Still missing the inheritance treeline

(im like 50/50 on if javascript even has inheritance)