Berkeley CSUA MOTD:Entry 42291
Berkeley CSUA MOTD
2018/10/20 [General] UID:1000 Activity:popular

2006/3/17-20 [Computer/SW] UID:42291 Activity:low
3/17    You are editing someone else's code.  Formatting is terrible or
        does not comform to your standards.
        What do you normally do to the code formatting?
        \_ go north
        \_ If there is a code standard I change it as minimally as possible
           to conform to the standard.  If there isn't a well defined standard
           I leave it alone.  Making huge diffs in your source control system
           really sucks.
           \_ Agreed.  But your organization should have agreed-upon
              coding standards.
              \_ Lots of companies I've worked for have coding standards that
                 leave a lot of leeway for personal choice.
        \_ I conform to the sloppy code, where there is consistency.
        \_ I conform to the sloppy code, where there is conformity.
           Generally this means lining up my modifications with whatever the
           indent is and putting my pointer *'s left or right.
           \_ Seconded.  When I add code to existing code, I try to conform to
              the existing code' formatting as long as one exists, even if it's
              lousy.  When I create new code, I conform to my own formatting
              standard.  I refrain from re-formatting existing code unless I'm
              making big changes to it.  --- yuen
        \_ From our coding guidelines doc at work:
           "A single file should have a single formatting style (i.e., when in
           Rome...). If you are maintaining code written in a style different
           from yours, pretend you're a spy sent on a secret mission to make an
           undetectable change to that code. It's lots of fun!"
           I found that amusing.  --dbushong
        \_ M-x indent-region.
        \_ Small edits, conform.  Major additions or rewrites, use personal
           style.  If the old code becomes a sufficiently small portion of the
           file, it gets reformatted.
2018/10/20 [General] UID:1000 Activity:popular

You may also be interested in these entries...
2013/12/21-2014/2/5 [Computer/SW] UID:54759 Activity:nil
12/21   I was laid off and started filing for EDD for my weekly pay.
        I just got a job. Is there a form I need to file, or do I just
        stop filing out EDD to get my weekly pay? As a side note, how
        do they actually know I am working or not?
        \_ You just stop filing and they stop paying; you don't need to do
           anything else.  I don't know the internals of how they do things,
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/12/28 [Computer/SW/Security] UID:54760 Activity:nil
12/28   Happy holidays everyone.
        For some reason my work's ip address gets logged in /etc/hosts.deny and\
I cannot ssh in anymore from work
        (except from home where I can ssh in fine): anyone knows if this file is\
 auto-generated due to some event? Thanks
2013/3/24-5/18 [Computer/SW/Unix] UID:54638 Activity:nil
3/24    How are people transferring large files to one other person these days?
        When I need to send some videos to my parents, I upload them to
        my SpiderOak account, but they don't have anything like that,
        so I'm not sure how to get videos from them.  Does DropBox do this
        for free?
        \_ DropBox +
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/2/19-3/26 [Computer/SW/OS/OsX] UID:54611 Activity:nil
2/19    I program a lot by sshing to a Linux cluster.  So I'm used to using
        Xemacs to code.  This works fine from a Linux or Windows workstation,
        but sometimes I have to use a Mac.  On Mac, the meta is usually
        bound to option, but that often doesn't work over ssh for some reason.
        This makes using emacs a real pain.  Any suggestions on how to fix it?
        (Other than "use vi")
2012/12/18-2013/1/24 [Computer/SW/Languages/Perl] UID:54561 Activity:nil
12/18   Happy 25th birthday Perl, and FUCK YOU Larry Wall for fucking up
        the computer science formalism that sets back compilers development
        back for at least a decade:
        \_ I tried to learn Perl but was scared away by it.  Maybe scripting
           lanauages have to be like that in order to work well?