Coding My Way Out Of A Wet Paper Bag

I started teaching myself coding a bit over half a year ago. I’ve progressed nicely. I used LPTHW for Python, also taught myself SQL. My big problem is not being able to implement much of anything. I have an idea, start trying to code it (after following the outline for how to start a new project from LPTHW), and then I get stuck.
To be more precise, let me outline three kinds of stuck:

  1. I get stuck, try to figure out how to fix the problem, generally get stuck in that, or get time-stuck (like waiting for a friend to answer, etc.), move on to a different task in the code, get stuck, don’t even know what to do, move on, etc., until I’m completely out of energy.

  2. Other times, I simply have no idea how to implement an idea. How do you check for that on Stack Overflow? (It might not even be a particularly good idea if you could…)

  3. A recent issue involved my rather poor understanding of HTML and CSS. I was trying to make a clickable black button, and got more stuck on how to do that than I would like to publicly admit. This seems to be a section of stuck that focuses on ideas rapidly bringing me to aspects of code that I know nothing about.

I get the feeling that I need to build up a kind of critical mass until I’m able to help myself move along when I’m stuck, but the whole problem is getting there. I find myself wishing I had someone to sit down and code with, but I don’t really have that. I have a couple of friends who code, but mainly in different languages than myself, and they’re pretty busy (and also just because they know doesn’t mean they know how to help a newcomer). How does a newbie un-newbie in a vacuum?

Any ideas from the masses?

1 Like

I would say start small and keep it simple. Coding is like any natural language, you need to learn the syntax and vocabulary of the language in order to become proficient in expressing yourself in that language and it takes time and practice!

Start with solving some small and simple challenges and seeing how many different ways you can code a solution. Explore the language and how it works and you’ll be surprised how many different ways you can code the same thing!

This method will also help you learn which approaches work best for a given problem and these learnt “code snippets” will help you to spot patterns in larger problems that these phrases can be applied to.

Also think about the data involved in the problem you wish to solve as it seems to me that most coding challenges are ultimately about how you structure the data and how you manipulate it. Tip: dictionaries are amazing things!

Try thinking the problem through in natural languge (i.e. English or whatever is your native tongue) and write it down, talk it through. This will really help you understand and deconstruct the problem in hand and allow you to break it up in to smaller problems that are easier to code whilst helping you to see how these bits of code fit together and the flow that needs to occur in your program. Never underestimate the power of having the big 10,000ft view for resolving the detailed level of code.

Like any skill, the more you practice the easier it becomes to progress. Just start with the fundamentals and form a solid foundation to build on.


@the Maybe LCTHW:live is something for you?

@DidierCH You mean the Junior program? I don’t think it’s going to work for me.

Yes it has a new name :grinning:
It was just an idea. I’m currently in this programm and it helps a lot + you get personal advice from zed :muscle:
There are some other ways you can connect with people who has the same interest. I think it would be good for you to join a computer/programmers club in your city or nearby. There are a lot of people which will and can help you.
There are also a lot of meetups everythere in the world.
See here: This is maybe a good start. Good luck.

Well that’s why I wrote this:

The problem is that you are limited by three things (most likely):

  1. You don’t know how to get started on an idea.
  2. You don’t know how to progress the idea after you get started and keep it solid so you can work on it for a long period of time.
  3. You don’t know what kinds of things to work on to improve your skill.

The More Python book basically teaches you these things. It’s free to read for now, so just start going through it and I’m sure it’ll solve this for you.

1 Like

@zedshaw The first two are the ones that are really eating me right now. I own More Python. I’ll admit my shortcoming in not having consistently dedicated time to it after getting it - I tried the first spike a grand total of once, and petered out. It’s really frustrating spending 45 minutes and only coming out with a thought that maybe there’s some way I can use this standard library thing, and not knowing how. I do understand that if I would spend 45 minutes a day consistently on this that if I don’t go stark raving mad that I’ll get on to the learning curve at last, but it’s hard to work that up. I guess I’m looking for an easier way out, one with a quicker feedback loop.

I’ll try to start back with More Python, though.

I think there’s another problem hindering me, in addition to the ones you mentioned (sort of a corollary to the second). Take the exercise form More Python. I find this standard library thing, now I have to learn enough about it to figure out if I even want to use it or not. It’s sort of like a maze of black holes - at this point in time I could potentially invest so much time in so many things that are dead ends (right now), and even if they aren’t, end up investing a ton of time learning tangential but necessary things. Is this normal? Is there a way around this?

Just a few thoughts on what you said from a fellow newbie…

First off it sounds like maybe confidence or being overwhelmed is as much of the problem as your perceived lack of skills in certain areas.

Looking at any problem as a whole is pretty daunting unless you have real domain expertise, and even then if the problem is large enough it can be terrifying. I say this as have run a couple of highly technical web start ups with teams of very experienced developers who were often in a state of how the … will we do this. So don’t worry about that feeling, it is normal.

My advice on big problems is just break it down into smaller chunks and have a go at those. Can’t do those? Break it down again and again until you can start at something. You may not solve all the problems yet but if you can get started you will learn as you go.

Given you mentioned HTML and CSS I am guessing that you want to do web? If so, go learn HTML and CSS fairly well for a while and just tick over on Python. You must know how to layout a page and make it work well before you can think about coding the back end, unless you want to work solely as a back end dev but even then you will feel lost not knowing HTML & CSS. For me at least, mapping out the front end helps me see things as components for which logic needs to be written.

Assuming again you want to do web, you will be amazed with how little actual Python you can get away with writing for something like Django. So much of what you do there will be generic class based views etc.

Keep going with it and don’t forget that nobody is born knowing how to code, it is a process. Comes easy to some and hard to others but if you keep at it you’ll get there.

@jimbot The funny thing is, I’m not so interested in web. I’m more interested in backend stuff. I had an idea for a project, though, which involved a clickable black button. The interesting part was supposed to be what happened when one clicked it. I figured, hey, it can’t be that hard to make a clickable black button, and I’ll be on to the cool stuff in no time.

Ha ha ha.

Hey, fellow newbie here.
My advice for the clickable black button would be to find or make an image of the black button and then save that image in a “static” directory in the main project directory. Then you can use the image as a submit button in your html file; for example:

<form action="/game" method="POST">
  <input type="text" name="action">
  <input type="image" src="static/image.png">

except obviously your action and method attributes would be different depending on what you want the button to do.
I found this resource very helpful in learning just enough HTML/CSS to do what I want:
You can also see the HTML tag list and HTML attributes (on the menu on the left) to learn more about how to use the input element.

As for the general “getting stuck” problem, I often have the same issue, but what I do is just keep googling (Google is your friend) and keep trying to solve your problem(s), take breaks when you need to, and follow jimbot’s advice on breaking problems down into smaller and smaller problems.
Hope this helps :slight_smile:

So I tried going back to More Python. I decided I’d lower my spike to 30 minutes, at least the first time, because 45 simply sounded too overwhelming. I quit after 15. Here is my code:

    #Import libraries
    #Create flag on command line to signal to parse
    #Read command line for arguments
    #'Should have three flags and three arguments'

I spent all fifteen minutes trying to figure out what would allow me to ‘discover’ what was being written on the command line from a script. I looked through Python documentation and SO questions, all of the latter having answers that, unsurprisingly, used argv. I still think the Python documentation was written for some species that I have not yet encountered.

In short, I feel like this just reinforces my problem; how on earth do I progress when these are my issues?

To be really, really clear, I’m not asking for solutions to how to make a script that mimics argv. I’m asking for solutions how to create a process that will allow me to figure out how to make such a script on my own.

Ok, but remember in the exercise I tell you to use argparse as well, and in addition that I use it in nearly every exercise after that unless it’s overkill. So, that tells me actually what’s going on:

  • You are not watching the videos. I can tell because I actually build these in the video so you can see how I’d do it and then try it again on your own.
  • You aren’t reading the problem description carefully enough. I recommend taking good notes and reading more slowly. Don’t skim. Take your time.
  • You sound like you’re “module shopping”, where you google around for modules that do things, check out every one, try them all, but then run out of time or get distracted by rabbit holes. I believe all of the problems in the book are solved by stock python modules and if not then I tell you what to install. For example, I use pytest and some things added to pytest. Just stop shopping for other modules and use what Python has.
  • You’re doing research on the standard library, but not being efficient about it. You probably try to learn every single function and everything it does, but really you need to look at the examples and see what’s the most common functions used. Then, just look up everything else.
  • You are probably assuming that you must memorize everything and that if you have to look anything up you’re a failure? Just a guess but I almost never memorize the standard libraries and always look them up. Only exception is ones I have to use all the time. The reason I always look them up is I assume that my brain is flawed and remembers things wrong, so I don’t trust my memory (and mine’s really really good). Just look things up.
  • You probably are trying to accomplish too much in 45 minutes and making it way too complicated. What you should do is, before you start hacking, write out a TODO list of everything that this tool should do. Then, get rid of 80% of that. Just pick the 20% that gets something that works. Then stick to it. If you hear yourself talking about strange edge cases stop. This isn’t meant to be a project that’ll get you entry to MENSA. It’s a dirty ugly hack that barely works.

Try those then report back to me. I have other students that I’ve helped through this and they all do the same thing at first.

1 Like

Here’s the report:

100%. I haven’t gone to the videos yet, because I want to be able to try and build it on my own. I figured I wouldn’t be doing myself any good by crutching on the videos at this point. Should I? I figured it would just get me into the habit of giving up after five minutes and using the videos.

Part of the issue, I think, is that_I don’t know what Python has_. I think that you solve this issue with your next point, though, which is that I should be looking for whatever people are using, and I would think that the probability will be high that it’ll be in Python.

I’m totally inefficient about it - that’s the whole problem I’m whining about! I would describe the inefficiency differently, though: I find a function everyone is using, try to figure out how to use it, can’t compile, check the docs, fail to understand the docs, look at something else the docs point at, don’t understand that, look at its docs, fail to understand those, find an obscure blog ripping that that sends me to somewhere else… I think you called those rabbit holes before. It doesn’t feel so much like Alice in Wonderland to me, except maybe for the ‘off with her head’ bits.

I think your last two points (a perfectionistic need to memorize and overcomplicating) also assume that I have much more of an idea of what I’m doing than I actually do. I appreciate the compliment, and if I had a clue what I was doing, and still was complaining about issues like these, would almost certainly be guilty as charged. I’m not looking for MENSA right now, I’m looking for Caveman Newbie. (Thok says COMPILE or Thok hit with CLUB!!! - hasn’t worked yet. Maybe I need a club. Or to change my name to Thok.)

So, try this strategy first:

  1. Take a piece of documentation and start at the top, doing a light review of it while taking notes about what it has.
  2. Start back at the top of the documentation and find the first full example you can type in and type it in exactly. Don’t change it, don’t be clever, make it exactly the same. If you get an error chances are you did it wrong, so go fix it. For example, if you get a syntax error then you typed a character wrong, so go find which one.
  3. When you type the example, do it incrementally. Don’t type in the whole thing then try to run it. I don’t even do that. Type in a bit at a time and get each little bit working as best as you can. This will help you fix syntax errors as you go.
  4. Go very slow and deliberately so that you type it in correctly.
  5. After you type it in and get that example working, study all the things that are mentioned in it from your notes and the documentation.
  6. Then make a backup of your working example and change the example in some way. Don’t try to make your own completely from scratch but rather slowly evolve the example with little changes that you think will work. If you make a change that doesn’t work, try to find out why by comparing it to your backup of the example.
  7. Keep doing this until you’ve gone through as much of the documentation as you can.
  8. NOW try to make something from nothing that uses this API. Be sure to start with English comments and fill in the Python under them rather than trying to make the Python flow.

That’s the best way to go through API docs for beginners.

1 Like