What do you mean?schael wrote:I now understand why I don't understand OOP with LUATrappingnoobs wrote:I use an OOP implementation I made
Need voice of experience.
- Trappingnoobs
- Citizen
- Posts: 95
- Joined: Tue Oct 12, 2010 8:52 pm
Re: Need voice of experience.
Re: Need voice of experience.
I mean that it means Lua is not an OO language . Isn't it ?
I'm learning...
- Trappingnoobs
- Citizen
- Posts: 95
- Joined: Tue Oct 12, 2010 8:52 pm
Re: Need voice of experience.
No, it's not, I don't think; but it's easy to implement, and much easier to code with it (Well, the majority of people, including me, think that).schael wrote:I mean that it means Lua is not an OO language . Isn't it ?
Middleclass is probably the most-used one here, but I'm not fussed with it or most of the other implementations; since they only, as far as I know (I could be wrong so don't hold me to this), allow single inheritance, eg
Class1
Class2
Subclass inherits from Class1
Subclass can't inherit from both classes, only one, and nothing can inherit from it.
I made my own which basically is:
Class "ClassName" {Properties}
Class "InheritsfromClassName" ( {Properties}, {ClassName} )
Looks wierd, but you're basically passing either one or two tables in.
And you can inherit from as many as you like, and you can inherit from classes that have already inherited from other classes, just like a real OOP language.
So it's not hard to implement; and it can save you a lot of time.
Re: Need voice of experience.
Middleclass is a part of PÄSSION right ? I will not use it for my first project but I will learn more about.
I'm learning...
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Need voice of experience.
No, middleclass is separate now.
And, btw, Trappingnoobs, you have observed wrong, I know for a fact that SECS has a version with multiple inheritance, and Slither does it by default too.
And, btw, Trappingnoobs, you have observed wrong, I know for a fact that SECS has a version with multiple inheritance, and Slither does it by default too.
- Trappingnoobs
- Citizen
- Posts: 95
- Joined: Tue Oct 12, 2010 8:52 pm
Re: Need voice of experience.
Can you have classes that inherit from classes that inherit from other classes?bartbes wrote:No, middleclass is separate now.
And, btw, Trappingnoobs, you have observed wrong, I know for a fact that SECS has a version with multiple inheritance, and Slither does it by default too.
What about default values?
Edit
I can't use SECS because I'm 14 and it wouldn't end up good for me if my parents saw that on my computer. I doubt they'd beleive it's to do with programming :L
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Need voice of experience.
..., seriously? I have yet to find a class system that doesn't do that..
Re: Need voice of experience.
Honestly, from what I've seen it's better to avoid OOP altogether when you first start out in Lua. Lua takes a different mindset than OOP languages and 90% of the time you can get by with simple metatables. OOP is built IN Lua rather than INTO Lua and a lot of people just can't seem to get around that.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Need voice of experience.
Ah ha! Yeah, I'm definitely not a supporter of suggestive library names, they just get in the way.Trappingnoobs wrote:I can't use SECS because I'm 14 and it wouldn't end up good for me if my parents saw that on my computer. I doubt they'd beleive it's to do with programming :L
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Need voice of experience.
You can just rename it, you know.
Who is online
Users browsing this forum: Bing [Bot] and 4 guests