Settings

Theme

Don’t Believe Anyone Who Tells You Learning To Code Is Easy

techcrunch.com

209 points by sumukh1 12 years ago · 185 comments

Reader

retrogradeorbit 12 years ago

"They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google and knowing which code is best to copy-paste."

No, no, no! This always frustrates me. This is not 'coding' (maybe it is, and we should be doing less of it, and more programming). This is gluing together pre-coded snippets and trying to make it work. Continuing to do this is an impediment to getting better. Thinking that somehow this is what 'coding' is, is missing the point.

I will read a stack overflow page perhaps in a search for some direction, look at all the 'solutions' like surveying a landscape of others approaches to the problem. Then I'll throw them all away and code my own. Possibly it will share a lot with one of the answers, what I would consider a good approach. But a literal copy and paste just doesn't happen. I would consider a copy and paste a recipe for inviting trouble, because you haven't really reasoned through the problem yourself, and thus don't really understand the solution intimately.

Programming is a process of mental reasoning around your problem with an eye on the form of reasoning computers use, so you can express that reasoning to the computer in the language you're using. Because computers don't reason like humans 'reason' (ie. humans don't really 'reason'...), knowing how a computer reasons and behaves is alien and takes time to understand and learn and it takes time to become quicker at comprehending this. This is the path of becoming a better programmer. Gaining that experience so the process is less alien and you more easily can fathom how a computer will respond and behave with a certain approach of laying out of the logic you are trying to express.

Copy and paste doesn't help you at all with this. In some cases it may prevent you learning essential lessons and hinder your improvement.

  • nhebb 12 years ago

    > Copy and paste doesn't help you at all with this.

    Generally I agree with this, but there is a way to use copy-pasta as a learning tool. If I find a code sample that does what I want but don't understand it, here is what I do:

    1. Add a comment with a link to the source for reference.

    2. Rename the variables.

    3. Comment the parts that I understand.

    4. Flag the parts I don't understand with a simple // ? comment.

    5. Research the parts of #4 until I understand them, and then update each comment accordingly.

    #2 is incredibly important to me. I've been doing some walk-through tutorials lately (e.g., http://learn.knockoutjs.com), and if I use the same variable names as the tutorials suggest, then I'm just transcribing. The code doesn't stick in my head, and I'm not really learning as much. But once I start changing the variable names, then it sticks.

    #3 might seem like a waste of time, but I've found with conceptually difficult code, having the #3 comments helps keep me grounded if my brain gets too muddled.

    • userbinator 12 years ago

      There should be one more step:

      6. Make changes to it so that it does the same thing, but in a better way -- faster, smaller/more concise, etc.

      I think that being able to do this (correctly) is to truly understand, since then you are "thinking beyond the code" and can see the problem that it solves, not just an implementation that solves it.

  • ronaldx 12 years ago

    Absolutely disagree.

    I personally learned (as I think many people did) by copying code out of books. Whenever something went wrong, I had to figure out whether it was my typo or the book's typo or my conceptual error or the book's conceptual error. That process helped me to learn a lot, and quickly. If everything went perfect, I got to play some creative game which I loved and gave me a sense of acheivement that helped me to progress.

    I no longer do this, because it's not relevant to me at this stage of my learning, but I view that as an important part of my early learning process. If you reflect on your own early learning process, I would be extremely surprised if you didn't copy and paste code. Frankly, you are surely still dependent on other people's code now, you just might call it a 'library' instead.

    I agree if you're saying professional developers should avoid copy-paste (there are also legal consequences), but new learners can make great progress by using copy-paste. I would say it's an essential part of studying what other people have done.

    • FreeFull 12 years ago

      Do note that there can be a difference between copying code from a book (where you have to read each bit of the code and write it down) and simply hitting ctrl-c ctrl-v, in terms of what you learn.

    • redshirtrob 12 years ago

      I think there's a large difference between copy-paste and what you're describing (which I'll dub 'manual transcription'). I have no formal training in learning or cognition, but I do have quite a bit of personal, anecdotal evidence to suggest that manual transcription is far more useful, from a pedagogical standpoint, than straight copy-paste.

      Rather than take a boring example from my programming career I'd rather draw from my brief mathematical studies in college. In undergrad I was taking a course on Real Analysis. The course redefined, much more rigorously, certain concepts that I had understood at a much higher level--think the limit, derivatives and the Riemann Integral. Suffice it to say that these new concepts challenged my understanding of introductory Calculus, and when I was tasked with writing proofs based on the underlying concepts (e.g. neighborhoods), I struggled.

      In what can only be described as frustration I decided I was going to start copying the proofs over and over. I repeatedly transcribed half a doze proofs for a few days straight (I did each one a few times each night). A strange thing happened. I began to understand the proofs. By that I mean I started to understand the intuition required to make the transition between each step of the proofs. At that point I found the material much more accessible. Reading the book was easier, the lectures made more sense, I could do homework, and consequently I could complete the exams.

      I like this example because there is no copy-paste alternative. I had to engage with the material, but I chose to engage at a very mechanical level. Still, there was something about the process of reading and writing that aided in understanding the material.

      I don't believe you can get that with copy-paste unless you find some other way to engage with the code.

      • ronaldx 12 years ago

        I'm very interested in whether or not manual transcription is pedagogically beneficial.

        I personally write a lot. I certainly find it useful to do that.

        However, I would not normally recommend Zed Shaw "Learn Code the Hard Way" type of method of writing out over and over again. I think it probably works and you can do it yourself, but I think it's quite inefficient. I don't need to type 10 PRINT "HELLO" 20 GOTO 10 more than once to get a good sense of what's going on.

        I think you most of all benefit here from the time you're forced to put in. If you can understand nothing, there's really no other sensible thing that allows you to concentrate for the time you need to make decent progress.

        However, I don't think this means transcription is pedagogically ideal. IMHO building something for yourself is more effective; getting expert tuition is more effective: in terms of time spent vs benefit received.

  • cliveowen 12 years ago

    I completely agree with you and frankly I'm shocked to see most of the responses here purporting copy-pasting someone else's code to be a legitimate practice. I also imagine that most if not all of these people are into web developed where there's a long history of copy-pasting snippets of code and no one knows what he's really doing. I've seen many people write a jQuery script for their website and calling themselves developers. You're not a developer, you're mashing together tools you don't really know how to use in the hope that everything works out. On the browser you're working with a single thread, in the real world you're always dealing with multi-process/multi-thread programs that inevitably lead to race conditions and deadlock. I doubt anyone involved in systems programming thinks is normal to copy and paste code to "get things done", it's just not gonna work.

    • ktran03 12 years ago

      Same. I'm actually a little shocked HNers think regularly coping and pasting code snippets off the web is ok. That's, kind of crazy.

      This is bad especially for young developers (such as myself). Not to mention jeopardizing the security and integrity of your software project.

      I hear 'don't reinvent the wheel' often written in blogs etc. That is not good. The lazy developer would read that and go, 'oh, I dont need to know how these things work, it's already been done for me. I'll just slap A to B, no need to reinvent anything'

      Imo how it should read instead is, 'keep reinventing the dam wheel till you understand how it was made, only then you're free from reinventing it'.

      • mattgreenrocks 12 years ago

        > I'm actually a little shocked HNers think regularly coping and pasting code snippets off the web is ok

        I'm not surprised.

        Ever observe threads about software engineering? They're profoundly anti-intellectual. HN is not the place to get any sort of engineering advice, I'm afraid. It's tailored towards self-promotion via programming. The difference may seem small, but the motives are quite different: mastery (as a developer) vs getting it done.

      • Iftheshoefits 12 years ago

        The HN engineering and programming community seems to me to consist of a wide variety of different groups and types of programmers (coders/engineers/whatever).

        It shouldn't be surprising that there is a group who feel "I'll just slap A to B" is a good idea (that's not what happens every time somebody copy-and-pastes, by the way--it's one extreme example, and it's possible to copy-and-paste with a deep and mature understanding of what one is doing). Just like it shouldn't be surprising when certain elements of other groups chime in with comments implying CS is some deeply intellectual study of the fundamental nature of mathematics and logic, and if a programmer isn't treating his Enterprise CRUD App X as a means to engage in a deeply intellectual study or application of algorithms, data structures, and complexity analysis he's doing it wrong, or he isn't a real programmer, etc.

      • collyw 12 years ago

        The thing is you can copy and paste code snippets properly and responsibly and try and learn at the same time. Or you can just patch over something and hope it works (a lot of the time it will).

        My first job was doing Perl, after studying Java. The Perl cookbook was a godsend, and basically encouraged copy pasting BUT had a discussion on the different methods presented and advantages of each one. I personally found that a very good way to learn.

        This is one thing I find nice in the Perl community. I haven't used Perl for a few years now, but I always found PeelMonks a lot better then Stack Overflow, because it encourages the discussions that Stack Overflow discourages. Essentially it encourages the bad type of copy pasting I have described.

      • raiph 12 years ago

        You seem very confident of your assessments. To the point you'll even suggest HNers who don't see things as you do are crazy.

        Are you aware of the notion that expressed confidence tends toward being inversely proportional to competence? And that this is a key to insightful learning?

        You've said you're a young developer, so perhaps you haven't recognized this aspect of mind yet, but there's plenty of solid science (as well as anecdotal examples such as your confidence/competence in this exchange may be) that corroborate the essential truth of this aspect of mind.

        Of course, I may well be wrong about applying that knowledge to this scenario, so I'm not going to claim confidence or competence in applying it, just that it seemed apropos. :)

        • ktran03 12 years ago

          I didn't call anyone crazy, it's the idea of copying and pasting code into a professional project that I think is crazy.

          That's how I was schooled by senior devs, whose opinion I have profound respect for. The reasoning is sound to me, I'll stick with it. Unless, someone has better reasons why I should copy and paste code, I would consider it.

      • chrissyb 12 years ago

        IMO it should be "You can't reinvent the wheel, but you can study physics to understand how the wheel functions."

  • soup10 12 years ago

    I copy and paste code all the time. I'm in the business of getting shit done, not learning everything ever, I don't need to learn the ins and outs of some obscure algorithm I'm only going to use once. I also don't need to memorize Apis and boilerplate for technologies I rarely use. Of course once i'm settled into a domain I don't need google anymore. But it's invaluable for quickly diving into new stuff.

    • Swizec 12 years ago

      Please never stop doing this. I get paid $$$++ to swoop in after people like you are done and whole teams grind to a halt productivity-wise because the codebase is so bad.

      You are doing god's work, son. Thank you.

      • lotsofmangos 12 years ago

        There is a fair amount of code you should copy/paste unless you are doing pure research, some because it has been so well studied it is almost a certainty that you are not going to drastically improve on it and others, such as encryption implementations, because it is actively dangerous to fuck about with unless you are extremely careful and a domain expert.

        • cheald 12 years ago

          If you're copy-pasting encryption implementations rather than using an existing library, you're probably doing it wrong.

          • lotsofmangos 12 years ago

            Well yes, but libraries are really just an advanced form of copy/pasting and you can still do damage by using the library incorrectly, so you often end up using sections of examples by the people who wrote the library or who are otherwise experts in its use on how to implement the library correctly.

            • cheald 12 years ago

              Sure, you can argue that library use is copy-pasting, if those snippets you're pasting come with regression tests and have been code-reviewed by multiple people.

              I'm going to go ahead and suggest that a tremendous number of encryption mistakes are made specifically because people copy-paste library invocations without understanding what they're invoking and why. When you just sling a chunk of code into a project without understanding what you're doing and why, the potential for bugs goes through the roof.

              • lotsofmangos 12 years ago

                I agree that you need to understand what you are doing and why. I'm not saying that these bits should be treated like magic, just that you should think very carefully before you differ from them by very much.

      • jacquesm 12 years ago

        Now I need to go buy another keyboard. Thanks :)

        To the GP: Swizec has it, please don't stop.

      • nomedeplume 12 years ago

        please define $$$++?

        • Strom 12 years ago

          It means 'lots of money'.

          • nomedeplume 12 years ago

            ...."lots of money" varies from community to community.

            • dkersten 12 years ago

              Which is why saying lots of money if more useful than specifying an amount, because that amount may or may not be a lot of money where the reader is from, but might be a huge amount where the person who posted it is from.

        • Swizec 12 years ago

          Well, you take a dollar amount. Then you increase it. Then you increase it some more. Because companies who can afford it will pay you pretty much anything if you can make their whole engineering team even just a few percent more productive by improving the codebase. Or can figure out very hairy issues caused by Daily WTF style situations.

          For example, I have a friend who sometimes fixes bugs in compiled software running banking systems with no access to the original code and woefully out of date documentation. He gets paid some 300eur an hour in a country where the median developer salary is only about 30k eur per year (about 14eur/h)

          Sure, that particular type of problem likely/hopefully isn't caused by copy-paste programming, but it is caused by the sort of endemic issues copy-paste programmers to produce.

          • goblin89 12 years ago

            IMO, as it often turns out to be, whether or not the code is copied and pasted doesn't matter by itself.

            A competent programmer borrowing code would likely factor it in in a way that won't present maintenance burden later on, and first of all would know when borrowing is appropriate. An incompetent programmer may produce problematic code even regardless of whether it's borrowed or original.

            (Though I'd agree that incompetent programmer borrowing chunks of code from different sources without thinking is ‘worse’ than same programmer just writing bad code by himself—more predictability in the latter case.)

            In my case, I regularly see borrowed code in projects that I maintain. As long as it's contained in an isolated module, documented (unless it's short and obvious) and used appropriately, I don't see a problem.

            Interestingly, front-end code I work on seems to suffer from much worse-quality borrowing—it's like Python people lose all their discipline once they turn to JavaScript.

            • Swizec 12 years ago

              Agreed. I do actually copypaste code in some very specific scenarios. For instance, writing a string capitalization function for Javascript and not needing a whole string processing library.

              Sure, you copy paste a line of code after inspecting it, and save yourself some half hour of time on a piece of code that is not core to the problem you're solving.

              But I have never seen a programmer who says "I am in the business of getting shit done, so I copy paste code" to produce good code. Anecdotal evidence and whatnot, and my argument could be a bit of a strawman, but this is the sort of canary in a gold mine that I've found.

              When a developer on my team says "I just want to get shit done", is when I start preparing for a lot of internal screaming down the line. Happens every single time. Every. Single. Time.

              So no, while copy-pasting on its own is not the problem, it is a good symptom to look for.

              • cheald 12 years ago

                I actually had someone bitch me out on StackOverflow for having an answer that wasn't useful to him, and it was slowing down his "above-industry average productivity rate". I had a damn good laugh about that one.

          • chubot 12 years ago

            Man... can I ask what led a company into the situation where they need to fix software without source code access? Did they rely on a vendor that went out of business? I imagine it is ancient software from the 80's or 90's?

            • nevi-me 12 years ago

              To answer you, I'm 24, and an accountant by profession. From what I've seen, most banks still run some core functionality of their systems in IBM Mainframe, which includes JCL, COBOL and maybe other languages.

              Because of space constraints then, file names were limited to 8 characters (someone correct me) and lines of code has fixed lengths. That already made commenting a nightmare. I have 'reverse engineered' scripts that were written more than a decade before I was born. Most have outdated documentation, filenames are a mess to figure out, and over time there have been automated conversion tools that were used to update language versions.

              As I said, most of these systems still run some core functionality of the bank, and the people who wrote them ain't there no more, so banks have to shell out lots of money to either fix and maintain these, or to figure out what's happening so they can move to newer systems.

              A form of anecdote could be that because IBM still make some form of x64 flavour Mainframe OS indicates that large corporates still have code that's potentially double my age.

            • Swizec 12 years ago

              I don't know the whole story, but seeming as this was banking software I wouldn't be surprised if it was indeed written some time in the 80's or 90's and the original developers were nowhere to be found.

              • nomedeplume 12 years ago

                i know it's not your first language but since you mentioned you like to think and understand things, the correct syntax is '80s and '90s; the apostrophe is used to indicate letter omission. incidentally, my first language was basic. didn't want to omit that :)

          • nomedeplume 12 years ago

            Thanks for responding with a specific $ amount. I do indeed appreciate it.

      • soup10 12 years ago

        Lol my code base is fine thanks. Maximizing productivity and writing maintainable code are not mutually exclusive.

      • twelvechairs 12 years ago

        You are being offensive here - going all as hominem rather than actually demonstrating any reason parent comment is wrong.

        • mercer 12 years ago

          I read it a bit of a joke, not meant maliciously, and yet with a lot of truth to it.

          I'm sort of in between "get shit done" and "fix other people's shit" in my work. Because I like to take pride in my work, and because I don't want to leave the full timers with yet more contractor mess, I take care to do my job as well as I can. And I prefer projects where I can be proud of everything I do.

          But in the 'trenches' of unsexy work, where my ideals meet reality, neither I nor the full-timers always have the time, money, or expertise to do things right, and are sometimes even forced by management to just get it done.

          And I don't always mind. I can be happy with the result because it serves its purpose, and I made both the managers and many customers happy, even though I cringe at the underlying mess we produced. I know it is likely to cause much more work down the road, and I would generally advise against 'ship first, refactor later', but I'm also okay with the idea that I provide work for specialists to fix my mess.

          Can I call myself a 'programmer'? Or am I more of a 'code monkey'? Do 'real' programmers thumb their nose at my sometimes shoddy code?

          I don't really care. I'm happy with my work, and with my solutions. My aim is to move towards being able to provide full, high-quality solutions, because that makes me happier. But it also makes me happy to creatively solve problems in a way that might be imperfect, or frowned upon by some.

          The most important reason for me to provide good, solid, readable code is because I care about the full-timers I meet who don't enjoy fixing my mess, and because I don't want my client to get into trouble later. That's why. It's primarily (but not exclusively) because I work with humans and I don't want to abuse my 'privilege' as a contractor and (relatively) skilled communicator to give other people headaches and crying fits over having to fix my junk. I've seen that happen, and it sucks.

          (sorry, not necessarily directing this at you specifically)

        • Swizec 12 years ago

          You missed this part of the post then:

          > whole teams grind to a halt productivity-wise because the codebase is so bad

          • randac 12 years ago

            Don't be ridiculous. That does not make "You are doing god's work, son. Thank you." any less ad hominem, nor do you actually demonstrate any reasons. Your argument amounts to "copy+paste coding is bad, therefore your codebase is bad", yet at no point explains why. But keep downvoting anyone who points that out :)

            • dannypgh 12 years ago

              An ad hominem argument is one in which you reject a position not on its merits but because of who is making it. They took a position that copy/pasting code leads to unmaintainable code, therefore his argument is not ad hominem.

              He's being insulting, sure, but that doesn't mean he's making an ad hominem argument.

              • twelvechairs 12 years ago

                It is ad hominem. The ad hominem part is the part which infers the parent poster makes whole teams grind to a halt and also earns less than himself.

          • twelvechairs 12 years ago

            I didn't miss this part - you didn't put any reasoning behind it.

          • jesusmichael 12 years ago

            I've seen that more from guys that "start from scratch" than guys who cut and paste... most guys who cut and paste also annotate and comment... most geniuses can't be bothered to both code and comment...

  • Shivetya 12 years ago

    I will disagree with your copy and paste assessment. While it will hinder a junior programmer its a godsend to the senior developer. Someone who can quickly recognize what the code is doing and integrate it into the final solution.

    There are more than enough APIs just on the platform I work with daily that I can imagine how much fun it must be sorting through all those available to Windows developers must not be a joy. Well Google lets me search quickly for established solutions and combined with my knowledge I can quickly identify which if any will do what I want to do and adapt if not drop into my coding style.

    TL;DR

    Copy/Paste might not be good for new programmers, but time savings for experienced programmers warrants its use

  • increment_i 12 years ago

    I can appreciate your opinion on this but it strikes me as a bit of a 'high horse' statement to declare that copy and paste is the wrong way to learn or advance the process of mental reasoning. At some level, we're all copying someone who came before us, unless you're working at the absolute bleeding edge.

    Everybody has their own style of learning, and not everyone is at a point in their journey where poring over API docs or dropping down into a lower level makes sense for them.

  • baddox 12 years ago

    > This is not 'coding' (maybe it is, and we should be doing less of it, and more programming). This is gluing together pre-coded snippets and trying to make it work. Continuing to do this is an impediment to getting better. Thinking that somehow this is what 'coding' is, is missing the point.

    That's not fair at all. Off the top of my head, three topics I have searched StackOverflow for a lot are Android development, MongoDB, and MySQL. Each time, I would consider the task I was doing to be programming, despite the fact that I was not building a mobile phone operating system or database myself from scratch.

  • lazyjones 12 years ago

    > Copy and paste doesn't help you at all with this. In some cases it may prevent you learning essential lessons and hinder your improvement.

    It annoys the heck out of me too when people apply for a programming job and cannot implement even trivial CS methods (like integer => string conversion with base N), then point out that they would just Google for a solution if they needed something like this.

    But to be honest, a lot of programming wisdom is buried somewhere on the web as well as inside libraries that do not warrant reimplementation. Much of this googling and copy-pasting simply represents the fact that our traditional programming library approach isn't sufficient anymore for distributing correct implementations of particular functionality - probably too much overhead. SO is much like a large library with mediocre code, imprecise interface specification and without working imports, but it also contains many solutions to trivial problems that competent engineers should be able to implement straighforwardly...

    • mattmanser 12 years ago

      I have been programming professionally for 10 years, 5 years more as a hobby. I have been paid 100s of thousands of dollars, my code is used daily by 10s of thousands of people, I have built large, complex systems from scratch, worked in teams and by myself. The things I make do what they're supposed to, they don't break often[1], tend to be fast and usually my client is a happy bunny.

      I can fix anyone's code, even when I've never used the language before [2] and it was written by an outsourced programmer who quite obviously only read "how to write SatanScript in 28 days" and then was locked in a room for 2 years until his program kinda worked if you held it upside down while reciting the words to Annie.

      I am confident I am a good coder at this point in my career, and much better than many of the programmers I have met. There are a handful I have met that I know are better than me.

      I would only have a vague idea of how to do a integer => string conversion with base N without googling it. So am I shit? Am I suddenly a useless programmer because lazyjones only likes people who studied CS? Even though I can understand that code in a glance and rewrite it, often better or clearer than the SO example?

      You have picked an arbitrary, and extremely rare in the programming world, standard. No-one needs to write their own string handling routines any more.

      Programming is hard and there are many different flavours.

      And yours is an old fashioned favour from the early 00s. Stop judging people by it.

      [1] Apart from my very bad habit of making a minor last minute tweak or bug fix, not testing it, and introducing an easily fixed bug

      [2] They're all pretty much the same after you've used 3 or 4.

      • wting 12 years ago

        > I can fix anyone's code, even when I've never used the language before [..]

        You can jump into any codebase and solve core architectural problems like precise garbage collection, eventual consistency, or miscellaneous dead locks? I'm not making up contrived examples, these are some of the problems my friends and I are currently dealing with at work for different companies.

        > I would only have a vague idea of how to do a integer => string conversion with base N without googling it. So am I shit? Am I suddenly a useless programmer because lazyjones only likes people who studied CS?

        I've never had to do integer => string conversion until asked in an interview either and I still did it. It's not a difficult problem. Anyone with a basic understanding of division and string manipulation should be able to reason out a solution.

        > You have picked an arbitrary, and extremely rare in the programming world, standard. No-one needs to write their own string handling routines any more.

        I wrote my own C++ string library before std::string was introduced. I contribute to Rust which has its own string, big number, vector libraries and much more. The web site I work on gets >130M monthly uniques and we have extended Python's string, dictionary, iteration, and datetime modules because the standard library isn't enough.

        > [Programming languages are] all pretty much the same after you've used 3 or 4.

        Then you haven't used enough languages. Try functional programming via Haskell, or dependent typing via Coq, or concurrency via Erlang, or memory safety via Rust.

        The world is a really big place. I know people infinitely smarter than me doing incredible things, and there are many more like them. Stop being limited by your own experiences.

        • mattmanser 12 years ago

          Yeah, probably, but that's one of my skills, I have fixed a lot of bugs.

          But take a step back. What are you trying to say? You're better than everyone who hasn't done these things? You're somehow a real programmer and everyone else isn't?

          And look how big your penis is!

          Seriously, what were you trying to achieve with this comment? What have you demonstrated? You're a specialist, you know certain things other people don't. So what? It doesn't make you any more of a programmer than I am.

          And seriously, don't puff up the differences between languages, in the end every language is just a different way to take some data, transform that data and emit that new data. What happens in between is nothing particularly complex, it's simply the sheer number of those steps that can happen that make it complex. The whole point of languages is to make it easier to express something. Not harder.

          I honestly don't know what perceived slight you were responding to. Carry on believing only the highly specialized 0.1% of programmers are real programmers if you want. Stop being limited by your own snobbish elitism.

          • delian66 12 years ago

            Wow, dude, chill out ... in my opinion, wting did not write anything, that gives you reason to accuse him, that he is an elitist. He simply pointed out, that you are limiting yourself with the kind of believe, that there is no need to know how to solve simple problems on your own, and give you examples of things that he was able to do, because he did not limit himself in such a way ...

      • delian66 12 years ago

        >>I would only have a vague idea of how to do a integer => string conversion with base N without googling it. So am I shit?

        If you receive a programming task like the above (with a relatively clear specification, very little state to manage, defined domain of the desired function, and the input and output of the function are most likely primitives in your language, your standart library probably have lots of utility functions to work with these primitives), I will expect, that you should be able to do it without googling.

        Your solution may not be the most effective/short/clean, but it should work. If you can not do it without googling, well ... yes, I do think you are a shitty (or just out of shape for the moment) programmer.

        You will need more programming exercise, in order to know more algorithms and aproaches to solving problems, and/or learn better your language and its standart library.

      • zAy0LfpBZLC8mAC 12 years ago

        I'd tend to agree with lazyjones. I doubt that his expectation is that you would know all the tricks for making the most efficient integer => string conversion routine ever, but I certainly would expect any competent programmer to be able to write an integer => string conversion routine without really thinking about it, not because anyone needs to write such code much anymore, but simply because a competent programmer should have sufficient mathematical understanding to see the obvious solution to the problem. This isn't about writing string handling code, but about demonstrating understanding of very basic mathematics using a trivial problem that should need a line or two of code in most programming languages to solve.

      • lazyjones 12 years ago

        > would only have a vague idea of how to do a integer => string conversion with base N without googling it. So am I shit?

        I would probably not hire you unless you could actually back up your dubious claims ("I can fix anyone's code ..."). The funny thing is, while I am judging people by their ability to solve a particular problem (which admittedly may have an age bias), you are judging people who studied CS based on the fact that you didn't but are still full of yourself.

        • mattmanser 12 years ago

          I'm not judging them. There are great programmers who studied CS. Is a worthwhile thing to add. The best programmer I know studied CS.

          It's worthwhile, if you can actually program.

          It's unfortunate that a lot of people have to wait till they've gone to Uni, studied CS, gone into the real world, got a job programming, and found they cannot program.

      • louthy 12 years ago

        > I would only have a vague idea of how to do a integer => string conversion with base N without googling it. So am I shit?

        It sounds very much like it I'm afraid. This is trivial problem solving. Your overconfidence + lack of problem solving ability are big red flags. If you're as good as you claim you are then you should know foundational principles. It gives you a far greater insight into programming than just grinding away with other programmers 'snippets'.

      • ryanpardieck 12 years ago

        I feel like it's a pretty common phenomenon for people to have their pet somewhat-arcane "gotcha" problem that they feel is the ultimate decider of who's shit and who isn't. And you're on HN, so the responses are going to be way more pedantic than just about anywhere else.

        Personally I think this example is way more reasonable than most other technical "gotcha" problems. (I say that because I could solve it despite not having studied CS and being still relatively inexperienced.) But at least they're not asking how many pickles you could eat before exploding if you were shrunk down to the size of a kitten's tongue and placed on a miniature rocking horse that may or may not be alive inside its sad plastic shell.

  • riveralabs 12 years ago

    Copy/Paste is OK as long as you understand the code. If the code is elegant and you know what's happening there's no need to change it.

    I would argue that the problem is not the copy/pasting but where to paste the code. As an iOS developer I download a lot of code samples from the Apple Development Website. In many cases on these samples the developers put a lot of code in Controllers to show how things are done.

    Beginner developers will usually copy/paste the code as is in the controller and believe what it does by faith.

    An experience developer should understand that the code was put in the controller for educational purposes and place the code where it belongs. A Model, Singleton, or leave it in the controller if it makes sense.

    • orkoden 12 years ago

      I have seen many sample projects included in full in final products. "It's from Apple, it must be good!"

  • Kiro 12 years ago

    > Then I'll throw them all away and code my own. Possibly it will share a lot with one of the answers, what I would consider a good approach

    So basically you're in the business of reinventing the wheel all the time. I feel sorry for your employer.

  • jesusmichael 12 years ago

    wow... You must be from the school of re-inventing the wheel... most things that need to be coded have been done before by someone else and quite well... No one chops down their own tress when they want to build a deck. They take lumber that someone else preformed and make it fit their project. If you are writing all your own code every time on every project... You must get nothing done...

    • nailer 12 years ago

      Libraries yes, copypasta no. They're maintained, have tests, and a download/follower count.

      • dyeje 12 years ago

        'They're maintained, have tests, and a download/follower count.'

        While not exactly what you're saying, I feel that a good StackOverflow answer has the same general properties.

  • Confusion 12 years ago

    Agreed, but doesn't that mean the main premise is almost correct? It indeed seems like the skill of 'programming' depends on the development of a knack for Googling for the right terms.

    I think it is actually the other way around: once you develop the skill of 'programming', you will know what to search for when you have a problem and you will understand enough of the puzzle to construct the last piece from the various results to your search query. If you don't know how to search for an answer to your problem, you do not sufficiently understand your problem.

  • chrismorgan 12 years ago

    I read that as tongue-in-cheek.

  • bra-ket 12 years ago

    copy and paste helps to get the job done

    • jwdunne 12 years ago

      I don't think so. A program is an infinite stream of jobs and is never quite 'done'. The less time you spend on keeping things nice and clean, the more frequent the jobs will be. After all, it still needs to be maintained.

      Unless you are using a library, it's gonna be better long-term going for complete understanding. Even then, it's usually a great idea to understand what a lib does under the hood.

      • goblin89 12 years ago

        I guess it depends. A freelancer hired through oDesk by default has a clearly defined job and zero incentive to care about ‘nice and clean’.

        Sometimes I just can't help thinking that the code I maintain has been optimized, foremost, for someone's job security—even when I know that the author is actually just of ‘get-shit-done’ type, and has been paid hourly.

rdtsc 12 years ago

You need multiple things to come together. Some are abstract and general, some are more specific. You need to know the tools you are using, the capabilities of your platforms.

At some lowest level it is about solving problems and knowing how to drill down and understand requirements, split a large problem into sub-problems. In that respect it is not unlike an architect or an engineer or carpenter.

Then it comes to about learning how to translate to an intermediate mental representation. Here where you you already think about the typical language paradigms. Like someone used to object oriented design starts seeing objects, factories, inheritance hierarchies. Someone used to actor based programming (like Erlang) starts seeing actors sending messages to each other. A Haskell programmer starts thinking about type-classes (presumably, I am not one).

Then it comes down writing it. Here one needs to know the tools in detail. The specific language, platform, API. Say something object oriented at the higher level could become something in C++, Java or Python here. Here is where Google-ing helps. Knowing that say oh Python has this cool built-in module that can help me. Or yeah, I'll use a smart pointer here. Well you have to know about the smart pointers.

Then here is boring but important stuff. Knowing how to use version control. Knowing how to estimate time, communicate with team-mates. Not being stupid about security.

Anyway a lot of things have to come together to make someone a successful programmer in the general sense. Some acquire these capacities formally by going to college. Some acquire these on their own.

The interesting thing is that regardless of how it was acquired, the usual instinct is to discount it while looking back. "Oh I just write Python, here is a book on syntax, learn it and start programming". That always somehow seems easy to programmers. And I have made the that mistake. Friends and family member I have tried to show/teach programming.

  • ChuckMcM 12 years ago

    I've found the hardest thing about teaching people to program has become that there is a huge learning curve between the "simple" stuff and making real progress. I've been working on a device which will level that out a bit with an easier intro level.

    I've found that interpretive languages, Python, Perl, or even BASIC can be less difficult to start because you can start exploring them right away. Compiled languages are harder because of the intermediate step.

  • alelefant 12 years ago

    "And I have made the that mistake. Friends and family member I have tried to show/teach programming."

    I'm just curious, knowing what you know now, how would you go about trying to show someone how to program?

    I may have that opportunity soon and I was going to suggest thinking about a simple yet everyday problem that arises, and try to make it better with an app (could be phone, web app, client app, etc).

    • paulbaumgart 12 years ago

      I learned programming with HTML/PHP. It's great in that HTML is really easy to understand and lets you draw colorful text and pictures to the screen almost immediately. Then, you can jump to Turing-completeness with a new kind of tag, "<?PHP" that can handle form inputs and generate new HTML!

      And then get them over to Python or something ASAP. PHP doesn't have enough structure for a beginner to learn good software design principles, it's best kept to just teaching a thing or two about loops and control structures.

      Teaching HTML + JS is tempting, but then you kinda have to explain the whole DOM too, which just makes things complicated.

    • philmcc 12 years ago

      1. I try to find out something that the person already understands, so I can frame my metaphors around that.

      2. Maybe I'm projecting, but I was tinkering with computers for a long time before I started learning to program. To that end, there's a lot of just intuitive understanding of software that you absorb, basic relationships like configuration files, rebooting, memory, what a browser does, what a URL variable is etc etc.

      There's a lot to be said for helping a person round out this knowledge, before you start teaching them how to program.

      I don't know that a person needs to know a lot about America before learning American English, but I wouldn't be surprised to find out that it helps. "You see, they're kind of a casual low key people, so their language has a lot of slang and elisions..."

    • jbcurtin2 12 years ago

      Learn to question everything. Use CodeAcademy, KhanAcademy, and w3schools.com. Don't listen to people who tell you something is a horrible idea. You're far to ignorant on programming to have your own opinion and accepting someone else's will just stunt your progress.

      It's like learning to speak another language; you're talking to a child. You have to tell/teach it everything about it's life. Eventually it'll be able to live by it's self.

      When you're ready for application programming, look for topics on c/c++ and other languages that people seem to love. Find out what your favorite game/website is built in and see if you can replicate it.

    • logicchains 12 years ago

      I'm teaching a relatively mathematically-minded friend programming and I've found http://repl.it/languages/Scheme to be an excellent resource. The simple syntax and semantics of Scheme and its easy accessibility allows them to quickly develop an understanding of the fundamentals, and from there it's not much work for them to download DrRacket and start on more practical applications.

      I think games are a great place to start; simple, humorous text-based adventures, for instance, are both really fun to write and teach a lot of the basics.

    • rdtsc 12 years ago

      I would be more patient. I would start with something they want to do, like a practical project. "make a garage door opener". Or make a "robot controller", beer brewing temperature probe with a web server, an app to teach morse code.

      The more abstract aspects often become internalized through experience and through concrete examples. Say I didn't care about all the network or socket programming until I had to implement a chat-like server. Looking back thinking "oh yeah algorithms are important" but I only internalized that until I picked the wrong one and got horrible performance. Or until I started interviewing and everyone and their cousin wanted algorithms -- so yes they are important in getting a good job ;-).

      Anyway this "example before abstract" is just my personal idea. Googling for example is something I do very often. Say when I get to an API section, I quickly look for example first. Man pages that have examples.

    • thrush 12 years ago

      I've found the hardest thing for beginner programmers is being in a state where they can actually run their code. That's why I think NodeJS and Javascript are so awesome. The code just runs, better yet, Javascript (perhaps not NodeJS) can run in the browser (there's the developer console, even JSFiddle)!

  • thrush 12 years ago

    What I think is cool about programming is that if you can understand a book, like the C Programming Language for example, then you can probably program. Although, being able to understand that book may take a little more work than just reading it (you might need some supplementary material). A lot of other pieces are soft skills for becoming a professional software engineer, such as time estimation, communication, version control, etc (soft skills in that they can likely be picked up on the job).

    • collyw 12 years ago

      Yes, but the coding part is usually the easiest party about being a programmer. All the other skills and knowledge you mention are what makes me far more valuable than when I started 14 years ago.

      • thrush 12 years ago

        I think there is a huge distinction between learning how to program, and becoming a valuable programmer. We need to decrease the barrier to entry, so that the more valuable skills (such as abstraction, optimization, security, etc.) are reachable for everyone and anyone.

gradys 12 years ago

>They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google and knowing which code is best to copy-paste"

This is a misleading simplification. I'm sure I'm preaching to the choir here, but I'm going to elaborate anyway.

Learning to program isn't fundamentally about learning what text to type in to a box somewhere. It's about learning to think computationally. "Think computationally" is vague and doesn't mean very much to the beginner. That's because it's something you need to learn with practice.

Think about writing in normal human languages. You could say there are two things going on when you are writing an essay, for example. At one level, you are thinking about the concepts. What are your arguments? How are you going to support them? At another level, you are thinking about how to write them down -- how to encode them in a way that readers will understand.

The same distinction exists in programming. At one level, you need to think computationally. What are the inputs I have access to? How can I use them to produce the right outputs? What data structures should I use? How should I handle this edge case? At another level, you are thinking about how to write all of this down so that the computer will actually be able to do it.

Copying and pasting will help you with the second part -- figuring out how to write down the structures you come up with -- and real, experienced programmers do that all the time, but it won't help you with the first part -- figuring out what structures to write down.

  • jimbokun 12 years ago

    "Learning to program isn't fundamentally about learning what text to type in to a box somewhere. It's about learning to think computationally."

    But learning how to start programming isn't about that at all, even a little bit.

    Writing your first program is learning what a text editor is (no, it's not quite the same as a word processor), maybe learning about the command line interface on your computer for the first time, learning about the various dependencies between the tools and libraries you need to install to get started. There is Googling and discovering tutorials that are out of date or have mistakes in them, and figuring out what to do then.

  • enraged_camel 12 years ago

    On the other hand, there is a lot to be said about knowing what question to ask and how to ask it. In the age of Stack Overflow, using the wrong terminology or being too specific with your question can lead to never finding that chosen, community-wiki'd answer with 500 upvotes that holds the solution to your problem (or shows you that you have been following the wrong line of inquiry, built upon the wrong set of assumptions).

ef4 12 years ago

> They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google and knowing which code is best to copy-paste. And they don’t let you in on a big secret: that there is no mastery, there is no final level. The anxiety of feeling lost and stupid is not something you learn to conquer, but something you learn to live with.

Just because you haven't achieved mastery yet doesn't mean it doesn't exist. It takes a very long time.

Until you've worked with masters, you may doubt they exist. But they do.

  • ScottBurson 12 years ago

    The OP has it right. I've been programming almost 40 years, and I think it's safe to say I've achieved a certain level of mastery. But when I'm working on something hard, I still feel lost and stupid. I wouldn't have it any other way! If I don't feel challenged, I get bored really really fast.

    • agumonkey 12 years ago

      Do you feel a difference in the way you handle the solution space exploration ? tricks or just decades-built patience ?

      • ScottBurson 12 years ago

        Patience, and a confidence that comes from having solved hard problems before. If there's a trick, it's to always focus on the part that doesn't make sense yet.

  • enraged_camel 12 years ago

    On the other hand, most masters will not call themselves that, and will resist being labeled as such. Because ironically, true mastery can only be achieved through humility.

    • krisgenre 12 years ago

      No, I don't think so. There are many masters in music who can be quite arrogant, don't see why it can't be applied to programming. Also, those people who don't call themselves 'masters' may not do so for the sake of their public image. Once you start working with them you'll know what they really think.

  • psyklic 12 years ago

    I disagree with the author -- I never feel lost and stupid. There is always a way of bringing an idea to life, even if there are compromises and tradeoffs.

    But nowadays, I am forced to rely on third-party libraries. These libraries often change constantly and have "in-development" nuances. So, the OP regrettably is correct that searching the Internet is a requirement for working on modern applications.

    I do reminisce about the pre-Internet days, when all I needed was my brain and a simple reference book!

    • cordite 12 years ago

      My mom taking python on coursers constantly feels lost and stupid. She's doing it again even though she passed last time.

      I remember feeling that way when I was eleven, teaching myself. But I think this feeling goes away with self confidence and experience.

    • cynwoody 12 years ago

      >I do reminisce about the pre-Internet days, when all I needed was my brain and a simple reference book!

      Once upon a time, I had a bookcase full of three-ring binders containing plural "reference books", updated frequently via snap-open, pop-out, slide in latest version.

      These days, I find Chrome's location bar far faster and more convenient than that bookcase!

      She is absolutely correct about the importance of "developing a knack for asking the right questions on Google".

      And as for copy-paste, when and to what extent to do that is another knack, one which will likely accompany the acquisition of the first knack.

    • woah 12 years ago

      I bet the person who maintained your code felt lost and stupid though! The benefit of libraries is that the reference exists at all.

      • psyklic 12 years ago

        You assume that all libraries are bug-free and documented accurately! I assure you that few are.

        • collyw 12 years ago

          That depends. Use a well known library in Python or Perl, and they usually are well documented and tested.

          Now choose some obscure JavaScript library from Joe Random on github, and what you say is probably true.

    • ef4 12 years ago

      If those libraries are open source, you can still do it. ;-)

  • bpatrianakos 12 years ago

    If you want to be super technical, sure. But in the context of this article that quote rings true. The masters really are surprisingly few in our field. At least the sort of masters I think you're talking about. In my experience most programmers have a sense of imposter syndrome that is very tough to crack so including that quote in the article was something I liked and think is important for other developers to hear. The amount of knowledge and experience needed for true mastery is so deep and wide that in practical terms I would agree with that quote completely.

    • greenyoda 12 years ago

      "The masters really are surprisingly few in our field."

      Contrary to what some readers here might expect, most highly competent developers don't have blogs or start their own companies. Most of the talented and experienced engineers who work in the bowels of Google optimizing search algorithms, or at Boeing writing avionics software or at Oracle designing database systems pursue their craft in obscurity and anonymity. I work with master programmers every day who nobody has ever heard of.

      Having been on HN for a few years, I've recognized several of the people here as being masters of their craft based on the depth of understanding and experience that's evident in the words they've written.

      "In my experience most programmers have a sense of imposter syndrome..."

      I think that the Dunning-Kruger effect, in which "incompetent people will tend to overestimate their own level of skill" and "fail to recognize genuine skill in others"[1] is much more prevalent in our field than impostor syndrome (the opposite phenomenon).

      [1] https://en.wikipedia.org/wiki/Dunning-Kruger_effect

      • mattgreenrocks 12 years ago

        HN is a bit of an echo chamber, unfortunately. Masters don't really tout themselves as that, nor do they self-promote everything they do.

        On the other hand, there's plenty of jr. devs who blog about the 'amazing' gains of productivity from switching to Vim...

      • jesusmichael 12 years ago

        Being a "Programming Master" has so little to do with coding, but the ability to analyze and automate real world processes and make them interact intelligently for the benefit of the user. Solving puzzles and memorizing algorithms it's taking someones project and giving it life.

Balgair 12 years ago

I'll hijack here a bit (sorry).

A good friend of mine in in a PhD program at UCLA. She's into solid-state physics and modeling. They use IgorPRO a lot in this field (oddly, also audiology). However, she can't use it a lick. She tries, she really does, but she just can't.

Why? Dyslexia. She has dyslexia. All the variables on the screen just look the same. i++ and i--, or +i and 'hi', or for() and if(). Just the same stuff to her. Its something not usually discussed, as I think most programmers don't have it so bad. 'Up to 17% of the population'[0] may have some form of dyslexia. It's something that really does impede many many people from just reading, let alone coding and programming. Does anyone know of a work-around for this at all? Thank you.

[0]http://dyslexiahelp.umich.edu/answers/faq

jimbokun 12 years ago

I have been programming a long time, and even now I often feel getting the environment set up to start something than just writing the actual code to solve the problem.

Compiler versions, dependency injection configuration files (why yes, I am a Java developer, how did you guess?), build systems, source control, dependency management, library incompatibilities, setting up a test environment, setting up and configuring databases and web servers, etc.

Maybe I don't actually spend as much time on these things as it feels like I do, but I do know futzing with this stuff when you just want to write real code to solve real problems is soul sucking and demoralizing.

So I definitely relate to the hard part of programming, beginner or not, as just getting to the point where you can actually write some code and see what it does.

  • BorisMelnik 12 years ago

    I really see your point on that. I am a hobbiest scripter, I know HTML/CSS, dabble in PHP and Javascript and can read a lot of C.

    I tried learning Ruby/Rails a while back and spent 3-4 hours just trying to get the environment setup. I finally realized that Windows 7 was not a very popular OS to learn Ruby on and gave up.

    On the contrary, getting a PHP/Python/Javascript "environment" setup is no problem. Notepad + a hosting account or any Linux/Mac and you are good to go.

  • beemoe 12 years ago

    This comment really resonates with me. It is what I think of when I hear that quote, "Technology has the shelf life of a banana". It demotivates from starting new side projects when the old ones take such efforts just to set up again. Code can give the impression that it has some timeless value like some truth that has always existed and you have captured, but in reality code cannot "exist"(or fulfill its purpose) in isolation.

  • 7952 12 years ago

    So much of the time the basic environment isn't even enough. Consider writing a 3D game. You can't just load some data into a structure and then invoke render(). You have to choose the correct library that will be performant enough to work and simple enough to learn quickly. However good your code is it will be too slow if you are targeting the wrong environment. IMHO this accounts for a lot of the actual frustration of learning to code.

  • kpennell 12 years ago

    Thanks for this comment. I've found it to be spot on. It is absolutely demoralizing to spend weeks on trying to figure out env and deployment settings vs. actually making things with code. I hate dev environments so much. They destroy your will to learn.

ant_sz 12 years ago

Programing is easy for who has already learned it. The second language is easier to learn than the first one. I think that's why programers keep telling programing is easy.

I admit that the learning curve of programing is a little steep. But isn't every skills in the world the same? Think about the first time a child learn to walk, the first time a child learn to speak. No healthy adults think these things hard to do now.

The conclusion: the programing is just like any skills in the world, they are always hard for the new beginners but become easier and easier while you are getting familiar with them. Saying if it is statically hard or not isn't an accuracy statement.

andrewfong 12 years ago

To borrow from PG, treat learning to code like learning to paint (or any other creative process). You might pick up the basics pretty quickly, but the quality of your first webapp will probably be comparable to that of your first self portrait.

felixrieseberg 12 years ago

There's merit in reminding people that a lot of development contains a decent amount of Googling, but I'm not sure that "knowing which code is best to copy-paste" is the main trait of coding.

What's certainly true is that learning how to code is dramatically easier than it ever has been; and is likely to get easier as time passes. Learning how to code is indeed pretty easy, knowing how to build a complex product goes beyond that, though.

  • demallien 12 years ago

    You know what? I don't think it is easier to learn to program now. Many years ago when I was a child and I got my first computer, it booted straight into a BASIC interpreter. The computer also came with a manual that taught you about if statements, for/next loops, gotos and gosubs. It showed you examples of how to draw to the screen and get inputs.

    Compare that to today. There was nothing to install. It was all already there. There wasn't even an environment to launch, you booted into the REPL. You didn't have to hunt for tutorials on the internet, everything you needed to get started was in the manual that came with the computer. And everything in that manual was appropriate to the computer. You didn't have to worry about having the wrong version of dev environment, making the tutorial incorrect.

    That's not to say that programming hasn't improved in other respects. I could spend years trying to build a basic TCP/IP stack on that old 8bit computer, which already comes pre-installed on a modern computer. I can grab a free copy of just about any language I've heard of. Huge numbers of libraries freely available allow me to stand on the shoulders of giants. But, nothing available today approaches the simplicity of that old 8 bit system for learning to program...

  • darkmighty 12 years ago

    It is remarkably easier, that far I can tell. The number of "building blocks" so to speak in a programming language are quite numerous for most tasks (i.e. not core algorithms) -- something I learned quickly which frustrated me when I started programming in HS -- unlike in math where dominating elementary logic/algebra allows you to solve incredibly complex problems just by thinking hard enough, in languages/libraries tools and problems are tightly coupled, and numerous.

    So often the better way is just googling, seeing examples, and a lot of copy-pasting.

spain 12 years ago

I highly disagree. The author says one of the main reasons coding isn't easy is because setting up the environment is so difficult. The problem is that if you try and learn "iOS" using XCode then of course the environment has a lot more weight and cause more issues that you really don't need to deal with as a beginner. A better option would be to fire up a simple Scheme or Ruby interpreter in a terminal and watch them go (after giving them a copy of your favorite programming book). Heck, with things like CodeAcademy you can just visit a website and eliminate the environment issue completely.

I'd say the problem with programming isn't that it's difficult, but that it's intimidating. Writing a bunch of arcane symbols and words in a text file scares people off, while really it's just everyday logic people use in a different form (at least, the very basics are). I think that's also why programmers keep telling people it's so easy, so that they get over that irrational fear.

ef4 12 years ago

Also see Peter Norvig's "Teach Yourself Programming in Ten Years".

http://norvig.com/21-days.html

withdavidli 12 years ago

>And they don’t let you in on a big secret: that there is no mastery, there is no final level. The anxiety of feeling lost and stupid is not something you learn to conquer, but something you learn to live with.

One of the biggest surprises when I started to learn, LANGUAGES ARE STILL BEING UPDATED. ?_? Totally thought that was done and over with, then I come to find language/framework updates can break entire programs. First time learning Rails was when they just upgraded to 4.x and all the tutorials was in 3.x. Now that was a "FUUUUU" moment.

P.S. I thought the pictures was done quite nicely ^.^

  • greenyoda 12 years ago

    Not all languages ignore backward compatibility. There's Fortran code written in the 1960s and C code written in the 1970s that will still compile correctly with today's compilers, even though these languages have evolved continually over the years.

fred_durst 12 years ago

I've been programming for maybe too long now, but likely not nearly as long as the higher level advanced developers, but still the idea that people copy & paste code from Google/SO is horrifying. You are really just going to work on some real life project and just blindly copy some random crap you found online without even knowing what it does completely? Yikes.

  • cmelbye 12 years ago

    I find it amazing how often I see comments on Stack Overflow complaining that the obvious pseudocode solution (meant as a guideline to explain the correct answer) "doesn't work". It seems like it's very common to outright copy and paste code without any sort of basic critical thinking on how to properly integrate it into one's project...

  • bowlofpetunias 12 years ago

    Uhm, that's how I still learn new languages. Copy, paste, modify just to get something done.

    The modify part leads to more concrete questions, more Googling, more detailed reading of docs, until at some point I'm engaged enough to go back to zero and actually start learning the language from the basics.

    (This doesn't work for those languages who's paradigm you first need to understand before being able to do anything, but most languages allow for hacking straightforward procedural code at the basic level.)

    • fred_durst 12 years ago

      I mean this in the best way possible, but do you like actually take your mouse over to the webpage, highlight the code, copy it, and then paste it into your editor? I am genuinely curious.

      • philmcc 12 years ago

        Yes. I do this from time to time. Recent example, wasn't sure what the event was called in JavaScript when the window changed. Couldn't remember if it was resize or windowResize or whatever.

        SE had a sample dummy event listener add function, complete with // do stuff here. I cut and paste the whole thing and added what I needed.

        I suppose I could've retyped the addEventListener function from scratch but...I dunno, that seemed inefficient. I just needed the name.

  • taurath 12 years ago

    If you don't know what a thing does and you don't have the time to learn it, sure. A few years ago when I was making my first applications I "used" regex's off of stack overflow long before I was able to take the time to learn the syntax myself. At the time it was much more important for me to learn design and compilation than it was to go off and learn regex.

  • garthk 12 years ago

    It's so common, large companies have entire teams dedicated to running Black Duck scans of their software to hunt down the paste-ins lest their software become open source or their patents cross-licensed by accident.

    That scenario might not be entirely possible given the terms of GPL and Apache, but that's how they talk about it.

    • belorn 12 years ago

      The problem such companies has is extremely similar to news papers. They constantly has journalists that copies from Wikipedia, uses images from "the Internet", and end up committing copyright infringement, for profit, in a commercial scale.

      Even political parties who's slogan is more police and harsher punishment don't understand copyright. In Sweden, the extreme right just plucked some images from the internet, did not check the license, and used it in their party program and commercials. In the end, every Swedish household got sent a pirate copy.

      The problem is that copyright infringement is so extremely easy to do, that it happens everywhere, and will likely keep happening regardless of scans.

jv22222 12 years ago

I've been coding PHP html css and JS for nearly 20 years and I still learn huge swathes of new information and techniques all the time. I wouldn't say I've mastered it. I'm pretty good at foreach though.

gcv 12 years ago

This is misleading. Learning to "code" or do the work horrifically called "software engineering" is definitely a huge pain in the ass. It's all about half-working fragile dependencies and outdated documentation. Don't do web programming. Don't do iOS. You can try it after you have used good tools first.

Instead, start by learning about computational processes. Use Racket — it's a stable, excellent environment. Read SICP or at least HtDP. You'll have fun. It's challenging, because it requires an adjustment to the way you think, but it is not particularly hard.

sal1800 12 years ago

With programming, art, carpentry and many other things, you just have to accept that the first project you finish will likely not be very good and the best thing to do is to throw it away and start over.

If you can embrace that idea, you can eventually learn to code.

The goal is to understand what you are doing and why, not just blindly copy and paste code that seems to work. Break it by changing something and fix it enough times and you will gain insight about how it all goes together.

Even the most complex problems can be made easy if you can break it into smaller tasks and build up to the finish.

analog31 12 years ago

>>> One of the most dangerous things I’ve seen happen to people who are just starting to code is being told that it’s easy.

I've encouraged my kids to learn programming. The one thing I haven't done is tell them it's easy. Anyway, they've seen me in bug hell, so they're under no illusions. But they're no strangers to learning hard things.

>>> And they don’t let you in on a big secret: that there is no mastery, there is no final level. The anxiety of feeling lost and stupid is not something you learn to conquer, but something you learn to live with.

Yes! Bring it on! Bright kids spend their entire school day at the final level -- 99th percentile on every possible measure. Those kids would benefit from an extracurricular activity with no final level (traditionally, "classical" music) that they can pursue at their own pace.

>>> They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google and knowing which code is best to copy-paste.

In my view, that's a general skill in its own right, worthy of learning. I fixed my refrigerator and clothes dryer that way. I rarely tackle any technical task without first seeing if somebody has blogged a tutorial. And I grew up fixing things before the Internet age. But I'd start kids on coding without the Google Everything approach.

>>> [the anxiety / boredom graph]

I enjoyed that. It does seem to ring true.

collyw 12 years ago

Depends on what you want to do.

I see lots of bioinformaticians writing simple scripts usually just counting stuff up, and doing some stats. It needs to run once, on one machine and often only on one dataset.

That type of programming is easy.

I am working for a sequencing centre, doing the database to run the place. I inherited a self taught bioinformaticians code after she had left. Second worst code I have ever seen (the worst was also a self taught bioinformatician, who didn't even indent stuff). The code was so bad, I had to refactor it just to debug it. The team leader didn't see a problem. It had worked. He didn't see the fact that it would have taken me a day or two to write this from scratch, if I had had an original specification, rather than spending a week to refactor her code until it worked. To this day, I have no idea what parts of the code are doing (I can see it is reading byte 8 of a binary file and doing something. I have no idea what the contents of that file are). At least now I have made the code modular so I can see the output of reading the file into a huge nested dictionary.

Learning to code is easy. Learning to code well is not. Hell we can't even decide what coding "well" means. 100% test coverage? Shit that works? Something that is readable and maintainable? Something that runs faster than all the equivalent software? In the end I think experience will mean a developer can work out which of these is most important. Maybe just getting something that works is what is important, and the example I gave above is perfectly acceptable code.

  • JoeAltmaier 12 years ago

    There are so many, many categories of program that its futile to say what it means any more. Expertise in any category doesn't mean squat about anything else.

    I've spent a lot of time doing embedded stuff. Totally different world. What matters here is irrelevant elsewhere.

    So any time someone says "I can program" you have to ask "Where? With what tools? For what audience?" and so on. Because there are so many niches (and so many being invented every week) its impossible to guess.

sirdogealot 12 years ago

I only tell my friends that programming is simple as a way to encourage them to get started.

Once they have begun, I tell them "sure, basic programming is simple, but you need to think hard about what you really want to do".

That generally has a good outcome and they continue to be interested in programming and wanting to learn more about it.

If you tell an interested person straight away that "it is incredibly difficult" then you will be discouraging a large number of people before they even begin.

wturner 12 years ago

At the college I use to work at they had a sound arts program and they still do. They decided to change this a bit and make a foray into the 'cool' world of programming. Instead of hiring software engineers to design the course they let the previous "sound recording" course directors and a few lab instructors attempt to write the program . All 4 or so of those people had never done any real programming with the exception of one, who as far as I know has never been in a professional programming or software development environment. In short he did some SuperCollider stuff as a personal hobby and was good at teaching MaxMSP. However, this is a different beast than teaching python or IOS which is what they intended. Especially at it pertains to audio.

Eventually they wrote a course that included Python.

I assume the instructors realized what they had bitten off as last I looked Python is no longer on the official curriculum. This story actually gets much worse as they wanted to do Objective C but they originally hired a former instructor who was a DJ to learn and teach it. That guy didn't show up for work one day ..... and never did again.

erikb 12 years ago

Although the basic assumption by the author seems to be correct, the author himself is not very far in his journey to become a programming master. I now study and work in programming for about 7 years. About 3 years into programming I thought the same way as the author: Tutorials and copy&paste.

If you reach a certain level tutorials become a waste of time, because you don't need structural help any more. You also understand that you shouldn't google how to implement a specific solution in the language of choice but which solution in that language solves the given problem. You also don't copy&paste because just solving a single problem is not the question any more. You can already solve most problems. It's more that the desire to improve leads to learning new principles, which means hand-copying small code examples (sometimes from actual programs not from SO questions) and playing with them until you get a feel for it and then start to use it in your daily programming tasks.

deadghost 12 years ago

When I see "programming is easy" I think "dirty, filthy lies!" When people say everyone should know how to program I think "why?" There's some weird nerd myopia going on with the programming literacy movement.

Programming takes an odd kind of thinking and is about as easy as anything else that takes a large amount of time and effort (read not easy).

klunger 12 years ago

This is a topic I have been thinking about a lot lately, so this article is quite timely.

I was a bad programmer for a long time. For a few years, I was an engineer and basically wrote quick and dirty matlab or python scripts to do physics based modeling and simulations. But, it was never elegant or efficient or anything that I guess you learn about in upper level CS courses.

It didn't have to be. A customer would never see the code, it would never have to perform under critical conditions, it could almost never be reused because each project data set was completely different. The code was just supposed to crunch input and produce meaningful output that could be analyzed.

I got to thinking that I was a pretty good programmer because I could write those scripts.

Then I quit that job and moved to a different country. The only job here that I managed to get was as a software engineer. Here, I learned how very wrong I was. Writing quick and dirty scripts that crunch data is easy. Programming is hard. Really really hard.

armada651 12 years ago

The kind of brain necessary for programming is the one that sees something it doesn't understand and then does everything it can to learn what it didn't understand.

The real reward in programming is clearly seeing how much your understanding has grown. But at the same time you're humbled by how much you have yet to learn.

oldspiceman 12 years ago

The only useful class I took in university was first year programming.

I felt like god when I first wrote an output stream to a file. I couldn't believe it was possible. Most people didn't have those kind of feelings. I think that's the difference. You're either captivated or you're not.

  • _random_ 12 years ago

    Then you read some science fiction and futurology forecasts and understand that there is no way future isn't going to be revolving around programming in every way. And you feel even better.

marincounty 12 years ago

I found the free cs50 courses at Harvard helpful. I honestly didn't have the patience to sit through the videos, but I listened to the mp3's while exercising. All the buzz words started to make sense. I don't think I'll ever become a Programmer--just don't have the drive, but I can put up websites--half ass, but they are improving. Yea, I know a bit about ROR, and Django, but would never call myself a Programer, or a cutesy Coder. In terms of making a living in this field, I honetly think who you knows matters more than what you know? I guess that's the case in a lot of fields? I've never had the stomach to suck up to someone I didn't truely like. I guess you have too though?

  • jimbokun 12 years ago

    I really feel like, relative to many other fields, programmers sincerely their field to be a meritocracy. They don't always live up to the ideal. For example, a lot of programming interviews used to heavily feature mathematical riddles and brain teasers. More recently this has come to be considered a bad way to evaluate potential programmers, but at least the intent was trying to find out something about the candidate's intelligence, and not just trying to make a personality fit or something.

brettgoulder 12 years ago

If you are considering a career as a web engineer, I think the first thing you need to ask yourself, do you enjoy tying and untying knots over and over again. If you do, you probably have the right stuff to be a really good programmer.

  • anishkothari 12 years ago

    I've also heard web programming described as plumbing.

    I wish I knew this before I started my Master's degree in IT. Programming is frustrating if you don't have an engineering background... you keep running into new problems and people telling you what you could do better.

    • PurplePanda 12 years ago

      I would never describe either finding new problems or people telling me what I could do better as frustrating! They are both some of my favourite things to experience!

gremlinsinc 12 years ago

My learning has progressed from one area to the next--each person learns differently, and coding can be easy to learn, but like everything else it's difficult to master. I started out on google, pulling snippets/coaxing them to do my will, then I became good at reading docs -- and implementing straight from the docs, for instance in Laravel/Rails apps.

The next big change for me was going beyond the docs to the actual API to do even more customization, and override existing methods. It's a progression from low-level understanding to higher, and whatever gets you there - just don't give up.

drakaal 12 years ago

Coding is easy. The problem is too many "teachers" expect you to have a larger vocabulary than you need.

I taught 3rd graders to code. I also taught 1st graders, but the 3rd graders it really clicked. They would come up with solutions to things I would not have thought were possible given the limited language we were working in.

We started in "Project Europa" it is object oriented, module based, and the vocabulary is very limited. But students built all sorts of virtual robots to do all sorts of interesting things.

When I learned to code I learned in RPG, and that doesn't stand for Role Playing Game. Then I moved on to Basic. Turbo Basic, and later QBasic. I wrote a 3D boxing game in QBasic. Yes. 3D graphics from QBasic.

To this day my vocabulary in any programming language is pretty limited. Those around me get upset because I'll use a While loop and increment a counter rather than a For loop and the Index of the thing I am looping through. It is not that I don't want to use the wider vocabulary, or that I have anything against Lambda's. I don't dislike Tuples. I have nothing against using a Class. But I don't usually need more than my 12 word vocabulary to build things. If I do, that is a performance optimization. What? Itertools and product will do the same thing I did with nested For Loops? So? I didn't know there was an itertools. I didn't know there was a product.

Someone said you need to develop a knack for asking the right question of google... Nah, sure StackOverflow has 90% of the answers you'd ever need to know, and they have a clever code snippet that I will admit comes in handy, but if you have to break thought to Google, you aren't breathing the code. It is like trying to learn Spanish by carrying the pocket guide with you rather than making do with the 12 words you know until you can learn 6 more, and then 12 more then 24 more words.

Take the training wheels off and suck it up. Machines are big and fast, large vocabularies are for people who want to speak concisely. A 3rd grader may not use the best choice of words, but he can still explain to you how to make a peanut butter sandwich, or build something in mine craft.

So don't let anyone tell you Programming is hard. Programming is easy. But there are a lot of ass hats who care if you should have built a function rather than copy and pasting the same code with minor variations 20 times. Or will say "you could have done that in one line with a lamba and a reciprocal function"

"Yeah, and Einstein had someone else do most of the math for his proofs because he kind of sucked at calculus. I'll get to optimizations after I have something that runs."

  • eropple 12 years ago

    > But there are a lot of ass hats who care if you should have built a function rather than copy and pasting the same code with minor variations 20 times.

    That larger vocabulary you sneer at is much of what allows developers to be multiplicatively productive, allows them to do much more work and do it in a faster and less error-prone way.

    Or, put another way: are they having to maintain your code when you get tired of it and move on or are they having to deal with second-order effects from your code being more brittle, less flexible, and slower to work on? 'Cause if so, they're not the asshat.

    • R_Edward 12 years ago

      I looked at the nightly order-processing workflow for the regional retailer I worked for one time. I was gobsmacked to find that one section of it consisted of launching the same suite of 5-6 programs one time for each of our 25 locations. And "launching" meant setting a handful of run-time variables, executing the object, waiting for it to finish running, and examining the result.

      It was fairly easy to see why this happened. That workflow was the heart and soul of the company's revenue processing, and no one wanted to touch it any more than absolutely necessary, to avoid breaking anything. So when they expanded from one warehouse to two, it made more sense to simply re-iterate the existing code with the new location id. When they added another location, re-iterate it again, and so forth.

      I created a Launch subroutine, then replaced all those hundreds of lines of code with a for loop that simply called the Launch subroutine for each object needed. Then I went through the rest of the workflow and swapped in Launch calls where appropriate. Overnight, that workflow became much shorter, more readable, and most importantly, significantly more maintainable. Previously, if you wanted to change what programs were run per branch, you had to insert the launching logic in twenty-five separate spots. Now? Once.

      That, my friends, is why we build functions, rather than copypasta-ing the same code over and over.

  • fivedogit 12 years ago

    You might as well say "basketball is easy". Sure, dribbling a ball can be taught instantly, but your 3 pt percentage or rebounding skill can continually improve over the course of a career.

    Just because you taught some 3rd graders a for loop doesn't make them coders and it certainly doesn't make them engineers.

    The programming is easy myth is doubly bad: it sets a false expectation for the aspirants and belittles actual engineers' lifetimes of study.

    • drakaal 12 years ago

      Mastering anything is hard. But kids play basketball.

      I can cook, but I'm not a master chef. That doesn't mean I don't do it. Nor does it mean "cooking is hard".

      Riding a bicycle is a lot harder than basketball.

      • eropple 12 years ago

        You pretty clearly have no conception of basketball at the level he's describing.

the_duck 12 years ago

"The anxiety of feeling lost and stupid is not something you learn to conquer, but something you learn to live with."

I started practicing mindfulness meditation a few years ago. Mindfulness trains you to experience your emotions without judging them; in other words, it helps you to "live with" feelings like frustration and anxiety without getting overwhelmed by them. It's been an invaluable addition to my programming toolkit.

Bizknacker 12 years ago

Though I'm a novice C++ programmer (working with templates at the moment), the only time I'd ever felt lost and stupid, which was just recently, was when it came time to write the end-of-chapter program in the book I'm reading.

Oddly enough, the program wasn't difficult to understand. I've even written it and got it to run before! I think what happened this time around, is I had read the chapter again, started writing more notes and had a better grasp on the material than before, that when it came time to bring all the concepts together, the example program didn't include them! For the first time in years, I actually felt stupid, borderline retarded (in the literal sense).

The example involved an abstract base class, Dragon, with 3 derived classes. The idea was to have a player fight a randomly selected dragon via Base class array and Base class pointer. At this point in the book, aggregation was discussed and shown in an earlier example, but wasn't implemented in the example. Mind you, no player class was created! So basically, arguments were passed to xDragon's defend and attack member functions via variables within the main function.

So I'd decided to create a Player class instead, and have the Player And Dragon objects interact with each other in the main function. Problem was, I hadn't learned enough to know how to do that, to which I didn't realize until error after error and trying desperately to get it running. I'd refrained from using Google and Stack Overflow for the most part, save for a few compiler errors I'd never received.

In the end, I'd decided to create a Game class that layered a Player and Dragon object. I had a feeling I should have written it that way from the start, but felt uncertain. The last errors that I was stuck on for a few days, I'd solved by way of "I wonder if this will help" lol.

Up until then, I wasn't aware that if you don't have a separate implementation file for a class, and should you decide to layer an object from that class, the class must be defined within the class declaration. Having defined member functions outside of the declaration, although within the header file, gave me: include\BlackDragon.h|22|multiple definition of `BlackDragon::calcDamage(short)', first defined here.

I will admit, it did put a damper on me. I felt like I was on a roll up until that. Perhaps I'll take a week or two break from programming get the feeling back again.

zhaphod 12 years ago

There is an enormous difference between writing in English and writing like Shakespeare, Hitchens, Rushdie, or Stephen King. When it comes to coding most people confuse learning syntax with writing great software.

vezzy-fnord 12 years ago

They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google and knowing which code is best to copy-paste.

And this is how the security industry makes its living.

yuribit 12 years ago

"The anxiety of feeling lost and stupid is not something you learn to conquer, but something you learn to live with"

That's exactly my daily felling, but I'm just a junior soft eng

snambi 12 years ago

A lot of coding today is "integration". This is where the code snippets and tutorials come into play. Imho, coding is probably less than 20% of development.

Uncompetative 12 years ago

Processing.js

http://sketchpad.cc/h3QngEM9Vu

ankurdhama 12 years ago

Learning to Code is really really easy. Learning to create something useful by code is the hard one.

krisgenre 12 years ago

Learning to code is actually easy. What's difficult is, to master it.

  • greenyoda 12 years ago

    Exactly. To expand on what you said:

    Learning to code is easy, just as learning to write English prose is easy - kids routinely do both of these things. However, learning to be a professional software developer or a commercially successful novelist or journalist is very different from learning to code or learning to write - for most people, it requires hard work, many years of experience and learning from lots of mistakes.

    • R_Edward 12 years ago

      I would further refine this to, "Learning to code is like learning to write prose: Easy to learn, and easy to do, but not so easy to do well. Especially since 'well' is at least a little bit subjective." There are plenty of people who can write well, who are not commercially successful. And there are people who are commercially successful who do not write very well at all. Cough-DanBrown-Cough.

  • minikomi 12 years ago

    I would almost say.. Learning how to code is easy, learning what to code is hard.

pekk 12 years ago

It is easy. It just takes years and years to become any good.

ulisesrmzroche 12 years ago

With strong tests, who cares about copy-paste though?

octonion 12 years ago

Coding is easy.

_RPM 12 years ago

" As a programmer, there is a limitless amount of stuff to learn"

I absolutely disagree with this. I learn new things at least once a week about computer science in general. No one knows everything.

"They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google"

So, she relies on S.O. for all her programming problems, what if other people don't? SO is _not_ my first choice anymore. Man pages are such high quality.

  • yen223 12 years ago

    "As a programmer, there is a limitless amount of stuff to learn"

    "I learn new things at least once a week about computer science in general. No one knows everything."

    How do these statements contradict each other?

    • _RPM 12 years ago

      I'm not sure what you mean, but I am saying that there is not a limit to what you can learn, as programmer.

  • jhspaybar 12 years ago

    I was recently going through the man pages on how to manipulate the route table and thought to myself, "man, these are kind of lacking compared to what I usually see." I get to the bottom and in the Bugs section is a single sentence, "This page is incomplete." Good times :)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection