Re: Other than php/perl/lisp/c/c++/java, anybody have a favorite computer-programming language?




On Mon, 5 Feb 2007, robert maas, see http://tinyurl.com/uh3t wrote:
From: "Arthur J. O'Dwyer" <ajonos...@xxxxxxxxxxxxxx>
[Someone else wrote, and Robert snipped the attribution for]
Ideally, an algorithm is designed independently of data type. While
this is not always possible, it most often is. A language that
supports generics/templates (C++, Eiffel, Ada, and now Java) can
enable this kind of generality of design.

Basically true if we assume "data type" means "primitive C-like
data type" (integer, char, bool, floating-point, bignum, even string),

I disagree with both of you. Many of the specific operations that are
meaningful for one datatype aren't meaningful at all for another datatype.
For example, arithmetic (add, subtract, multiply, divide) make
sense for numbers (integers including bignums, floating-points,
rationals) but not for the other types (char, bool, string).

We were talking about algorithms. You're now talking about operations;
that is, you're talking about mappings from S*S to S, where S is some
set (for example, the set of integers modulo 255, where the operation
is addition).
Algorithms --- to take a specific example, Euclid's GCD algorithm ---
can be applied to many different primitive types, as long as those types
provide operations which are isomorphic to each other.

Picking an element based on index makes sense for strings and other
kids of vectors (1-d arrays), but not for char or bool or even
integer except if the integer is treated as if a bitvector.

"Strings aren't vectors." "Yes they are, they're vectors of characters." "Well then, integers are vectors of bits." This is
very close to the point I was making: algorithms typically rely on
particular data /structures/ (for example, vectors), but not on the
primitive data types (for example, characters or bits).

Potentially interesting tidbit: If your language of choice
chooses to represent strings as /lists/ of characters rather than
random-access /vectors/, then you might find that algorithms expecting
vectors of characters have suddenly acquired a factor of O(n) or two!
(*cough*Lisp*cough*)

-Arthur,
who has nothing against Lisp
.



Relevant Pages

  • RE: VBA question: How to extract cell values in different language
    ... language is entered, but it seems like all that data is lost when the VBA ... about having binary data and not unicode data confirms my suspicions. ... You are have 256 binary characters. ... First column has the string IDs ...
    (microsoft.public.excel.programming)
  • Re: A note on personal corruption as a result of using C
    ... impossible to write effective string validation routines by definition ... (Note that a string literal may contain embedded null characters; ... without resorting to abusive language. ... In practice, programmers typically use "struct" ...
    (comp.programming)
  • Re: Russian language support
    ... Actually in our previous test we didnt do language transition properly ... bytes, or if in Unicode, just a string of 2-byte values, each of which is ... it selects a font to use to display ... TTF fonts in Windows CE map Unicode characters into suitable glyphs. ...
    (microsoft.public.windowsce.platbuilder)
  • RE: VBA question: How to extract cell values in different language
    ... language is entered, but it seems like all that data is lost when the VBA ... You are have 256 binary characters. ... Unicode data on the same file with two diffferent language setting gives you ... First column has the string IDs ...
    (microsoft.public.excel.programming)
  • RE: VBA question: How to extract cell values in different language
    ... You are have 256 binary characters. ... Depending on the language settings the characters are displayed differrently, ... Unicode data on the same file with two diffferent language setting gives you ... First column has the string IDs ...
    (microsoft.public.excel.programming)