Re: Miscellanous Language Ranting (was Re: For performance, write it in C - Part 2, comparing C, Ruby and Java)



On Sun, 2006-07-30 at 03:47 +0900, M. Edward (Ed) Borasky wrote:
I don't think I've ever needed lexical closures.

Oh no ohh no... I think Chad hit it pretty well on the head with "well
you don't *need* switch statements." There are plenty of things in
programming languages you don't *need*, but once you've gotten into
them, you find yourself missing them when you have to do without them.
The programming I get paid to do is largely in PHP and ActionScript 2.0
for Flash; once I got the hang of using anonymous functions in
ActionScript, which are (or at least try to be) lexical closures, I
found my life getting a lot easier. For writing very event-driven code,
such as responding to a GUI and responding to callbacks generated by
remoting, anonymous functions, (despite a strong orthodoxy in much of
the Flash community against their use) can be a great way to write
smaller, clearer code.

I submit to you that you use lexical closures all the time and don't
even know it. You mention below that you've written Java, and I presume
you've written other object-oriented stuff. Guess what? Objects are
full of closures. The methods of an object are closures on the object
itself. If they weren't, you wouldn't be able to access instance
variables from them. Unless they started making everything global, and
then you may as well write in Fortran IV.

A working programmer needs to know C, plus whatever languages are used
in his or her shop. Regardless of what the designers and communities for
those other languages intend(ed) them to be, they are in fact occupying
an economic niche. They are special-purpose languages by that definition.

I only kinda-sorta know C; the university I went to didn't use it as one
of its main teaching languages at the time (CS I and II were done in
Java, CS III in Ada 95, and I took a Programming Languages course that
used Scheme quite heavily). I picked up a little of C in an Operating
Systems course, just enough to do some programming assignments involving
POSIX threads in Linux. I've yet to have need of C in my paid work, but
should the occasion arise, I'll learn it then.

Enough languages these days have inherited so many characteristics from
C, and C itself is a nice small-enough language with excellent
literature on it, that I don't think it will be a major problem for any
reasonably experienced programmer to learn it when needed, and for the
same reason, I don't think anyone really *needs* to know C unless
they'll be working on certain kinds of projects such as a Linux kernel
module to drive some special device (the company I work at has a project
going on currently that includes just that, and also involves Java, PHP,
and ActionScript 3.0, and of course the usual amount of SQL).

In this sense, Ruby is on the edge of becoming a special-purpose
language as the engine underneath Rails.

So? C has already become something quite like a special-purpose
language as the engine underneath *nix. And why not? Writing Unix is
what C was pretty much invented for. This doesn't imply that you can't
do plenty of other things with it, nor that no one doesn't do other
things with it, but a large amount of C's usage today falls in a certain
niche. Probably the biggest part of C's importance is the influence it
has had on other languages and on programming in general. I think it
would be just fine if Ruby followed a similar trajectory.

--ch--


.



Relevant Pages

  • 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)
  • Re: Is there a mainframe skills shortage?
    ... That's because the author of the article is comparing it to standard SQL. ... and material around Lamdas and functional programming. ... obvious which languages were the ones to learn. ... stick to writing system software and leave applications to the COBOL ...
    (comp.lang.cobol)
  • Re: GoTo in Java
    ... Scripting languages are programming languages; ... override the method.via an interface, or write a new method in the wrapper. ...
    (comp.lang.cobol)
  • Re: LISPPA
    ... >> a match for such imperative languages as C, ... >comparing Lisp with languages like C, Pascal and Basic, ... I can accept that Lisp tries to compensate of the lack of compile-time ... If you have tools of visual programming, nice editor, advanced ...
    (comp.lang.lisp)