Each post must contain one bad programming practice to add to the list. I'll start:
In C++, overload library functions by using #define. That way it looks like you are using a familiar library function where in actuality you are using something totally different.
Name:
Anonymous2010-10-19 0:42
putting a { on the same line that a function is declared
Never write comments - good code (that is *my* code) explains itself
Name:
Anonymous2010-10-19 0:49
>>5
good programmers should be able to trace through a program no problem and discover what it's doing without comments, now if you're learning the language then the examples should have them, but unless you're a retad you probably don't need comments k
>>10
Doing that increases the velocidensity of the sector of your hard drive where the file is stored, which in turn means that there will be less velocidensity available for your music files. If you use lossy compression you won't notice the difference, but your FLAC files will gradually lose information.
>>16
Please learn about monoids, thank you. (+) is a natural candidate for the monoidal operation because it is always associative and usually commutative.
Why is sub proc{my @arr=('a','b','c');return @arr};print( (proc())[1] );,
possible, but not sub proc{my %h=('a'=>'b','c'=>'d');return %h};print( (proc()){'a'} );
>>37 no True Programmer uses anything but references.
Refs are a pain in perl5. It's the only time sigil variance causes problems (indirectly) for me. OTOH in Perl 6 refs are implicit most of the time, and during assignment you use the binding operator instead of taking a ref and assigning that.