top 50 comments

sorted by: hot top controversial new old
[–] 113 points 2 years ago* (1 child)
load more comments (1 reply)
[–] 107 points 2 years 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.

  • source
  • hideshow 13 child comments
  • [–] 74 points 2 years 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.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 43 points 2 years ago* (last edited 2 years 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 🤷

  • source
  • parent
  • hideshow 3 child comments
  • load more comments (1 reply)
  • load more comments (1 reply)
  • [–] 24 points 2 years ago (2 children)

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

  • source
  • parent
  • hideshow 3 child comments
  • load more comments (1 reply)
  • load more comments (7 replies)
    [–] 69 points 2 years ago (4 children)

    I'm choosing the third side: WebAssembly

  • source
  • hideshow 6 child comments
  • load more comments (2 replies)
    [–] 61 points 2 years ago (1 child)

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

  • source
  • hideshow 2 child comments
  • [–] 61 points 2 years ago

    vanilla javascript? what are you, fucking Amish?

  • source
  • [–] 53 points 2 years 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.

  • source
  • hideshow 2 child comments
  • load more comments (2 replies)
    [–] 41 points 2 years 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.

  • source
  • hideshow 37 child comments
  • [–] 16 points 2 years 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

  • source
  • parent
  • hideshow 5 child comments
  • load more comments (5 replies)
  • load more comments (33 replies)
    [–] 40 points 2 years ago

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

  • source
  • [–] 36 points 2 years ago (4 children)

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

  • source
  • hideshow 6 child comments
  • load more comments (2 replies)
    [–] 34 points 2 years 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.

  • source
  • hideshow 7 child comments
  • load more comments (7 replies)
    [–] 33 points 2 years 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.

  • source
  • hideshow 2 child comments
  • load more comments (2 replies)
    [–] 33 points 2 years 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.

  • source
  • [–] 31 points 2 years ago (5 children)

    typescript is a bandaid on a severed leg

  • source
  • hideshow 5 child comments
  • load more comments (5 replies)
    [–] 28 points 2 years ago (13 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.

  • source
  • hideshow 18 child comments
  • [–] 14 points 2 years 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.

  • source
  • parent
  • hideshow 4 child comments
  • load more comments (4 replies)
  • [–] 11 points 2 years 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.

  • source
  • parent
  • load more comments (8 replies)
    [–] 22 points 2 years 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...

  • source
  • hideshow 6 child comments
  • [–] 22 points 2 years 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.

  • source
  • parent
  • [–] 12 points 2 years 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.

  • source
  • parent
  • hideshow 7 child comments
  • load more comments (7 replies)
  • load more comments (2 replies)

    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.

  • source
  • [–] 20 points 2 years ago (2 children)

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

  • source
  • hideshow 2 child comments
  • load more comments (2 replies)
    [–] 17 points 2 years ago (1 child)

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

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 16 points 2 years 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)

  • source
  • [–] 14 points 2 years ago* (last edited 2 years 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.

  • source
  • [–] 12 points 2 years ago (7 children)

    Just use Kotlin to write your JS/TS

  • source
  • hideshow 8 child comments
  • load more comments (6 replies)
    [–] 11 points 2 years ago (1 child)
    load more comments (1 reply)
    load more comments
    view more: next ›