|
|
|
|
|
by chmod775
1922 days ago
|
|
I like the idea and project goals. There are however gems like this in the source: https://github.com/gajus/slonik/blob/master/src/routines/exe... You can spend an hour trying to reason about the control flow of that triple try/catch alone. Bonus points if that function can recursively call itself (not sure what retryTransaction can get up to). There may be an explanation for this horrifying code, but it should probably be right above in the form of: /*
* The following code is not for the weak minded.
*
* Great care needs to be taken with it, for even the smallest mistake
* risks summoning the gods of old to end all life on earth
* in the most terrible way imaginable.
*
* There is however no other way because a, b, and c.
*/
To untangle that mess you'd probably have to rewrite it once just to understand it, rewrite it again
to get it right, then spend a month getting the edge-cases right.But at least afterwards a newcomer can fix a bug without endangering the multiverse. |
|
Maybe a one liner comment would help, but exaggerating as if the code is some horrifying monstrosity is not helpful IMO. It just smells of elitism and makes the code seem more unapproachable than it really is.