this post was submitted on 08 Sep 2023
546 points (94.2% liked)

Programmer Humor

19623 readers
26 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 111 points 1 year ago* (last edited 1 year ago) (1 children)
load more comments (1 replies)
[–] [email protected] 108 points 1 year ago (10 children)

What Typescript drama is there? It's fantastic. It's been an industry standard for years. In my anecdotal experience the only people that hate it are juniors who did pure JS at their bootcamp and seniors that have refused to learn anything for the last 5 years.

[–] [email protected] 74 points 1 year ago (2 children)

DHH (guy who founded Ruby on Rails) ripped typescript out of a supporting library and swapped it for JavaScript. He did it in his typical fashion of not allowing discussion and being a dick (PR only open for a couple hours and then merged disregarding all the negative feedback about the change) . So people are mad at him again.

He does stupid shit like this all the time because he’s a fucking knob.

[–] [email protected] 43 points 1 year ago* (last edited 1 year ago) (2 children)

RoR will always have a special place in my heart, but yeah... DHH sure does have opinions. What possible justification is there for removing it when it's already there? Guess someone could just shift the types out to DT.

Edit: So I read his blog post about it. He's dropping it because he just doesn't like it and he's allowed to not like it. Okay then 🤷

[–] [email protected] 17 points 1 year ago (2 children)

His blog to me sounds like he did it because it was too difficult for him to understand a few errors. Says it all.

load more comments (2 replies)
load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 24 points 1 year ago (2 children)

or people used to work alone never having to go back to their code (e. g. bad consultancy jobs)

[–] [email protected] 19 points 1 year ago (4 children)

Even alone I find it indespensible. I find it's mainly useful for writing code correctly the first time around.

load more comments (4 replies)
load more comments (1 replies)
[–] [email protected] 13 points 1 year ago* (last edited 1 year ago) (1 children)

Svelte decided to ditch it because it became impractical due to the compilation step slowing down development and making debugging their compiler harder. I think for libraries it makes sense to go the jsdoc way as long as consumers can choose typescript.

load more comments (1 replies)
load more comments (7 replies)
[–] [email protected] 69 points 1 year ago (4 children)

I'm choosing the third side: WebAssembly

[–] [email protected] 35 points 1 year ago (4 children)

Blazingly fast 🦀🦀🦀

load more comments (4 replies)
[–] [email protected] 13 points 1 year ago

You can even compile Fortran code to wasm and run it on a web browser. Who need Javascript's puny 64bit floating point precision when you can have Fortran's superior 128bit floating point precision?

load more comments (2 replies)
[–] [email protected] 62 points 1 year ago

vanilla javascript? what are you, fucking Amish?

[–] [email protected] 61 points 1 year ago (1 children)

I'd rather stay out of the frontend all together but I'd rather chop my balls off than go back to JS.

[–] [email protected] 21 points 1 year ago* (last edited 1 year ago)

Plot twist: You are transgender and love working with JS

[–] [email protected] 54 points 1 year ago (2 children)

TypeScript of course. The compiler often times catches mistakes in variable names, API methods, whatever. So it saves time by not having to run the whole application all the time. Also the input help is much better, when the editor knows sth is a string or a number, for example.

load more comments (2 replies)
[–] [email protected] 41 points 1 year ago* (last edited 1 year ago) (35 children)

Honestly, as a mainly backend dev wanting to do more full stack, webdev is frustratingly intimidating. I keep trying to look up best practices but there's so little in the way of consensus. "Use JQuery, no use Vue! React is better, but also React is clunky and bad. Write pure js, no don't that's a waste of time, at least use typescript." It's all such a mess and I spend so long trying to figure out what to use. I'm trying to just pick something and stick with it, but I keep worrying that I'm not doing things the best way.

[–] [email protected] 16 points 1 year ago* (last edited 1 year ago) (5 children)

I'd agree with you if you were saying this about 8 years ago, but IMO the post-jQuery-front-end dust has settled and the "best" (in terms of what most organisations end up choosing) hasn't really changed in a while.

  • Typescript unless you've got a really good reason not to.
  • React if you have anything remotely complex.
  • Webpack (or one of the wrappers) to bundle it up.

Sure, someone may like a React alternative, and that's completely fine. But at the end of the day, most companies are using React because it's basically industry standard at this point, and it's got too much momentum behind it for that to change any time soon.

I'd say the back end is where all the choice is these days

load more comments (5 replies)
[–] [email protected] 13 points 1 year ago (2 children)

Don't worry, none of us are doing things the best way.

load more comments (2 replies)
load more comments (33 replies)
[–] [email protected] 41 points 1 year ago

Typescript is great for catching long standing bugs in old legacy JS.

[–] [email protected] 36 points 1 year ago (4 children)

Me: 2024 is finally going to be the year of WASM, boys!

[–] [email protected] 13 points 1 year ago (7 children)

And then there's me, missing flash :(

Flash and AS3 was so much fun to work in. I completely understand why the industry moved away from it but even today we have yet to fully catch up to all the media animation and programmatic features it provided all in one. RIP.

load more comments (7 replies)
[–] [email protected] 9 points 1 year ago (3 children)

I just wish WASM could replace JS rather than merely augment it for non-DOM work.

load more comments (3 replies)
load more comments (2 replies)
[–] [email protected] 34 points 1 year ago

I dunno, Typescript can be nice at times but it always feels like I'm bolting on something that doesn't belong on top.

I'll still use it for now. Not sure JSDoc is as adequate for an enterprise app for me. I know Svelte and stuff do, but I'll wait and see.

[–] [email protected] 34 points 1 year ago (7 children)

I think there's a positive coming from this competition, though. Apparently this infighting has re-lit the want for type annotations to be embedded in vanilla JS (ECMAScript proposal). I feel like this would be the ideal scenario: things working right out of the box without needing a compile step or additional tooling.

You can get as close as it gets to this experience by using alternative runtimes such as Deno or Bun, which have native TS support (meaning you can just execute a .ts file without having to transpile it), but of course as soon as you have to write code for a browser you are back in the middle ages.

load more comments (7 replies)
[–] [email protected] 33 points 1 year ago* (last edited 1 year ago) (2 children)

Typescript may have a million problems that make getting into it annoyingly hard and even seem pointless, but once it's settled in your project and used well... Damn is it fucking good.

And I'm saying that even though I had to disable intellisense and most of those advanced features because the project I work for is too large and typescript would easily use over 20GB of RAM and get my computer to freeze.

But if you're trying to use it like a traditional typed language, you'll only see the bad side of it and you'll certainly hate it.

load more comments (2 replies)
[–] [email protected] 31 points 1 year ago (5 children)

typescript is a bandaid on a severed leg

load more comments (5 replies)
[–] [email protected] 28 points 1 year ago (16 children)

My issue with typescript... and, correct me if I'm wrong... is it doesn't exist without Javascript. Typescript needs to be compiled down into Javascript to be run. It has no stand alone interpreter (that I'm aware of) and definitely not one baked into web browsers or NodeJS (or adjacent) tools. In essence, Typescript is jank sitting on top of and trying to fix Javascript's uber jank, simultaneously fracturing the webdev space while not offering itself as a true competitive and independent language for said space.

That's my amateur two cents for what it's worth.

[–] [email protected] 23 points 1 year ago (1 children)

The fact that TypeScript doesn't attempt to obfuscate JavaScript, and just fills in the gaps, is what makes it the best solution to the problem.

It's not a separate language, it's Javascript tooling

load more comments (1 replies)
[–] [email protected] 14 points 1 year ago (4 children)

I don't think it really fractures anything considering you can call a ts package from js without knowing. The other way also works with third party typings in DefinitelyTyped.

It really just adds a bit of extra type info into js, looks like js, and transpiles into js that looks almost exactly like the input, including comments and spacing and such if you like, so there isn't any lockin.

There isn't any competition, it's just an extra optional tool for the js ecosystem in my eyes.

load more comments (4 replies)
[–] [email protected] 11 points 1 year ago

As a professional with 25 years of experience I agree with you. The entire modern architecture was created by people who don't like simple things that work. I'm pretty sure there are a couple of high ranking master developers sitting at the head of W3C competing to create the most convoluted system possible.

[–] [email protected] 10 points 1 year ago (2 children)

You are correct.

That says I would never ever EVER start a project without TS.

It's like coding with hands vs coding with your elbow.

load more comments (2 replies)
load more comments (12 replies)
[–] [email protected] 22 points 1 year ago (4 children)

I'm kind of a beginner... Can someone explain why you would make/use/have a dynamically and/or weak typed language? Is it just to not write some toInteger / as u64 / try_from()? I mean the drawbacks seem to outweigh the benefits...

[–] [email protected] 22 points 1 year ago

The typical arguments for a dynamic typed language are that it takes less time to write something in it.

The benefits of static typed languages are that your development environment can be a lot smarter (ironically enough leading to faster development speed) and several classes of bugs being unable to happen. In a statically typed language, the IDE can detect if you're trying to call a function that takes a number but you're actually providing a string. In this case the IDE will let you know and you can immediately fix silly mistakes like that.

[–] [email protected] 12 points 1 year ago* (last edited 1 year ago) (7 children)

If you are writing small and simple apps it will give you more velocity and much less boiler plate.

As apps grow it becomes harder to keep track of things and can quickly grow into a mess. You then start to need external tools to give you the features of a strong static type system.

Also from a web point of view you don't want the website to crash and burn with every error. JS will power through things like invalid types. Imagine if any error caused the website to just stop.

load more comments (7 replies)
load more comments (2 replies)
[–] [email protected] 21 points 1 year ago

I learned typescript because so many authors are using it.

I think it's like jQuery. Learn it because you'll have to debug someone's code one day.

[–] [email protected] 20 points 1 year ago (2 children)

I’m not on Twitter, what’s happening?

load more comments (2 replies)
[–] [email protected] 17 points 1 year ago (1 children)

HTML + CSS. No need for any of that newfangled "*script" bloatware / malware.

load more comments (1 replies)
[–] [email protected] 16 points 1 year ago

I am just a little "programmer" (if I can even call myself like that), and I'm using Typescript. Sure, it has it's own shortcomings, as everything, but it looks better than plain JS (at least in vscode)

[–] [email protected] 14 points 1 year ago* (last edited 1 year ago)

I like TypeScript for its types and type-checking, but I also want to write JavaScript to avoid having a local build step, and having to wait for things to transpile/compile/etc when running locally. I have a pretty large project where I've gotten both worlds by just using JSDoc and only using TS for type-checking. VSCode still offers built-in type-checking with JSDocs and ofc the type-checking can also be run separately if needed.

[–] [email protected] 12 points 1 year ago (7 children)

Just use Kotlin to write your JS/TS

[–] [email protected] 11 points 1 year ago

the fuck? TIL

load more comments (6 replies)
[–] [email protected] 12 points 1 year ago (1 children)
load more comments (1 replies)
load more comments
view more: next ›