Ask Slashdot: How Do You Make Novice Programmers More Professional?
Slashdot reader peetm describes himself as a software engineer, programmer, lecturer, and old man. But how can he teach the next generation how to code more professionally?
I have to put together a three-hour (maximum) workshop for novice programmers -- people with mostly no formal training and who are probably flying by the seat of their pants (and quite possibly dangerous in doing so). I want to encourage them to think more as a professional developer would. Ideally, I want to give them some sort of practicals to do to articulate and demonstrate this, rather than just "present" stuff on best practices... If you were putting this together, what would you say and include?
This raises the question of not only what you'd teach -- whether it's variable naming, modular programming, test-driven development, or the importance of commenting -- but also how you'd teach it. So leave your best answers in the comments. How do you make novice programmers more professional?
This raises the question of not only what you'd teach -- whether it's variable naming, modular programming, test-driven development, or the importance of commenting -- but also how you'd teach it. So leave your best answers in the comments. How do you make novice programmers more professional?
Find some good source code for them to study
Ideally, I want to give them some sort of practicals to do to articulate and demonstrate this, rather than just "present" stuff on best practices...
This raises the question of not only what you'd teach -- whether it's variable naming, modular programming, test-driven development, or the importance of commenting -- but also how you'd teach it.
I think this is already going down the wrong path. Those are just technical skills and practices that will be picked up over time, and some kind of workshop isn't really the place to learn them imo.
The important differences between a new guy and someone with a decent bit of professional experience under their belt isn't so much in technical skills or adherence to best practices, but it's more of a mindset and general direction thing. Once you've seen a few projects from start to completion, you start to recognize certain patterns and points where things can go really well or really bad. Once you've worked on a bunch of different teams, you start to recognize how different people contribute to a team dynamic and the various ways in which a team functions. You start to understand how your job integrates with the rest of our department and the rest of the business, how the whole management structure works, and what really drives most technical decisions (hint: technical merit is often the last thing driving a decision).
The problem is, you can't really teach that. So I guess my answer would really be very generic "how to be a good employee" type stuff: Take ownership of your problems, check your ego, play well with others, etc. Being a more professional programmer has little imo to do with being a better programmer and more to do with being a better professional. You become a more professional programmer by learning how to have a productive meeting with management about your project, not by learning the magic of continuous integration.
My company hires many young non-degreed self-taught programmers (because that is all we can find). We give them a reading list, and require them to spend about four hours per week doing professional reading and studying on their own time. The books include "Clean Code", "Programming Pearls", "The Pragmatic Programmer", several books on algorithms, code complexity, and books on software engineering such as "The Mythical Man-Month" and "Joel on Software". A lot of it is stuff that they would have learned if they had a CS degree. They can substitute books of their own choosing with pre-approval.
Many of these younglings have matured into great programmers. I hired one guy while he was a junior in high school. He worked for several years, and then decided to go to college, and ended up getting a PhD from Stanford.
No college degree, self taught Z80 assembler. Long story short, marketing found out I wrote space invaders for an 8080 based 1553 bus protocol analyzer. Took it to trade shows. Management found out, took me from tech to engineer. As an engineer I wrote code for various hardware. The rule was, when a bug came in you had to fix it. No matter how long ago it was, you owned it.
Quickly learned how to write good code that I could understand a year after release.
. We give them a reading list, and require them to spend about four hours per week doing professional reading and studying on their own time. The books include "Clean Code", "Programming Pearls", "The Pragmatic Programmer", several books on algorithms, code complexity, and books on software engineering such as "The Mythical Man-Month" and "Joel on Software".
So, question........how do you ensure that they actually read them?
"First they came for the slanderers and i said nothing."
Positive examples are good. So are negative ones. I'd recommend giving a novice ownership of a large, ugly, very messy, but heavily used hunk of software and have them "clean it up". The ones that don't kill themselves will become professional programmers.
because that is all we can find
Is there an implicit "for cheap" at the end there? Because lots of old guys are frequently bellyaching here about how after age 40/50 they can't get any work (and one presumes they know the ropes by then).
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
I agree on the examples and discussion around them.
... a working program (without bugs :) was the goal -- however they got there (rule 1). Negative criticism wasn't allowed -- only constructive criticism (rule 2) -- and thankfully there were no issues with this. My usual teaching phrase was to say "a better way to have done the same thing was ___ because ___", and to remind them that in the end we paid them to write working code.
I taught a class for some new programmers fairly recently out of school. They knew PHP and a few other languages, so they could do basic coding. However, we needed them to know Perl and our app.
I taught 5 classes of 1 hour each, 2 every week. There was about 20 minutes of lecture up front to explain ideas beyond the basics, and they were encouraged to ask questions during that. I also gave them a problem to solve at end of the lessons to complete for next time. The homework at the beginning was solvable in 10-20 lines; the ones at the end took nearly 50 lines. The last ~40 minutes of a session was spent going over the homework and discussing it. Each person presented their answer for everyone to look at and were asked what they found hard to do and why and we talked about solutions with emphasis on the why.
Part of the reason it worked well was because I stressed there was not 1 definitive answer, not even mine
The discussion of the homework allowed them to see how others did it, I also showed my answer though I always went last. We also talked about ways to do it better with a large emphasis on why something was better, trade-offs, etc. I also did my best to point them in the direction of good habits: comments, testing, modularization, maintainability, etc. I also mentioned useful books, most of which have been mentioned by others.
If I ever had to teach something like this again, I believe I'd do it the same way. All of the class members gave me good feedback and said they liked the format.
So, question........how do you ensure that they actually read them?
I ask them what they thought of the book, what they learned from it, and what questions they have that the book didn't answer.
These are self-taught people that passed a rigorous interview process consisting mostly of coding. They want to learn. I have never caught any of them faking their professional development.
It's good that early on, you're weening them away from the fiction that their time doesn't belong to the company.
You don't do professional development for "the company". You do it for yourself.
Project Euler is a test of math skills, not programming skills. The two are often conflated, but in reality overlap only rarely. In many branches of programming you can function very well while knowing nothing more than what +, -, *, and / do.
Moreover, the problems are arranged in chains that lead up from basic understanding to advanced understanding. Simply dumping one at random into the lap of an unprepared person is very likely to weed out all the excellent programmers, leaving only math students - who I'm guessing aren't responding to your ads to begin with. So that's your problem right there: you ask for one skillset, and then you are surprised that your test for another skillset isn't working out. It isn't the quality of your candidates. It's you.
If this wasn't clear enough: I've been programming since the eighties, I have my masters degree, and somehow they trust the software I write controlling (which literally means "deciding life and death of") spacecraft costing 300 million euro and up. If I ever fuck up I guarantee you _will_ read about it here on slashdot. Yet somehow I have _never_ needed to determine if a number is prime, or indeed any of the other circus tricks at Project Euler.
Object oriented is a good idea, so long as they have experience doing so (at least in school or at home). If not, just tell them to try to keep all of their functions down to less than X lines. Each with a very explicit name, to the point that the function name itself is practically a comment.
I'd also print out the following and have it near their desk:
----------
RULES FOR OPTIMIZATION:
1) Don't.
2) (Experts Only) Don't yet.
----------
I remember when I was starting out, being able to right "fast" code felt like the mark of a good programmer, and often rendered code unreadable and bug-prone by optimizing sections that had no business being optimized in the first place. It took time to learn that good programming is clear, easy to understand programming, with optimization done by first identifying a problem, profiling the code to see what's actually consuming cycles, and focusing on the low-hanging fruit therein.
Part of it also was that a lot of the "optimizations" aren't actually optimizations. For example, loop unrolling, and very often loop checks, the compiler does that for you, so I was just uglifying my code for no good reason and getting full of myself for "optimizing" when I was doing no such thing. My interest in people writing "fast" code however led to me reading Carmack and Abrash, which led to getting a better understanding of what actually helps vs. what's a waste of time, and where to focus your efforts.
The big brain am winning again! I am the greetist! Now I am leaving for no particular raisin!
The problem is that our industry, unlike every other single industry except acting and modeling (and note neither are known for "intelligence") worship at the altar of youth. I don't know the number of people I've encountered who tell me that by being older, my experience is worthless since all the stuff I've learned has become obsolete.
This, despite the fact that the dominant operating systems used in most systems is based on an operating system that is nearly 50 years old, the "new" features being added to many "modern" languages are really concepts from languages that are between 50 and 60 years old or older, and most of the concepts we bandy about as cutting edge were developed from 20 to 50 years ago.
It also doesn't help that the youth whose accomplishments we worship usually get concepts wrong. I don't know the number of times I've seen someone claim code was refactored along some new-fangled "improvement" over an "outdated" design pattern who wrote objects that bare no resemblance to the pattern they claim to be following. (In the case above, the classes they used included "modules" and "models", neither which are part of the VIPER backronym.) And when I indicate that the "massive view controller" problem often represents a misunderstanding as to what constitutes a model and what constitutes a view, I'm told that I have no idea what I'm talking about--despite having more experience than the critic has been alive, and despite graduating from Caltech--meaning I'm probably not a complete idiot.)
Our industry is rife with arrogance, and often the arrogance of the young and inexperienced. Our industry seems to value "cowboys" despite doing everything it can (with the management technique "flavor of the month") to stop "cowboys." Our industry is agist, sexist, one where the blind leads the blind, and seminal works attempting to understand the problem of development go ignored.
How many of you have seen code which seems developed using "design pattern" roulette? Don't know what you're doing? Spin the wheel!
Ours is also one of the fewest industries based on scientific research which blatantly ignores the research, unless it is popularized in shallow books which rarely explore anything in depth. We have a constant churn of technologies which are often pointless, introducing new languages using extreme hype which is often unwarranted as those languages seldom expand beyond a basic domain representing a subset of LISP. I can't think of a single developer I've met professionally who belong to the ACM or to IEEE, and when they run into an interesting problem tend to search Github or Stack Overflow, even when it is a basic algorithm problem. (I've met programmers with years of experience who couldn't write code to maintain a linked list.)
So what do we do?
Beats the hell out of me. You cannot teach if your audience revels in its ignorance and doesn't