|
Kazinsal posted:
|
# ? Jul 16, 2023 14:54 |
|
|
# ? Jun 8, 2024 07:23 |
|
Surprise T Rex posted:Are Java enums sort of like Union types? From a C# perspective they’re confusing since in C# it’s just a strongly typed list of name-to-Integer mappings. They’re sugar for collections of singletons with special compiler support to let you use them in switch statements, and special support classes like EnumSet and EnumMap that take advantage of the compiler-generated ordinal() method to use them as efficiently as integers in other common situations.
|
# ? Jul 17, 2023 08:44 |
|
motherfucker,
|
# ? Jul 20, 2023 18:59 |
|
Hammerite posted:motherfucker, Not an email address. Yes I know
|
# ? Jul 20, 2023 21:00 |
|
Hammerite posted:motherfucker, your login name is not necessarily the same as your publicly visible steam account name and if like me you only used steam on one pc and had it set to auto sign in you might have not actually seen that login name for years e: wait this is the coding horrors thread not the steam thread
|
# ? Jul 21, 2023 06:43 |
|
Hammerite posted:motherfucker, Phone numbers can only be digits, spaces, parentheses, and a plus sign. Hope this helps. [WONTFIX]
|
# ? Jul 21, 2023 09:59 |
|
https://www.youtube.com/watch?v=t863QfAOmlY
|
# ? Jul 25, 2023 20:10 |
|
Beef posted:I went into a video call expecting a tabs vs spaces discussion when I raised the issue of the baffling seemingly random C code style on a project I'm working on. Sometimes there would be a space between the function name and arglist, sometimes where wouldn't. There are occasional superfluous space after an open brace, which my emacs setups paints in angry red, that I would have to sweep up using whitespace-cleanup before commits. I used to maintain perl written by EE's. EE's generally have funny ideas about software, will get things working once then move on to other problems. This was perl that smashed ASCII together into SQL queries, so just the best possible environment for clever solutions to persist for years. A couple of the genius inventions that I had to deal with included code:
The other incredible move was redefining $\, the newline character, from '\n' to '' so it could slurp a whole file and do one s/// operation instead of "looping" over "lines" like some uncourageous jerk.
|
# ? Jul 25, 2023 21:59 |
|
JawnV6 posted:The other incredible move was redefining $\, the newline character, from '\n' to '' so it could slurp a whole file and do one s/// operation instead of "looping" over "lines" like some uncourageous jerk. Okay, that's worth some electroshock therapy on whoever did that.
|
# ? Jul 25, 2023 22:03 |
|
the horrors of perl can be summed up byJawnV6 posted:redefining $\, the newline character,
|
# ? Jul 25, 2023 22:11 |
|
Look, bash programmers overwrite $IFS all the time so what’s the big deal???
|
# ? Jul 25, 2023 22:43 |
|
JawnV6 posted:I used to maintain perl written by EE's. EE's generally have funny ideas about software, will get things working once then move on to other problems. This was perl that smashed ASCII together into SQL queries, so just the best possible environment for clever solutions to persist for years. when maintaining feral perl you need to act as if it has a long term nuclear waste message around it, e.g. quote:This place is a message... and part of a system of messages... pay attention to it!
|
# ? Jul 25, 2023 23:00 |
|
turning theoretically everything into a single-line expression was
|
# ? Jul 25, 2023 23:08 |
|
JawnV6 posted:The other incredible move was redefining $\, the newline character, from '\n' to '' so it could slurp a whole file and do one s/// operation instead of "looping" over "lines" like some uncourageous jerk. I do that all the time, it’s a great trick, but only in one-liners for some quick data wrangling that I’ve hopeful never committed. But if you’re working in the Boston area: my bad.
|
# ? Jul 25, 2023 23:53 |
|
Hahahahaha "committed" lmao, sure right okay. let me direct you back to the intro: JawnV6 posted:I used to maintain perl written by EE's "commit" wasn't in the vocabulary back there, this landed in my email as a .zip file
|
# ? Jul 26, 2023 00:15 |
|
Dijkstracula posted:Look, bash programmers overwrite $IFS all the time so what’s the big deal??? Not me because apple ripped bash out of macos a version or two ago
|
# ? Jul 26, 2023 01:35 |
|
I was a teenage perl kid, and now my null checks are if (ptr == nullptr) because it makes my meaning explicit and adds some amount of typesafety honestly I can't imagine working in a dynamically typed language for a living. I barely trust my code after it's compiled, letting the compiler yell at me about my many shortcomings is the right move
|
# ? Jul 26, 2023 07:54 |
|
more falafel please posted:I was a teenage perl kid, and now my null checks are if (ptr == nullptr) because it makes my meaning explicit and adds some amount of typesafety Cause I'm just a teenage perl kid baby
|
# ? Jul 26, 2023 13:56 |
|
At my last Perl job the company had developed some functions to do runtime type checking.
|
# ? Jul 26, 2023 14:07 |
|
Bruegels Fuckbooks posted:when maintaining feral perl you need to act as if it has a long term nuclear waste message around it, e.g. I personally prefer the inscription on the Gates of Hell from the Inferno. quote:Per me si va ne la città dolente,
|
# ? Jul 26, 2023 18:27 |
The new I-9 form has a new checkbox and its options are "Off" for unchecked and "Yes" for checked.
|
|
# ? Aug 3, 2023 21:29 |
|
It's like they didn't even consider that the checkbox might be FileNotFound at all
|
# ? Aug 4, 2023 02:44 |
|
Everyone's favorite, the n+1 possible states checkbox
|
# ? Aug 4, 2023 02:49 |
|
Foxfire_ posted:It's like they didn't even consider that the checkbox might be FileNotFound at all You know, it's funny... at work I ended up refactoring our internal permission check result into (roughly) yes, no, and "you are not allowed to know this exists". 404 Not Found. That's me.
|
# ? Aug 4, 2023 03:09 |
|
Macichne Leainig posted:Everyone's favorite, the n+1 possible states checkbox The "checkboxes" in the Microsoft Office Installer... or at least that's what they were when I last installed Office, 3000 years ago. For each item you can toggle between install, do not install, and install on first use. And if you fold out the the more detailed stuff, a fourth option can be chosen, that means "partially selected".
|
# ? Aug 4, 2023 07:23 |
|
i was recently dealing with a ui that had essentially four possible states, but represented them with a two-state toggle control and no other way to disambiguate which state you were in
|
# ? Aug 4, 2023 07:26 |
|
So many booleans evolve into an enum. Like when a nice and simple ReadOnly/Writable boolean becomes a ReadOnly/Writable/WriteOnce.
|
# ? Aug 4, 2023 13:19 |
|
lifg posted:So many booleans evolve into an enum. Like when a nice and simple ReadOnly/Writable boolean becomes a ReadOnly/Writable/WriteOnce. Good thing they're both already the same type.
|
# ? Aug 4, 2023 13:38 |
|
leper khan posted:Good thing they're both already the same type. Except in this one hardcoded instance that’s not going to be touched for 6 months, well after you’ve forgotten about the work.
|
# ? Aug 4, 2023 13:47 |
|
Foxfire_ posted:It's like they didn't even consider that the checkbox might be FileNotFound at all rarbatrol posted:You know, it's funny... at work I ended up refactoring our internal permission check result into (roughly) yes, no, and "you are not allowed to know this exists". 404 Not Found. That's me. I am currently working on a project to add a third return state to an existing workflow that previously only returned "true" or "false." The new state is "we don't know because the remote service didn't respond or responded unintelligibly." True/False/FileNotFound is the only cited reference in the design doc.
|
# ? Aug 4, 2023 14:39 |
Eagerly awaiting the day where all computer logic switches from binary to analog and checkboxes have any value between "unchecked" and "checked" represented by how transparent the checkmark is
|
|
# ? Aug 4, 2023 15:39 |
|
Touch fuzzy logic, get dizzy data.
|
# ? Aug 4, 2023 15:58 |
|
https://github.com/TodePond/Cquote:Arrays quote:Indents quote:String Interpolation
|
# ? Aug 6, 2023 21:32 |
|
I liked thisquote:Mutable data is an anti-pattern. Use the const const const keyword to make a constant constant constant. Its value will become constant and immutable, and will never change. Please be careful with this keyword, as it is very powerful, and will affect all users globally forever. Also this quote:Both variables and constants can be named with any Unicode character or string.
|
# ? Aug 6, 2023 21:55 |
|
The project has a LICENSE.md with this at the topLICENSE.md posted:Congratulations! You found the hidden examples page!
|
# ? Aug 6, 2023 22:03 |
|
This is goddamn brilliant.quote:To declare a function, you can use any letters from the word function (as long as they're in order): quote:You can make classes, but you can only ever make one instance of them. This shouldn't affect how most object-oriented programmers work. quote:To avoid confusion, the delete statement only works with primitive values like numbers, strings, and booleans.
|
# ? Aug 6, 2023 22:24 |
|
quote:You can make classes, but you can only ever make one instance of them. This shouldn't affect how most object-oriented programmers work. quote:When perfection is achieved and there is nothing left to delete, you can do this:
|
# ? Aug 6, 2023 22:43 |
|
Coding Horrors: Booleans are stored as one-and-a-half bits.
|
# ? Aug 6, 2023 23:10 |
|
I just got to how the compiler is implemented and, yeah, that checks out. 99% certain someone is working on a paper on that very compiler architecture, if it's not already published.
|
# ? Aug 6, 2023 23:11 |
|
|
# ? Jun 8, 2024 07:23 |
|
quote:C has a built-in garbage collector that will automatically clean up unused variables. However, if you want to be extra careful, you can specify a lifetime for a variable, with a variety of units.
|
# ? Aug 6, 2023 23:32 |