On Friday 15 April 2005 14:43, Colin Carter wrote:
Yes, I have noticed how most modern programs waste time poling the mirriad of open windows ....
Urgh - folks, can we stop the urban legends at some point, please?
Everybody who has a minimum clue of how any kind of GUI programming works
should know that those programs spend most of their time waiting on a socket,
waiting for user input - on X11 (no matter what toolkit is being used - KDE,
Gtk, OSF/Motif, Xt, ...) and on Win32. There is no "busy wait" in any such
program I know.
The other myths about object orientation etc. are similar: If you do
non-trivial software, you simply NEED that kind of thing so you can have the
kind of abstraction level you will want to have so the software can be
mantained at all, much more for extended periods of time.
The times of glorified "hello, world" programs are over.
Most of the finite elements programs people were so fond of in the FORTRAN
times are written by now - there are probably generic programs for that kind
of thing.
Today's software is supposed to do everything, including making coffee,
cleaning your shoes and taking the dog out. You do not want to write that
kind of software with a 70s era approach - monolithic blocks of code like
people used to write with old Pascal, C, or (heaven forbid) FORTRAN.
Sure, you CAN do that. But it hurts - big time.
C's string handling for instance sucks - it is the source of most security
holes that need to be fixed. Buffer overflows happen because C does not have
a concept for variable length strings - it only has character pointers. What
a nightmare.
Been there, done that, hated it from the bottom of my guts.
I have been programming since the mid-80s, and even though I also tend to
bitch about many things, things have improved a lot since then. No more
rebooting because a null pointer in C overwrote your PC's interrupt table at
0000:0000 on MS-DOS. Anybody remember what a PITA that was?
No more dumbass 64k limits because certain ingenious inventors had considered
that much memory "enough for everybody".
No more nightmarish Turbo Pascal {Imyinclude.pas} to overcome the lack of a
module or linker concept.
And today, it's no more segfaults because the C string handling is so dumb.
Use modern tools. Use tools like C++ - or, for that matter, C#, or even Java.
Use predefined (meaning: well-tested) classes for common purposes. Do not
repeat everybody's (and their mothers' ) mistakes by writing your own because
you think you can do a better job at that.
You argue this comes at a price - and the price is performance and system
resources. That may be right, but I rather sacrifice some MB of RAM rather
than experience random crashes because nobody can debug a software of that
complexity written with outdated tools any more. My time (and, for that
matter, my nerves) are way more precious to me than some MB of RAM saved.
I could keep ranting a lot more like that, but other duties are calling right
now. ;-)
Just my 2 Cents
(well, make that 4 - or 6) ;-)
--
Stefan Hundhammer