No, Seniors write code that juniors can understand
junior use chatgpt, mic, Ctrl C, ctrl V
HACKER: print(num & 1 and 'Odd' or 'even')
PRO: print('Odd' if num&1 else "Even")
heres a cool number guessing game i mad (junior coding way) import time import random print("hello, welcome to the number guessing game!") time.sleep(2) print("you will have to guess number from 1, 10") time.sleep(2) print("if you get it right you get a point on your streak!") name = input("hello, what will be your username for this play? ") print("hello, " + name) print("steak so far is 0") time.sleep(3) print("computer is now guessing the number...") time.sleep(2) number = (random.randint(1, 10)) print("number has been chosen") time.sleep(1.5) player_guess = input("what do you think the number is? ") if player_guess == number: print("yay you got 1 on the streak") if player_guess != number: print("oh, sorry you got it wrong. ") time.sleep(1) print("GAME") time.sleep(.5) print("OVER!") hope this was cool, copy it pls
In java it is more easy.
"Clean code" thrown out the window
Seniority doesn't come for lines go code instead it's from codes readability on the go, if I am not mistaken
Normal if to nested if
printf(number % 2 ? "Odd" : "Even");
No. In this case top one is definitely Senior and bottom one is just an idiot way to programming. To be good at coding, it goes to get the most powerful result in the simplest way, not to reveal complex and difficult to understand things. If your code is hard to understand even by yourself, you are a bad programmer.
Come on guys, let’s remember all togheter what Linus Torval once said
both are junior
I would argue the "junior" code is better because it is more easily readable
It looks like seniors are just insane at optimizing codes into shorter formats so systems can get things done faster. I can say “the car I am driving of which I’m steering and controlling the speed, is going fast” and the senior would shorten it to “the car I am driving is going fast” that’s cool to see someone translate code into something more efficient
Neither junior nor senior do this kind of tasks.
it's the same code... ternary or if doesn't change anything...
Senior... could be considered dated. We used to code like this to crunch for space and coders could be that single person doing it all. "Junior" is weening old heads out of the habit because not only that we have more space than we do in the past but we're not working on the same project anymore.
in case anyone cares, in q/kdb: 1 ("even";"odd") number mod 2
@marcomang6717