[OT] unbelievable: #ifdef _OTHER_LIB_H

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 26 13:00:14 PST 2014


On Wed, Nov 26, 2014 at 08:06:01PM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> So my computer died on me again last week and I had to buy new
> hardware. I was forced to update the software to run the new
> hardware... and it is painful.

I have a high distrust of brand new *hardware*, because they inevitably
are gratuitously incompatible with my current software and require
new-fangled OSes bloated with features I never use. Because of this, I
only ever upgrade once every 5 years (if not longer). And when I do,
I'll be sure to spend plenty of time researching what hardware isn't
horribly broken or requires a specific version of a specific OS and
doesn't work with anything else. Vendor lock-in is evil.


> I hate all software and have learned that if I want a job done right,
> I have to do it myself. Rarely, I find other people's software is OK
> with some slight modifications, so I try to do that.

	I don't trust computers, I've spent too long programming to
	think that they can get anything right. -- James Miller

:-)


> xterm is one example. I basically like it but it is ugly and stupid so
> needs a few fixes. As such, I maintain my own private fork of it.

You're brave. :-P  Me, I've given up on xterm long ago, and use
rxvt-unicode these days. At least it supports Unicode & Unicode fonts
without *too* much pain. But still...

Speaking of which, whatever happened with your D-based terminal app from
a while back? You did get it to the point where it could support inline
images and stuff, which is pretty cool; if you could get it to the point
where it works well with Unicode fonts, I'd dump rxvt and use your
terminal instead. :-P


> I went ahead and compiled that on the new thing today.... and it
> failed.  wait what?!
> 
> 
> #ifndef _XLIB_H_
> #error Please include <X11/Xlib.h> before "xutf8.h"
> #endif
> 
> 
> That's in the xterm source code. Yes, it depends on the presence of a
> particular include guard.

Whoa. That's ... messed up in more ways than I can name!


> The X11 source apparently recently changed to:
> 
> #ifndef _X11_XLIB_H_
> #define _X11_XLIB_H_
> 
> 
> thereby breaking xterm... and blackbox... and who knows what else.

Yeah, that's the downside of maintaining your own fork of stuff.
Upstream (presumably) would've taken care of updating these ugly bits of
code, but you don't get the benefit of that unless you regularly pull
from upstream and merge, which is a lot of work to begin with.


> This one was brought to my attention thanks to the #error directive.
> But there's certainly other things silently being compiled out now, as
> the program does not work correctly after fixing this.

Sigh... what else is new. That's the unvaryingly sad story I find with
every sufficiently-complex C/C++ program. No matter how well-intentioned
you start out and no matter how clean the initial design, it inevitably
gravitates towards an incomprehensible patchwork of hacks upon bandages
over patches to older hacks, containing hundreds of implicit assumptions
(that's been already forgotten since the second last guy took over the
codebase). Break any one of these hidden assumptions, and little
inscrutable malfunctions start showing up everywhere.


> Unbelievable.
> 
> Praise D's modules.

Not just D modules, but many other aspects of D tend to keep your
program away from sinking into the rathole of patches upon hacks upon
bandages over patches, that every C/C++ program inevitably gravitates
towards.

(Unfortunately, some areas of D haven't been ironed out enough in this
respect, and sometimes you do still have to do ugly hacks to make things
work. But generally, D does give you the tools to limit the scope of
such hacks so that they don't creep and take over program readability.)


> PS the fonts are all hideous on the new linux too. I should have just
> bought a Windows license.

Shouldn't you be able to just install the good ole fonts and expunge the
ugly new ones? Or has Linux "desktop" code devolved to the point of
hard-coding specific font names for everything?

<soapbox> This is one of the reasons I've completely given up on the
whole "desktop metaphor" movement. It has become all glitz and no
substance IMNSHO; all about this font vs. that font rather than actually
solving real problems. Give me ratpoison and a bare terminal emulator
any day, and my productivity gets boosted 300%. Even when I'm using
Windows, that purportedly sports "better" UI design than Linux, I find
myself spending more time fighting with the UI than actually getting
anything done. The GUI emperor has no clothes, and I'm calling BS on the
whole movement! </soapbox>


T

-- 
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the world. --
Anonymous


More information about the Digitalmars-d mailing list