Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
r/ProgrammerHumor icon
r/ProgrammerHumor icon
Go to ProgrammerHumor
r/ProgrammerHumor
A banner for the subreddit

For anything funny related to programming and software development.


Members Online

TypeScript

Meme
r/ProgrammerHumor - TypeScript
Archived post. New comments cannot be posted and votes cannot be cast.
Share
Sort by:
Best
Open comment sort options

Whats the rectangular thingymebober next to “the door”?

thingymebober : any

u/daavko avatar

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

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

Uno reverse but typescript

// @ts-ignore

Instructions unclear. Dick stuck in JavaScript.

More replies

Any can't have type glass

More replies
[deleted]
[deleted]

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

More replies

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]
[deleted]

variable1

Wandus

[deleted]
[deleted]

Undefined

The OS

More replies
u/IntuiNtrovert avatar

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

[deleted]
[deleted]

"why cant i pet this Unknown?"

[deleted]
[deleted]

"why can't i null this undefined 🧐"

[deleted]
[deleted]

"why can't I parse this int?"

More replies

Oh now we mocking typescript huh

u/2017macbookpro avatar

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

Lies! It's mockable!

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

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

u/Lithl avatar

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

We like FP languages too, but they can also be mocked.

For instance:

A Scheme dev is too eager to use Haskell.

More replies
[deleted]
[deleted]

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

[deleted]
[deleted]

Comment deleted by user

u/2017macbookpro avatar

Not having types completely annihilates the maintainability of your code. Anything more than a very tiny program needs to have static typing to prevent nearly untraceable runtime errors, among many other things

[deleted]
[deleted]

Comment deleted by user

More replies

Hundred percent this. Worked on large projects (mainly on frontend) and I have rarely been caught off guard with types. I mean theres only 7 basic types in js. Its not that complex a language that we need to go crazy and add a full blown type system around.

In fact JS is more beautiful than TS because of how dynamic and resourceful it is with only 7 types whereas TS is a step backwards into Java territory and I dont know anyone that loves working with Java.

I did, still shit and just unnecessary comblicates js.

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

More replies
u/scisaif avatar

Blasphemy

More replies
[deleted]
[deleted]

Comment deleted by user

[deleted]
[deleted]

Controversial comment, but I 100% agree. Typescript >>>> jQuery and JavaScript.

u/TheC0deApe avatar

is it really controversial? i don't know a professional dev that would say JS is better than TS. i am sure they are out there but they are well hidden.

[deleted]
[deleted]

Look at the other comments. They all are talking about js being superior

u/TheOnlyGodInTown avatar

Because most of them aren‘t professional programmers… I guess 70% of the people here are hobby programmers at best.

more replies More replies

We're in r/ProgrammerHumor, people are too busy figuring out how to consume their crayons to give any kind of valuable input.

That's because they don't know what TS is

More replies

They have been scorned into perpetual silence, never to share their thoughts again

u/5tUp1dC3n50Rs41p avatar
Edited

I am a professional dev and have used JavaScript since 2005, Typescript since 2019. I still prefer vanilla JS, no frameworks because:

  • TypeScript is Microsoft horse shit. They never understood JS, as evidenced by their shitty incompatible browser Internet Exploder, so they thought they needed to fix JS instead of fixing their shitty browser. Wait until they reach the Extinguish phase of their Embrace, Extend, Extinguish philosophy for JavaScript.

  • TypeScript basically replaces your code function level JS Doc syntax and typeof checks, which if you had a non Microsoft IDE would give you all the highlighting and intellisense you ever needed for handling typing errors. Instead with TS you run some compilation step to compile to JS and it checks all these things for you and throws annoying errors in the console. Then when you deploy the actual code you lose all the type handling code because it got compiled away. With JS, the type handling typeof checks etc are still in the code and functional in production. If you have developers who make fundamental coding issues because of type incompatibility, they're just shitty developers.

  • With TS, most of the time is spent resolving annoying typing issues, rather than just getting shit done and focussing on business logic.

  • With TS you're more likely to need to add npm, yarn etc, a bunch of other shitty node modules, linters, prettier, bla bla just to do basic stuff. With JS, you just add a script tag and it works. You don't get the 1GB of node dependencies which are a costly maintenance nightmare.

  • JS is stable. My website from a decade ago is still running. TS changes the APIs every other release, deprecating stuff, changing things. Include this in your business and your company will eventually go bankrupt just maintaining that shit and keeping up with the node updates, node modules/npm dependencies etc.

The one thing I'll say though is that TS is good for your CV though if you want to get another job. That's because all you Microsoft loving junior developer muppets keep supporting it and promoting it to your unsuspecting managers. The real developers left a long time ago due to framework fatigue and hype driven magpie development. They're probably out planting fruit trees or something.

u/Voidrith avatar
Edited

Its so obvious that you have no idea what you're talking about. Every single one of your points is either just straight up nonsense or irrelevant

  1. irrelevant, TS is not related to IE in the slightest. different projects, different teams, from different eras, with different leadership and different goals.

  2. typeof is limited to object/array/string/integer/undefined/boolean/function. which, as far as the type checking that ts goes, is basically unusable in 90% of situations. instanceof can be used to check if a specific thing is of a certain class (or derived) but plenty of libraries return things that are literally just JSON.parse(something), which instanceof willl do nothing for. Even most manually constructed response objects are raw objects with specific fields, which TS is designed around.

  3. nonissue. compiler errors are ALWAYS better than runtime issues because its immediate feedback on if you have a problem.

  4. nonsense. npm has no preference over ts or js,and you can also just "add a script tag" for a library in ts - the script you end up with wont tell the difference

  5. you can pin the version of ts you're using. nonissue

u/Lithl avatar

Instead with TS you run some compilation step to compile to JS and it checks all these things for you and throws annoying errors in the console. Then when you deploy the actual code you lose all the type handling code because it got compiled away.

Why the fuck would I want to spend cycles type checking at runtime when static analysis can remove the need?

More replies

Im right here. JS is way way way better

u/Voidrith avatar

objectively incorrect.

Errors at compile-time are 10000% better to deal with than errors at runtime

more reply More replies
More replies

I've never met anyone who gave a good reason to use Typescript. I guess hand holding is desirable now?

That's because when you talk like that they immediately know not to argue with you and let you slide.

more replies More replies

Yes the computer should catching as many of your dumb programming errors as possible. There is literally no good reason to have it not do this except some dumb sense of pride

more replies More replies
More replies

Had an ex manager who believed that and understandably buried that belief in scotch/narcissism

u/kilobrew avatar

I joined a team where a senior staff made me (staff) drop typescript because he was a node purist and thought it made the code too verbose…. I subsequently spent a very long time fixing bugs because being a dyslexic programmer sucks.

I don't even know what typescript is

u/Lithl avatar

Typescript is a superset of JavaScript, which adds type information and static analysis to make the code more robust and less prone to errors.

More replies
More replies

Controversial comment

Lol?

[deleted]
[deleted]

Was typescript even invented the last time a JS dev admitted to using jQuery in public?

Well jQuery was only needed when IE had any market share, so...

[deleted]
[deleted]

If you mean the time period I guess it overlaps, if you mean as an IE-fixing patch I disagree - it was a really handy little library generally, it's just mostly been superseded by semi-sane frameworks and better Web APIs. It certainly didn't incentivise writing scaleable code, but it was great for avoiding boilerplate in the days when JS on a page was mostly that.

more reply More replies
More replies

Yup, TS was invented in 2012, jQuery fell out of favour after 2015 IIRC.

More replies
u/cryptomonein avatar

Why are you talking about jQuery when speaking about typescript ?

Why are we comparing jQuery(module) vs TypeScript (JS superset)

u/mosskin-woast avatar

Who's comparing it to jQuery? I prefer a hamburger to a colonoscopy, but that's not really a meaningful comparison.

[deleted]
[deleted]

no cap very controversial omg fr fr ong slay

More replies

Hey now. We can't get too readable. If we did that, people might start to figure out that most JS programmers don't know what they fuck they're doing. :D

That's like saying dysentery is better than AIDS, sure but I still got dysentery

But at least you know it's of type Dysentery!

More replies
[deleted]
[deleted]

Comment deleted by user

u/SZ4L4Y avatar

The machine takes away my job >:(

interface MyInterface extends WhateverInterface

You should learn how to properly use it before hating it

isn't that kinda like "better than Zombie-Hitler"?

I mean… yes, but…!

u/Ylsid avatar

If typescript is so good, how come I need to compile (obfuscate) it to make it work on a browser?

[deleted]
[deleted]

All this to 90% of your code be any

Shitty code then :/

99.99999% of all software and especially js

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

The downvotes above are because the authors are on this sub

More replies
More replies
More replies
u/Sh4rp27 avatar

Or lint scolding you for applying typing that's implied

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.

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]
[deleted]

But I wanna.

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

more replies More replies

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.

more reply More replies
More replies
More replies
More replies
// @ts-ignore
More replies
u/cosmo7 avatar

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

More replies
[deleted]
[deleted]

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

u/quiteCryptic avatar

The freedom to write shitty code quickly

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

u/crusoe avatar

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?

u/quiteCryptic avatar

Yea sure I write lots of tests for random shit personal projects

More replies
More replies

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...

u/MatsRivel avatar

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!

u/Heimerdahl avatar

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.

More replies

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!

[deleted]
[deleted]

Overall I think the front-end dev space is not even close to reaching its full potential right now - especially when compared to the overall application programming space. We can only hope that in the future the standards will evolve beyond just JavaScript (webassembly?🤞) but for now we’re kind of stuck with trying to make JS as usable as possible.

More replies

No hate - we prank those we love.

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

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.

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

I wrote a 3 million dollar SAAS in JS. JS is elegance, TS is training wheels. Once you learn how to code you dont need those training wheels anymore.

[deleted]
[deleted]

Training wheels? Why wouldn’t you want compiler-enforced type checking? Even if you claim to be some prodigy who never makes mistakes, why wouldn’t you want to use the typing system to communicate the intent of your code to the reader? Why wouldn’t you want the compiler checking that your idiot coworker didn’t misuse the code you wrote? What a bizarre macho attitude.

More replies

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.

Any is just another way of doing generics. So...

More replies
u/lazernanes avatar

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

More replies

I like typescript because I don’t trust my coworkers

u/Robbsen avatar

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

u/ToxicMonkeys avatar

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

More replies
More replies
u/PacificShoreGuy avatar
Edited

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

Edited

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.

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

I love TypeScript too - still, the meme holds.

More replies

Once I switched to typescript, many headaches melted away.

[deleted]
[deleted]

Comment deleted by user

[deleted]
[deleted]

Comment deleted by user

You guys use assembly? I use static electricity to entice electrons in the RAM.

Strange and unfounded conclusion.

[deleted]
[deleted]

What the hell. Have you ever written a medium to large web app?

Seems like you've never worked on a project with other people

More replies
u/BlackneyStudios avatar

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....

u/crusoe avatar

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

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.

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

u/jdgrazia avatar

fragile non-typed dev ego

u/Random-Gif-Bot avatar
More replies

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

That's how you talk to a machine, if you don't like it you chose the wrong career.

Typescript, bringing some respectability to Javascript

import * from "cowTools";

thing on top of TheHouse not defined.

That part is written in JS

More replies

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.”

u/sh0rtwave avatar

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

A pile of shit will represent javascript as it is

u/Stech72 avatar
u/rollie82 avatar

Both abysmal languages.

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

More replies
[deleted]
[deleted]

Comment deleted by user

Good. I don't want a scripting language running my front-end.

u/Triumph7560 avatar

So machine code is the only scripting language?

So...?

u/gatimus avatar

Exactly modern js/ts applications resemble an interpreted language like Java or C#

Tbh if the world was designed by off white

What is the type? WHAT IS THE TYPE?!

u/gatimus avatar

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

…Virgil Abloh has entered the chat…

THE HUMAN

Error: Painting tool undefined

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.

Ben Garrison irl be like

u/BlackneyStudios avatar

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....

u/Leinad580 avatar

Where do I buy a thecat?

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

[deleted]
[deleted]

Now do JavaScript

[deleted]
[deleted]

I thought typescript is when you type javascript?

Confused🤣

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

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

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

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

u/Arkraquen avatar

Now switch it to any and see how confusing it gets

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"

What is that slope on top of the house?

Edited

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

u/PhatOofxD avatar

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)

u/BadBadderBadst avatar

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

ZHC when he is customizing a house.

Why the fuck would you not want types you dumb dumb

Meanwhile in rust :

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

JavaScript: easy to write, painful to maintain

TypeScript: painful to write, easy to maintain

Choose your pain.

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

u/jack-of-some avatar

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

u/xdjiijii avatar

Someone just discovered static typed languages

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

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

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

The Far Side is so awesome

Off white x nike shoes be like

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

u/tanacious10 avatar

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

u/IntuiNtrovert avatar

why hate on the only interpreted typed language?

Still missing the inheritance treeline

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