function flip(n) {
if (n == 1) {
return 2;
}
return 1;
}
greatest function ever written, it will save humanity and stop the AI takeover
function flip(n) {
if (n == 1) {
return 2;
}
return 1;
}
greatest function ever written, it will save humanity and stop the AI takeover
coding is easy until you make a program with 100+ variables and no comments (how i coded my VCT data program)
100+ variables isn’t that bad. no comments is cancer though, u atleast put small reminders so u don’t have to figure everything out again after being away from it for awhile
i dont really think so
for me atleast, the variables and functions are self explanitory enough though
https://pastebin.com/qM7kyC92
KIWOOM DRX aka "KRX"... absolute terror of a rename
REALLLLLLLL THIS SHIT IS SO ASS
variables are not self explanatory. the whole point of comments is not just to understand what a variable does but how it all comes together to work with the other parts of a function/object/class/file
comments. it isn't documentation because it is more brief and alot less organized
then I have to disagree with your above comment
comments (as in "notes" that are to be read alongside the code) should never be necessary (they ofc are from time to time, however they should be used with purpose)
proper naming + documentation should be used to achieve the goal you described above
(the most practical reason being that your ide shows you documentation, but doesnt show you comments when accessing a function/variable from another location)
So e.g. (from https://realpython.com/documenting-python-code/#commenting-vs-documenting-code)
def say_hello(name):
"""A simple function that says hello... Richie style"""
print(f"Hello {name}, is it me you're looking for?")
vs
def hello_world():
# A simple comment preceding a simple print statement
print("Hello World")
fair
however what you described initially is something you HAVE to have (just in documentation form)
u can put anything u want in comments. if it helps u, u can put it. it isn't always strictly to only describe a simple variable or line
Bruh who need comments anyways, code hygiene is only something told in books to programers once they grow up, a fairytale
I have projects with like over 30000 lines of code without comments but yea it fucking painfull af finding stuff in there. Luckely I've improved a bunch on doing comments
ammo = 0
if ammo == 0:
print("Reloading... ")
else:
print("Fighting ")
print("Reloads mid-fight 🤡")