Forgot your password?
typodupeerror

Comment: Re:Nice looking bike... (Score 1) 345

by PatMouser (#47281569) Attached to: Harley-Davidson Unveils Their First Electric Motorcycle

As I've told a few Harley-Davidson employees, including some pretty high up in the management chain, the reason I ride a BMW R1150RT is because Harley doesn't make a sport-touring bike. I've already warned my wife that the day they put a fully faired, Revolution powered sport tourer on sale, I'm buying it.

Comment: Re:ftfy r.e. idioms... (Score 1) 373

by PatMouser (#46595517) Attached to: Ask Slashdot: What Do You Consider Elegant Code?

He's no longer with us thanks to his horrible attitude. It was all about coding in job security and being perceived as some sort of guru, complete with the dribbling out just enough information to keep you guessing.

Upon being presented with the coding style guidelines and team best practices, his response was "we do things differently, I'm not going to change how I code."

That should have been a red flag.

As for Java, I could be so lucky... :)

Comment: Re:ftfy r.e. idioms... (Score 1) 373

by PatMouser (#46586217) Attached to: Ask Slashdot: What Do You Consider Elegant Code?

All valid points, but I still say that one scans better than the other, and at 3 AM that becomes an issue. Especially when I get woken up by one of our lower tier folks who is trying to figure out why it doesn't work, asking me to decipher it for him. Turns out the issue was that he failed to check whether the open had succeeded. It didn't. So I added the croak and did some more repairs, with a rewrite for legibility's sake coming up.

This guy never met an array or hash that he didn't turn into a reference just for gits and shiggles. Seriously. Every single damned one. I don't think I ever saw a native @ or % in his code (except for @_).

Comment: Re:Duff's Device (Score 1) 373

by PatMouser (#46583767) Attached to: Ask Slashdot: What Do You Consider Elegant Code?

Oh so this!

I have had to tell cow-orkers to knock that crap off. They've got the job, and from this point on the only thing that will impress us is code that can be maintained by anyone else on the team, even if they have not set eyes on it in years.

Programmer did:

my $something = [];
open my $filehandle, '<', $filename or croak "Can't read file";
push @$something, <$filehandle>;
close $filehandle;

How about:

open(my $filehandle, '<', $filename) or croak "Can't read file";
my @something = <$filehandle>;
close($filehandle);

Much more succinct, gets rid of a pointless use of an array reference (seriously, it was used as an array in that function only, never passed around or returned), and at the end of the day, is far more readable.

The meat is rotten, but the booze is holding out. Computer translation of "The spirit is willing, but the flesh is weak."

Working...