Skip to content

Categories:

Just use someone else’s coding convention already

If there’s one thing that’s bugged me throughout my entire coding career, it’s the fact that I can’t seem to stick to a single coding style for a given language. Scope decorators, braces, spacing around parentheses, Hungarian notation, variable and method naming conventions — there’s so many stupid and trivial things to think about, with so many exceptions and gotchas, that after a while it seems like you end up putting half as much time into figuring out how you’re going to write your program as you actually do designing and coding it. Months later, I’ll have an epiphany, and change my coding style, until months after that, I’ll have another epiphany and change it back. This is an endless cycle.

Some languages are easier than others. Ironically, I have very little issue with Perl, but C++ gives me this headache every time I try to code something. It never resulted in bad code quality — I don’t think that any of the conventions, in and of themselves, were bad — but I occasionally sort of lost sight of what I was actually supposed to be doing.

Recently, I started work on a small C++ hobby project, wasted a ton of time, and got completely sick of this song and dance. I had again spent so long playing with my damn coding conventions that I failed to actually get work done.

I poked around for a little bit, and I ended up just going with Google’s C++ style guide. I didn’t love it; I didn’t even really like it. There’s a lot of things I completely hate about it. But Google is telling me to shut the fuck up and write some damn code, and it makes it easier to focus on what actually matters — writing (and finishing) a program that does what it’s supposed to.

Posted in Sysadmin.

Tagged with .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



WP SlimStat