Re: dangers of operator overloading




In article <1117005663.569508.202330@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, makc.the.great@xxxxxxxxx writes:
> > with types of hash functions. MD5 is completely unsuitable for the
> > purpose he describes, and referring to it as "typical" in this context
> > indicates that he lacks any real understanding of hashing.
>
> Exactly what I was making my point about - I don't have to know these
> things. I need a compiler to know this instead.

Then you ought to be using only languages operating at a sufficiently
high level that they incorporate appropriate data structures auto-
matically. Understanding data structures and algorithms is what
programming is about.

> > At any rate, a series of 200+ comparisons, however constructed, seems
> > like a pretty lousy solution to me. Put the keyword-token mapping in
> > an external file. If that's unacceptable for some reason, generate
> > it as a static data structure and compile it into the program. And
> > sort it so that it can be binary-searched.
>
> Code binary search on 200 items? Interesting idea, but - thanks - no,
> my PIV can handle 200+ comparisons (actually, avg. 100).

What "code" do you have to write? What language are you using where
a binary search is not already available to you?

Linear-searching through 200 fixed strings is inelegant. Implemen-
ting it with a hash lookup or a binary search saves on refactoring at
some later date when performance does become an issue. It's trivial
to do it right the first time.

> 2ndly, wherever you put this
> mapping, *YOU* still have to put it there manually.

Says who? If I want to generate it with a tool, I'll write a tool
that generates it. Probably a trivial task with the command-line
utilities available to me.

> It was my point
> that I had to write auxiliary code to make machine to do that instead
> of doing it myself;

Yes, we call that "toolsmithing". It's part of the job, and that's
true of a lot more domains than programming. When I'm doing carpen-
try I often have to make custom jigs. When I'm doing silverwork I
often have to make punches.

> it was my point that whole idea of "high-level
> language" suggests that this kind of auxiliary codes should be already
> written - I should be presented with some means to "explain" my problem
> to machine, so that it would "come up" with ready-to-edit code for
> solution.

Ah. You want to be a manager. They have such devices; they're
called "developers".

> That's what I would really call "high-level". If you
> disagree, just think how much better code could be optimized
> hand-crafted binary search routine in ASM (yeah that supposed to be a
> joke).

Disagree about what you would call "high-level"? You can call a
banana split "high-level" if you like.

And quite a few people have hand-crafted search routines in assembly.
I've done it myself, once upon a time. Compared to that well-written
C looks significantly "higher", and languages like Ruby or ML or APL
are positively stratospheric, albeit in very different ways.

Not that there isn't room for other kinds of programming languages,
for various sorts of problem domains. Back around 1990 I worked on
IBM's Data Explorer/6000, which was a scientific data visualization
product. It had a drag-and-drop GUI dataflow programming environ-
ment, where you'd drop modules onto a canvas, connect their inputs
and outputs together, and set their properties; you could also write
macro modules and implement new modules in any language that
supported the standard OS calling convention. I've seen similar
things for building applications out of Javabeans and the like.

Now that's a very high-level environment, in some ways. It would be
no good whatsoever for the kind of work I do now, but I can see
applications where it would be useful.

--
Michael Wojcik michael.wojcik@xxxxxxxxxxxxxx

Is it any wonder the world's gone insane, with information come to be
the only real medium of exchange? -- Thomas Pynchon
.



Relevant Pages

  • Re: Does good programming come with experience ?
    ... with lower level languages like C to do decent stuff in higher languages IMO. ... Doesn't it depend on the type of programming that someone needs to do? ... That's just stringing together high-level ... If the hardware designers knew nothing of software and vice-versa, ...
    (comp.programming)
  • Re: Does good programming come with experience ?
    ... with lower level languages like C to do decent stuff in higher languages IMO. ... Doesn't it depend on the type of programming that someone needs to do? ... I personally think that if someone only knows high-level languages ... One common denominator for good programmers in my opinion is ... ...
    (comp.programming)
  • Re: Why not unions
    ... >>Why are only structures used for implementing data structures. ... > This sounds like a question about struct and union in the C programming ... Both struct and union are used by C programs. ... As do older languages, such as Pascal. ...
    (comp.programming)
  • Re: compiler for Chinese development language
    ... This relates to the development of vernacular ... Indian vernacular display, OS and programming languages. ... Bangla and other vernaculars. ...
    (comp.compilers)
  • Re: Head-in-the-Sand Liberals (LA Times Columnist)
    ... You claimed to have known several computer languages, ... If you lie about knowing computer languages, ... of the programming loop for a functional ... You also don't know Java. ...
    (rec.org.mensa)