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

1999/8/3-5 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Functional] UID:16238 Activity:very high
8/3     What do people think about STL (Standard Template Library) for C++?
        I used it recently and it looks pretty cool.  -emin
        \_ STL is a good advance in terms of API, but the implementations
           will need a while to mature to avoid foiling compiler
           optimizations.  This will come soon from KAI, Sun, et al. -mel
        \_ for more docs try:
           http://www.sgi.com/Technology/STL
           --jeff
        \_ for Java "port", see http://www.objectspace.com/jgl and forget all about
                them java.util collection classes       --petr
        \_ It's pretty convenient.
        \_ I think it tends to be arcane. (And I'm a Unix bigot, so I have
           a high tolerance for arcana.) Having a copy of the C++ standard
           handy helps. Failing that, Stroustrup is your friend, sort of.
           -brg
        \_ In my humble opinion if there is a real need to use templates
           for what you need to do, Lisp may be a better language than
           C++.  -- ilyas
           \_!!! You're kidding, right?  A good portion of the reason
             for using templates is for inlining code while providing
             \_ huh? inlining code?  stl has nothing to do with inlining.
                \_ Try again.  It has *a lot* to do with inlining.  That
                   is what your functors do when you pass them to
                   classes like map, priority_list, etc.
             \_ Even with STL, C++ is much much harder to write and maintain
             than Lisp.  Furthermore, there is little evidence that
             explicit memory management outperforms a good garbage collector
             receiving hints from the programmer (something Lisp allows and
             encourages). -- ilyas
                   \_ The STL is about not having to write general-purpose
                      code any more.  Efficiency is a requirement, not the
                      goal.
                      \_ My point is that we've had things like qsort()
                         in the standard library for a while, but you
                         had to pass a function pointer.   That meant a
                         function call for every compare.  Inlining the
                         code makes a *huge* difference.
             flexibility.  I don't need or want the overhead of a
             garbage collector and closures.
             \_ Even with STL, C++ is much much harder to write and
                maintain than Lisp.  Furthermore, there is little
                evidence that explicit memory management outperforms a
                good garbage collector receiving hints from the
                programmer (something Lisp allows and encourages). -- ilyas
                \_ "C++ is much harder to write and maintain than Lisp"?
                   Please list your sources for this ridiculous
                   assertion.
                   \_ This is not an academic point, but a practical one.
                   In practice, me and many of my friends and coworkers
                   found the assertion to be true.  If it is not true for you
                   I would be happy to know why. -- ilyas
             \_ ilyas loses THREE POINTS. -1: One of the biggest benefits of
                templates is typesafe containers. LISP does not have type
                safety at all. LISP can't compete.
                -1: Large LISP programs are MUCH harder to maintain than
                c++ programs.  -ali.
                \_ Given two programs of equal size (down to a line), a
                   Lisp program will probably have a LOT more
                   functionality than a C++ program due to Lisp's
                   inherent terseness.  I don't see a single thing that
                   will make C++ easier to maintain in the long run.
                   Not only will a given amount of C++ code express a
                   lot less than the same amount of code of Lisp, but
                   the C++ maintaner is forced to cope with bugs on two
                   fronts -- memory and logic, whereas a Lisp programmer
                   only needs to worry about logic.  Strict type safety
                   can be easily implemented in LISP using CLOS methods,
                   if the programmer wants it. -- ilyas
                \_ The industry didn't side with typed languages like
                   C++ and Java over Lisp/Scheme on a whim.  They did
                   it because the C++ projects were getting done on time
                   and on budget and the Lisp programs weren't.  That's
                   why Lisp has been consigned to academia and think tanks
                   while C++ programmers have jobs. -mel

                   \_ This may be the case, although I certainly wouldn't
                      say industry sides with things for a good technical reason.
                      Witness clueless executives gather around NT like scared
                      cubs around their dead lioness mother.  I don't know if
                      anyone actually did a rigorous in-depth study of software
                      development times across languages.  It may be that Lisp
                      is consigned to Academia and think tanks, but remember that
                      this is generally where the best and the brightest make
                      their living. -- ilyas

                \_ This is much like English vs. Spanish.  People often
                   claim that Spanish is much more consistent and simpler
                   than English hence better.  The problem with LISP is that
                   although simple and consistent, it's too simple and
                   consistent making it visually difficult to distinguish
                   different constructs and mechanisms easily (too many
                   parens and no type declarations).  You can argue that
                   declarations are a bad part of language but on a large
                   scale they tend to help a lot whereas languages lke LISP
                   and LOGO or acceptable for grade school pedagogy uses.
                   \_ Declarations, type safety and private data members
                      are useful features of a language, but they tend
                      to be used as crutches by programmers who are not
                      careful.  Which language looks visually more
                      intuitive is a very subjective thing.  Moreover,
                      one shouldn't need a type declaration to be able
                      \_ I find type declarations very useful for various
                         reasons.  It's ability to restrict space and
                         functionality of a variable helps increase it's
                         compactness and computational efficiency.  Plus,
                         I don't mind having an explicit reminder of what
                         type something is.  The alternative is to use
                         \_ I am saying that often these features are not
                         as necessary for programming as people say, and often
                         may be more trouble than they are worth.  In
                         particular, static typing is often a cludgy,
                         complicated affair that really only tells the
                         programmer that he can't stick a round peg in a square
                         hole (something he ought to know anyways if he put
                         sufficient thought into design).  Btw,
                         ad hominem has no place in a mature discussion.
                         -- ilyas

                         the Hungarian notation and I would rather declare
                         types any day over using the Hungarian notation.

                         \_ Hungarian notation is just one convention, and
                         a rather cludgy one at that.  Also, if you remember,
                         this convention is mainly used in languages with
                         explicit types like C++ and Visual Basic -- if type
                         declarations were as helpful as some people say the
                         convention wouldn't need to be used in such languages.
                         Furthermore, it is not true that a language with
                         static typing has to have type declarations, remember
                         ML?
                         And it is not true that a language with dynamic types
                         has to be inefficient.  Good programming practices and
                         a good compiler will make sure that most things you
                         care about, such as arithmetic, will be fast. -- ilyas

                      to distinguish variables, else one doesn't know
                      how to name variables correctly.  That Lisp is a
                      pedagogy language is a serious misconception.  --ilyas
                      \_ "tend to be used"?  You're saying that because
                         some features are used by bad programmers in
                         the wrong way the language is flawed?  Please
                         crawl back under the hole you came out of.
                         \_ I am saying that often these features are
                            not as necessary for programming as people
                            say, and often may be more trouble than they
                            are worth.  In particular, static typing is
                            often a cludgy, complicated affair that
                            really only tells the programmer that he
                            can't stick a round peg in a square hole
                            (something he ought to know anyways if he
                            put sufficient thought into design).  Btw,
                            ad hominem has no place in a mature
                            discussion.  -- ilyas
                            \_ Neither do baseless assertions belong.
                               Go away.

                \_ That's only TWO POINTS.  You owe ilyas a point,
                   bitch.
                        \_ Everyone loses a point for taking part.
                \_ Static typing is not especially useful.  It requires
                   a lot of work for very little benefit.
2025/05/25 [General] UID:1000 Activity:popular
5/25    

You may also be interested in these entries...
2012/7/19-11/7 [Computer/SW/Languages/C_Cplusplus] UID:54439 Activity:nil
7/19    In C or C++, how do I write the code of a function with variable
        number of parameters in order to pass the variable parameters to
        another function that also has variable number of parameters?  Thanks.
        \_ The usual way (works on gcc 3.0+, Visual Studio 2005+):
               #define foo(fmt, ...) printf(fmt, ##__VA_ARGS__)
           The cool new way (works on gcc 4.3+):
	...
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/4/13-14 [Computer/SW/Languages/C_Cplusplus] UID:13175 Activity:high
4/13    How much C++/C knowledge do recent Berkeley CS/EECS grad have?
        \_ Class CSGrad inherits FromDaddy and does not implement C++Knowledge
           very well.
           \_ funny.  just the rich and poor as always.  the middle class can't
              afford education.
        \_ They know how to deal with pointers and addresses, malloc and free.
	...
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/11/21 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java] UID:19871 Activity:very high
11/21   All java class inherites from class *Object*, if I have three classes
        A, B, and C all have one same method showErr().  If I want to have a
        function that can call showErr() depending on the object that I passed
        in, eg.
                public void handleErr(Object o) {
                        o.showErr();
	...
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
	...
2009/4/24-28 [Computer/SW/Languages/Functional] UID:52902 Activity:nil
4/23    what book is this?
        "I'm reading this horrible horrible book about a programmer
         from silicon valley that gets magically
         transported into some world where magic is real
         and uses computer programming skillz to become the world's
         greatest sorceror … in book 1 of the series
	...
2008/12/17-2009/1/2 [Computer/SW/Languages/Functional] UID:52267 Activity:nil
12/17   wtf is happening to the dollar?
        http://quotes.ino.com/chart/?s=NYBOT_dx
        \_ People are finally taking Bernanke seriously when he says he
           is going to print as many dollars as he has to, to reinflate
           the dollar.
           is going to print as many dollars as he has to, to kill deflation.
	...
2008/7/28-8/5 [Computer/SW/Languages/Python, Computer/SW/Languages/Functional, Computer/SW/Languages/OCAML] UID:50704 Activity:nil
7/28    So, I'd like to try playing with a functional language.  Any
        recommendations?
        \_ Haskel.  Why would you start with anything else?
        \_ Haskell if you want a _functional_ language.  Ocaml if you want to
           see what a proper language implementation looks like.  LISP if
           you want old fogies to think you are cool. -- ilyas
	...
2008/4/2-6 [Computer/SW/Languages/C_Cplusplus] UID:49645 Activity:moderate
4/2     Is there an interpreted version of C or C++ that can be used for
        educational purposes? It doesn't have to be full-featured or
        strictly adhere to the standards, but it's painful for students
        to change a variable in a for loop and then wait for a compile
        to see how it changes the result. Something really lightweight
        would encourage them to play around a lot more and learn more in
	...
2007/8/30-9/3 [Computer/Theory] UID:47837 Activity:nil
8/30    what AI is editing the motd?  that's some next level shit.
        \_ Sorry. -- ilyas
        \_ ilyas -> i l y a s -> s l y a i -> Sly AI
           \_ ilya shpitser -> lisp hysteria
	...
2007/3/7-11 [Computer/SW/Editors/Emacs] UID:45897 Activity:moderate
3/7     In emacs 21, is there a way in Emacs-Lisp to detect whether emacs was
        started with the "-r" switch?  In C mode, the syntax colors are
        different when I start emasc with and without "-r".  I want to do the
        same in my elisp code, but I can't find how this is done in cc-mode.el.
        Thanks.  -- yuen
        \- are you sure what you are talking about is being done by the cc*.el
	...
2007/2/9-11 [Computer/SW/Languages/Java, Computer/SW/Languages/JavaScript] UID:45694 Activity:low
2/9     Looking for a Javascript slider bar example. The first example
        on Google is horrible-- initialization code all over the place,
        global variables, method conventions suck, etc. Thanks!
        \_ I don't have an answer for you, but what do you think of this
           article?  http://ajaxworldmagazine.com/read/333329_p.htm
           \_ From the article:
	...
2006/8/11-14 [Computer/SW/Languages/Perl, Computer/SW/Languages/Functional] UID:43974 Activity:low
8/11    How do you find out the max # of file descriptors for a process,
        thread, and entire system?
        \_ Dep on OS. Are the youth today assuming "linux is the standard"?
           That is kinda sad.
           \_ LINUX RUUULES!  W1ND0ZE DR000LEZ!
        \_ while(true) { do(something that uses a fd) if (good rc) counter++; print }
	...
2006/3/17-18 [Computer/SW/Editors/Vi, Computer/SW/Editors/Emacs] UID:42280 Activity:moderate
3/16    I'm looking to troll the motd. What are some good topics guaranteed
        to get results?
        \_ sex!
        \_ Easy.  Anything of interest to more than 1 person that isn't
           resolvable.  Next!
        \_ http://www.trollwars.com  -John
	...
2006/2/21-23 [Computer/SW/Languages/Java] UID:41939 Activity:nil
2/21    What is the best way to get the current method name in Java?  So far
        I have seen 3 approaches:
        1. Create new Exception, grab the first frame off its stack trace.
           Inelegant, requires creating a stack trace (expensive).
           \_ Yeah it sucks.  Yeah it does much more work than you need.
              Yeah it is really fragile and may break when you switch java
	...
Cache (1037 bytes)
www.sgi.com/Technology/STL -> www.sgi.com/tech/stl
Industries 10 Developers 11 Services and Support 12 Serious Fun STL 13 Services & Support Standard Template Library Programmer's Guide 14 Introduction to the STL 15 How to use this site 16 Table of Contents 17 Download the STL 18 Index 19 Index by Category 20 Design Documents 21 What's New 22 Other STL Resources 23 Frequently Asked Questions 24 IOstreams library (experimental) 25 Send us a comment Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the below copyright notice appears in all copies and that both the copyright notice and this permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. Copyright 1994 Hewlett-Packard Company 26 Using this site means you accept its terms of use | 27 privacy policy | 28 trademark information Copyright 1993-2004 Silicon Graphics, Inc.
Cache (13 bytes)
www.objectspace.com/jgl
References 1.