this post was submitted on 30 Jun 2024
571 points (98.1% liked)
Programmer Humor
19503 readers
1408 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's been a long time, but I'm pretty sure C treats a leading zero as octal in source code. PHP and Node definitely do. Yes, it's a bad convention. It's much worse if that's being done by a runtime function that parses user input, though. I'm pretty sure I've seen that somewhere in the past, but no idea where. Doesn't seem likely to be common.
Node doesn’t.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
You seem to have missed the important phrase "in source code", as well as the entire second part of my comment discussing that runtime functions that parse user input are different.
I read that, but I thought it was a useless qualifier, because everything is source code. You probably meant “in a literal”.