Thursday, May 21, 2009

Index Zero

This is a copy of my post in reply to this comment about Tony's hate of starting the use of C arrays at '1':
http://greenstripe.blogspot.com/2009/05/i-recently-read-design-document-which.html

I think you know this, but you are confusing counting the number of something (to find the number in the set) with enumerating each item, thereby giving each one a numerical reference. For enumeration, there is no particular reason why the first reference has to be '0' or '1' or any other number - or in fact a number at all ... think Javascript arrays where the index is a string - this associative array is like a c++ map.

I'm not convinced that losing the memory for element 0 is, in most systems, critical. Except perhaps where you have constructors / destructors - then you are running code on element zero.

However, I do think there is a deeper problem in C with using 1 as the first element 'because it's seen by the user therefore the conceptual gap between problem domain and solution domain is smaller'. The first that comes to mind is that (a) the user display is tied to this ascending number sequence. We don't, I believe, naturally think of things as numbers - or named as numbered. Therefore there is a lost of abstraction that really could do with being hidden. Objects (e.g. with a C++ class) could sort this. Secondly, or (b), in C, at least, where I've seen this, there tend to be -1 and +1 sprinkled randomly around the code (without the help of object oriented design). Thirdly, or (c), (what do you mean I've run out of enumerations?!) if you have to remove an element or make the list bigger in the middle, or do any sorting, then the index (which is what we are talking about) becomes invalid. But the user numbering, apparently, does not. Doesn't that mean that the whole 'fixed sequence' is an artificial construct of the specifier or developer? Where does this leave the user?

I'm sure there are more ...

One last thing: I can hear a bunch of programmers saying "but on small systems"/"my system" it's the most efficient way of showing something. But that's not the argument here. Either: (a) you bit the bullet and go for efficiency and ignore usability or (b) you abstract the user from the internals of the program but make the internal of the program easy to maintain. The third option making it easy by removing abstraction only works in very narrow cases and tends to be fragile to change.

Reply about Zuma and World of Goo

In reply to Tony's blog post: http://greenstripe.blogspot.com/2009/05/computer-games.html

Zuma: I think PopCap is a very interesting company who've been able to capture the puzzle game market by good sales, contacts and marketing. But their games do have annoyingly good but simple game play. Zuma, specifically, is a fast paced arcade game, and as such increases excitement and fun factor (and probably adrenaline - think roller coaster). I wouldn't find them satisfying all the time - but occasionally a game without much plot or exploring is a good change. It's sweet vs. savoury of games.

World of Goo has entrancing graphics, fantastic sound and music and a good game. However, the game play is, mostly, not timed giving a much gentler game. The game also is interesting for a 'explore physics point of view' but is it really better game play? I certainly appreciate the quality, polished 'production' and independent game developers. But do these actually make a better game?

Footnote regarding World of Goo: Additionally, as a programmer, I'm really irritated by how good the graphics and music are. But that's just jealousy.

Sunday, May 17, 2009

Encryption, Linux, Programming

Been creating encrypted disk images on the USB key I carry around. I released I had various projects (not all mine) and personal data that wasn't protected. Created encrypted disk images - cross platform ... so it should at least slow people down :-) The thing with disk images is that you don't need to do a seperate encrypt/decrypt cycle, like you do with something like GPG.

I also really want to play properly with an up-to-date Linux. My main machine is a PowerPC box and I do have recent Ubuntu for PowerPC - but really want to run both in parallel. Projects like Mac-on-mac and Mac-on-Linux are pretty much dead. At some point I'll have an Intel Mac - which will make things like VirtualBox/Parallels and VMWare Fusion options. I was looking at things like Thinkpads on ebay and they aren't terribly expensive - certainly cheaper than buying a new netbook - although less portable (X-series maybe excepted). One of my mates has an old ThinkPad ... so that might allow me to run both in parallel at my desk. (He also has an old Tower - but I'm trying to give up non-portable computers for size, storage and portability reasons.) Another mate has just offered my my original Tangerine iBook back. That would be interesting but it's only a 300MHz G3. I wonder which model ThinkPad it is.

I also have been pretty slow at my two programming projects - the importer and the robot. Hopefully I'll get some actual serious work done over the next week. Need to finish the importer so I can get onto the next project that I'm desperate to start!

Saturday, May 02, 2009

Subversion finder scripts

Came across these, referenced from macosxhints.com

http://svn-finder.sourceforge.net/

Looks interesting but haven't tried it yet.
Newer›  ‹Older