@anze3db @gvwilson i know this isn't the point of this at all, but that python code isn't even good. That multiplication produces a float, so the function should return a float and not an int.
(Editing to clarify: python has dynamic typing, but you can specify types. It's specifying the wrong type which is funny to me)
@Henodudude @anze3db @gvwilson correct me if I'm wrong from years ago but didn't not need to declare variable types?
@UkeBLCatboy @Henodudude @gvwilson types are optional in Python so the suggested code will still run even with incorrect type definitions. Type checking tools like mypy will report an error.
@anze3db @Henodudude @gvwilson Which is why I usually left them out so it's couldn't NOT work due to an error XD
Same reason I always declared EVERY integer in C++ as a long long int even if it was like 5, 1) computers had 16 gb of ram anyway, 2) in my university we didn't get less points for non-optimized code, but we did get points deducted or just a fail if it didn't work. Meaning (combined with 1) ) that anyone with half a braincell quickly learned to write everything in the easiest most
@anze3db @Henodudude @gvwilson obvious straightforward completely unoptimized manner possible XD
Probably not a great habit to learn, but as long as it made everyone pass the courses... xD
@Henodudude @anze3db @gvwilson and to be fully precise, money is decimals and not int or float
@Henodudude @anze3db @gvwilson None of these examples are any good. All of them use an undocumented citationless literal as a multiplier - a Magic Number.
If you're writing code like this, isolate the literals in a module or library, document what they mean, units of measure (if applicable), and cite the source of the data.
# From 2024-11-27 email from Chad in HR (see refs/salary_info.txt
# TODO !ticket_number: Justify why this is not 1.0
female_salary_modifier: float = 0.77
I refactor a lot of legacy engineering code and do V&V on safety-related codes so flagging and fixing Magic Numbers is reflexive. Unsurprising that LLM-fabricated code is both sexist and bad.
@anze3db @gvwilson @GossiTheDog I just need to ask to ensure I understand, there’s code bases the model was trained on out there with this shit in it o_O ?