Live data from Hacker News

Why Learning to Code Is So Damn Hard

vikingcodeschool.com

151–160 of 270 posts

Re: Why Learning to Code Is So Damn Hard

#151
post #122

I feel like I'm in the "Desert of Despair" and I'm not quite sure where to go. So far I'm self-taught in C, C++, Python, Lisp (a few of them) and some shell stuff. I have the basic syntax nailed in all of those. I don't know any of them well enough to be able to write simple programs without constantly looking up StackOverflow articles or reading references. I haven't even touched GUI programming. It doesn't help tha…

I agree with gambiter, this is the phase where practice comes into play. Also, studying the code of really competant and efficient programmers. I was in the of desert of despair for years until I learned to stop being overly self-critical and had internalize the patterns of much better programmers. I still made a living in this phase. Then I found that I was a good programmer and entered the upswing of awesome and it is awesome. I have the self-confidence now to know when to cut corners (sometimes you just brute force it) and when to spend extra time (sometimes an elegant algorithm is called for.)

Re: Why Learning to Code Is So Damn Hard

#152
post #116
post #81

This seems like a symptom of learning to code for the sake of being able to code , versus learning to code because you enjoy coding . It's just as much work in an absolute sense, but the process in the latter case seems more effortless and fun. There's a similar thing in the music world. Some people want to be good at guitar, others like playing guitar. The former get bogged down in despair, the latter fiddle around…

Shortly after I began driving my uncle taught me drive stick. We went out a few times, I'd practice in the parking lot, and I was eventually able to get it in gear and drive on the streets. I was horrible at driving stick, stalling at intersections, but I was good enough at it to get by. It wasn't until I actually bought a car that had a manual transmission that I got good at driving stick. I was terrible because I w…

this is exactly why most programming tutorials are terrible. they show you how to do calculator exercises and spend hours and hours on data types and syntax. it's like driving around in circles in the parking lot over and over again.

after struggling for years to 'get it' in my friends cars, i learned how to drive a stick in a single afternoon after saying 'fuck it' and buying a car with a manual transmission.

Re: Why Learning to Code Is So Damn Hard

#153
post #71

Earlier quoted context omitted.

Unless you're doing Rails, in which case it'll be read as a magic method and guess what you meant :-P Seriously, that was a major sticking point for me having programmed for a long time: going from "if you have not declared that identifier, game over" to "magic happens".

I've been teaching myself off of online resources and 'magic' was what I hated most along the way. I can't debug magic. I've ended up digging so deep to understand things that I'm covering assembly now. It's painful, but going so far has made everything else make a lot more sense. Data structures are easier to conceptualize and will be easier to work with (for example). But most people I know don't get this far when…

Nicely put. Not enough people dive to the lower levels.

Re: Why Learning to Code Is So Damn Hard

#154
post #122

I feel like I'm in the "Desert of Despair" and I'm not quite sure where to go. So far I'm self-taught in C, C++, Python, Lisp (a few of them) and some shell stuff. I have the basic syntax nailed in all of those. I don't know any of them well enough to be able to write simple programs without constantly looking up StackOverflow articles or reading references. I haven't even touched GUI programming. It doesn't help tha…

TL;DR: Don't give up! It gets better, and so will you!

  I always try and obsessively look for the "best" or "proper" way to do something.
Don't. Do your personal best, and THEN look at ways to improve it, and in one facet at a time. Otherwise, you might not always understand why the "best" way is better. (You won't appreciate source control until you lose All The Things, but ... I'm sure you're already using Git. ;))

There are nigh-infinite blog posts about ways youcan do X better (unit test, standards, unicode compliance, date handling, names, design, CSS, layout, etc) -- don't worry about those yet.

=== Coding on your own ===

Consider writing code to solve programming puzzles, like Project Euler -- it can often start small, and then improve as you learn more.

Consider building a "simple" toy project in a web framework -- Django, Flask, etc. (I mention those as they are some Python frameworks.) There are often tutorials that run you through building something toy-scale. (Your own twitter, a TODO app, etc). Doing this will let you quickly build something with a simple UI, and simple guts, and then you can look into ways to improve it.

For example, I'd like to make a flash card game for my kids. (Real project, tired dad. ;)) I can start with some code that randomly generates problems, and shows them to a UI in a pretty way. (Large font, perhaps.) Later on I can improve it with things like letting people enter the answer, tracking how long it takes to answer, tracking scores over time (so that I can focus on the ones they have problems with), leaderboards, and custom decks. ALL of those are way out of scope of the initial project though.

=== Coding with others ===

If you'd like more of a challenge, or in some ways less, try being a contributor to a larger project, rather than trying to write something totally from scratch. This is really important -- most of us are not writing Large Software solo. I might write a handy tool solo, but most of my day-to-day work (and the environment in which I do most of my learning) is maintaining a larger codebase.

Existing projects already have a build framework, a code review protocol, RPC/API infrastructure, GUI, etc already done for you. They have a test suite that tells you if you broke something. Now, your improvements are things like, "Add an error message when this happens", or "Add support for a new API call...". It's MUCH easier to add something similar to what someone else already wrote (once you understand how it works by reading their code ;)), than it is to have to write all of that infrastructure yourself. There are also OTHER developers who have domain knowledge of the codebase, and that you can ask for help -- this is VERY useful and important for our learning as programmers.

=== Direction ===

I have no idea how to help you there. ;) It's easy to feel inadequate in this profession, as there are always smarter/faster people. Since what we can create is endless, it's hard to PICK something -- that's why I suggest doing a tutorial-based project in a web framework. You can then use that to focus on the Python side, or on the UI side, or as inspiration/guidance for making your own things.

Also, don't worry about looking at Stack Overflow. Definitely do that if you're stuck on something, or you forget whether something is possible ("Can I declare a dict plus it's members in Java the way I can in Python?"). It can at times be hard to tell when the answer you find on SO doesn't match the problem you really have, though, which takes practice.

I'd be happy to talk more via e-mail if you like. I've updated my user profile to include a poorly-obfuscated rendition of my gmail address. :-)

Re: Why Learning to Code Is So Damn Hard

#155
post #132

Here's where I disagree with other people - software development is special in that it requires focus, relentlessness, intelligence, creativity and I also find it interesting that many software developers tend to suffer conditions from the autistic spectrum. To me that's a clear sign that software development requires the mind to be hardwired in a certain way. And the thing is - I never needed handholding, which is w…

I don't really agree with the notion that software development is something that others cannot learn if they try to do it; that seems like a very harsh perspective which, from my anecdotal experience, is far from the truth. Any skill can be learned if you have the discipline to put in regular effort: that's just the way the human mind works. I do agree that for a lot of people, Software Engineering is easier because…

If there isn't difference in ability (which I think there probably is), there is certainly difference in inclination.

I work with a couple of guys that want to learn to program. They try. Sort of. They took the same online classes I did. But the content never transformed from theory into "hey, look what I could do with that!" They also just don't have whatever it is (fanaticism? lunacy? lack of better things to do?) that made me sit in front of a terminal for days and nights running together on end, barely eating, hardly sleeping, dreaming about it, trying again, beating on until it worked. There is something different about productive programmers, and no, I don't think everyone has it or has the capacity to become that.

I'm not going to claim it's a virtue... it really is almost more like a vice. An addiction. An ability to tune out the rest of the world (which sometimes is more important in reality) and focus intently on organizing abstraction.

I'll also say... long periods of this are not so great for your relationships and personal life. At least in my experience. So maybe they are better off truth be told.

Re: Why Learning to Code Is So Damn Hard

#156
post #132

Here's where I disagree with other people - software development is special in that it requires focus, relentlessness, intelligence, creativity and I also find it interesting that many software developers tend to suffer conditions from the autistic spectrum. To me that's a clear sign that software development requires the mind to be hardwired in a certain way. And the thing is - I never needed handholding, which is w…

I don't really agree with the notion that software development is something that others cannot learn if they try to do it; that seems like a very harsh perspective which, from my anecdotal experience, is far from the truth. Any skill can be learned if you have the discipline to put in regular effort: that's just the way the human mind works. I do agree that for a lot of people, Software Engineering is easier because…

[deleted]

Re: Why Learning to Code Is So Damn Hard

#157

Many of the coders I know (which is mostly folk in their 40s) never learned from scratch. More often, we started in support roles, and slowly worked into the code. First, learning to read it to help troubleshoot issue, then making basic changes, and slowly picking up more and more of a specific codebase. Once the basics were understood, we'd start making basic apps on our own, often while still supporting more comple…

That's pretty much exactly my recommended approach for both training people who are new to software development and bringing an experienced developer onto an existing codebase (or language, or platform, etc) they haven't worked with before. The only difference, per individual, is how long they need to spend at each level before moving on to the next.

When you get into real-world software development, it's much easier to work with an existing codebase than to start from scratch on a new one. If the application is in production, then you know that the existing code works, so you've got a baseline. You can study it to figure out how it works, and you can compare that to requested changes in the way it should work, and then you just need to figure out how to change the code to make the behavior change. That leads you to asking the right questions, focusing on the right code. It's like the hand-holding phase, except it's real code instead of play code. Figuring out how the code works also teaches you a bunch of stuff on the side, like how to do debugging in this new codebase, how to set up and work within your development environment, the practices and patterns of your team, etc.

Re: Why Learning to Code Is So Damn Hard

#158

When I was in college, one CS professor explained the difficulty of coding to me in terms of discreteness vs continuity. In the real world, things are continuous. If you accidentally build your structure with 9 supports instead of 10, then you only lose 10% of the strength of the structure, more or less. The strength varies continuously with the amount of support. But if you're writing a 10-line program and you forge…

> But if you're writing a 10-line program and you forget one of the lines (or even one character), the program isn't 10% wrong, it's 100% wrong. (For example, instead of compiling and running correctly, it doesn't compile at all. Completely different results.) This is where the beauty/simplicity of some programming languages, namely, intepreted languages (e.g., Python), comes in: if a bad line of code never gets exec…

> This is where the beauty/simplicity of some programming languages, namely, intepreted languages (e.g., Python), comes in: if a bad line of code never gets executed, then the program itself will run fine. In other words, if the line is never called in the program, then you'll not know that the functionality that that line presented was bad. In this case, the analogy breaks down a bit - and also shows why certain languages are easier to learn than others (e.g., Python vs. C++).

Actually, that's one of the pitfalls of interpreted languages.

You want to Crash Early & Crash Often [1] or you'll move along, merrily ignorant of a serious problem just because it doesn't get executed.

I try to solve this shortcoming of languages like Python with proper unit testing. It gives me the confidence that there's a decent coverage of the different code paths so that I won't learn about the problem in production.

[1] - https://pragprog.com/the-pragmatic-programmer/extracts/tips

Re: Why Learning to Code Is So Damn Hard

#159
post #132

Here's where I disagree with other people - software development is special in that it requires focus, relentlessness, intelligence, creativity and I also find it interesting that many software developers tend to suffer conditions from the autistic spectrum. To me that's a clear sign that software development requires the mind to be hardwired in a certain way. And the thing is - I never needed handholding, which is w…

I don't really agree with the notion that software development is something that others cannot learn if they try to do it; that seems like a very harsh perspective which, from my anecdotal experience, is far from the truth. Any skill can be learned if you have the discipline to put in regular effort: that's just the way the human mind works. I do agree that for a lot of people, Software Engineering is easier because…

What you're saying is true and I used to be optimistic about it like you, however I stopped believing that it is feasible for most adults after failing to teach family members the basics or junior colleagues to become better.

Maybe I've been a bad teacher, however the thing I noticed is this - yes, if you put enough effort, Ok, we can probably do anything, like learning to play the violin or do programming, except that's easier said than done. The effort required is actually enormous. Put in that equation real-world concerns, like a social life, a day job, raising children and so on and it becomes next to impossible.

For a child it is easier - he has the time available and that desert of despair mentioned can be actually fun. Because to a child, making the computer do stuff can feel like magic, whereas to an adult it feels like a chore to get somewhere, a chore that eats all of the available time.

Knowledge is accessible and that's great. The noise is also great though and one still has to filter, analyze, learn and work. The Internet is indeed disruptive, like you get access to books or to online courses from reputable universities without being there and without paying a single dime. But I still see this as helping children in impoverished nations, rather than adults in first world countries.

Note that I'm not discarding the possibility of adults actually making it over the learning curve. I'm sure there are people out there that have succeeded. But those are super-humans and I think they represent the exception.

There's also another thing that's starting to piss me off. Some of the problems we end up working on are extremely difficult, yet because we are idealists, we go around telling everybody that everybody can do it, probably out of sheer enthusiasm for the things we do, because we believe the world would be better and maybe because we want to share with others our passion. But you know what, some of the stuff we do can be really challenging, objectively speaking not everybody can do it and going around and saying that opens us up for abuse. And then we start complaining about agism or about companies fixing salaries and entering no poaching agreements. How stupid can we get? Oh, so you want more or better software developers? Capitalism works both ways, demand and supply is a bitch, so fucking pay up.

Re: Why Learning to Code Is So Damn Hard

#160
post #112

Hey there, really, really great article! It really spoke to me. I've got a small question for you, though: I'm in the Cliff of Confusion, but I have a serious problem. I can't even build a program. I know syntax, structure, etc., but I don't know how to pull all of it together to actually build something that serves a purpose. Do you have any advice for me?

As Baq said, programs must:

- be executable - (optional) take input from somewhere (e.g. stdin, or command line arguments) - (optional) write output (e.g., print statements)

Would you be able to write a small script that implements solutions for Project Euler? (Even just a few of them.)

- You don't need any input at first, because the problems are already specified. - You can write a separate program for each problem, or just comment out calls to each exercise's solver - Brute force is OK for many early problems - You probably know enough to write a function that solves an easy one (e.g., Nth fibonacci number)

Once you write such a function, you should be able to find out how to write an executable program in your language, and then you're off to the races: Run it over and over from the command line until you (a) stop getting errors, and (b) get an answer that you can defend and understand. :)

Post reply on HN