[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/prog/ - Programming

Programming board

Catalog

See 8chan's new software in development (discuss) (help out)
Infinity Next Beta period has started, click here for info or go directly to beta.8ch.net
Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 1 per post.


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

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

>>1029
You are just molecules. How does that make you feel?

f9efda No.1057

>>1051
>How does that alter your neurochemistry?
ftfy

af84c9 No.1059

>>1030
In 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

>>1059
That's because of metatables, which are quite a bit fancier than lists.

c06e94 No.1769

>>1763
>>1063
Both can be implemented using lists.

a19182 No.1770

>>1769
Everything can be implemented with lists. Doesn't mean it should.

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

a19182 No.1773

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

>>1779
According to stoustrup, C++ is a good idea.

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

7a7d1f No.1789

>>1784
banner-worthy

3ca347 No.1796

>>1762
clearly you're just using object to encapsulate some functions and state, not for actually interesting inheritance/polymorphism stuff

pleb

c06e94 No.1797

>>1796
The ``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

it make a me feel gooot


c95349 No.3651

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

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.




[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[]
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]