Live data from Hacker News

Null

popey.com

171–180 of 196 posts

Re: Null

#171

Earlier quoted context omitted.

> But yes, all strings are truthy. Except an empty string! And maybe some little-used nullish characters? Doubtful, but... Or "0"

But not in PHP 8

http://sandbox.onlinephpfunctions.com/code/d6df91536669985a6...

Set it to PHP 8 and click "Execute code," then set it to PHP 7 and Execute again. They give the same result, which is that "0" is falsy in both versions.

Re: Null

#172
If you want to find a bug in your software, make a live demonstration.

Re: Null

#173
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?

> If I pour water in the gastank of my car, it will also fail to drive.

But I'm pretty sure the manual say you shouldn't do that. Like microwaves say you can't put living animals in it.

Re: Null

#174
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?

With physical things, if I do something stupid, I blame myself. With software, if it allows me to do something stupid, I blame the software. Unfortunately, the same mindset carries for clients, employers, and other various people using software who will report said stupidity to me, my client, or my employer.

Like, putting water on the gas tank is obviously wrong, as it's called a gas tank, and gas cars don't tend to run on water.

Clicking a button that was enabled for me and does many things in the background is not so obvious.

Also, cars have been accessible to everyone way longer that PCs and smartphones. Most people alive today (in developed countries/areas) saw their dads driving when they were kids. A person in their 60s didn't have a PC when growing up

Re: Null

#175

Earlier quoted context omitted.

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).

Sorry, I was generalizing a bit for simplicity. I believe the Rust docs do use localStorage. The "cookies" settings in Chrome/Firefox control all the browser's various forms of storage: FF calls it "Cookies and site data". If you disable it, the site can't set cookies or localStorage. (As being able to set localStorage would defeat the point of what the setting is really attempting to control.)

> but I don’t know that that’s possible on a per-site basis so it’s an unlikely configuration

Yeah, if you were using the "Block" settings in "Cookies and site data", for example, that would disable LS on a per-site basis. (I essentially block-by-default, and have an exception of allowed sites in that FF setting.)

(I also have an extension that I wrote to produce a fake, good-for-this-page-load-only localStorage, with two settings: hold the values in RAM, or just /dev/null them. Most sites do not handle localStorage denying access, and essentially crash, so it's handy there, as that works around the poor programming on those sites.)

Re: Null

#176

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…

> When I was in high-school, I took physics. I was assigned to room, say, 309, to a teacher whose name I didn't recognize. But I knew the teacher in room 309, and she even taught physics. So, I approached her, and asked, "I've been assigned 'Ms. Stewart', but it lists her as being in your room. Do you know what the correct room number is, Ms. Cook?" Right room; it was her maiden name, of course.

I'm reasonably certain one of those two 'Ms.' instances should be 'Mrs.'.

Re: Null

#177

> I went through a phase a while back of holding down keys to see what they did. Back when I was a gamedev at EA, one of the things QA would do is button-mash test the games. Just smash as many buttons as they could at the same time at all sorts of random points in the game. This was a constant source of bugs. It was surprisingly easy to get the game into a state where it was totally hung because of this. One of the…

Sounds right, I've even had a lot of modern games crash or hang when the action gets hot and I'm spamming inputs (Path of Exile was frequent, but even Hades crashed the other day like this).

Re: Null

#178

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…

> When I was in high-school, I took physics. I was assigned to room, say, 309, to a teacher whose name I didn't recognize. But I knew the teacher in room 309, and she even taught physics. So, I approached her, and asked, "I've been assigned 'Ms. Stewart', but it lists her as being in your room. Do you know what the correct room number is, Ms. Cook?" Right room; it was her maiden name, of course. I'm reasonably certai…

Traditionally yes, but there's no legal requirement and many people don't feel the need to make the change (my wife being one).

Re: Null

#179

Earlier quoted context omitted.

Couldn't you just stop receiving keypresses when a UI transition begins and then re-enable input once the new UI state has been established?

The problem is "key down" and "key up" are usually separate events. If you write software in a way that you always expect a "key up" to be preceded by a "key down", you'll have problems like the above mentioned.

Seems like a great place to use state machines. That’s not a total solution, of course: if “hold X” and “hold A” have very different behaviors, developers still have to code those states to be exclusive...unless they shouldn’t be. Ain’t easy, that’s for sure.

A robust solution should probably use state machines coupled with generative testing, so that all of those unexpected combinations can be generated and handled before the testers try button-mashing, without relying on developers to think of and write all the individual test cases.

Re: Null

#180

I understand Gary Null has had some experiences.

Fun story: At work, we were learning how to use a new browser tool that was put together at the last minute. Plenty of people were having trouble logging in, so the instructor had one of the people share their screen so he could help. The user's profile showed: "name: null", which prompted someone to observe "I see your name is null, too". I interrupted with "yes, it is a family name". Good laughs were had.
Post reply on HN