Berkeley CSUA MOTD:Entry 21109
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/11/23 [General] UID:1000 Activity:popular
11/23   

2001/4/26-27 [Computer/SW/Languages/C_Cplusplus] UID:21109 Activity:high
4/26    What are some good reasons to use C fptr over regular method calls?
        \_ Data directed programming allows you to do function calls
           in constant time. Of course, many modern compilers will
           take switch/case statements and implement them in constant
           time.  Look at examples of C function pointers and you can
           see why they're used.
           \_ dude, read the fucking post. VERSUS METHOD CALLS. are you
              fucking awake?
              \_ Well, maybe if he/she DEFINED C METHOD CALLS...
                 \_ Method calls are what the Java people use to call
                    functions associated with a certain class because
                    they're "too cool" to just call them member functions
                    or just functions. Kind of like the whole "Java doesn't
                    have pointers, they have references" bullshit. Even
                    Hilfinger thinks the guys at Sun are full of it.
                        \_ Hilfinger thinks anything which doesn't involve
                           400 macros is full of it.
                    \_ but C is not OO, and hence does not have classes or
                       methods.  Even if the original poster meant "functions"
                       instead of methods, the question makes no sense.
                    \_ It has nothing to do with being "too cool".  Method
                       call is the terminology from Smalltalk, which predates
                       the C++ "member function" terminology.
        \_ Cool people use function pointers.
        \_ you should use method calls whenever you can.
        \_ methods?  in C?  what?
           \_ farms? in berkeley? what?
              \_ moo.
                    \   ^__^
                     \  (og)\_______
                        (__)\       )\/\
                            ||----w |
                            ||     |b
2024/11/23 [General] UID:1000 Activity:popular
11/23   

You may also be interested in these entries...
2004/8/30-31 [Computer/SW/Languages/C_Cplusplus] UID:33228 Activity:high
8/30    Ok this is pretty basic but... is there a way to "escape" text to
        avoid it being substituted by C preprocessor macro expansion?
        \_ Wouldn't that functionality make C preprocessing as powerful as
           lisp's quasiquote/escape? -- ilyas
           \_ Squish!  Isn't it illegal to talk about lisp on the motd?!
        \_ In general no.
	...
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/7/5 [Computer/SW/Languages/Perl] UID:31164 Activity:high
7/4     Is there something like a macro in Perl?  Couldn't find any in
        the Camel book.
        \_ If you truly need macros in Perl, you probably want AUTOLOAD.
           Of course, if you truly need macros, Perl is the wrong language for
           what you are doing.  -- ilyas
        \_ I don't know perl, but don't almost all interpreted languages have
	...
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
	...