This is a collection of observations about program complexity.
Someone starts with a function that begins like this:
def GetReportData(selector, fields=None): if not fields: fields = self.DEFAULT_FIELDS
then they are instructed to add a start/end date, so they end up with this:
def GetReportData(selector, fields=None, start=None, end=None): if not fields: fields = self.DEFAULT_FIELDS if not start: start = datetime.min if not end: end = datetime.utcnow()
Hint: Python datetime documentation
function clamp($x,$y,$z)Quick: What will clamp(100,0,69) return?
if($x>$y)return $y; if($x<$z)return $z; return $x; |
$a=func_get_args(); sort($a); return $a[1]; |
Let's solve this problem with gigabyte text editors | ... |
---|
#define S(x) (*(uint64_t*)(#x "\0\0\0\0\0\0\0\0"))but somebody replaced it with std:: objects because they were "better".
Proxy.prototype.get = function(key) { return this.object[key]; }I wonder how they intended to send the Proxy object.
I wonder if the programmer thinks about how f.on and f.emit must be implemented.
f.on("message", function(x) { command[x[0]].apply(command, x.slice(1)); }); ... f.emit("message", ["a", 69]);
/** * * @param DefinitionEntry $cDefinition */ public function SetSingleSelectionLimited(DefinitionEntry $cDefinition)