r/learnpython • • Nov 27 '20

Milestone - 1,000 lines of code - TU r/learnpython!

Hi friends,

Just wanted to tell you all that I reached my first 1,000 lines of Python code (wanted to show a pic, but not allowed). I'm going through the book Python Crash Course, 2nd edition and doing all the exercises and some of the examples. Strongly recommend this resource, as so many others already have done. Also, I want to say a huge thank you to this community! I wouldn't have come this far without you <3

333 Upvotes

49 comments sorted by

View all comments

54

u/potato-sword Nov 27 '20

Congrats! Just a suggestion for the future, try not to measure your learning / success by lines of code written as there is no correlation between the two.

You may find yourself refactoring code to increase reusability which can reduce the number of lines. As well, you may be able to accomplish some tasks in just a couple lines depending on the implementation. For example, using a list comprehension instead of a for loop.

17

u/TheTruthIsOutThur Nov 27 '20

I'm not sure I'd say there's no correlation. Lines of code is a metric of time spent coding, and I definitely would say the more you practice the better you are. Even if these 1000 lines OP is mentioning are garbage, I bet OP is a lot more competent now than before they wrote them.

That said. "Time spent coding" is probably more correlated haha

5

u/soul_fly25 Nov 27 '20

I agree, I would not say there is no correlation and I 100% back the more practice the better. Coding is a skill that requires constant practice. But practice doesn't consist of purely writing code. Lines of code written is a shit metric of measurement as it doesn't account for any real world factors.

Things like complexity of the problem being solved, reading and understanding the existing code base you're going to add to or fix a bug in, design and architecture, hashing out stakeholder requirements etc.. all require significant practice. But if you're looking at how many lines of code did you write, you're ignoring the value that all these other things bring to the code you do write.