@marcomang6717

I guess real senior write it like the junior version!

@lucassouza5370

No, Seniors write code that juniors can understand

@Code_to_the_Core

PRO: 
print('Odd' if num&1 else "Even")

@Shoppingcartsarecoolfr

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

@lukasjetu9776

printf(number % 2 ? "Odd" : "Even");

@Accountingtalk

Normal if to nested if

@JoseVelandiaR

Real senior (probably using unit tests instead of `main`):
```
def is_odd(number: int) -> bool:
  return bool(number % 2)

def even_or_odd(number: int) -> str:
  message = "Odd" if is_odd(number) else "Even"
  return message

def main():
  print(even_or_odd(4))
  print(even_or_odd(5))
  etc..

if __name__ == '__main__':
  main()
```

@jkli6031

in case anyone cares, in q/kdb:
1 ("even";"odd") number mod 2

@aidenadkisson209

"Clean code" thrown out the window

@eomchy

you can put an if inside a print 😮
i’m very new to program don’t flame me

@aadithyaahil2046

Seniority doesn't come for lines go code instead it's from codes readability on the go, if I am not mistaken

@sonicaxy

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.

@yurisucupira

print('Even' if int(input('Which number? '))%2==0 else 'Odd')

@GIOBLANCO1

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

@thePCchip

Its the same without enter spaces

@totalarvindgaming6079

here is more short code 
number = 4 ; print("even") if number % 2 ==0 else print("odd")

@Nowimcoding

😊😊😊😊😊

@mysticcc210

Come on guys, let’s remember all togheter what Linus Torval once said

@TKZ9

who writes it like the first one?

@sergeydzhagov147

Senior: chatGPT