tip 5 "Premature optimization is the root of all evil." - Donald Knuth
I didn't make up the above sentence. But you can find it on Wikipedia, so it must be really smart.
SAGE for that.
Name:
Anonymous2007-06-03 10:42 ID:6+tsARYp
He forgets to mention that all code should be written to be read by people first. Compilers are robust that way, they only look at the actual code. People are the real audience, those programmers that come after you (which includes the three weeks older you).
Name:
Anonymous2007-06-03 11:32 ID:UcNRWgS7
>>3 is right, eg if(!aB[c]&&!Ca[b]&&p->p_list[aB[c]&Ca[b]<aB[b]<<Ca[c])
is awful to look at.
>>8 is an EXPERT PROGRAMMER.
here's some real code written by an EXPERT PROGRAMMER: import System;
var argv:Array=Environment.GetCommandLineArgs();
for(var j in argv){
if(argv[j]!=int(argv[j]))continue;
var n:int=argv[j];
Console.Write(n+' ( ');
for(var i:int=2;n>1;n%i?++i:(n/=i,Console.Write(i+' ')));
print(')');
}
Name:
Anonymous2007-06-03 21:49 ID:22UmPneK
So you sit down and start to write Kill Bad Aliens in C++. Tip 2: Use #define a lot. No, a LOT.
Fail.
My lecturer referred to and bagged out this guy, and now I see why.
Name:
Anonymous2007-06-03 23:09 ID:taQjxBQ8
#define #define const
Name:
Anonymous2007-06-03 23:23 ID:xtXeqJ2l
Guy mentioned in >>1 is a better programmer than any fag who has ever posted on this board.
I hate to be the silly SICP weenie, but...
I have a better rule for clean code: I don't program in c++
also, to me clean code is well abstracted code, not well commented code. clean code is something obvious like "only once", which of course can't never be achieved in a language like c++ unless you do lots of clever hacks. clean is having multimethods or being able to say "X class is a singleton" and that's it, no need to use an unabstracted pattern (code rewrite).
then again, maybe I'm just dumb programmer with much less programming experience than the guy mentioned in >>1
#include <stdio.h>
using namespace std;
int main(int nArgs, char **sStrArgs) {
char enemy[100];
printf("enter enemy to ddos: ");
scanf("%s", enemy);
system("ping -s 65000 %s", enemy);
return 0;
}
Name:
Anonymous2007-06-04 4:32 ID:j1aPC+J3
I have a better rule for clean code: I don't program in c++
Rightful statement, I approve
X class is a singleton
Unrightful statement, I DO NOT APPROVE! >:o
Singletons are for Java enterprise fucktards. If you need a global variable, use a fucking global variable.
Name:
Anonymous2007-06-04 4:40 ID:O/cbxI53
Comments are like training wheels, once you really learn the language you can read the code as well as English if you use good variable names.
>People are the real audience, those programmers that come after you
If they don't understand the code, they need to learn the language more.
Name:
Anonymous2007-06-04 7:12 ID:7GAU2xN6
>>20 Comments are like training wheels, once you really learn the language you can read the code as well as English if you use good variable names.
Obviously clueless. Guess you never wrote something more complex than a Hello World.
Name:
Anonymous2007-06-04 11:54 ID:XKSkt8yE
oh, the singleton example was just a comparison between the expressive power of java and, say, ruby. Actually if I have to use something like a singleton (I had to - Common Lisp btw) I just create an instance once and assign it to a global variable, since I find it easier and shorter to refer to a global than calling some function everytime.
Name:
Anonymous2007-06-04 12:18 ID:3vg2/3u0
this is dos, not ddos
Name:
Anonymous2007-06-04 17:03 ID:X3Vsh6oE
>>17 I have a better rule for clean code: I don't program in c++
hahahaha, you are talentless