Live data from Hacker News

Null

popey.com

41–50 of 196 posts

Re: Null

#41
post #7

>While I’m not a QA or security professional, I have developed a knack for doing “stupid” things with software which causes it to malfunction. A person after my own heart. I've had many a dev go "why would you do that" In which I answer "it doesn't matter, but if you accept my input it's your job to ensure the app doesn't crash"

A favourite technique of one of my colleague's was just to mash the keyboard randomly to see if the app breaks. It's very crude and not at all foolproof. For the lack of sophistication it's shockingly effective at highlighting a huge amount of assumptions we make about how software is / can be used.

One of my professors back in college loved to do that. "Shockingly effective" is exactly the right term. Learned a lot from that little exercise.

Re: Null

#42

I worked on an API that regularly got requests from the mobile app for GET /users/(null). I think that's Swift, or Obj-C's way of to-string'ing a null? I have a generational suffix on my name. I often include it, and quite often as the proper Unicode character, e.g., "Ⅲ". (Assuming HN displays it after I post this, try to select it; that's one character.) That wreaks a fair bit of havoc. When I was in high-school, I…

> Every now and then a dev will make a branch with "BranchPrefix/" and the OS X machines all start having issues since OS X's file hierarchy isn't case sensitive. (We've also had issues w/ two files, same name different case. git supports it, but OS X can't cope.)

FWIW macOS is perfectly fine with it. The FS (both HFS+ and APFS) can be configured to work in CI or CS modes. The default is CI. Since git uses the FS for part of its data storage, things break.

That’s more of an issue with Git not supporting CI FS, really.

Re: Null

#43
post #28
post #7

>While I’m not a QA or security professional, I have developed a knack for doing “stupid” things with software which causes it to malfunction. A person after my own heart. I've had many a dev go "why would you do that" In which I answer "it doesn't matter, but if you accept my input it's your job to ensure the app doesn't crash"

Why do you require software to be more resilient than other things? If I pour water in the gastank of my car, it will also fail to drive. Or gas in the sprinkler tank. So the car should somehow prevent the enduser putting the wrong thing in the tank?

The answer to this should vary by the functionality of the software. If I have a program that calculates projected weight loss and it's only used by me on my computer, crashing or displaying obviously incorrect values from accepting negative values for weight or body fat percentage only impacts me so it's mostly a user friendliness issue. If I'm entering my billable time into my employers time tracking system, anything that could corrupt data impacts more than just me. While I could intentionally lie about my billable hours without detection, I shouldn't be able to accidentally or intentionally enter that I worked -5 hours or 5000 hours on a particular day. Accepting either is undesirable and impacts others.

I'm confused why the parent comment is being downvoted. It's a valid question. It might sound naïve to some but it's still worth discussing.

Re: Null

#44

Earlier quoted context omitted.

That’s how C usually prints it. Swift will print “nil”.

Huh. I feel like I distinctly remember it being both one of our mobile clients, and it being the string "(null)". Java, perhaps? (That was our Android app, of course.) Although we did have a desktop app (weirdly) and that was in C++.

> Huh. I feel like I distinctly remember it being both one of our mobile clients, and it being the string "(null)".

Objective-C will do that with the format string "%@" if you pass it nil.

Re: Null

#45
post #3

Reminds me of https://www.wired.com/2015/11/null/ Numerous cases of encoding out of band data as a special case of in-band data.

My browser is set to not accept cookies from sites I don't have a relationship with, because … well, frankly, I don't know why the rest of y'all still let shady people on the Internet use your hard disk for their ad tracking. So, that link (like so many), just plain doesn't work. It just loads a white screen. There are many sites like this on the Internet. Twitter waffles between working and "Ooops! something went wr…

> But it won't persist any settings you change, of course, which is what it uses the cookies for.

Seems dumb not to use local storage (possibly with a cookies fallback though I wouldn’t even bother).

You can also disable LS, but I don’t know that that’s possible on a per-site basis so it’s an unlikely configuration (and you can fallback same as if cookies were disabled, probably).

Re: Null

#46
> A year or so ago, at a company sprint I gave a lightning talk in which I wanted to make the tiniest possible snap

What is a snap in this context?

Re: Null

#47
post #46

> A year or so ago, at a company sprint I gave a lightning talk in which I wanted to make the tiniest possible snap What is a snap in this context?

I would assume it's a Snap package [1], the new (?) packaging system that was somewhat controversial when included in Ubuntu 20.

[1] https://snapcraft.io/

Re: Null

#49
post #28

Earlier quoted context omitted.

Why do you require software to be more resilient than other things? If I pour water in the gastank of my car, it will also fail to drive. Or gas in the sprinkler tank. So the car should somehow prevent the enduser putting the wrong thing in the tank?

> Why do you require software to be more resilient than other things? Because software by virtue of not requiring physical access is much easier for bad actors to mess with. Abuse of such also seems to be classified very differently than abuse of physical systems by human brains e.g. almost no rando would think of putting sugar in your gas tank while walking near your car, but nobody blinks at fucking with your input…

[deleted]

Re: Null

#50
post #5

Declarative programming is something that helps deal with weird edge cases like this right? I'm learning Elixir currently and the subtle semantics around the 'traditional' assignment operator (=) are quite cool. It means you can ditch most if blocks and provide a list of pattern-matchable functions (matched on their arity) to define logic which helps deal with edge cases a little better. I'm curious how such a declar…

I don’t see how a string “null” would break anything besides a very stupidly written program (e.g., one which tries to eval() the input) or an ordinary program written in a very stupid language (e.g., one which tries to coerce strings to other types—PHP, is that you?). I’m a big fan of pattern matching (especially statically verified pattern matching so sorry elixir), but I don’t see how it would help here.

Yes, implicit type casting is the work of the devil. Even the limited case in C is a popular source of trouble, never mind implicitly casting between strings and other types. Similar case with SQL's "NULL".
Post reply on HN