[–]▶ df2de3 (27) No.1029 >>1051 [Watch Thread][Show All Posts]
Objects are just lists.
How does that make you feel?
____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1030>>1059
>lists
>with inheritance and polymorphism
Nice meme :^)
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1051>>1057
>>1029 (OP)You are just molecules. How does that make you feel?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1057
>>1051>How does that alter your neurochemistry?ftfy
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1059>>1765
>>1030In Lua, you can easily implement OOP (including inheritance and polymorphism) with just tables and functions without sacrificing syntax.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1063>>1769
> lists
> not hashmaps/tables
kek
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1759
Makes me feel good.. like everything is okay
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1762>>1796
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.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1763>>1769
>lists
>not maps
Literally retarded.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1765
>>1059That's because of metatables, which are quite a bit fancier than lists.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1769>>1770
>>1763>>1063Both can be implemented using lists.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1770>>1771
>>1769Everything can be implemented with lists. Doesn't mean it should.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1771>>1773
>>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.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1773>>1777
>>1771>Hashmap>Implemented with lists>Not with vectorsFor what purpose?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1777>>1779
>>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). Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1779>>1783
>>1777>If vectors were objectively superior in every regard, then nobody would use linked lists ever again.According to Stroustrup, they are.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1783>>1784
>>1779According to stoustrup, C++ is a good idea.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1784>>1789
>>1783The more you learn about programming, the more you realize that each and every language is absolute shit in it's own way.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1789
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1796>>1797
>>1762clearly you're just using object to encapsulate some functions and state, not for actually interesting inheritance/polymorphism stuff
pleb
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1797
>>1796The ``interesting'' inheritance and polymorphism are useless and better done with a good type system, respectively.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1799
Objects are just overly complicated closures.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1825
check out GObjects, the object implementation in GLib that GTK is built on.
(They use hashmaps though nuggah)
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.1827
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.3650
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) No.3651>>3656
Objects are just instances of structs.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ df2de3 (27) 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.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.