$num = 1.007;
print "Floating number: $num\n";
$newNum = $num * 1000;
print "Possibly integer: $newNum\n";
print sprintf("Real integer: %d\n", $newNum);
Sunday, April 4, 2010
Perl and The Time It Owes Me
Monday, February 25, 2008
80's The Limit
- Microsoft(TM) Windows(R) 3.1
- Microsoft(TM) Windows(R) NT 4
- Microsoft(TM) Windows(R) 95
- Microsoft(TM) Windows(R) 98
- Microsoft(TM) Windows(R) ME
- Microsoft(TM) Windows(R) 2000
- Microsoft(TM) Windows(R) XP
- Microsoft(TM) Windows(R) 2003
- Microsoft(TM) Windows(R) Vista
And they still haven't found the "Change font size" button... too sad.
Limiting line length is good, but why limit it to the ridiculous number of 80? When programming in an object oriented language, creating a line which calls a class method and specifying 2-3 parameters will exceed this limit. So to avoid losing points an evil linefeed needs to be inserted.
The huge problem here, as I see it, is that most of the people studying with me haven't programmed in a real programming language (not Pascal) and doesn't know how a real-life code should look like. This is one of some bad habits they learn in a place that should theoretically teach them everything they should know about programming.
So what's the moral here? Read Code Complete and forget about people who know nothing about programming.
