T
1

My first 'Hello World' program went from 20 lines to 2

When I started learning Python last month, I wrote a script to print 'Hello World' that was a total mess. It had a bunch of extra variables and an if statement for no reason, like 20 lines total. Yesterday I looked back at it and just facepalmed. I rewrote it in literally two lines, just 'print("Hello World")'. It's crazy how much cleaner your code gets once you actually understand the basics. Anyone else have an old beginner project that looks super silly now?
2 comments

Log in to join the discussion

Log In
2 Comments
caseyrivera
I used to think you needed more code to be safe, but now I see less is usually better.
6
jesse_lewis
Yeah, @caseyrivera gets it, less code is just cleaner.
5