• 15 Posts
  • 261 Comments
Joined 2 years ago
cake
Cake day: June 2nd, 2024

help-circle








  • First do it, then do it right, then do it better. Get the ugly prototype in front of users.

    I tend to agree with that one. I’ve heard it phrased “Don’t ask users what they want. They don’t know. Just give them something to work off of, because they most definitely know what they don’t want”.

    But there’s a catch that I’ve seen twice now: If a feature doesn’t work correctly when you present it, users lose trust and avoid it. That could mean they use the ‘long way around’ when creating entities instead of just copy/pasting them, or that they unnecessarily refresh web pages instead of trusting the state that’s displayed to them.

    Even when you tell them that their behaviour is … not optimal, they stick to it.


  • bleistift2@sopuli.xyztoProgrammer Humor@programming.devso many levels
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    12 days ago

    Soo… Some characters are not valid in URLs (or not used for other reasons) and must be replaced. In this case, the + is percent-encoded to %2B, which renders Loss_(Ctrl+Alt+Del) as Loss_(Ctrl%2BAlt%2BDel), which is a perfectly fine URL (cut off the front for clarity).

    Hower, something on the client (OS, browser) then seems to look at that URL and think that the percent sign cannot be there and encodes that again to yield Loss_(Ctrl%252BAlt%252BDel).

    When Wikipedia looks at this and tries to figure out the page to load, it de-encodes that string back to Loss_(Ctrl%2BAlt%2BDel) and seems to stub its toe on the %2B, if @SpaceNoodle@lemmy.world is to be believed.

    https://en.wikipedia.org/wiki/Percent-encoding



  • The “bypasses” your first link talks about are mostly ways of telling the compiler about types. If I make an HTTP request, how is TypeScript supposed to know of the return type of some arbitrary API? That’s where as Foo comes in. If that makes a language not type safe to you, then you must also throw out the types in Java’s variable declarations.

    Quite a few more of these ‘bypasses’ fall into the category ‘garbage in, garbage out’. If you declare a string index on an object that does not, in fact, return a value for every string passed, what do you expect the compiler to do about it? This is easily fixed by declaring the proper type Partial<{[key: string]: T]>.

    If you declare a variable as an Integer and then let the database driver write a Person reference into that variable, Java will fail in the same way.

    Some of these bypasses are just lies, like “delete operator - Remove required properties”. You cannot delete a mandatory property from a type.

    One thing I grant you that I was reminded of while reading that article is this: Some constructs are simply not expressible in TypeScript (that I know of). For instance, an object that serializes to valid JSON. That could be used to introduce type-unsafety (or whatever the correct term is).

    From your second link:

    TypeScript is indeed type-safe

    Thanks for disproving yourself, I guess.

    The medium article contains good examples, if a bit contrived. Thanks for digging that up.