Fang Talks

Vamos!

Or just, you know, creating software in general.

There’s so many tiny little things I do when I work on a project that I take pride in, or just generally enjoy doing, even though they barely have any impact for the end-user. Sure, some have a decent impact back-stage, for example a small performance improvement, or maybe it makes the system as a whole a bit more easier to extend, or more understandable for others who may one day have to work with my code.

So, what’s this all about? The tiny things. Like my own naming conventions. They fluctuate a lot in between languages and projects, but I’ve got a neat little set of rules I almost always abide to. I also do a lot of premature, and often unnecessary optimizations. But only there where it’s easy to do. Less unnecessary, are the way I handle images. I always throw them through a crusher. Put bluntly, it compressed an image without actually reducing its quality. It gets rid of useless data, groups blocks together, all those kinds of things. I occasionally find myself crushing a 1x40px gradient down from a couple of kilobytes to only a few hundred bytes. It always amazes me, and it always saddens me to think that the only thing the user will know is that “hey this thing loads fast”, and even that’s a rare case.

Also, curly braces go on a new line, you idiot. I see way too many people appending them on the line of the block they open, and sure it saves a line of space, but that’s about it! There’s a lot of debate about this, but I always fail to see any great positives of current line over new line. If you need to put a box in a box, you don’t try doing so by bumping it against the edge of the outer box, now do you? (People are going to read this and shame me for it. If you’re one of those, look in a mirror and shame that.)

Comments, too. I’ve never worked on a large enough group project, or a personal project that lasted long enough (and was complicated enough) for them to be really super-duper useful, but I take pride in my sometimes pretty verbose comments. They’re all over the place in some files, and that’s a good thing! Don’t want to come back a year later to a file with the only comment being “// don’t touch this”. Ah yeah, there’s one too, I’m gratuitous with spaces. They make stuff easier to read, “like( so )”.

Apparently there are people who use tabs to put all the semi-colons on the exact same position each line. Sure looks sexy, but think about editing that mess!
~ Fang

Comments

  • 12/07/2013 (12:50 AM)

    I’ve read other programmers who complain about other programmers not using enough notes or not making them detailed enough. Even if the end user doesn’t appreciate what you do then another programmer probably would, and some of this sounds pretty impressive to me. Especially the compression thing.

Post a comment

Your email will stay hidden, required field are marked with a *.

Experimental anti-spam. You only have to do this once. (Hint: it's "Fang")