February 27, 2004

Never use throw-declaration in C++

Never equip your class functions with throw-declarations.

If for any reason an exception gets thrown (inside or below that member), which is not derived from one of your throw-declared exceptions, you'll get an undefined exception along with a nice coredump. And this is not that easy to trace back.

You can only do this, if you have a compiler which ignores them completely (as Microsoft Visual Studio) or refuses to compile if the throwed exceptions don't match.

As I don't know of any C++-compiler which does the latter well enough, I only can give you the hint:
Never use throw-declarations in C++ or you'll be cursed with untraceable coredumps/crashes far in the future.

Update:
Since this page is hit quite regulary with search engines directly, I'll provide some additional information for the real interested ones.

We had quite problems in our code with the debugging of very strange Linux and AIX coredumps and meaningless backtraces.

The cause of this were constructs like following:

int test1(int i) throw(Exception1)
{
  if(...)
    throw Exception2;
  return 0;
}

Problems occour, if Exception2 is not derived from Exception1. In such a case, most compilers not even give you a warning but compile correctly and generate an executable.
But when during execution Exception2 is thrown and not catched before leaving the method the exception is transformed into an unexpected_exception and not catchable anymore even with catch(...).
It's only catchable with the unexpected_exception-handler, but in that case you are not able to get the type/class of the exception, nor where it originated from.

A nice example can be found in Bruce Bruce Eckel's Thinking in C++, 2nd Ed: Cleaning up, but there he rethrows the exception in the unexpected-handler and it gets catched later in the next upmost method on the call-hirarcy.
Besides that this is in my eyes a very ugly workaround I don't think that this works on many platforms.

Moron's hightime

Perhaps you remember my girlfriends programming teacher. This year he doesn't teach her C++ anymore but Delphi. Different language, same problems. He gives a homework/test, then the studends give them back more or less correct and then he tells them their mark and that they should correct it. BUT without giving the tests back, so that the students would know, what they made wrong. And he doesn't tell them how to make it right.

Recently he tries to hang the boss out: If the students want two tests per term, he chooses the time and date. If they want to choose theirselves, he only permits one test/term. So you have the choice of "all or nothing" but you know when or "a bit more security with a second shot" but you don't know if the shots fall around dates where your schedule is filled up with tests in other subjects.

Sidenote to the tests: His exercises are formulated in quite technical language, come with a pre-defined layout, class- and function-structure and if you don't build your solution into this, you get a worse mark. This is like learning a language just by copying letters written in that foreign language.

How should anyone learn programming in that way???

I think, he just has a problem with acceptation and so he enjoys forcing his students to do exactly what he wants, no matter how insane it is.

February 25, 2004

Evening action (3)

Everything worked well over the night but only seconds after we gave an "everything ok!" this morning, everything collapsed.

We had a lot of trouble and finally we went back and removed the update, because the system threw out coredumps every other moment.

Time for debugging now, but the coredumps are not very meaningful.

Evening action (2)

The release change is over, everything worked almost immediately, going home.

Have to get up at 06:00 to take my car (again) to the garage, so that they can fix my mirror, which they forgot last time.

February 24, 2004

Evening action

Today is carnival, and what am I doing?
I'm participatin in a software release change at one of our customers systems.

Action starts at 23:00 and I guess if nothing goes wrong, we'll be finished shortly after midnight.

My personal fraction of work will be to shut down the systems, change a small part, wait for my collegues to finish database- and web-updates and then start the whole stuff up again. Mostly waiting.

I don't expect something to go havoc because our release-process ensures an almost straightforward workflow and our software should be failure-tolerant enough to start up without much trouble. And takeover systems are always present so that the customers shouldn't recognize, that something is changing.

Nevertheless, stopping a system which is in use by several thousands of people 24/7 is a bit thrilling every time.

Disabling the old blog

I have now disabled the old bpi.blogspot.com-blog and established an automatic redirect pointing here.

All posts have been transferred and I'm now exclusively posting only here.

I'll suggest that you still reach me by the old link because if this blog is disabled for any reason (perhaps because of FreePgs.com shutting down its great service, what I don't hope, I'll re-activate the old blog again.

Educating new coders

Yesterday our team got a new member. Its current task will be to slowly grow into our systems, libraries and structures and (midterm) help us with the development of our solution.

It will be mostly my function to help him with that and show him every niche and the dark corners of our software.

This is the first non-trivial teaching exercise I have got and I'm willing to give my new collegue as much insight and knowledge as I can.

I showed him to the overall structure and flow yesterday and either he is cleverer than me when I were introduced to that or I'm a better teacher than the person who introduced me to the whole system two years ago.
In fact, that doesn't matter. What matters is, that he understands the whole stuff :)

February 23, 2004

... and it's huntin' season!

"Hit the Bush" now has its own category instead of being attached to a post.

Today something
for hunting fans.

Other peoples food

Here in our company we regulary go to a canteen for lunch.

It's about five to ten minutes on foot and if the weather is not too bad many of us take the walk.

They offer several menus there, every one not being something I would die for, but it's worth its price.

What I think is strange is that, no matter what menu I choose, if a collegue of me chooses another menu I always think, that this one would have tasted better than the one I chose.

Always!

I know every meal is not gourmets first choice, but why have I always the feeling of having chosen the one which I like least?

And this only comes up AFTER I have paid it...

February 22, 2004

Nothing new in the programming realm

Recently I found an Interview with Victoria Livschitz where she talks about the current state and future development of (modern) programming languages.

"Here's what's really sad -- the overwhelming majority of so-called successful development projects produce mediocre software."

What she says (better, what I interpret) is, that a programming language should make it much harder for the developer to create (design) mistakes and give him more time to "create" software instead of "debug" it.

She also says, that there currently is no language, which gives such strengths into the hands of developers. One of the last non-trivial changes in programming structures was the introduction of Java, but it (almost) only prevents the programmer from producing memory-leaks and introduces few other concepts.

What's missing is something which somehow syntactically makes it harder to create semantically buggy software. Or that a working software evolves (and almost any software grows over its initial purpose) into a buggy state.

"Well, I see two principal weapons. One is the intuitiveness of the programming experience from the developer's point of view. Another is the ability to decompose the whole into smaller units and aggregate individual units into a whole. ... A forest is a complex ecosystem, but for the average hiker the woods do not appear complex."

So the development environment should aid the developer to put together the bricks and create a building instead of forming every brick over and over again.

Reusage of components is probably one of the keys of future development, but it is not enforced enough yet.

Shifting a bit off-topic:
(Third answer, second paragraph)
'"... Take almost any corporate accounting application, and you'll find it poor in quality, unimpressive in capabilities, difficult to extend, misaligned with other enterprise systems, technologically obsolete by the time of release, and functionally identical to dozens of other accounting systems. Hundreds of thousands of dollars are spent on development, and millions afterwards on maintenance -- and for what? From an engineering standpoint, zero innovation and zero incremental value have been produced."

Well, this is something what large parts of the other development-teams of our company do. Creating accounting systems.
Should I be worried? Not for the immediate future, but what about mid-term, perhaps three to five years?

Luckily I'm not in a team, which has to do with accounting, I'm working in a relatively "hyping" area now. And I think, we have the potential to keep a place in the market if we don't make our mistakes from the past again.

February 21, 2004

Tweakin' the new blog

I saw, that Teitans Paraphrasis seems to be offline currently.
Teitan, what's up?
And does "L�schblatt" have any deeper meaning?

Well.
The new blog is going not so bad, I'm still in the process of re-styling the site to look not that similar to the MT blog at first sight, but keep its usability.

The main page is almost finished for now, just some style tweaks left.

What I still want to do is to enhance the archive pages to not only list the posts alone but also some better navigation on the left.

February 17, 2004

Blog transfer continues

My new blog testbed
It's now working. Without much trouble I could create a new DB, enabled scripting and imported the entries from here following the guide here.

Currently it has just the default MovableType style but I'll soon change this to a new layout.

Now I also have a chance of backing up all my entries and comments, which I couldn't do with the Blogger+Haloscan combo.

I'll twinker around there now a bit more and perhaps soon, I'll establish an automatic redirect from here to there.

February 16, 2004

Hm, I'm thinking of migrating my blog to another provider/system. I've been thinking of somehow migrating to Movable Type for a while now, but since I don't have money left to spend on a server somehow nor want to migrate to a third-party maintained system, I've been staying here.

I want to migrate to MT, because I have just more features there bundled all in one and I can more easily save my old blogs somewhere.

And now I have stumbled upon http://systems.freepgs.com.
They offer some free server space (20 MB), with PHP/Perl enabled and MySQL database, exactly what I need for MovableType.
I don't expect to hit the traffic limit (2 GB/month) anytime soon, so there should be freedom too.

20 MB sound not that much, but I don't want to blog pictures and for text this should be enough for quite a while. MT says, it needs around 2-3 MB for itself.

I plan to give it a try soon, and if it works, I hope that this service lasts long enough, until I can efford a more secure place.

February 13, 2004

You probably heard, that parts of the Win2k sourcecode have leaked into the public internet (also on BetaNews).
Microsoft has meanwhile confirmed this.

According to BetaNews, they have tracked back the leak to Mainsoft, a partner of Microsoft.

This means several things:

  • good - OpenSource can profit by the knowledge of the source

  • bad - Crackers can now more easily scan for bugs and security holes in the released parts and take advantage of them in future viruses and worms

  • good/bad - Mainsoft has a serious problem with intellectual copyright issues now
Microsoft just has lost some million dollar of intellectual property, shouldn't harm them that much, besides the copyright stuff.

February 11, 2004

Car repaired... almost

Today I'll finally get my car back from garage. It was delayed another day because the mechanics "didn't want to fix it in a hurry".

But if they took that much care of it, why didn't they fix my right-hand mirror? "...overlooked..."

Well, I'll get a new one the next time I have to show up for service there. I hope, they remember that by then.

Odd. I'm sitting here at work, and let my girlfriend take up the car although she's the reason why it halted beside the road in the first place. But I believe, this just was bad luck in a terribly bad week for us all, and so I trust her. She also surely takes a bit more care now while driving, but I don't want to say that she drove dangerous before, far from it.
But this just has to look strange from third person view ;)

"Sure, we do that"
This driver could have been written by one of our sales people ;)

Today's "Hit the Bush"
CNN reports that GW. has released some of his military files to the public, but there is no content in them, which absolutely states, that he really attended to his duty.

February 10, 2004

"... we're releasing the Allegiance source code to the community...".
Did you ever expect such a phrase from someone from Microsoft?

Allegiance is a space combat game, and I appreciate the step of Microsoft to release its source because the coding team can't support/develop it anymore. Surely it can help people out there, creating their own small space-game.

February 9, 2004

This and that

Saddam's an OutKast: Hey Allah! (updated 2013-07-14) If you like the current chart-breakers Outkast with their song "Hey yah!", you'll surely like this one.

My car is still apsent one more day because the garage got already-damaged replacement-parts and has to reorder them.

And I corrected an old post from me, which directly connects me with my employer. As I don't want this because of job security, I modified the name of my employer, so that it should be safe for both sides now.

Today's "Hit the Bush" Bush still defends Iraq war on CNN.com. At the core, Bush now says he attacked Iraq, because Saddam only "was able to" produce WMD. Well, then now he has to make war on almost every country on earth, because even less experienced scientists can build WMD's with the power of (some) money and the internet. Surely, everyone knows a report on a TV channel where the reporters get their hands on dangerous materials.

February 7, 2004

Week roundup

This week was really strange. I told you about Monday to Thursday last post and now I want to make a whole week:

  • Friday: This morning, one of our customers system was not working again. We quickly brought it up again, before the customer recognized. Once again, a software component which we removed long ago but is still existing in outdated installations was totally disfunctional. One small fluctuation in the database and this crap runs crazy.
Meanwhile my new XML Site Feed began to work.

Today's "Hit the Bush"
WMD panel shouldn?t blame CIA, diplomat says. But "...warned that the commission will serve no useful purpose if it becomes a pawn in a blame game over Iraq."

February 5, 2004

Tough week

Wow, this week is really tough.

  • Monday: Several client systems have outages, peak had been four weird acting or down databases (at four customers) at the same moment.

  • Tuesday: Again two outages at two clients. One gave us a error-report, which has to be resolved until Wednesday noon, to prevent us from paying bills.
    To make the day successful, my car somehow hit the ground besides the street and I'm not (completely) mobile until monday evening. Insurance and mechanics are working on the case ;)

  • Wednesday: The error-report could be closed half an hour before we had to pay penalties. This afforded much of work from all of us and the re-surrection of long deprecated systems, because the customer has a very out-of-date version running. But we managed it in time, which I didn't expect.

  • Thursday: They turned of our internal network-phone! I have no network-connector left near me, where they could plug in a default hardware phone, so somehow I got a Bosch DECT Phone. Don't let you fool by the image on the link, on my phone "BOSCH" is printed instead of "Tenovis" on the phone, but the hardware is exactly the same. Perhaps Tenovis is or purchased Bosch. The mobility is a bit greater with this compared to my 2,5m headset line on the computer, but the speech quality is much worse.

Today's "Hit the Bush"
differentstrings has a posting about how G.W.B. influences the 'Iraq Intelligence' Commission.
It's something helpful for a president who's trying to get re-elected.

February 2, 2004

BBC NEWS: "Nasa to rethink Hubble decision"
Finally someone got around it and is thinking about hubbles value a second time.