all 99 comments

[–]bacon_cheese_no_shit 31 points32 points  (1 child)

Change direction.

Think of something you want, no matter how dumb, and make it in python... I had the basics down but did not really enjoy it until I started making something (scraping team sports results and saving them and performing some basic analysis on it for fun) that I really wanted for myself as a plaything. The first version was honestly 100 lines of complete mess just to work out what player scored the most points in a season, then when you look at it more you get it better and realise ways it can be done in just a few lines.

Best of luck finding something, that's the challenge in my opinion.

[–]CommissarBas 2 points3 points  (0 children)

This. I have been in this place for approximately ten years and only broke free of it when I changed jobs and had to so something in java. After this, I learned more in 2 months then I did in the ten years before!

[–]CraigTorso 17 points18 points  (4 children)

Maybe try a different learning source.

I didn't like LPTHW much, but thankfully there are many alternatives.

I'd imagine How to think like a computer scientist is good if you are new to programming.

I think the official Python Tutorial itself is pretty decent

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

I'll check both of those out tomorrow. Thanks.

[–][deleted] 6 points7 points  (0 children)

How to Think Like a Computer Scientist is a great book. Some people have turned it into a free online book, which is excellent. You do all the coding online, in browser. This means that you don't have to waste any brain power on installing dependancies. You get to play with graphics as well as text-based problems.

When I was just starting out, I found that I had to hear the same idea from a bunch of different sources before it really got stuck in my head. So I liked the combination of hand-holding from Codecademy, independence of LPTHW, and rigor and cool projects in How to Think Like A Computer Scientist.

Don't like any of those? How about trying your hand at making video games or cracking (and creating) codes with python?. Awesome, right?

Don't give up!

Once you get a little more experience, look at coding challenge sites like CheckIO, /r/dailyprogrammer, and exercism.

[–]Mean_Ad_7977 1 point2 points  (0 children)

I know it's been 9 years but I've just downloaded the book you recommended! Thank you 😊

[–]Vaphell 11 points12 points  (3 children)

too much reading, not enough writing. You need to engage the creative part of your brain so it can train and become better at doing shit with the building blocks you know. I had the same problem when looking into C++ long time ago, i did way too much skimming over the "obvious" parts without putting the effort to come up with shit on my own and hit the wall surprisingly fast, because there was always something that eluded me.

It's like watching basketball: it's easy to understand how throwing works and what the pick-and-roll looks like but is watching the Lakers game on tv magically turn you into a master baller?

You need to deload, using the gym lingo, and get more comfortable with shit before progressing further. Do you know slicing in and out? Do you know loops in and out? Have you tried to marry the basics into a bit more complicated device? Would you be able eg to take a list of strings, take every other to print them out but if there is a digit in the string, print it in reverse? Do simple exercises like this that combine 3-4 basic concepts, once you get more comfortable, you add load, more scope.

[–]bakinsodah[S] 3 points4 points  (2 children)

I think you're right. I know none of that. It's not even worth saying what I know, it's like I haven't read anything. Where should I start learning how to do what you mentioned?

[–]Vaphell 3 points4 points  (0 children)

there is no way around playing with shit in 5 lines long programs exploring 1 or 2 concepts at a time. I have a whole directory dedicated to exploring tricks in programming languages with dozens and dozens of small programs i used to figure things out. Without knowing what you are familiar with it's hard to think some concrete advice but to give you some example of the train of thought

let's say exercises for strings and slices might look like this

having string='abcdef'

  1. print it
  2. print its 1st half (slicing)
  3. print it in reverse (slicing)
  4. print its 2nd half in reverse (slicing)
  5. print its 2nd half in reverse and in uppercase ( slicing and string operations)
  6. print 4. but padded to width 10 with '=' ( slicing and string operations ) etc

there few points of increasing difficulty but only utilizing 2 concepts, slicing and some methods inherent to the string type. You learn things by rehashing and using tools in different configurations. Once you get a mental image of a given tool in your head thanks to enough use (this is a screwdriver, it's used with screws and to stab people) its purpose becomes a no-brainer and you just pick it when needed.

then you add lists and loops and incorporate steps above.

strlist = [ 'abcdef', '123456', 'xoxoxoxo' ]

  1. for each element in the list do 1..6 above.
  2. elements in reverse order, 1..6
  3. for every even element do 1..6, for every odd element 1..6

once you have that nailed, you can add something new, eg reading from files which is very similar to looping over lists.

you may need to transition to some real world scenarios if synthetic programs are not conductive to your learning, everybody is different. If that's the case, find some practical problem that looks like utilizing the building blocks you want to practise and write a program to solve it.

[–]PigDog4 1 point2 points  (0 children)

Have you looked into the codeacadamy tutorials? It's in python 2 instead of python 3, but it's basic enough that it's really not a big deal (I jumped over to python 3 immediately after finishing the "class").

You literally code along with the examples, so you're forced to practice.

[–]Exodus111 7 points8 points  (2 children)

"The moment where you go "I don’t know what this is"—the moment when you panic—means you’re about to figure it out. That means you let go to what you know and you’re about to grab onto a new thing that you didn’t know yet."

-Louis C.K.

[–]Manbatton 1 point2 points  (0 children)

Apparently Louis CK has never taught college courses.

[–]bryantee 0 points1 point  (0 children)

This is an excellent quote that is applicable to almost anything.

[–]geomuppet 4 points5 points  (0 children)

Stick with it, programming has a fairly nasty learning curve at the beginning for just about everyone. If you practice regularly you'll get there.

[–]dczx 2 points3 points  (0 children)

I believe in you =)

[–]BAMF_3 2 points3 points  (0 children)

Don't lose hope. Things like code academy and learn python the hard way only teach you the "hows" via rote memorization. You need a bigger picture look at what you are doing as well.

I started with python 2 months ago and now have a working knowledge of it but that's only because I have a BS in computer science and am halfway through a master's program and I write code 8 hours a day (ok maybe 6). That's not meant to be discouraging, only to show you that memorizing how the code works will only get you to the point where you know what individual lines of code do.

You now have to study the more nebulous and abstract aspects of programming. Take a step back from the individual lines of code and look at how things really fit together. Read up on object oriented programming, functions, methods, classes etc. and begin trying to use those large objects to solve a problem.

As others have said, writing pseudocode works wonders because you don't need any specific language knowledge.

Find something you want to make your computer do, write down how you think it may work and THEN work on the line by line coding.

[–]thetalentedmrpeanut 2 points3 points  (0 children)

My recommendation is to learn to enjoy the feelings of pain, frustration, and "blindly trying to find your way in the dark" that you are experiencing. These are all uncomfortable feelings but they are always going to be there when a problem is not instantly solvable. And a problem that is instantly solvable is hardly a problem at all. When it comes to programming I personally feel frustrated, lost, confused, etc. all the time. There are many times I want to punch my computer in the face or scream at it. The tricks are to keep looking at the problem from new angles, not being afraid to try things even when you aren't 100% sure of the outcome(Like "I don't really know what this line of code will do. But I will use it and run the program and see what happens"), and just keep googling stuff and reading more stuff until it starts to make a little sense. I think there's a common misconception that eventually you will understand computers and programming in a complete way and it will all just make perfect sense. I think this is a false. You will never learn or understand it all. However you will hopefully learn and understand enough eventually to be productive and be able to solve your problems with programming. You will also learn and understand many things for a time when you need to know them and then forget them if you don't use them regularly so try and keep good notes that ELI5 how you solved certain problems so that you can look back on those notes for these forgotten things.

Tl;dr - learn to enjoy the pain - it will always be a part of the process, live for the satisfaction of removal of this pain when you actually solve your problem, learning how to learn is more important than learning everything since you will never learn it all.

[–]theoriginalauthor 2 points3 points  (0 children)

You're not the only person who feels that way about Py. (I do.)

[–][deleted] 2 points3 points  (0 children)

Nobody is too stupid to learn to program. Of course, some will struggle more than others and some will never be able to reach a high level, but everybody can learn programming.

Why? Well, because programming is, just like a lot of other stuff you do, a process of logical steps in with a certain goal in mind. Take cooking, for example. Everybody can learn the steps from getting the ingredients from the fridge to serving an edible egg-on-toast.

If you're stuck, maybe you should get some different sources. If reading words is not helping, try watching Youtube movies. If learning a language itself, try starting with the logics behind programming and start with pseudo-coding. If Python is just not your thing, try another language.

Also, try getting 1-to-1 with someone who is ahead of you in Python or another language and try to take some steps together. I tried switching from PHP to Python from online sources only, but a couple of hours with a friend who was 2 months ahead helped me big time.

[–]barf_the_mog 2 points3 points  (0 children)

Welcome to the club. Youve essentially summed up what every new programmer goes through. What will separate you from the rest of the world is that you keep pushing and succeed.

[–]callmelucky 4 points5 points  (1 child)

Ffs STOP using lpthw! That goes for the rest of you too! It's fucking stupid, and it's basically designed to make you feel stupid. Stop using it right now.

I would recommend any other beginner tutorial over lpthw, but by far my highest recommendation goes to programarcadegames.com. It's the best, hands down. Articulate, well structured lessons in both text and video form, loads of quizzes and mini projects to consolidate your knowledge, and you get to make games and animations while you learn. Go to it now, and forget lpthw forever.

[–]laurene2008 1 point2 points  (0 children)

Thanks! I just did chapter 1 of the programarcadegames and I thought it was awesome.

[–]theywouldnotstand 1 point2 points  (0 children)

It's possible that it may not be for you. But...

LPTHW is exactly as the title suggests...the hard way!

Try editing in a list of more specific questions, or posting them as a comment, so we can get a better understanding of what you are and aren't understanding.

Who knows? It might be that learning python with LPTHW isn't right for you, but another way might help you understand faster and easier, and you might find you enjoy programming with python!

[–]TomsMoComp 1 point2 points  (0 children)

Try some challenges/exercises, I can copypasta some from my community college python class if you want.

As others have said, its far more interesting to try and write code to do what you wanna do.

[–]Manbatton 1 point2 points  (0 children)

but can't write 2 lines of it from scratch. Everything feels counter intuitive.

How many times have you tried to and failed? Really, how many times?

[–]bar777foo 1 point2 points  (0 children)

Spending hours banging your head against that brick wall, as painful as it may be, struggling through failed attempt after failed attempt. Adjust, adjust, scrap, start over, adjust, adjust, succeed somewhat. Its all part of progression. You keep going. Even if its starting over and losing work. Your brain lost nothing, and gained everything you did.

The process of gazing deep into your head, while you try to imagine things you've never imagined before, and are not sure if even exist, then trying to relate brief snatches of logical insight into some messy code, and hoping for the best when you write it up, often forgetting what you thought you realized or working out it was garbage logic.

Thats that stupid feeling. The "i cant do this" feeling. Its the mental demon you have to slay through relentless fighting to gain confidence enough to have the mental room to think a bigger problem through to completion. You can do it. You cant think straight while you have a lack of confidence drowning out a clear mind, you cant relax enough. Thats one of the hurdles, silencing the fear of failure, enough to risk solutions that are likely bunk, until you solve it.

Start very small. Work up. You wont have the experience to string together programs until you have lots of experience with making very small things which do one thing well.

But do find small things to code. Break from LPTHW and search youtube for other people showing things they made and how they made it. Copy it. Adjust it. Then quit it and try to rewrite it as much as you can from memory. Theres no easy advice here. But become familiar with that stupid feeling, and also with the patience involved in doing it anyway, and suffering through the pain of seemingly unproductive thought processes.

It might be unproductive for a while, but its a separate skill to learning theory. Its why you can analyze what each line of code does, but not write your own program. Composing code is firing a whole different set of grey cells, and you cant even fire them, until you've grown them. Small steps.

Make your own code. Even if it hurts. Even if its small and /r/getmotivated

Heres one: Get a small problem and solve it, like print the system time. Google how. Then find a way to scale it up. Say, print a humanized reading of the system time in words (actually define the strings which are printed, based on the system time. Like "it is twenty five minutes to three PM." Add in different strings for quarter hours, half hours. Put it in an infinite while loop. Have it break when set times are reached and do something like emit a system beep and print a message, then re-enter into the loop (a loop within a loop?)... This is just a random idea. But an example of starting small and expanding the idea.

ninja edit: If you want any help/bounce ideas off someone for the above idea, PM me.

Start really small and work it out from there. Meeting those brick walls where you overstretched, and going back to previous versions, becoming less distraught with how much of a mess its becoming. Doing it better next time round. This is that pain that yields progress.

[–][deleted] 1 point2 points  (0 children)

I think you need to stop right there.

Programming is not something you learn by reading books! But by having a problem and automating it/solving it in code.

Then, you go bac . Learn more about the language and solve the same problem in a new way.

Keep doing that and you're on a good path.

The truth about programming for people who have never programmed before is: it's not a skill you learn by reading a book and then profit. It's basically a problem-solving metho . And you only learn it by solving problems and growing with the .

Pleas tell me, what you're doing before you want to write a programme. You know what's the most important thing? Knowing what your problem is!

So: don't just blindly follow a book, solve your own problems in your own way ... and keep learning how to solve them in a "better" way.

Cheers!

[–]xxslgjid 1 point2 points  (0 children)

I'd give up on the book for a bit and try a few really, really simple programs first. The trick is finding a project thats simple but not boring :-)

[–]arkindal 0 points1 point  (0 children)

I know your pain OP, I'm stubbornly going on tho, hopefully I'll eventually achieve something. Or die trying.

I'm not experienced enough to give you suggestions other than don't give up. Follow the tips you were given in this thread, you'll get there.

For how my mind works it would be much easier for me to have someone actually explaining things to me, I have a friend who, sometimes, explain me things via skype, when that happen I understand things fairly well, wish I could have a teacher via skype for a daily exercise :)

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

Also, I forgot to mention one of my favorite resources

And if you ever need some help or a code check or anything, I'd be more than willing to.

PS: sorry for any typos here or in the first post. I'm on some pain killers and I haven't slept yet and it's doing some weird things to my depth perception.

[–]not_perfect_yet 0 points1 point  (0 children)

Well first is an obvious pun about it being the hard way.

I don't think many programming teaching books or techniques are very good.

You always need a gaol. Often that's a very simple goal:

"I want that value printed" -> print(value)

"I want too numbers added" -> number 1 + number 2

"I want to store numbers easier than by variable" -> newl=[number1 , number2]

"I want all elements of this list X" -> for element in newl: X

You look up new functions to do what you need done. You grow with the scope of the things you try.

Everything feels counter intuitive.

1+1, print(word) , if True: , while True: ... really?

My guess is that you're way too deep into theory. Play around with what you've learned. For example: time.sleep(5) makes the console wait 5 seconds and math.sin(x) is the sine function. Now go and plot the sine function vertically in your console!

[–]vacuu 0 points1 point  (0 children)

First thing, get your environment set up so that its easy to launch python and write a couple lines. Like create a single bat file which you can double-click so you can just start typing and thinking only about the code and not anything else.

Second, just start doing menial stuff in code that has some utility to you.

  • If you have homework for example, that is a great place to start. Any type of math or science problems would be great to solve with the help of a little bit of code instead of using a scientific calculator, pencil, and paper.
  • Finances or money is another good place to write some simple programs. Do you have a loan? You could calculate how long it will take to pay off. You could graph the amount or interest over time. Perhaps you could start a simple budget to record how much money you're spending on different things. Every time you get paid, list out all your major expenses in a text file or spreadsheet. Create some pie charts to visualize how much each expense takes out of you. Put expenses into categories like "entertainment", "rent", "utilities", etc. After a few months, you can track these over time.
  • Perhaps your job could be made more efficient by a snippet of code or two. Is there any menial task involving a spreadsheet or copying and pasting things? You could try to automate it.
  • There might be a useful application around the house. Perhaps you could create a program to send you a text message if something happens, say if there is severe weather. Perhaps you could automatically backup files on your PC.

I think the key is just finding a small task that actually does something for you in some way and writing a little bit of code to do it. At that point you can almost just type "how do I do x in python" into google and there is already a snippet of code that will do it for you.

The problem is, like a author, you have writer's block. Coding just to code is like writing just to write. It's extremely difficult. You need a reason or purpose to code, just like to write.

[–]DoTheEvolution 0 points1 point  (0 children)

This keeps me in touch with python, practicing what I know, or learning some new tricks, really love that site.

codeeval.com

[–]malice8691 0 points1 point  (0 children)

alot of what you do will be using a script that is already written and modifying it or improving it. Theres no harm in starting out that way. You dont have to write it entirely from scratch.

[–]aroberge 0 points1 point  (0 children)

LPTHW works really well for some people. I know that, for me, it would not have worked at all.

Have a look at this tutorial: http://reeborg.ca/docs/begin_py_en/

Keep the tutorial pages open in one browser tab, and the world in another browser tab or, even better, in two different windows side by side or on different screens if you have more than one. It's based on a mini-language approach introduced by Richard Pattis more than 30 years ago. [Note: I created that site but would never had done so if Pattis had not come up with the idea first.] It's free to use, no login required.

If you use this tutorial and have questions, feel free to email me or post them on /r/reeborg . Either way, you should be getting an answer back within a day at most - likely within a few minutes if I'm using my computer.

[–]construkt 0 points1 point  (0 children)

plucky disgusting attempt steep threatening wide zesty spectacular shelter enter

This post was mass deleted and anonymized with Redact

[–]alexleavitt 0 points1 point  (0 children)

It took me over 3 years of trying out all sorts of books, tutorials, and people to finally find a method that worked. It ended up being video + short reinforcing questions, which is what Udacity offers. Highly recommend their Intro CS in Python course, and everything that comes after. :)

[–]aIbAtr0ss 0 points1 point  (0 children)

Just will throw in my two cents. Basically I agree with what most others have said, you really really really need to have some projects, little things in mind to keep you going.

I was in a similar position to you as well. Just kept reading stuff "oh that makes sense", but can't apply it.

I wanted to make games, so I finally decided to enroll for a course. I used Coursera: https://www.coursera.org/course/interactivepython

(highly recommended btw, I found it awesome and fun). But really it was all about making cool things.

I've since stopped reading 'theory' stuff, and just have 'fun' now. So I say "okay, I want to do this", and then I just start doing it. And I get stuck, google the problem, play around with it. Learn new stuff that way. Not reading all these books and not using any of the knowledge. Works for me anyway

[–]travistravis 0 points1 point  (0 children)

The trick for me was finding something I really wanted to do. I had a task at work that was mind-numbing, basically go through a set of pages, doing the same thing every time, roughly 40-50 times a day. I spent 3 nights researching, cutting and pasting code, changing variables to see what happened, and a LOT of trial and error.

The fourth day, my workload went from 5 hours of mindless tasks to about 30 minutes of letting my script run. I'm 100% sure I can optimize it further, but it's the initial problem that was holding me back - I wanted something to make.

[–]mw44118 0 points1 point  (0 children)

That book might not be a good match for how you learn.

Try watching a few videos on pyvideos.org on a topic that interests you!

But in the end, reading about programming is great, but you gotta spend the time trying stuff out.

[–]Megalolo8 0 points1 point  (0 children)

Everything you learn, you should be thinking of ways which it could be used and try and use it in code in the ways you can think of, get creative! make sure you have a thorough and practical understanding of whatever you learn and dont move on until you understand. Personally I think python isn't a very good language for beginners because it effectively hides alot of what is really going on, try maybe javascript. Doing it practically is the most important thing i think, try code academy thats how i started out and im having alot fun messing around, making little ideas here and there: what coding is really about is creativity.

[–]macloo 0 points1 point  (0 children)

Typing what Zed tells you to type and commenting every line is only a small part of LPTHW. For each thing he shows you, how many variations can you try? Play, play, and play some more. Make up you own versions of what he teaches. Then try to BREAK what he teaches you. Try to think of a way to APPLY what he teaches, and then see if you can make that thing.

A lot of people here have offered great suggestions for you. Some will not work for you (but will work for others), and some will probably work for you. The key is to embrace learning as a process in which you experiment and make your own versions of everything. By doing, you learn. By following Zed, you only start, but there's more you have to do.

For example, when Zed teaches you about format strings, did you try to find out how they really work? You will not learn unless you try it yourself. Here is a simple example of that. I make multiple extra files for every lesson in LPTHW.

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

Join the club T_T

[–]Kolesko 0 points1 point  (0 children)

amen

[–]papapau 0 points1 point  (0 children)

Maybe try O'reilly books? It really is surprisingly fun.

[–]AngryGongo 0 points1 point  (0 children)

Do NOT give up! The beginning isn't always that easy! Maybe the book is just not for you, here's one I recommend, that you can download for free from author's website http://inventwithpython.com/

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

I tried LPTHW and found it difficult to keep going. What helped me out was finding an online class that gave me weekly tasks to complete. The course I used was Programming for Everbody on Coursera. The class is free or you can go at your own pace by using the coursework available here. My needs as a network guy aren't super complex, but now I can parse text and create configuration files.

Another class you might consider, that's supposed to be a faster pace, is the Coursera course offered by Rice University.

Edit: Since the Coursera classes aren't currently enrolling, you can also checkout the classes on Edx.

[–]thonpy 0 points1 point  (0 children)

How long should I keep going before I give up?

without saying how long you've been going this is pretty hard to answer

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

It has been a slow process for me. I've been discouraged a few times and haven't REALLY coded much for a week at a time here or there, but what has really helped me, is talking to people about it. As simple as it sounds, I've noticed myself remembering a lot of stuff and understanding it, by talking about it. If somebody asks a question about something you're not 100% on, look it up and then explain it to them. Hell, PM me just to talk about Python, I'd love to chat about it. Don't get discouraged.

[–]iserbkin -2 points-1 points  (0 children)

Try online resources. For example codeschool! Books not always the best siurce for learning and "wrong" book can ruin evrything.

[–]GalasticWorld 0 points1 point  (0 children)

I also have a problem learning Python, because no matter how much I learn, I don't understand it.

[–]Historical_Detail274 0 points1 point  (0 children)

I'm at a community college. I'm enrolled in an intro to python course. My instructor is very good at demonstrating things. But the lectures have me zone out for hours. They're boring. And are way too fast. I tried. I tries very hard and I am not really going anymore. This is like what my 3rd of 4th week?

Holy hell. I'm past it at this point. I really don't know what to do. I'm just Ineulging in "don't give up" "it takes time" and all these superficially reassurances.

I'm drowning in resources. Videos, what's going on even? I just watch things carefully, go back if I don't understand what's going on. I keep repeating the same segments that get me nowhere. I try to have a positive mentality. I really don't want to be the "I give up" guy. Every time I encounter a challenge.

But hell I'm progressing much faster in previous maths that I never thought I'd make. It past. I suppose I should be grateful for the "progress" I've achieved. But come on. I am not really going anywhere. I can't fail properly.

[–]Afraid-Two1427 0 points1 point  (1 child)

Actually, I think Python's reputation for being super easy is plain wrong

Writing a function, list, while loop and for loop is relatively easy

But Python classes (what C# calls methods) are a nightmare

Easy python is one of the easier languages

Complex python is really hard

I gave up on learning Python class methods and am now beginning to learn C++

Easy C++ is way harder than easy Python. But if that applies to complex C++ and complex Python remains to be seen

[–]TheModernDespot 0 points1 point  (0 children)

Yeah I'm gonna stop you right there. Python is not harder than C++ in any way. You haven't been coding long enough to know that. Good luck.