Friday, April 17, 2015

Self Taught Coders and Ugly Code

code_quality[1]

I love this cartoon from xkcd. Of course some self taught programmers write really nice looking code. And some formally taught programmers write ugly code.  The message I take away from this is that learning how to write clear well organized code takes some work. Training and the use of standards can help. I’ve written some ugly code in my time. I try to demonstrate clear good looking code to my students though. I want to give them the best start that I can and that involves modeling good practice.

2 comments:

Algot Runeman said...

Iteration and refactoring became a regular process for me. Early linear, monolithic code gradually became more compact with subroutines.

Learning that way and encouraging others to think "try another - add a skill" works because, even with a mentor, ALL coding is ultimately self-taught. A real coding project doesn't duplicate another's work.

Understand the value of both: good enough & elegant solution.

Alfred Thompson said...

Refactoring is going to be an upcoming topic in my class. I wrote an AI for tic tac toe (because I asked my students to do so) and after finishing it (for one definition of finished) I have started refactoring it in a big way. Hopefully that will be a good discussion starter.