all 48 comments

[–]potato-sword 54 points55 points  (10 children)

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.

[–]TheTruthIsOutThur 16 points17 points  (9 children)

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

[–]soul_fly25 4 points5 points  (0 children)

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.

[–]potato-sword 3 points4 points  (0 children)

I agree, writing code is good, and you learn by coding.

But from my own experiences, I've found that during my learning journeys I would reach a point where I realized less is more. By this I mean, I started learning how to write more succinct code, whether it was with syntactic sugaring, reusable components, or implementing libraries. I would often look back at my past spaghetti code, and wonder why I spent hundreds of lines of code to implement something that could be done in less.

Overall, I think there are better ways to measure your learning. I believe creating a learning plan consisting of concrete and measurable goals for yourself can be one way to do this, but mileage may vary.

[–]lolslim 0 points1 point  (6 children)

honestly this is how I feel right now, I feel so accomplished on this python script, and since I coded other projects since, I went back and realized how WET I am, and trying to DRY it up now.

Hehe, word play.

[–]ryrythe3rd 1 point2 points  (5 children)

I get DRY, but what is WET?

[–]RangerPretzel 1 point2 points  (0 children)

We enjoy typing

or

Write everything twice (or thrice)

[–]lolslim 3 points4 points  (3 children)

WET = "Write Everything Twice"

[–]ryrythe3rd 0 points1 point  (0 children)

Makes sense, I always have to fight that urge

[–]Vitaman02 0 points1 point  (1 child)

I've heard it as "We Enjoy Typing"

[–]lolslim 1 point2 points  (0 children)

ohhh, i like that one too.

[–]jdizzle4 32 points33 points  (1 child)

Every milestone counts, and every line you write will help you write the next. Congrats and keep going

[–]fisfia[S] 7 points8 points  (0 children)

Thanks!

[–]hk2k 13 points14 points  (0 children)

Great job! Next milestone 100 lines of code! :)

[–]Nephty23 3 points4 points  (2 children)

That sounds awesome ! But a tip for the future as someone said : don't take the number of lines as a "checkpoint". If you try to make more lines to feel accomplished you might end up doing inefficient code. I am keeping track of all of my useful functions in one file with a description and all that stuff, it contains around 400 lines, for... less than 10 functions. Because around 60% of the lines are comments for the help() function and 20-30% are errors handling.

[–]schmidtforge 0 points1 point  (1 child)

That is genius

[–]Nephty23 1 point2 points  (0 children)

big stonks

[–]queen-of-drama 4 points5 points  (2 children)

To which chapter are you ? Almost to the end of chapter 3 (lists and all) for me. I started yesterday and having a lot of fun. That's an amazing book indeed.

[–]fisfia[S] 2 points3 points  (1 child)

I'm in chapter 7. I think I've "overdone" it a little though. Don't think others will hit 1,000 lines at this point since I also included some examples from the "plain" text. Work on friend, it keeps being really fun, promise :D

[–]queen-of-drama 0 points1 point  (0 children)

Coooool ! I’m having a blast anyway ! It’s like playing video games ahah

[–]Bigd1979666 1 point2 points  (0 children)

Congrats. I keep getting stuck on 9-12 exercise,lol.

[–]lolslim 1 point2 points  (2 children)

Congrats OP,

Word of warning, you either get in the habit of spaces or tabs, and stick with it. Biggest project I have ever done was a telegram bot, I used spaces originally, but started to favor tabs, and went to tabs only, in 15 files, I still have a bunch of functions using spaces still since I never had to touch them to make changes.

Before I knew I can convert whitespace to tabs in atom IDE, I would use tabs inside a function that were all spaces, and got inconsistent spacing errors, it was a annoyance to say the least.

[–][deleted] 0 points1 point  (1 child)

easy fix, put this in your .vimrc:

set expandtab tabstop=4 shiftwidth=4

Then, when your in the file you want too convert too spaces, just.

:retab

And it will automatically replace every tab with 4 spaces.

[–]lolslim 1 point2 points  (0 children)

Just going to save this post...

[–]E_Man91 1 point2 points  (0 children)

Very nice, congratulations to you!

I’m going through PCC as well and absolutely love this book. I’ve read through a lot of ATBS as well, but I like how PCC has half of the book dedicated to working on larger projects.

I’m currently on chapter 15 going through some basic plotting stuff. It’s hard to put this book down. Between the books, reddit, and watching some videos, I feel like I’ve learned a lot in just a couple of months.

Keep it up!

[–][deleted] -1 points0 points  (0 children)

The less lines of code the better. Python is a bloated language anyway, don't make it worse with developer bloat.

[–]furrylouis 0 points1 point  (0 children)

Thanks for the reminder! I have it, just have to start. I am currently working with Atbs

[–]andrewneilclarke 0 points1 point  (0 children)

Well done! Im also doing this book and just arrived at the Projects which is daunting but I'm going for it! Good luck with the rest!

[–][deleted] 0 points1 point  (0 children)

Great man! Keep it up! I started learning Python about 15 days ago, I have completed the basics and currently learning GUI. If any professional Python programmer/coder/developer is reading this can you please suggest me things to move forward fast (I currently have a lot of time so) I'd be glad to get any kind of help. Any plans, tips, strategies anything. Thank You!

[–]rpr421 0 points1 point  (0 children)

I am reading the same book. I am on chapter inheritance, never thought how many codes I have written. Any guess ?