Archive for November, 2008

Can we just remove “slow” from the programmer vocabulary please?

author Posted by: whaledawg on date Nov 26th, 2008 | filed Filed under: general

Fast

So I answered this question over at Stack Overflow and another poster said this:

glReadPixels/glDrawPixels is slow.

Now, assuming he’s correct(has OpenGL really figured out a way to optimize everything but bit blitting?) you still have to ask “Slow for what?” If you’re only reading and writing pixels every 10 seconds who cares how slow it is.

Working on my game engine, I’ve come up with 4 scenarios:

  1. Happens once at load
  2. Happens every time a user enters input
  3. Happens every time an internal alarm goes off
  4. Happens every frame

So is reading/writing pixels slow at load time? Who cares? Every time a user enteres input? That only happens a few times a second. When an alarm goes off? This could get costly, but you can also control the granularity here. Every frame? Well, that’s 30-60 times a second. Now speed might actually count for something.

But if some asshole on Stack Overflow convinces me that it’s slow, I won’t use it the 75% of the time when its speed is irrelavant. Fuck Your Mother. I’ve just made a whole lot of things I may need to do take 10 times longer for no visible gain.

These “slow” decriers are the same people who convinced me for years not to use virtual functions. They have “overhead”. Do you know what the overhead on a virtual function is vs. a regular function call? A table lookup. Fuck Your Mother it’s just a table lookup to see which function to call. So I cut out a huge amount of object oriented technique(and most of the interesting stuff) to avoid a God Damn table lookup.

Anytime anyone calls a technique slow we should remember that “slow” is a relative term. 9 times out of 10 the “slow” technique takes me much less time. I’ve come to the conclusion that my time is more valueable than the fucking computers, and if you feel differently I have to question your actual knowledge as a programmer.

Vim 4 Eva

author Posted by: whaledawg on date Nov 15th, 2008 | filed Filed under: general

VimI just bumped into a very old article on Vim vs. Emacs and it had a few interesting points. The fact that Vi was designed to run over a 300 baud modem was something I never knew. The gist seems to be that Vi was built to be as powerful an editor as possible with a very light footprint. It didn’t take up much memory or use a lot of bandwidth in a remote terminal. Emacs, on the other hand, was made by people with much greater computing resources. That’s why Emacs is built on top of the OS to do a million different things and Vi was built to use the OS(for things like ‘ls’ or ‘awk’).

So why then is Vi still around? Why is Vim still being developed? It was created during the computing equivalent of the paleozoic, how can a thin program still be useful? After all, Joel On Software tells us that features are what people want. Shouldn’t the more feature rich Emacs be the choice for programmers? It has a built in email client for God’s sake!

Well, no. Features are not what people want, useful features is. An email client doesn’t help me edit text files in the slightest. And the same goes with extensibility and options, useful is good and useless is bad. While Emacs has proven itself more extensible than Vi(or Vim) it isn’t more useful than Vim. That’s why an editor designed to be used over TTY is still prominent.

A less philosophical reason for Vim’s persistence, chorded keys suck. The Control and Alt keys are in the least convient places possible on a keyboard and constantly having to press them is a pain the ass. While command mode/insert mode is unintuitive, it works well by allowing me to avoid having to press 4 keys at once.

And for those who say that Vim has chorded keys too, that’s right. But I map them away. So instead of <Cntrl-[> to enter command mode I press ‘ii’(how many words have 2 i’s in a row?) See, Vim’s customizable too.

Been a while

author Posted by: whaledawg on date Nov 4th, 2008 | filed Filed under: general

since I posted. But that’s actually a good thing. I’ve been busy working on my project and gaming. Unfortunately the exact time I need to kick my coding in the ass is the time that they drop every awesome release for the year! I’ve gotten Deadspace, Fable 2 and Fallout 3 in the past 3 weeks and they are all great. And Gears 2 and the new Call of Duty are dropping soon. Plus I made the mistake of checking out the Mirrors Edge demo, it’s crazy. If I had anything resembling time I’d pick that bad boy up.

And with all this gaming going on I still have to keep working on the project. I’ll post about that tomorrow, but basically it’s rolling along. There’s just so much damn work, I’m not sure I would have started if I knew how long this would take. Naw, that’s bullshit. I love it actually, but I’d like to be finished enough to get to the next step in my plan. Which I’ll talk about tomorrow.