From: Robert Billing on
Is it just me, or is programming getting more difficult?

I'm trying to write a little application (it'll probably be implemented
as a perl script) that catalogues files on memory cards. I'd like it to
be able to detect when a card is plugged in, scan it quickly to see if
any files have been added since we last saw that card, then do something
with the new files.

To do this I need to know when the cards are plugged in.

There used to be something called hotplug that got notifications from
the kernel. However dbus seems to be the flavour of the month, so I
started reading up on dbus.

Oh dear. All I want to do is find out about hotplug events.

I'm faced with a lot of documentation that waffles on endlessly about
objects and methods, but nothing that answers the real question, "How do
I get events when someone puts a card in a reader?" OK, I'll probably be
able to puzzle it out in a couple of days, but whatever happened to
making things simple and having the documentation useful?

It's not just dbus. I was trying to set up a network printer a couple of
days ago. Now CUPS demands a thing called a printer uri, which seems to be:

ipp://(hostname)/printers/(name of printer)

That's simple enough, but why the seven bells doesn't the documentation
say so? Instead it talks about resources, but nowhere defines what a
resource is, or what the syntax is for describing one. The word
"resource" isn't in the glossary.

I'm beginning to wonder if the new "everything is an object" philosophy
isn't making programming needlessly obscure. The dbus documentation says
"If you use this low-level API directly, you're signing up for some
pain." To me that's an admission that the API is badly designed. A
well-designed API might well be complex, but it shouldn't be difficult
to use.

The standard C runtime library can do a lot, and after more than 20
years I still find bits that I didn't know about. Yet it's not painful
to learn or use. So why can't modern interfaces be as simple as open()
select() and read()?

Or is it just that I'm getting old?
From: Lionel B on
On Wed, 07 May 2008 12:52:31 +0100, Robert Billing wrote:

> Is it just me, or is programming getting more difficult?

[...]

Sounds like your gripe is more about lousy documentation than anything
else.

> I'm beginning to wonder if the new "everything is an object" philosophy
> isn't making programming needlessly obscure. The dbus documentation says
> "If you use this low-level API directly, you're signing up for some
> pain." To me that's an admission that the API is badly designed. A
> well-designed API might well be complex, but it shouldn't be difficult
> to use.

To me the implication is clearly that there is some *high*-level API
knocking about which you should rather use.

I guess it's all about a drive to higher levels of abstraction that
naturally accompanies a growth in system complexity... now I know zilch
about dbus, but I bet if you did climb that learning curve you'd find you
suddenly knew an awful lot more than just how to detect when a card is
plugged in. Probably more than you wanted to know...

> The standard C runtime library can do a lot, and after more than 20
> years I still find bits that I didn't know about. Yet it's not painful
> to learn or use. So why can't modern interfaces be as simple as open()
> select() and read()?

Well, I guess those old interfaces are still there, it's just that as the
man said, "If you use them directly, you're signing up for some pain." I
mean if you want to program a database you don't do it using open() select
() and read(). You could, but that *would* be painful; rather, you'd use
some library with an abstract (and, to begin with, obscure) API.

> Or is it just that I'm getting old?

Definitely.

--
Lionel B
From: Geoffrey Clements on
"Robert Billing" <unclebob(a)tnglwood.demon.co.uk> wrote in message
news:fvs560$hjn$1$8302bc10(a)news.demon.co.uk...
> Is it just me, or is programming getting more difficult?
>

I think you're being rhetorical but ...

I've just been catching up with "new" python stuff, things like properties,
descriptors, decorators, meta-classes, generator expressions, co-routines
and so on, so in my opinion yes programming is getting more difficult (or
moving too far away from the way I was taught Fortran - my first ever
lecture at University - I remember laughing at the lecturer's constant use
of "do loop" which sounded funny to me and the others around me).

> I'm trying to write a little application (it'll probably be implemented
> as a perl script) that catalogues files on memory cards. I'd like it to
> be able to detect when a card is plugged in, scan it quickly to see if
> any files have been added since we last saw that card, then do something
> with the new files.
>
> To do this I need to know when the cards are plugged in.
>
> There used to be something called hotplug that got notifications from
> the kernel. However dbus seems to be the flavour of the month, so I
> started reading up on dbus.
>
> Oh dear. All I want to do is find out about hotplug events.
>
> I'm faced with a lot of documentation that waffles on endlessly about
> objects and methods, but nothing that answers the real question, "How do
> I get events when someone puts a card in a reader?" OK, I'll probably be
> able to puzzle it out in a couple of days, but whatever happened to
> making things simple and having the documentation useful?
>

I sometimes think that the developers write documentation without thinking
of the different classes of end users, but not all; there are some very good
examples out there.

> It's not just dbus. I was trying to set up a network printer a couple of
> days ago. Now CUPS demands a thing called a printer uri, which seems to
> be:
>
> ipp://(hostname)/printers/(name of printer)
>
> That's simple enough, but why the seven bells doesn't the documentation
> say so? Instead it talks about resources, but nowhere defines what a
> resource is, or what the syntax is for describing one. The word "resource"
> isn't in the glossary.
>

http://en.wikipedia.org/wiki/Uniform_Resource_Identifier, personally I tnink
a resource is anything a URI can point to but I guess your point is what is
a resource in the context of CUPS?

> I'm beginning to wonder if the new "everything is an object" philosophy
> isn't making programming needlessly obscure. The dbus documentation says
> "If you use this low-level API directly, you're signing up for some
> pain." To me that's an admission that the API is badly designed. A
> well-designed API might well be complex, but it shouldn't be difficult to
> use.
>

OO by its nature will tend to abstract things, that's its power; that way
the low level details can change without messing up the higher level API,
however a well designed API should lead you to doing relatively simple tasks
easily but not having looked into dbus in any depth I can't really comment.

> The standard C runtime library can do a lot, and after more than 20 years
> I still find bits that I didn't know about. Yet it's not painful to learn
> or use. So why can't modern interfaces be as simple as open() select() and
> read()?
>
> Or is it just that I'm getting old?

I'm getting old too, it seems to get harder and harder to absorb these new
programming "paradigms".

--
Geoff


From: Ian on
On 7 May, 12:52, Robert Billing <uncle...(a)tnglwood.demon.co.uk> wrote:
> Is it just me, or is programming getting more difficult?

It happens to the poor bloody user as well.

On my -> 2007 Ubuntu machines I have XMMS. It's simple, neat and does
exactly what it says on the tin.

Not on 8.04 though. Oh dear me no. XMMS is out, XMMS2 is in. A
horrible convoluted client-server monstrosity, which probably looked
awful clever to the people writing it but is ridiculously complicated
- and ridiculously under documented.

I just hope that someone picks up the XMMS baton and runs with it,
leaving XMMS2 to wither and die.

Ian
From: Robert Billing on
Lionel B wrote:

> Well, I guess those old interfaces are still there, it's just that as the
> man said, "If you use them directly, you're signing up for some pain." I
> mean if you want to program a database you don't do it using open() select
> () and read(). You could, but that *would* be painful; rather, you'd use
> some library with an abstract (and, to begin with, obscure) API.

That's rather my point. I've used both Postgres and MySql, and the
documentation says "Do this to create a table, do that to put a record
in a table, do the other to search for a record matching these
criteria." Firstly the documentation tells you what to do and secondly
the API is designed in such a way that you can write very simple
programs to do simple things. Xlib is much the same, although I've only
once had to go to that level, most of the time I've used higher levels.

Think how it would be if, instead of nice, understandable SQL you had to
fight your way through something that used a dozen or so neologisms
without defining them and in the end left you to try to piece things
together deductively.

I grew up with DEC kit, and expect documentation to be of the standard
of the "great grey wall" which actually told you what the API was, and
had useful examples. It also gave you hints as to what was guaranteed
stable, and what might change in a subsequent release.

I admit, though, that my main gripe is about poor documentation.

I get paid for working on the kernel, mainly driver writing, and I'm
finding the same sort of thing there. In the kernel there are huge
blocks of code without a comment in sight.

There's something wrong here. People seem to be coding without giving
enough thought to those who will have to use what's been coded as a base
for building something else.