4 ms·
const int EIGHT = 8 lol I really doubt any AI (even some small local models) would actually generate something like this :)
by dryarzeg 9mo ago
const int EIGHT = 8 lol
I really doubt any AI (even some small local models) would actually generate something like this :)
- Alifatisk 9mo agoYeah, I don’t think this is a case of ai slop. LLMs tend to be verbose with the comments but are fine with magic constants, at least from my experience.
- SomeUserName432 9mo agoI've run into something akin to `const int EIGHT = 7`. Courtesy of TCS.
- bobx11 9mo agoAgreed. This reads more like a very junior dev reads static analysis warnings and extracts it into a constant to satisfy the ide. An LLM would at least give the constant a slightly abstracted name.
- hulitu 9mo ago> const int EIGHT = 8 lol > “The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.” > — Early FORTRAN manual for Xerox Computers, attributed to David H. Owens.