programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Lowpast, in the myth of type safety

Sounds like you don’t know how to properly use TypeScript…

Zangoose,
@Zangoose@lemmy.world avatar

If I had the willpower or time to go through a multi-thousand line (not including the html templates) legacy Angular 6 codebase where almost every property is typed ‘any’ then I assure you I would have, it’s driving me insane 🙃, also why I prefer backend

roadrunner_ex,
@roadrunner_ex@lemmy.ca avatar

I kinda feel your pain. A project that I helped launch is written in Typescript technically, but the actual on-the-ground developers were averse to using type safety, so any is used everywhere. So, it becomes worst of both worlds, and the code is a mess (I don’t have authority in the project anymore, and wouldn’t touch it even if I could).

I’m also annoyed at some level because some of the devs are pretty junior, and I fear they are going to go forward thinking Typescript or type safety in general is bad, which hurts my type-safety-loving-soul

Zangoose,
@Zangoose@lemmy.world avatar

In theory I’m a fan of the inferred but static typing systems that most modern languages use (kotlin, rust, TS, etc.) where most local variable types can be inferred and only return types/object fields/parameters need explicit types.

I just despise typescript because it feels more like someone put a bandaid over JavaScript and all of its oddities instead of making a properly fleshed out language, and allowing the option for an ‘any’ type to be used freely by default emphasizes that.

Zikeji,

Based on your description it sounds like you haven’t given it a fair shake. I’ll take TS over JS any day, at least there is room for improvement. I will say however I personally haven’t been unlucky enough to run into projects that abuse the any type. The worst I’ve run into is a JS library with no typings I have to manually type.

Knusper,

I imagine what they mean is e.g. that TypeScript can tell you something is a Date, but it doesn’t attempt to fix some of the confusing, quirky behaviour with that: developer.mozilla.org/en-US/docs/Web/…/Date#inter…

So, yes, it’s generally better than JS, but it doesn’t actually make it good/attractive, if you’re used to the sanity of backend languages. It very much feels like lipstick on a pig.

Zangoose,
@Zangoose@lemmy.world avatar

Exactly this. I’d rather use TypeScript than regular JS, but I enjoy using almost any other statically-typed language more (except maybe C++) because TS has the potential to be just as bad as JS for codebases where it isn’t being used correctly (this is true for other languages as well but it’s usually a lot more obvious).

Not that it isn’t possible to have good typescript code, but rather that code becomes a lot harder to maintain because of problems that could’ve been prevented at a language level (truthy/falsey logic, ‘any’ type being allowed by default rather than ‘unknown,’ etc)

Traister101,

TypeScript is JavaScript and not in the literal it’s compiled to JS sense but in the think of TS as a linter not a language sense.

Lowpast,

One file at a time. Make strong pre-commit eslint rules (that way you don’t impact existing code), eventually update tsconfig. You’ll get there :)

walter_wiggles,

Print the code out and burn it

0xSim,

The boy scout technique: fix your types when you're working on a bug or a feature, one file at a time. Also try to use unknown instead of any for more sensitive parts, it will force you to typecheck.

WhatAmLemmy,

The fuck the lemons technique: resign and seek an employer that didn’t fail at the most basic level of engineering management and development culture for years and years — because life is short and we’re all running out of time… always.

When life hands you lemons, just say fuck the lemons and bail

DudeDudenson, (edited )

resign and seek an employer that didn’t fail at the most basic level of engineering management and development culture for years and years

So basically change careers

Hupf,

combustible lemon

griD, in We've come a long way baby

I really like how my meme proliferates along this 'verse :) I hope the discussions ITT are as nice as in mine.

redcalcium, (edited ) in We've come a long way baby

Combine this with Chrome enforcing manifest v3 starting at June 2024, YouTube ads will be virtually unblockable on Chrome, even with an ads blocking extension installed because Google will be controlling the ad blocking mechanism used by the ad blocker. They can arbitrarily reduce the max number of the blocking rulesets, how often the extension can update the rulesets, or even elect to skip running any rulesets that target YouTube or Google domains.

technom, (edited )

They can arbitrarily reduce the max number of the blocking rulesets, how often the extension can update the rulesets

The size is already just 50. Those who think that adblocking is possible with this are fooling themselves.

or even elect to skip running any rulesets that target YouTube or Google domains.

If anybody acts surprised when it happens, they’re probably too stupid to be allowed on the web.

words_number,

Yes, I can’t wait! Firefox usage will skyrocket :D

lseif,

i hope so, but sadly many users are just stubborn and lazy.

Copatus,

That’s sort of better for the people who migrate then, no?

If the average user just decides to deal with ads that means it won’t be worth the effort to go after the minority of people who will be AdBlocking

lseif,

good point

technom,

They could instead severely cripple or outright block Firefox users. Since we are the minority, it won’t affect them. They will just blame it on Firefox and wash their hands off.

xavi,

deleted_by_moderator

  • Loading...
  • jballs, in We've come a long way baby
    @jballs@sh.itjust.works avatar

    I read in a different post that the code was misinterpreted to be a 5 second sleep before showing the video, but instead was waiting 5 seconds to execute some anti-ad-block script. Still pretty sleazy either way.

    A_Very_Big_Fan, (edited )

    There’s a video going around of a guy using a useragent spoofer to prove that it only does this on non-Chromium browsers. So I don’t think it’s necessarily anti-adblock, but it could be interpreted that way when you consider Google’s plans to implement DRM in Chromium.

    vpklotar,

    Had a look at Louise Rossmans video yesterday about this and from what he showed he got it on all browsers.

    Video: https://youtu.be/_x7NSw0Irc0?si=My5Nurw4XqdjDH8l

    Solemarc,

    When I went rooting around to find it. I figured it was some QA process that starts 5 seconds after the video loads (the timer seems to be async and the code sends a promise off while it waits). Of course, it’s all minified JS so it’s a huge pain to read.

    dingleberry, in haha patents

    Even more likely: have been using GPL libraries without a care in the world.

    onlinepersona, in Yes

    The dude on the right is some neckbeard who yells “RTFM” and “i use Arch btw ;)” IRL.

    Blackmist, in Me trying to fix a complex bug that's not important

    That moment where you finally convince your boss it’s not worth fixing, and then you instantly think of a way to easily solve it.

    lurch, in Password requirements are getting out of hand

    Pretty unsafe, because it makes people prefer big letters, i.e. W

    plistig,

    That’s why my password consists exclusively out of Assyrian cuneiform letters, e.g.

    https://en.wiktionary.org/wiki/File:Assyrian_cuneiform_U12030_MesZL_293.svg

    Yes, that’s one letter.

    candyman337, in Password requirements are getting out of hand

    “Password length requirements: 6 inches”

    Guy tries to make an account

    “Password requirements not met”

    “Bro I swear that’s 6 inches 😢”

    dingleberry,

    Can’t login when it’s cold.

    mattd,

    My password was in the pool!

    Matombo, in Welcome to the wonderful world of code obfuscation

    Ok another US local units are retarded rant: it’s called weekEND! why do you start your week at sunday and not monday! Sunday is part of the weekEND!

    teft, in Me trying to fix a complex bug that's not important
    @teft@startrek.website avatar

    How some people are in comments. Always gotta get that one last comment in the chain in.

    ErKaf,

    I disagree

    DieguiTux8623, in me_irl

    The worst case is when someone requires changes, you address them, but then they disappear/go on a leave.

    If the repository rules require all conversations to be resolved before merging and only the original reviewer can mark them as solved, the PR is stuck forever even if the rest of the team approves it.

    DeltaTangoLima, in Debugging
    @DeltaTangoLima@reddrefuge.com avatar

    My biggest problem isn’t discovering my own crime. It’s trying to determine what my motive was at the time.

    Gormadt,
    @Gormadt@lemmy.blahaj.zone avatar

    Usually my motive is, “It’s 3am I’ll just put this temp placeholder here and fix it in the morning.”

    Proceeds to not fix it due to forgetting by the morning

    AnarchoSnowPlow, in me_irl

    Also me waiting for the junior dev to address review comments satisfactorily.

    henfredemars, in Debugging

    You’re sure that there was a crime? You’re fortunate that your bug is consistently reproducible.

    Gormadt,
    @Gormadt@lemmy.blahaj.zone avatar

    My “favorite” is when following the steps to reproduce a specific bug you get an entirely different bug then what was reported

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #