principles while writing go?
Especially about making everything a class
For example making a number generator a struct instead of a function
the reason for clean code is for other programmers to read your code easily.
it's not about adhering to principles it's about writing clean code the principles can guide you, but they're not to be followed and then just expect the code to be clean also the design patterns are heavily influenced for object oriented languages, many of them simply don't apply for go
I do this a lot, I hate tossing functions around and when there are functions that I can't relate to any structs, I'd put them in a struct called Utils{}. It makes the code a lot clearer, I had to make my own version of some libraries because of the autocomplete getting too crowded when writing parts of the library's name
Обсуждают сегодня