|
Victor, you are thinking too advanced. The only way to program is to create an analytical machine in the form of a difference engine to do it for you! No need for messy punch cards, only pure determination and genius. Lots of genius. I'd love to see dynamic programming on one of these babies. Also, far less writing and punching than cards.
|
# ¿ Mar 31, 2008 16:26 |
|
|
# ¿ May 7, 2024 01:01 |
|
if you're doing an in-class example and want to make sure everyone knows what you're doing... then this is better than a for loop due to clarity, at least in my opinion.
|
# ¿ Apr 14, 2008 19:24 |
|
RegonaldPointdexter posted:
it's sizeof in C, case sensitive...
|
# ¿ Sep 11, 2008 14:19 |
|
JoeNotCharles posted:
Only on 32-bit machines... e: Also true. My mistake. narbsy fucked around with this message at 04:00 on Oct 7, 2008 |
# ¿ Oct 7, 2008 03:56 |
|
tripwire posted:God I hate hungarian notation. How in the hell did anyone ever think it was a smart idea Ask nebby!
|
# ¿ Dec 29, 2008 01:23 |
|
hexadecimal posted:Personally, I like to do if( n&1 ) to check of it is odd or not. It is probably a lot faster than % operator. hexadecimal, with each of your posts how you got into a masters program becomes more of a mystery.
|
# ¿ Jan 6, 2009 00:40 |
|
rjmccall posted:Folly of microbenchmarks, I think. Your benchmark time is probably dominated by loop and general interpretation overhead. What did you run it in? Uhhhhhhh it's the same loop. I ran a simple benchmark in C; without any optimizations, & is faster than %. With -O3 they are essentially the same.
|
# ¿ Jan 6, 2009 01:43 |
|
minato posted:Why do you consider &1 to be silly? Is it code clarity, performance, portability, or something else? I'd consider it silly for two reasons, the first of which being that it is unclear to use a bitwise operation to determine even/oddness instead of using modulo as is convention, and also because it falls under the category of if(p), which has been mentioned as it too assumes 0 is false. The second reason is that if the code is C, as hexadecimal was thinking of, the performance benefit really isn't large. It doesn't show up much on un-optimized code, and barely at all under optimized code.
|
# ¿ Jan 6, 2009 07:00 |
|
Painless posted:Hrm good sir I think you are wrong, allow me a moment to write a two-page refutation of this complete with references (with exact page numbers) to the C99 standard, the C++98 standard, the ANSI C standard and the C++0x draft. One can find everything in the C++0x draft, so that may not help your case. It's "Programming with Everything but the Kitchen Sink, but We Threw One In Anyways" in one document.
|
# ¿ Jan 7, 2009 15:59 |
|
hexadecimal posted:Lol yea I know, right? I coded this as fast as I could at the time to meet the dead line and and didn't give it much thought. But why did you think of !(x^y) before (x == y)??????
|
# ¿ Jan 8, 2009 22:23 |
|
TRex EaterofCars posted:I couldn't even venture a guess. Probably some rear end in a top hat making things more complex than they need be to justify how smart they are. "I'm bored and this is all I have to do! Let's see how many lines of code I can make it..."
|
# ¿ Feb 23, 2009 15:40 |
|
Avenging Dentist posted:oh fabulous, a tired talking point about an easy-to-diagnose problem that only occurs when people are intentionally trying to be retarded Or just plain retarded and don't understand pointers.
|
# ¿ Mar 17, 2009 05:44 |
|
|
# ¿ May 7, 2024 01:01 |
|
Not to jump on the PHP bandwagon, but: Aspect Oriented Programming in PHP
|
# ¿ May 11, 2012 02:05 |