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

2004/3/11-12 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Misc] UID:12613 Activity:moderate
3/10    Teach yourself programming in 10 years:
        http://norvig.com/21-days.html
        \_ "Learn at least a half dozen programming languages"
           Why? What is the point of knowing a bunch of languages
           when the only language that is of any real use is C?
           \_ Assuming this is not a troll I'll just throw in that I know
              more than a couple of people who have been slow to get re-
              absorbed into the employment pool because they could not claim
              to be experienced and proficient in more than one language. As
              an outside observer, it really looked to me like they should have
              been augmenting C with Java or J2EE with C++ and so on...
               -- not a cs professional
           \_ Did you study CS at Berkeley?  If you want to get any
              real work done, you ought to use high-level languages.
                \_ if you want any real job you need to know more than 1 lang.
                \_ I didn't study CS (I was an eng.) I'm not sure
                   what you characterize as real work, but I've
                   worked on device drivers, custom embedded
                   oses and encryption protocols; all in C.
                   \_ "Hydrological _and_ hydrodynamical!  Talk about
                   \_ "Hydrological _and_ hydroelectrical!  Talk about
                      running the gamut." -- ilyas (though the credit has to
                      go to Sideshow Bob)
                      \_ The first mention of my profession on the motd,
                         ever! Well, actually I kind of gave up on hydrology.
                         -- ulysses
           \_ Because really learning another language means learning what
              its strengths are and understanding why those are strengths.
           \_ It's better to learn new languages naturally as the need arises.
           \_ I don't know why I bought all those tools when the only
              \_ BAM!
              tool of any real use is the hammer.
2025/05/24 [General] UID:1000 Activity:popular
5/24    

You may also be interested in these entries...
2014/1/14-2/5 [Computer/SW/Languages/C_Cplusplus] UID:54763 Activity:nil
1/14    Why is NULL defined to be "0" in C++ instead of "((void *) 0)" like in
        C?  I have some overloaded functtions where one takes an integer
        parameter and the other a pointer parameter.  When I call it with
        "NULL", the compiler matches it with the integer version instead of
        the pointer version which is a problem.  Other funny effect is that
        sizeof(NULL) is different from sizeof(myPtr).  Thanks.
	...
2013/4/9-5/18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Apps, Computer/SW/Languages/Perl] UID:54650 Activity:nil
4/04    Is there a good way to diff 2 files that consist of columns of
        floating point numbers, such that it only tells me if there's a
        difference if the numbers on a given line differ by at least a given
        ratio?  Say, 1%?
        \_ Use Excel.
           1. Open foo.txt in Excel.  It should convert all numbers to cells in
	...
2013/4/29-5/18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:54665 Activity:nil
4/29    Why were C and Java designed to require "break;" statements for a
        "case" section to terminate rather than falling-through to the next
        section?  99% of the time poeple want a "case" section to terminate.
        In fact some compilers issue warning if there is no "break;" statement
        in a "case" section.  Why not just design the languages to have
        termination as the default behavior, and provide a "fallthru;"
	...
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+):
	...
2011/3/7-4/20 [Computer/SW/Languages/C_Cplusplus] UID:54056 Activity:nil
3/7     I have a C question.  I have the following source code in two identical
        files t.c and t.cpp:
                #include <stdlib.h>
                int main(int argc, char *argv[]) {
                  const char * const * p1;
                  const char * * p2;
	...
2011/2/5-19 [Computer/SW/Languages/C_Cplusplus] UID:54027 Activity:nil
2/4     random C programming/linker fu question.  If I have
        int main() { printf("%s is at this adddr %p\n", "strlen", strlen); }
        and soda's /proc/sys/kernel/randomize_va_space is 2 (eg; on)
        why is strlen (or any other libc fn) at the same address every time?
        \_ I don't pretend to actually know the right answer to this, but
           could it have something to do with shared libraries?
	...
2010/2/12-3/9 [Computer/SW/Languages/C_Cplusplus] UID:53708 Activity:nil
2/12    I need a way to make a really big C++ executable (~200MBs) that does
        nothing.  No static initialization either.  Any ideas?
        \_ static link in lots of libraries?
        \_ #define a   i=0; i=0; i=0; i=0; i=0; i=0; i=0; i=0; i=0; i=0;
           #define b   a a a a a a a a a a
           #define c   b b b b b b b b b b
	...
2009/9/28-10/8 [Computer/SW/Languages/C_Cplusplus] UID:53409 Activity:nil
9/28    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
        Java is #1!!! Followed by C, PHP, C++, Visual Basic, Perl,
        C#, Python, Javascript, then finally Ruby. The good news is
        Pascal is going waaaay back up!
        \_ C is still more popular than C++?  I feel much better about myself
           now.
	...
2009/8/7-14 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java] UID:53252 Activity:high
8/6     In C one can do "typedef int my_index_t;".  What's the equivalent in
        C#?  Thanks.
        \_ C#? Are you serious? Is this what the class of 2009 learn?
           \_ No.  I have to learn .NET code at work.  I am Class of '93.
           \_ python is what 2009 learns, see the motd thread about recent
              cal courses and languages
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
2009/10/1-22 [Computer/Companies/Google, Academia/Berkeley/CSUA/Motd] UID:53424 Activity:kinda low
10/1    google wave is a really fancy version of wall.  i can pipe
        giant ascii text files through it.  my dream has come true.
        does anyone remember when jwang made it so if you walled
        embedded html tags, it would appear in the csua lwall www page?
        google wave is a little better than that. - danh
        \_ http://www.techcrunch.com/2009/10/09/google-wave-is-easier-to-understand-than
	...
2009/3/26-4/2 [Computer/SW/Languages/Misc, Computer/SW/Apps] UID:52760 Activity:nil
3/26    Anyone here uses Heritrix?  I'm trying to read the Intro document at
        http://crawler.archive.org/An%20Introduction%20to%20Heritrix.pdf but
        both Adobe Reader 8.1.3 (Win32) and gv 3.6.5 (cygwin) display error
        messages and show me blank pages.  Adobe displays:
        "Cannot extract the embedded font 'FTXWSG+TimesNewRomanMS'.  Some
        characters may not display or print correctly."
	...
2008/11/27-12/4 [Computer/SW/Languages/Ruby, Computer/SW/Languages/Misc] UID:52121 Activity:nil
11/28   http://www.tiobe.com/content/paperinfo/tpci/index.html
        why is ruby going down so fast?
        \_ Because everyone's finally realizing how much it sucks? Not the
           language, necessarily, but the interpreter. Also, Zed Shaw.
        \_ mongrel_rails start -p 80 -e production -d
           thus: way too easy to start a rails server
	...
2008/6/9-12 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Security] UID:50194 Activity:nil
6/8     CSUA code guru please help. I need to see my random number
        generator with a good seed (I just need random 18 bit
        identifiers). The usual time(NULL) is OK, except my program
        might be invoked faster than once a second, and seeding using
        time() produced the same result. I tried clock() but it seems
        to return 0. My program needs to be run in Linux/DOS (Watcom
	...

	...
2008/4/29-5/5 [Computer/SW/Languages/Perl, Computer/SW/Languages/Python] UID:49852 Activity:moderate
4/29    Scaling your web app in the real world:
        http://teddziuba.com/2008/04/im-going-to-scale-my-foot-up-y.html
        \_ This article is crap.  While yes, 99.9% of all websites don't
           need any serious scalability plans, if any of them become worth
           anything they will need to scale.  If you write a web application
           without careing about scalability you are writing a webapp that can
	...
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
	...
Cache (4819 bytes)
norvig.com/21-days.html
The first 78 were computer books number 79 was Learn Bengali in 30 days . I replaced days with hours and got remarkably similar results: 253 more books, with 77 computer books followed by Teach Yourself Grammar and Style in 24 Hours at number 78. The conclusion is that either people are in a big rush to learn about computers, or that computers are somehow fabulously easier to learn than anything else. There are no books on how to learn Beethoven, or Quantum Physics, or even Dog Grooming in a few days. Lets analyze what a title like Learn Pascal in Three Days could mean: Learn: In 3 days you wont have time to write several significant programs, and learn from your successes and failures with them. You wont have time to work with an experienced programmer and understand what it is like to live in that environment. So they can only be talking about a superficial familiarity, not a deep understanding. Pascal: In 3 days you might be able to learn the syntax of Pascal if you already knew a similar language, but you couldnt learn much about how to use the syntax. In short, if you were, say, a Basic programmer, you could learn to write programs in the style of Basic using Pascal syntax, but you couldnt learn what Pascal is actually good and bad for. Alan Perlis once said: A language that doesnt affect the way you think about programming, is not worth knowing. One possible point is that you have to learn a tiny bit of Pascal or more likely, something like Visual Basic or JavaScript because you need to interface with an existing tool to accomplish a specific task. Teach Yourself Programming in Ten Years Researchers Hayes , Bloom have shown it takes about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, painting, piano playing, swimming, tennis, and research in neuropsychology and topology. There appear to be no real shortcuts: even Mozart, who was a musical prodigy at age 4, took 13 more years before he began to produce world-class music. In another genre, the Beatles seemed to burst onto the scene, appearing on the Ed Sullivan show in 1964. But they had been playing since 1957, and while they had mass appeal early on, their first great critical success, Sgt. Samuel Johnson thought it took longer than ten years: Excellence in any department can be attained only by the labor of a lifetime; When youre the best, you get to test your abilities to lead a project, and to inspire others with your vision. When youre the worst, you learn what the masters do, and you learn what they dont like to do because they make you do it for them. See what it takes to understand and fix it when the original programmers are not around. Think about how to design your programs to make it easier for those who will maintain it after you. Know how long it takes your computer to execute an instruction, fetch a word from memory with and without a cache miss, read consecutive words from disk, and seek to a new location on disk. It could be the ANSI C committee, or it could be deciding if your local coding style will have 2 or 4 space indentation levels. Either way, you learn about what other people like in a language, how deeply they feel so, and perhaps even a little about why they feel so. Have the good sense to get off the language standardization effort as quickly as possible. With all that in mind, its questionable how far you can get just by book learning. Before my first child was born, I read all the How To books, and still felt like a clueless novice. Instead, I relied on my personal experience, which turned out to be far more useful and reassuring to me than the thousands of pages written by experts. Fred Brooks, in his essay No Silver Bullets identified a three-part plan for finding great software designers: Systematically identify top designers as early as possible. Assign a career mentor to be responsible for the development of the prospect and carefully keep a career file. Provide opportunities for growing designers to interact and stimulate each other. This assumes that some people already have the qualities necessary for being a great designer; Lave, Jean, Cognition in Practice: Mind, Mathematics, and Culture in Everyday Life , Cambridge University Press, 1988. Answers Timing for various operations on a typical 1GHz PC in summer 2001: execute single instruction 1 nsec 1/1,000,000,000 sec fetch word from L1 cache memory 2 nsec fetch word from main memory 10 nsec fetch word from consecutive disk location 200 nsec fetch word from new disk location seek 8,000,000nsec 8msec . Footnotes This page also available in Japanese translation thanks to Yasushi Murakawa, in Chinese translation thanks to Xiaogang Guo, in Spanish translation thanks to Carlos Rueda and in German translation thanks to Stefan Ram.