Lazycoder

24Aug/118

How we learn to write code

Great post titled “Your code is my hell” describing some particular problems with Ruby and Rails projects.

One thing that is brought up in the comments that I wanted to expand the discussion on is how universities teach programming.

I blame the education system for developers. Shockingly few universities and colleges deal with the “why” of programming, only the “how”, and almost all seem more focused on the tuition money coming in rather than the quality of education going out. The only programmers worth a damn anymore are the ones who taught themselves from youth, and we’re outnumbered by the 9-to-5ers churned out by higher education.

I think the “why” of programming can’t really be taught, or at least it is miscommunicated. The “why” is often thought of in terms of features or user needs. These needs do have to be considered, and “git ‘er done” is valid thinking. But maybe it should be expanded to “git ‘er done right”.

The “why” of programming can also be thought of in terms of developers and maintainers needs. Why do we need unit tests? So people who come after us, including us a few years from now, who have to work on this code can tell if something breaks when they make a change without having to wait for QA or the users to tell them.

Mostly it seems like we learn to program by working on new, or greenfield, projects. All the classroom assignments start with creating a brand new project with well defined requirements. All the sample code put out by Microsoft, Apple, Google, and others assumes the same starting point. While it is important to start new projects, most of the code you will work on as a professional developer, in my experience, is NOT written by you from scratch.

Maybe young developers and university students would benefit more from joining an internship program? Or maybe university CS departments could function as consultants or “offshore” firms and provide low-cost temporary employees to firms, killing two birds with one stone.

  • http://blog.componentoriented.com D. Lambert

    I think we can heap some of the blame for this on businesses that expect to hire kids straight out of college and put them to work on real projects with effectively no mentoring or guidance.  To some extent, this is also a by-product of a throw-away approach to software development, so if you build each application with the understanding that you’re never going to maintain it over any significant period of time, then any code that has the outward appearance of getting the job done is as good as any other, and the cheaper the better.

    Businesses don’t perceive code bases as long-term assets, so there isn’t a lot of effort put forth to create systems that are sustainable over a period of years.  This is due, in part, because many of the decision-makers don’t understand how one chunk of code can be considered “good” and another “bad” if they appear to produce the same results — even if they produce the same results most of the time.

    I’ve been in organizations that “get it”.  I don’t believe this was ever ubiquitous, but I think it’s becoming rarer as time goes by.  I think you can trace some of this back to education, but I really believe that the schools are giving businesses what they’re asking for.  Maybe what we really need is some education for business school majors so they can begin to appreciate why they might be interested in code bases that don’t collapse into a steaming pile as soon as someone sneezes on them.  I remember some finance classes where we discussed depreciation and accounting for computer systems, but nobody ever said “boo” about the idea that the quality of the code in the system had any kind of appreciable effect on the cost of maintenance for a system.

    Maybe we’re fighting this fight from the wrong end…

  • http://twitter.com/cammerman Chris Ammerman

    Re: the internship idea…
    I can speak from experience as a developer who is both self-taught and college-educated that my internship throughout college was indispensible. Even though the management environment left much to be desired, I learned more on the job than in 4 years of classes, about programming, balancing user needs vs the maintenance and support needs of the project’s future lifecycle, the importance of testing your own code, project management, business, and a hundred other things.

    To their credit, the advisors at my college urged us VERY strongly to all get internships by our senior year. They explained frankly that not only would an internship be a crucial complement to our classroom education, but that it would dramatically improve our job prospects after school. I know it was so for me on both fronts.

  • http://www.abler.com/products/Ablerquant Horse Medications

    This is interesting article that you show in here. Actually,
    I would like to learn writing code. Thank you for sharing a little bit idea
    that you have.

  • http://www.trafalgargeothermal.com/ trafalgar geothermal

    Yeah, that was the main problem in learning programming on
    how schools they can provide the quality services to the students. Mostly, they
    (students) learned from their experience like on the job training.

  • http://www.johnsoncomfort.com/plumbing-service-company-edinburgh-indiana/ plumber edinburgh

    My son wanted to learn programming. I will share this to him.
    I hope this can help him into his study.

  • http://trainingcenter.com/vmware-training-course-online.htm vmware training courses

    This is very good post that makes people wanted to read the
    content. In fact, my friend was now aiming to learn programming.

  • Tarah Adermann

    Been learning it like 4 years…but then again my life is more connected into helping a business grow online business and I’m happy with it. Still, needs to learn more about the said category.

  • Tarah Adermann

    Been learning it like 4 years…but then again my life is more connected into helping a business grow online business and I’m happy with it. Still, needs to learn more about the said category.