Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Re: tlug-digest Digest V2004 #194



Quoth Viktor Pavlenko (Thu 2004-07-29 10:47:01PM -0400):

> >>>>> "JG" == Josh Glover <tlug@example.com> writes:
> 
>     JG> I have come to be of the opinion that C should be avoided for
>     JG> all but the most systemsy of software.
> 
> This sounds kind of wrong. And it's coming from you Josh? :)

Heh, but I am a systems programmer, so I get to invoke the "all but the
most systemsy of software" clause whenever I feel like a little C. :)

>     JG> Write your stuff in a higher-level language, and rewrite the
>     JG> inner loops in C where blazing speed is necessary.
> 
> C++ gives you a much higher level without sacrificing the speed. Of
> course, a digital album software is better written in perl but for
> performance critical applications C(++) is more suitable.

> Regarding C++, it just brings fun into C...

I actually feel that a lot of systems software can *really* benefit from
OO, so I tend to agree with you here. However, C++ brings with it its own
can of worms (mangled names, anyone?). Believe it or not, I would actually
choose Java over C++ in most places.

Before anyone starts throwing furniture, let me explain my reasons:

- Java is *much* better at OO than is C++
- Java has some really great development tools (like Ant, Eclipse, etc)
- Java has a *massive*, *standard*, class library (mmm mmm reusability)
- Java does memory management for you
- The bottlenecks are not where you think they are

What I mean by my last point is that the "traditional" bottleneck, the
CPU, is seldom the bottleneck anymore, in these days of The Network
permeating even the lowest levels of systems software.

Sure, Java is a memory hog. Sure, it is not as efficient as good C. But
if you have the memory to throw at it, why not?

Now, remember that I am in the telecomm industry, so much of what I say
is slanted toward systems software that uses a network (which network is
sometimes more interesting--I do some ISDN stuff sometimes, and believe
you me: TCP/IP is *trivial* compared to the ISDN protocol stack!) to do
stuff. Then again, as I point out above, the network is now everywhere.

So I stand by my original statement: never use C, unless your "prototype",
which is written in a higher level language such as Perl, Python, Ruby,
or Java (is Java really higher level than C? sorta) just can't get the
job done. And then, optimise only the bottlenecks that *you have measured
empirically*! Make no assumptions, because you know what *they* make of
you and me...

C just takes that much more effort. I don't care how macho a C hacker you
are, it does. Measure for yourself if you don't believe me. (In case you
need some convincing, the Pragmatic Programmers[1] *and* Kernighan and
Pike[2] agree with me.)

Cheers,
Josh

[1] http://www.amazon.com/exec/obidos/ASIN/020161622X/qid=1091194898/sr=2-1/ref=sr_2_1/104-9312387-8407967
[2] http://www.amazon.com/exec/obidos/tg/detail/-/020161586X/qid=1091194970/sr=1-1/ref=sr_1_1/104-9312387-8407967?v=glance&s=books

-- 
Josh Glover

Gentoo Developer (http://dev.gentoo.org/~jmglov/)
Tokyo Linux Users Group Listmaster (http://www.tlug.jp/)

GPG keyID 0xDE8A3103 (C3E4 FA9E 1E07 BBDB 6D8B  07AB 2BF1 67A1 DE8A 3103)
gpg --keyserver pgp.mit.edu --recv-keys DE8A3103

Attachment: pgp00067.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links