bleistift2

@[email protected]

This profile is from a federated server and may be incomplete. View on remote instance

bleistift2 OP , to Programmer Humor in Surely "1337" is the same as 1337, right?

PHP and Node definitely do.

Node doesn’t.

> parseInt('077')
77
  1. If the input string, with leading whitespace and possible +/- signs removed, begins with 0x or 0X (a zero, followed by lowercase or uppercase X), radix is assumed to be 16 and the rest of the string is parsed as a hexadecimal number.
  2. If the input string begins with any other value, the radix is 10 (decimal).

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

bleistift2 OP , to Programmer Humor in Surely "1337" is the same as 1337, right?

I’ve also never seen any piece of software that would treat a single leading zero as octal

I thought JavaScript did that, but it turns out it doesn’t. I thought Java did that, but it turns out it doesn’t. Python did it until version 2.7: https://docs.python.org/2.7/library/functions.html#int. C still does it: https://en.cppreference.com/w/c/string/byte/strtol

bleistift2 OP , to Programmer Humor in Surely "1337" is the same as 1337, right?

I’m not sure if you’re getting it, so I’ll explain just in case.

In computer science a few conventions have emerged on how numbers should be interpreted, depending on how they start:

  • decimal (the usual system with digits from 0 to 9): no prefix
  • binary (digits 0 and 1): prefix 0b, so 0b1001110
  • octal (digits 0 through 7): prefix 0, so 0116
  • hexadecimal (digits 0 through 9 and then A through E): prefix 0x, so 0x8E

If your zip code starts with 9, it won’t be interpreted as octal. You’re fine.

bleistift2 , to Programmer Humor in Junior dev VS FAANMG dev

they also pay 3000$/mo for a moldy apartment

bleistift2 , to Programmer Humor in Junior dev VS FAANMG dev

the rule is flagging a false negative

false positive?

bleistift2 OP , to Programmer Humor in Surely "1337" is the same as 1337, right?

Yes, I know the field isn’t nullable in the database. I’m asking you what you are sending me, jack——

(Directed at a colleague)

bleistift2 , to Programmer Humor in Alcohol is my way to turn myself on and off again

Somehow I can tell that this story didn’t go down in the US.

bleistift2 , to Programmer Humor in Alcohol is my way to turn myself on and off again

I wouldn’t have thought that content suitable for talesfromtechsupport would be acceptable here. As the description says,

This is a place where you can post jokes, memes, humor, etc. related to programming!

Customer support is not usually related to programming.

bleistift2 OP , to Programmer Humor in Surely "1337" is the same as 1337, right?

Hell, no. If I wanted to save bytes, I’d use a binary format, or just fucking zip the JSON. Looking at a request-response pair and quickly understanding the transferred data is invaluable.

bleistift2 OP , to Programmer Humor in Trying to understand JSON…

I’m sad that there are people who call themselves developers who need to be told this.

bleistift2 OP , to Programmer Humor in Surely "1337" is the same as 1337, right?

I refuse to validate data that comes from the backend I specifically develop against.

bleistift2 OP , to Programmer Humor in Surely "1337" is the same as 1337, right?

Or even funnier: It gets parsed in octal, which does yield a valid zip code. Good luck finding that.

bleistift2 OP , to Programmer Humor in Trying to understand JSON…

For those who don’t know:

Speaking at a software conference in 2009, Tony Hoare hyperbolically apologized for "inventing" the null reference:[26] [27]

I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.

https://en.wikipedia.org/wiki/Tony_Hoare

bleistift2 , to RPGMemes in I've got a great new armor idea... :)

Sounds like any action move protagonist.

bleistift2 , (edited ) to Programmer Humor in Alcohol is my way to turn myself on and off again

Hey, IT, I imported this data set twice, and now there are a lot of duplicates. Is there something wrong with the tool?

– Yes, that happened.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • kbinchat
  • All magazines