I stumbled over an interview with Bjarne Stroustrup and he said something clever: "My rule of thumb is that you should have a real class with an interface and a hidden representation if and only if you can consider an invariant for the class." Bjarne Stroustrup I find this a very good rule of thumb.
February 2005 Archives
So I've decided to go with CSS and xhtml instead of the old table driven way of designing a webpage structure. What would be a better start than just try to put together a simple two column classic layout centered in the middle of the page. Shite! Did this quirk bite me? I struggled for hours with this insanity. Finally found out that a simple two column layout is one of the hard things to get working without hacks. Insane.
I started reading up on CSS and XHTML the other day. I used to work with designing and coding webpages but that was some time ago. I quickly remembered how hard it is to not throw the computer out of the window when trying to create web content that shows roughly equal in different browsers. Anyway one of the hurdles I had to overcome was the way CSS standard handles a box compared to how the IE dev team and I thinks of a box.
We've been arguing at work about whether it's ok to use the & operator while indexing an STL vector. I'm currently working with a compiler that is throwing errors at me for doing it, so I finally has backup for my arguments *sigh*. It's quite easy to learn the 'right' way: Never do: [cpp] // Bad m_vecSound.erase( &m_vecSound[i] ); [/cpp] Do: [cpp] // Good m_vecSound.erase( m_vecSound.begin() + i ); [/cpp] May be obvious to some but apparently not to all. :o
I think it's handy to use my favourite IDE Visual Studio .Net 2003 even when I do gcc development. It's quite easy to do a makefile project, and add the relevant paths to the IDE so it can find the necessary binaries for compiling and such. But I found it rather annoying that I don't have clickable errors and warnings since I'm quite used to that (cough lazy cough). How nice there is an easy hack you can do though. Look! Open up cc1.exe (and cc1plus.exe if you use c++) in your favourite hex editor. Then search for the string "%s:%d: " (don't forget the space) and replace with "%s(%d):". Then save the files and you're done.