Class Library Differences - 30log vs Middleclass

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
3CordGuy
Prole
Posts: 6
Joined: Fri Feb 14, 2014 4:50 pm

Class Library Differences - 30log vs Middleclass

Post by 3CordGuy »

Hey Guys

I was searching the forums for an answer to this one today but couldn't find much on the topic.

I've selected 30log when I first started my initial "test project" with which to learn LÖVE and dive deeper into Lua. I really like it so far, but I'll admit I'm just now starting to dive into OOP.

When reading the forums, I've noticed a lot of users tend to suggest Middleclass as their goto class library. I can't help but be curious if I'm missing out on some functionality that makes it more prominent here on the forums???

What's the big difference or draw?

When I was looking at the docs on github for Middleclass, I didn't really see how you declare specific class variables before the object instance is initialized... If that makes sense.

Thanks for any illumination!
I LÖVE BACON.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Class Library Differences - 30log vs Middleclass

Post by Inny »

middleclass is the general recommendation as it has about the right level of functionality that most people need from a class-inheritance system. Mixins in particular are one of the stronger features.

30log also has a lot of good functionality, and there's no reason to bash on it.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Class Library Differences - 30log vs Middleclass

Post by Karai17 »

30log is actually kind of crap in that Inheritance is broken. I highly recommend either using middleclass or hump.class.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Class Library Differences - 30log vs Middleclass

Post by Roland_Yonaba »

Karai17 wrote:30log is actually kind of crap in that Inheritance is broken.
Enlighten me, please.
I'd love examples.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Class Library Differences - 30log vs Middleclass

Post by Robin »

Karai17 wrote:30log is actually kind of crap in that Inheritance is broken.
You might be thinking of the similarly named 32log, which I've skewered like something that gets skewered a lot, three and a half years ago.

Not that 30log is free of faults. It uses a deep_copy implementation that is in some ways a deep copy implementation, some of the time. It handles non-tree datastructures much the same way SLib does. Keys are never copied. If you pass in a third argument, it becomes a shallow copy that only brings in values of a specific type, used to make sure mixins only mix in functions. Yep, deep_copy is one crazy function.

I didn't really want to take a close look, you can probably find much more wrong with it if you were willing to look at the code for more than five minutes
Help us help you: attach a .love.
3CordGuy
Prole
Posts: 6
Joined: Fri Feb 14, 2014 4:50 pm

Re: Class Library Differences - 30log vs Middleclass

Post by 3CordGuy »

I didn't really want to start a war here, I just wanted to know why people preferred one over the other... but if it gets super technical, then it may be over my head anyway. :|
I LÖVE BACON.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Class Library Differences - 30log vs Middleclass

Post by Karai17 »

Nah, there is no war here. the 30/32log libs annoy me because their main goal is to use the least amount of lines to prove a point, instead of provide the most amount of function to provide a service. Middleclass and hump.class are both top notch libraries (hump also has lots of other terrific libs) and I recommend using either.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
szensk
Party member
Posts: 155
Joined: Sat Jan 19, 2013 3:57 am

Re: Class Library Differences - 30log vs Middleclass

Post by szensk »

:emo: I like Moonscript's class implementation.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Class Library Differences - 30log vs Middleclass

Post by Roland_Yonaba »

szensk wrote::emo: I like Moonscript's class implementation.
Which is described here, by the way. :nyu:
3CordGuy
Prole
Posts: 6
Joined: Fri Feb 14, 2014 4:50 pm

Re: Class Library Differences - 30log vs Middleclass

Post by 3CordGuy »

Roland_Yonaba wrote:
szensk wrote::emo: I like Moonscript's class implementation.
Which is described here, by the way. :nyu:
Thanks for the link. That looks a bit too complex for my skill level. I'm still wrapping my brain around the basics.
I LÖVE BACON.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 233 guests