[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]

/prog/ - Programming

Programming
Name
Email
Subject
REC
STOP
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Options

Allowed file types:jpg, jpeg, gif, png, webp,webm, mp4, mov
Max filesize is16 MB.
Max image dimensions are15000 x15000.
You may upload5 per post.


File: 1420363460009.jpg (24.4 KB,364x455,4:5,poo.jpg)

df2de3 No.1029

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 No.1030

>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 No.1051

>>1029
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 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 No.1059

>>1030
In 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 No.1063

> 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 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 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.
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 No.1763

>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 No.1765

>>1059
That'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 No.1769

>>1763
>>1063
Both 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 No.1770

>>1769
Everything 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 No.1771

>>1770
Ever 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 No.1773

>>1771
>Hashmap
>Implemented with lists
>Not with vectors
For 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 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).
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 No.1779

>>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 No.1783

>>1779
According 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 No.1784

>>1783
The 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 No.1789

>>1784
banner-worthy
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 No.1796

>>1762
clearly 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 No.1797

>>1796
The ``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 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 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 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 No.3650

it make a me feel gooot

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 No.3651

File: 1448698302882.jpg (45.29 KB,330x357,110:119,Feelsgoodmangreen.jpg)

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 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.



[Return][Go to top][Catalog][Nerve Center][Random][Post a Reply]
Delete Post [ ]
[]
[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]