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

/prog/ - Programming

Programming
You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.

Name
Email
Subject
REC

0:00

Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Expand all images

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

[–]

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

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

>>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 (27) No.1769>>1770

>>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 (27) No.1770>>1771

>>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 (27) No.1771>>1773

>>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 (27) No.1773>>1777

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

>>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 (27) No.1784>>1789

>>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 (27) 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 (27) No.1796>>1797

>>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 (27) 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 (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

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 (27) No.3651>>3656

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

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.



[Return][Go to top][Catalog][Screencap][Nerve Center][Random][Update] ( Scroll to new posts) ( Auto) 4
26 replies | 1 images | 1 UIDs | Page 8
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ][ watchlist ]