Conversation
Notices
-
Embed this notice
kaia (kaia@brotka.st)'s status on Tuesday, 15-Aug-2023 15:40:37 JST kaia
have to write a script that does too much at a time and it breaks my head. I asked ultem and he said I need to break it either into functions or into separate scripts. he gave me the function names and I was like "how did you come up with this??? how do you know what each returns????" and he was like "just split up your code!" mmmmmm -
Embed this notice
Aroop Roelofs :verified: (finlaydag33k@social.linux.pizza)'s status on Tuesday, 15-Aug-2023 16:18:30 JST Aroop Roelofs :verified:
@kaia I don't know the language you're working in but yea... that is generally the way to go.
Functions help keeping your code "DRY" ("Don't Repeat Yourself").
Classes can help with SRP ("Single Responsibility Principle") where 1 class does 1 thing and is very good at it.As for the "how do you know what each returns: In most languages, you can define that and most editors will be able to show it.
In the screenshot here, my function returns an instance of the "ReponseBuilder".kaia likes this. -
Embed this notice
grillchen (grillchen@brotka.st)'s status on Tuesday, 15-Aug-2023 16:18:40 JST grillchen
@kaia structuring a big task into many smoller tasks. i think i never use my whiteboards more than when im programming or doing math.
u dont have to fullfill some UML diagram level of stuff but in general a visualisation helps alot.
later if u are very high skilled you can skip that skip for medium sized tasks
or u just start and waste hours over hours refactoring the code. this is the common approach^^kaia likes this.
-
Embed this notice