Berkeley CSUA MOTD:Entry 17942
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2000/4/6-7 [Computer/SW/Languages/C_Cplusplus] UID:17942 Activity:very high
4/6     C vs. Java vs. Perl comparisons:
        Conclusion: C is still the fastest. Java is not as slow as people
        think it is. Perl is nowhere close to Java performance.
        \_ Apples, Oranges, Bananas, and Trolls who like to delete
                \_ Multithreaded java with native threads with a
                   decent rt gives you functionality that you can
                   only dream about in perl and groan about in C.
                   Debugging a multithreaded java server is much
                   easier than an equivalent c/c++ server. If
                   I'm running in an enviroment where CPU cycles
                   are important, c/asm is the only choice, c++
                   perl and java don't even enter the picture.
                   In every other environment the easy of development
                   and maintenance overrides speed concerns.
                   If you are concerned about performance
                   get better algorithms.
           postings, look only at implementation languages and not the
           entire problem to be solved.  -- tmonroe
        \_ What about php4?
                \_ who mentioned web application development?
        \_ You're right.  Compiled perl is much faster than java.
           \_ Multithreaded java with native threads with a decent rt gives you
              functionality that you can only dream about in perl and groan
              about in C.  Debugging a multithreaded java server is much easier
              than an equivalent c/c++ server. If I'm running in an enviroment
              where CPU cycles are important, c/asm is the only choice, c++ perl
              and java don't even enter the picture.  In every other environment
              the easy of development and maintenance overrides speed concerns.
              If you are concerned about performance get better algorithms.
              \_ How exactly is c faster than c++?
              \_ Formatting widened.
                 \_ c++ has more language overhead if you classes/exceptions/op.
                    overloading. Also the binaries for a c++ app are larger than
                    those of a c app. In a severly memory/cpu constrained env.
                    c is better than c++ in terms of size (smaller ex. image) and
                    speed (less instr. to execute for straight c vs. c++ using
                    objs.)
                    \_ this is completely false. the only execution overhead
                       you'll see in c++ is from virtual dispatch, which ONLY
                       happens with virtual functions. there is NO overhead
                       in overloaded functions (unless virtual), none in using
                       class's instead of structs. there is overhead in using
                       exceptions, yes. but the rest of your comment is full
                       of shit. and the only reason why your executables might
                       be bigger is because symbol names are longer in c++,
                       so unstripped binaries will be larger. if you don't
                       know what you're talking about, say so in your post,
                       please, so people won't go around spreading your
                       shit. oh, if you want to talk about code bloat, you
                       ought to be mentioning templates, not the crap you
           \_ on the other hand, I think Larry Wall or some high mucky-muck
              has been quoted as saying "dont byte-compile perl, its broke"
              \_ Perl is normally byte-compiled every time you run it.
                 \_ gimme a breakhere.i'm trying to differentiate between
                   "compiling perl" as in "installing", vs
                   "precompiling your perl" forspeedgain, as hinted at by
                   the above poser
                   \_ He didn't mean "installing" and you don't deserve a
                      break, loser.  You're probably the same idiot who made
                      the "c is faster than c++" comment.
                      \_ I (the "idiot" in question) did not make this comment.
        \_ Apples, Oranges, Bananas, and Trolls.  -- tmonroe
        \_ I could an implementation on my TI-85 pseudo-BASIC that will kick
           the crap out of any of those. Take an algorithms course. That's
           the conclusion.
           \_ Yeah, according to algorithms course radix sort should run
              faster than quick sort on large data sets.  That is, until
              you take CS 252 and actually run the algorithms do you find
              out otherwise.
        \_ They're defined recursively, but you don't want to compute them
           that way...
        \_ PEOPLE! JESUS FUCKING CHRIST, LEARN PROPER ENGLISH!
                \_ what's wrong?
                       mention. but then, most people don't know how to use
                       templates so they don't use them. -ali.
                       \_ I heard that you almost never need to write your
                          own templates since the standard and useful ones
                          are usually already supplied by the development
                          environment.  Is that true?
                        \_ I though that an object in c++ contained a copy
                           of each of its parent classes, thus a class
                           requires more memory to store than a struct.
                           \_ gee, in C,

                              struct A {... };
                              extending things are in C, without requiring
                              struct B { struct A a; ... }
                              struct B is pretty damn big too.
                              i don't understand what you're asking. if you
                              want to argue "C++ hides the fact that things
                              get large by making it easy to bloat your code
                              with only a few keystrokes" i might concede,
                              but i don't see what the alternative way of
                              extending objects are in C, without requiring
                              identical bloat. -ali
                                \_ YOU ARE BLOATED, ALI
                                        \_ man, give ali a break, he's a
                                           good guy - ali #2 fan
2025/05/25 [General] UID:1000 Activity:popular
5/25    

You may also be interested in these entries...
2005/1/21-22 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java] UID:35849 Activity:high
1/21   Thought this was an interesting read:
       http://paulgraham.com/noop.html
       I tend to agree with him, as I've seen relatively little gain
       from such languages as C++ and Java in terms of creating better
       software.
        \_ I thought it was pretty sophomoric, really.  OOP is a tool that is
	...
2004/10/29-30 [Computer/SW/Languages/C_Cplusplus] UID:34449 Activity:very high
10/29   C++ is so freaking BROKEN.  Augh!
        \_ Just use C.
           \_ Would if I could.
        \_ No, you are.  C++ works just fine, and far better than C for many
           purposes.
           \_ C vs. C++.  FIGHT!!!
	...
2004/8/18-19 [Computer/SW/Languages/C_Cplusplus] UID:32995 Activity:very high
8/18    Doesn't math.h define min() and max() functions?  What should I include
        to get them?  I'd rather not do the (a < b) ? a : b thing.  Thx
        \_ No.  Many programmers define it as a new macro.  Don't know what
           gcc people do, offhand.
        \_ OS X has fmin(3)/fmax(3) which conform to ISO/IEC 9899:1999(E).
           Linux might have these too.
	...
2004/3/30-31 [Computer/SW/Languages/Perl] UID:12925 Activity:kinda low
3/17    In Perl, how do I make variables have static types and type check
        for valid parameter/actuals? I realize that variables are untyped
        in Perl ($var can be 0.001 or "hello") but I'd like to have more
        strict checking so that errors would be caught ahead of run-time,
        Thanks,                                                 -java guy
        \_ use java.  Seriously.  You don't use perl if you want strong
	...
2003/7/6-7 [Computer/SW/Languages/C_Cplusplus] UID:28939 Activity:high
7/5     Besides method lookup of non-virtual methods, how is C++ considered
        slower than pure C?  The follow-up question: why hasn't C++ or
        another OO language moved into usage in kernels and drivers?
        \_ Larger standard library + linkers which link everything =
        \_ You probably mean "Besides method lookup of virtual methods".
           large code = poor cache performance.
	...
2003/4/22-23 [Computer/SW/Languages/C_Cplusplus] UID:28189 Activity:insanely high
4/22    Anyone know a good link that explains all of C++'s use of the
        keyword mconst?
        \_ http://www.parashift.com/c++-faq-lite
           Search for const in the text box.
           Search for mconst in the text box.
           \- perfection
	...
2002/11/5 [Computer/SW/Languages/C_Cplusplus] UID:26409 Activity:high
11/4    I'm having a problem formatting inline elements in xsl-- I have to
        handle the situation where
        <school>I graduated from
          <link href="<DEAD>www.berkeley.edu"<DEAD>Cal</link> in 1998.
        </school>
        My current template is like this:
	...
2001/3/17-18 [Computer/SW/Languages/C_Cplusplus] UID:20827 Activity:high
3/16    Why does so much C sample code use #define instead of const?
        \_ because any good C code will use a bunch of preprocessor
           anyways. you can't be a good C programmer and eschew the
           preprocessor. For that, you need a language which fills those
           gaps with other constructs (c++ templates go a long way to
           obviate the need for preprocessor for example). you
	...
2000/8/9-10 [Academia/Berkeley/Classes, Computer/SW/Languages/C_Cplusplus] UID:18929 Activity:high
8/8     How well do UCB EECS and CS newgrads know C/C++? (in general)
        \_ If it makes you feel any better, Stanford undergrads start out
           take 3 quarters of "Introductory Programming" in C instead of
           SICP.
        \_ on average, better than other schools' new grads, with a
           lot more upside
	...