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
-
Hazarth94863y@lambda123
This is correct.
Max 6 lines, though there is no limit on how many characters >:D -
@lambda123 hell, no! 😆
I like your sarcasm and I‘m with you about the misuse of design patterns and abstraction.
But I consider 100+ lines of switch case not to be "clearly in one spot".
It could be reasonable in some rare case but as I said: It smells. -
@Lensflare it's 130 lines with logging, plenty of carriage returns, comments and stuff like that.
The actual code is stuff like this; you receive a message from Line, those messages can have varying formats, you forward those messages to our own application. There's no black magic going on there. -
@IHateForALiving thanks for showing the code. It’s not bad but personally I‘d extract each case into a function.
-
jeeper59663y@Lensflare I agree with this. Because, if something breaks how it is now, the log will be “error in function bigassswitch” where as if you break the cases in to functions, it will be like “error in function specificCase”
SUPERVISOR: You wrote this 140 lines method, it's too long. You should split it up, it's not readable
IHateForALiving: Bruh be serious, this is a single switch-case; I can't split it.
SUPERVISOR: Fine, I'll do it.
HIS CODE: He split the 140 lines method into 2 methods: the first is 4 lines long; it's a try-catch surrounding a call to the other method, 136 lines long.
rant
javascript
monkey
supervisor