|
Missing "FileNotFound" and "{CompanyName}Yes"
|
# ? Dec 30, 2022 20:38 |
|
|
# ? May 30, 2024 12:58 |
|
Bruegels Fuckbooks posted:Missing "FileNotFound" and "{CompanyName}Yes" My favorite, the 4-state boolean.
|
# ? Dec 30, 2022 20:42 |
|
Macichne Leainig posted:My favorite, the 4-state boolean. This is why you model booleans as varchar in databases, so you can have Y = Yes, N = No, Z = CompanyYes, F= FileNotFound etc. Absolutely brilliant future-proofing.
|
# ? Dec 30, 2022 20:47 |
|
Hammerite posted:Thank god it's documented what each value means
|
# ? Dec 30, 2022 20:54 |
|
Foxfire_ posted:I've written stuff like that when I've had a lint rule to issue warnings on undocumented enum values, and writing the stupid comment is less ugly and easier than suppressing it for those particular lines Hammerite posted:love to see a library in which every property accessor has a documentation string that says either "gets the value of the Foo property" or "sets the value of the Foo property" as though that were helpful to anyone, clearly solely because there is some policy saying that every method and property accessor is required to have a documentation string so they can claim they reach some documentation target perhaps if you have a rule or policy that says everything has to have documentation, and that rule or policy can be satisfied on paper by writing documentation that is obviously totally and utterly useless, that rule or policy is not actually worth imposing or enforcing
|
# ? Dec 30, 2022 21:03 |
|
Hammerite posted:love to see a library in which every property accessor has a documentation string that says either "gets the value of the Foo property" or "sets the value of the Foo property" as though that were helpful to anyone, clearly solely because there is some policy saying that every method and property accessor is required to have a documentation string so they can claim they reach some documentation target This person was trying to pad the size of their commits. Are we sure this isn't the Twitter codebase post-Elon?
|
# ? Dec 30, 2022 21:11 |
|
Foxfire_ posted:I've written stuff like that when I've had a lint rule to issue warnings on undocumented enum values, and writing the stupid comment is less ugly and easier than suppressing it for those particular lines Modify the linter to disable that rule And if it's an open source linter then open a pull request to permanently delete that rule because it is an abomination
|
# ? Dec 30, 2022 21:14 |
|
Hammerite posted:love to see a library in which every property accessor has a documentation string that says either "gets the value of the Foo property" or "sets the value of the Foo property" as though that were helpful to anyone, clearly solely because there is some policy saying that every method and property accessor is required to have a documentation string so they can claim they reach some documentation target sometimes it’s easier to tell your IDE to autogenerate a doc block instead of arguing in a pull request about how confusing a member function called “encodeToBuffer” that takes one parameter called “buffer” really is.
|
# ? Dec 30, 2022 21:19 |
|
biznatchio posted:That's the beauty of it. If it's not written down as a requirement then you still absolutely shouldn't be changing the logic during a refactor! The logic was broken, preserving broken logic is unnecessary
|
# ? Dec 30, 2022 21:19 |
|
Hammerite posted:love to see a library in which every property accessor has a documentation string that says either "gets the value of the Foo property" or "sets the value of the Foo property" as though that were helpful to anyone, clearly solely because there is some policy saying that every method and property accessor is required to have a documentation string so they can claim they reach some documentation target A genuine thing I found in a former employer's web app: code:
|
# ? Dec 30, 2022 21:28 |
|
Variable names are comments.
|
# ? Dec 30, 2022 21:55 |
|
QuarkJets posted:The logic was broken, preserving broken logic is unnecessary As mentioned above, literally none of the people involved in the refactor said anything about the logic being incorrect. The change was presented as being based entirely on a guess by someone who had no idea what the code was for. And as also mentioned above, even if the logic was wrong, you shouldn't mix refactoring with functional changes.
|
# ? Dec 30, 2022 22:33 |
|
biznatchio posted:As mentioned above, literally none of the people involved in the refactor said anything about the logic being incorrect. The Transcript posted:1:18 here's a piece from some sales analysis
|
# ? Dec 31, 2022 00:56 |
|
I think he meant the logic about that particular line. He's right, none of the people in the video even implied there was a bug there. They clearly didn't know why the logic was like that, so the safer thing to do was leave it be. I don't even know why the video even mentioned that the code was buggy because they didn't say whether the bug was fixed or not by the end.
|
# ? Dec 31, 2022 02:52 |
|
qsvui posted:I think he meant the logic about that particular line. He's right, none of the people in the video even implied there was a bug there. They clearly didn't know why the logic was like that, so the safer thing to do was leave it be.
|
# ? Dec 31, 2022 07:31 |
|
qsvui posted:I think he meant the logic about that particular line. He's right, none of the people in the video even implied there was a bug there. They clearly didn't know why the logic was like that, so the safer thing to do was leave it be. There's also that, unless you contrive very specific requirements, the change they made to the line won't actually fix what they guess the intended behavior is supposed to be; and if the system is a fixed-point system (which is a possibility considering the pseudo-language is based on COBOL and Fortran), would in fact make the code more wrong. They suppose "well this condition is 'less than 25%' so this condition should just be 'less than 1/3rd'". If we assume they guessed correct and that's what the logic should actually be, then the change they made does not actually make the code do that comparison -- regardless of whether the underlying system is fixed-point or floating-point -- because .33 is already lower than 1/3rd; and changing the operator doesn't *make* it 1/3rd. But it *does* suddenly mean that 0.33 exactly (which is only possible in fixed-point) would not match the condition, when it should because 0.33 exactly is less than 1/3rd but they just added it to the set of values that will incorrectly fail the condition. There's a test case right there that would have passed pre-change and failed post-change. And in either case, with the change or without the change, values that mathematically would calculate out to >0.33 and <(1/3) -- for example 0.332 (which is >0.33 in floating point comparisons; and rounds to 0.33 in fixed point scale 2) -- would fail the check even though by the presumed logic they should pass it. (Well they'd have passed pre-change fixed-point, but failed post-change fixed-point; but they also fixed >=(1/3) to <0.335 failing pre-change fixed-point but passing post-change fixed-point, so let's call that a wash.) So at best (floating-point) they failed to fix the supposed defect. At worst (fixed-point) they failed to fix the defect and introduced a regression. biznatchio fucked around with this message at 09:37 on Dec 31, 2022 |
# ? Dec 31, 2022 09:20 |
|
I bet this code has lots of unit tests
|
# ? Dec 31, 2022 10:09 |
|
What they did is make the code more fixable.
|
# ? Dec 31, 2022 10:11 |
|
QuarkJets posted:Modify the linter to disable that rule For decades nobody could be assed to change their IDEs to display four space tabs instead of eight (or two if they personally preferred!) Now you expect them to change linter settings, lmao.
|
# ? Dec 31, 2022 11:42 |
|
It's worth noting the end-goal of the video is not how to refactor or troubleshoot code (presumably that would be in another video where they find the real bug), but how to write your code to avoid this sort of error-prone process in the first place. It's obviously contrived since nobody's gonna look at "rr" and immediately guess what it is, every interpretation could be wrong and they don't know it.
|
# ? Dec 31, 2022 13:47 |
|
Hammerite posted:love to see a library in which every property accessor has a documentation string that says either "gets the value of the Foo property" or "sets the value of the Foo property" as though that were helpful to anyone, clearly solely because there is some policy saying that every method and property accessor is required to have a documentation string so they can claim they reach some documentation target and nothing anywhere in any documentation or comment that explains what Foo means
|
# ? Dec 31, 2022 15:10 |
|
They went about this the wrong way. Both should have been changed to less-than-equal-to.
|
# ? Jan 1, 2023 18:13 |
|
Nalin posted:They went about this the wrong way. Both should have been changed to less-than-equal-to. 0.33 should have changed to 1.0/3
|
# ? Jan 1, 2023 19:31 |
|
They should just have rewritten the whole thing in algol
|
# ? Jan 2, 2023 02:37 |
|
Soricidus posted:They should just have rewritten the whole thing in algol Jensen device FTW.
|
# ? Jan 2, 2023 18:55 |
|
The soviets used a pencil
|
# ? Jan 2, 2023 22:02 |
|
Thanks Microsoft.
|
# ? Jan 6, 2023 12:36 |
|
I miss STL's cat examples.
|
# ? Jan 6, 2023 21:37 |
|
The examples are ridiculous but it seems a bit sus to pass this by value in the first place. I guess it’s good for hot paths or something, just seems like a footgun going forward
|
# ? Jan 6, 2023 21:55 |
|
sufficiently small struts perform better when passed by value, because avoiding potential for aliasing makes it simpler for the optimizer to reason about
|
# ? Jan 7, 2023 10:20 |
|
|
# ? Jan 7, 2023 14:36 |
|
The only reason I could think of doing it this way is if you are perversely proud of this hack and want to get asked about it. It's software exhibitionism.
|
# ? Jan 7, 2023 17:24 |
|
lmao software engineers need to be subject to licensing requirements
|
# ? Jan 7, 2023 23:03 |
|
QuarkJets posted:lmao software engineers need to be subject to licensing requirements also language designers, honestly
|
# ? Jan 7, 2023 23:23 |
|
Bruegels Fuckbooks posted:The only reason I could think of doing it this way is if you are perversely proud of this hack and want to get asked about it. It's software exhibitionism. Obfuscation contest for the language.
|
# ? Jan 8, 2023 00:01 |
|
Says way too much about Go when someone uses such a dirty hack of templating and unicode abuse to replicate basic Rust behavior. Or worse, it really is based on ye olde Java templating.
|
# ? Jan 8, 2023 07:02 |
|
If they had just used the word "precompiler" it'd be considered perfectly normal
|
# ? Jan 8, 2023 07:55 |
|
QuarkJets posted:If they had just used the word "precompiler" it'd be considered perfectly normal
|
# ? Jan 8, 2023 10:16 |
|
Unicode was a mistake
|
# ? Jan 8, 2023 11:08 |
|
|
# ? May 30, 2024 12:58 |
|
Sagacity posted:Yes, having to insert Aboriginal characters would then be completely acceptable You mean having the *privilege* of inserting Aboriginal characters
|
# ? Jan 8, 2023 11:13 |