- 2.1 Ode to the Method
- 2.2 How Much + in C++?
- 2.3 Something Sleek and Modern
- 2.4 What's in a Cache Miss?
- 2.5 Code Spelunking
- 2.6 Input Validation
2.3 Something Sleek and Modern
Move fast and break things.
Idiots’ Mantra
Many letters to KV run along this vein of wanting to use a new language or technology to kode. As I point out here, what matters isn’t newness but appropriateness to the job, and the use of good software engineering practices. Most of us in the koding business have a thing for the sleek, new, and modern. Many in our industry would probably be quite comfortable with the Futurist Manifesto, except for its unhealthy relationship to fascism. Written in 1909 by Filippo Tommaso Marinetti, nearly the entire manifesto could be twisted into the language of modern tech companies, “Move fast and break things,” but honestly the manifesto was twisted enough to begin with.
As technologists many of us are attracted to new ideas, methods, and ways of working, especially if they promise to make our systems faster or able to do more with less. The fact is that being sleek and modern is no panacea for the ills of software. Good software requires careful thought, deliberate planning, and careful execution, as I point out here, and there has yet to be a silver bullet to the problems of developing good software.
Dear KV,
When I read your column, you sound to me like one of these guys who only kodes, as you would misspell it, in C or maybe C++. Many of us code in other languages such as PHP, Python, and Perl. How about writing about languages like those? Perhaps something written and designed after most of your readers born.
Where I work we provide a lot of web services, so we use a good deal of PHP in our work, with only a small amount of C and C++ doing the computationally intensive tasks, or things that have to be closer to the operating system. Do you have any advice for those of us who kode in other languages?
21st Century Kodern
Dear 21,
I’ll have you know that I was born after C, but only just. I have no doubt that many of the readers of Queue cut their teeth on other languages, perhaps, though I shudder to think it BASIC, but I can only write about what people ask about. There have been letters from koders using languages other than C or C++, such as Linguistically Lost, who wrote to me a few months ago. If you had asked a concrete question, this would have made my job easier, but clearly that was not your goal. As to my misspellings, take it up with my editor, though I recommend you take a couple of self-defense classes first.
I have read plenty of PHP code in my time as well as Python, Perl, C, C++, TCL, Fortran, Lisp, COBOL, and others. The basic fact is that what separates good code from bad code has very little to do with the language itself. As someone recently pointed out in Queue, you should learn ”How Not to Write FORTRAN in Any Language.”
Good code is code that uses the dominant metaphors in a language in order to make it easy for other people to understand. All the languages I’ve mentioned in this reply have comments, and yet many people seem to either leave these out or misuse them completely. Since the 1980s it has been possible to write understandable variable and function names, and yet people still continue to use single letters, believing that those who look at the code after them will know what they mean.
In PHP you can write this:
function getn($data)
as easily as this:
// This function takes a string as input in the name_field // The name must be a string starting with an alphabetic // character, i.e. A..Z or a..z, and may not be more than 32 // characters in length. Only the first character must be // alphabetic and all the following characters can be // alphabetic or numeric i.e. 0..9 function get_name($name_field)
and yet people continue to write the first version. So, I don’t care how modern you and your young friends are; if you apply the basics of writing code that is easy to understand the first time, some other poor koder has to read it. Once you’re done with that, get back to me with some specific questions on PHP that will illuminate its sleek, modern feel, and we’ll have something to talk about.
KV