The use of `class` for things that should be simple free functions
quuxplusone.github.io
The use of `class` for things that should be simple free functions
1–10 of 406 posts
Re: The use of `class` for things that should be simple free functions
#2I've seen in a lot of threads like these, people often end up talking past each other, because one person's idea of what an "object" turned out to be different from someone else's.
Re: The use of `class` for things that should be simple free functions
#3EDIT: typo, changed link
Re: The use of `class` for things that should be simple free functions
#4Now I have I have a class with some static functions in it.
Re: The use of `class` for things that should be simple free functions
#5Also known in python as "if your class has only two methods, one of which is init, it's a function" in the "stop writing classes" https://www.youtube.com/watch?v=o9pEzgHorH0 EDIT: typo, changed link
Re: The use of `class` for things that should be simple free functions
#6I'm fairly new to Unity programming in C# and I was surprised a few months ago that everything in C# must be in a class. As far as I can tell there is no such thing as just a function. Now I have I have a class with some static functions in it.
Re: The use of `class` for things that should be simple free functions
#7Also known in python as "if your class has only two methods, one of which is init, it's a function" in the "stop writing classes" https://www.youtube.com/watch?v=o9pEzgHorH0 EDIT: typo, changed link
Re: The use of `class` for things that should be simple free functions
#8For anyone who wants to post their opinions on whether OOP is good or bad, may I suggest briefly explaining what you consider to be "object-oriented programming"? I've seen in a lot of threads like these, people often end up talking past each other, because one person's idea of what an "object" turned out to be different from someone else's.
Re: The use of `class` for things that should be simple free functions
#9As far as functions vs class go, both are terrible to maintain in the long run. Both lead you on a never ending path of go-to-definition, because the documentation is rotten and the tests aren’t right/even there. The only difference is whether or not you want to search a few large or a metric fuckton of single responsibility files.
Maybe it’s different if your code bases aren’t crap and you’re a better developer than me.
Re: The use of `class` for things that should be simple free functions
#10I'm fairly new to Unity programming in C# and I was surprised a few months ago that everything in C# must be in a class. As far as I can tell there is no such thing as just a function. Now I have I have a class with some static functions in it.
It's not a surprise the designers of java, c#, ... went that route.