Programming Paradigms and Lua/LÖVE
Posted: Sun Dec 25, 2011 3:54 pm
Ok I'am starting to understand OOP's concepts and it's usefulness, so I want to have a little discussion about this and any other styles that you guys use and why. Let us start with a survey kind of thing:
1. What I don't grasp yet is the need of classes. In PiL it says that OOP in Lua can be done with prototypes instead of classes. Up to this point creating a class system seems to be additional effort for the sake of what? Is prototype based OO worse? Who uses one of those/both paradigms and why?
2. I'am currently reading a Java book to get into OOP (since it seems to be the most used language with the OO paradigm). It looks like not even Java is 100% strict with the OO. C++ is a widely used language for programs that need to communicate more directly with the machine it's running on, such as game engines (as well as LÖVE). In the internet C++ is labeled as a 'hybrid-language'. In the java book (core java vol.1) I'am reading C++ is even considered as "...a bad dream of which you'd rather not be reminded." And on the internet I've even found descriptions like "warzone" and similar lol. Where does Lua stand in comparison? It seems that you can go for both extremes (purely procerudal and purely OOP). So a better question would be: How do most people program with it? Are there other paradigms that are widely used?
3. I've skimmed through some similar threads and apparently not all of you are very strict with OOP in their code. Where do you draw the line and why?
4. Especially LÖVE doesn't seem to promote OO and it's skeleton looks very much like a set of subroutines. how right/wrong is that observation and what do you think of that?
1. What I don't grasp yet is the need of classes. In PiL it says that OOP in Lua can be done with prototypes instead of classes. Up to this point creating a class system seems to be additional effort for the sake of what? Is prototype based OO worse? Who uses one of those/both paradigms and why?
2. I'am currently reading a Java book to get into OOP (since it seems to be the most used language with the OO paradigm). It looks like not even Java is 100% strict with the OO. C++ is a widely used language for programs that need to communicate more directly with the machine it's running on, such as game engines (as well as LÖVE). In the internet C++ is labeled as a 'hybrid-language'. In the java book (core java vol.1) I'am reading C++ is even considered as "...a bad dream of which you'd rather not be reminded." And on the internet I've even found descriptions like "warzone" and similar lol. Where does Lua stand in comparison? It seems that you can go for both extremes (purely procerudal and purely OOP). So a better question would be: How do most people program with it? Are there other paradigms that are widely used?
3. I've skimmed through some similar threads and apparently not all of you are very strict with OOP in their code. Where do you draw the line and why?
4. Especially LÖVE doesn't seem to promote OO and it's skeleton looks very much like a set of subroutines. how right/wrong is that observation and what do you think of that?