Mai 30 2012

No exceptions

Christoph

Thanks to Tobias for this code candy

return verify_iban($this->iban);
# we could throw exceptions of various types, but why –
# does it really add anything? possibly some slightly
# better user feedback potential. however, this can be
# written by hand by performing individual checks ala
# the code in verify_iban() itself where required, which
# is likely almost never. for the increased complexity
# and maintenance / documentation cost, i say,
# therefore: no. no exceptions.

Source: Direct link to the source code
Software: php-iban
Programming language: PHP

1 Star2 Stars3 Stars4 Stars5 Stars (3 Bewertungen, Durchschnitt: 4,67 von 5)
Loading...Loading...

Apr 17 2012

IE caching for ajax requests

Christoph

Thanks to dac-xp for this code candy

/*
 * random number for the shitty InternetExplorer to f*ck
 * their caching-system. I hope the programmers of the IE
 * caching for ajax requests will die a terrible death.
 */
var requestid = Math.random() * (9999999999-0+1);

Programming language: JavaScript

1 Star2 Stars3 Stars4 Stars5 Stars (2 Bewertungen, Durchschnitt: 5,00 von 5)
Loading...Loading...

Apr 3 2012

God were we wrong

Christoph

Thanks to Andi for this code candy

/**
this code does more than necessary. this was because we thought we could leave the parameters optional. god were we wrong…
*/

Programming language: PHP

1 Star2 Stars3 Stars4 Stars5 Stars (1 Bewertungen, Durchschnitt: 4,00 von 5)
Loading...Loading...

Jan 6 2012

Clean it up

Christoph

/*
 * This code is rather messy, but I don’t have time right
 * now to clean it up as much as I would like.
 * But it works, so I’m happy. :-) jpw
 */

Source: Direct link to the source code
Software: OpenBSD
Programming language: C

1 Star2 Stars3 Stars4 Stars5 Stars (1 Bewertungen, Durchschnitt: 4,00 von 5)
Loading...Loading...

Dez 6 2011

out-of-date preferences

Christoph

# Now bring out-of-date preferences back up to speed
# What a nice developer I am, taking care of the
# behind-the-times users. :-)

Source: Direct link to the source code
Software: PilotManager
Programming language: Perl

1 Star2 Stars3 Stars4 Stars5 Stars (2 Bewertungen, Durchschnitt: 4,00 von 5)
Loading...Loading...