de3cd3 No.1029
Objects are just lists.
How does that make you feel?
ad7243 No.1030
>lists
>with inheritance and polymorphism
Nice meme :^)
dff429 No.1051
>>1029You are just molecules. How does that make you feel?
f9efda No.1057
>>1051>How does that alter your neurochemistry?ftfy
af84c9 No.1059
>>1030In Lua, you can easily implement OOP (including inheritance and polymorphism) with just tables and functions without sacrificing syntax.
d5f9b7 No.1063
> lists
> not hashmaps/tables
kek
8f4ae9 No.1759
Makes me feel good.. like everything is okay
0f52dd No.1762
Objects seem like a big deal, but when you think them as just lists of functions and other datatypes, they feel less intimidating. It's not the scary big complex object any more, just your good old friend the list with a few quirks more.
a19182 No.1763
>lists
>not maps
Literally retarded.
6e7965 No.1765
>>1059That's because of metatables, which are quite a bit fancier than lists.
c06e94 No.1769
>>1763>>1063Both can be implemented using lists.
a19182 No.1770
>>1769Everything can be implemented with lists. Doesn't mean it should.
c06e94 No.1771
>>1770Ever implemented a hashmap? I have, and most likely, its going to look like a linked list. That being said, should it be composed of only lists? No. Maps are a more specialized data type, they aren't fit for the general representation of data that lists are.
a19182 No.1773
>>1771>Hashmap>Implemented with lists>Not with vectorsFor what purpose?
7438a5 No.1777
>>1773>For what purpose?Performance, m8. If vectors were objectively superior in every regard, then nobody would use linked lists ever again.
The CPU cache is very fast, but also completely worthless as soon as your data set gets bigger than a few megabytes.
Also, in practice, a good hashing function will have few, if any, collisions, meaning that an array of linked lists and an array of vectors would be functionally identical (i.e. only the first or second bucket in each chain would ever be accessed). 9f6ec9 No.1779
>>1777>If vectors were objectively superior in every regard, then nobody would use linked lists ever again.According to Stroustrup, they are.
c06e94 No.1783
>>1779According to stoustrup, C++ is a good idea.
05e756 No.1784
>>1783The more you learn about programming, the more you realize that each and every language is absolute shit in it's own way.
7a7d1f No.1789
3ca347 No.1796
>>1762clearly you're just using object to encapsulate some functions and state, not for actually interesting inheritance/polymorphism stuff
pleb
c06e94 No.1797
>>1796The ``interesting'' inheritance and polymorphism are useless and better done with a good type system, respectively.
4ae913 No.1799
Objects are just overly complicated closures.
f60d4d No.1825
check out GObjects, the object implementation in GLib that GTK is built on.
(They use hashmaps though nuggah)
ed3001 No.1827
ff5bfc No.3650
c95349 No.3651
Objects are just instances of structs.
85b33f No.3656
>>3651
In C++, objects and structs are the same thing. struct and class are synonyms; it's valid C++ for a struct to have methods.