Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
740027806yThat's the code equivalent of compiling again without changing anything, hoping that it will work this time
-
And of course there was only indirect unit-testing because of unit-tests of classes which use the configFactory.
And of course I will refactor the shot outta this factory class ^^ -
One say:
"It ain't stoopid, if it works!"
I say:
"Stfu! Go refactor and cover your unholy piece of code"
^^ -
I hate it when people treat machines like everything else they do. Machines are deterministic. They are not dogs, cats or other pets. You don't ever "save again, just to be sure." If it didn't work the first time, it's not going to work the second time, and if it does, you've got some serious race conditions in there.
Beware code that's like
something.doSomething()
save();
somethingelse.doSomething()
save(); //Just in case
No! Stop that!.
Related Rants
Today,I found this gem:
static function getConfig(){
$cacheKey = 'foobar';
try {
$config = $this->repository->getConfig();
$this->cache->set($cacheKey, $config);
}
catch(Exception $e){
try{
$config = $this->repository->getConfig();
$this->cache->set($cacheKey, $config);
}
catch(Exception $e){}
}
}
I don't want to live on this planet anymore...!
rant
noobs
just try it again
try and try
try
try..catch bullshit
you must try