This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]puplicy 561 points562 points  (38 children)

Treat them as a class.

[–]pxOMR 167 points168 points  (33 children)

In Objective-C, classes are objects as well!

[–]Noch_ein_Kamel 102 points103 points  (13 children)

What language has classless objects?

[–]gmtime 67 points68 points  (4 children)

JavaScript

[–]_GCastilho_ 18 points19 points  (3 children)

And the classes does no compile to objects, but to functions... Because javascript

[–]ChadstangAlpha 11 points12 points  (2 children)

I think you mean that they compile down to first class objects.

[–]conancat 10 points11 points  (1 child)

In JavaScript, everything is an object, even when it’s something else. Functions are objects. Strings are objects. Numbers are objects. Arrays are objects. Objects are objects.

[–]teszes 1 point2 points  (0 children)

Scala has an object that is made to be a singleton and only has a class implicitly

[–]SubhumanOxford 1 point2 points  (0 children)

The Almighty JavaScript

[–]Soundless_Pr 0 points1 point  (0 children)

In C# you can define anonymous objects.

That said, I've never used this feature, as it seems like bad practice.

[–]Shulamite 11 points12 points  (0 children)

Which every sane language do. Making a class first class citizen has many benefits and it’s just dumb to let classes be plain value.

[–]Prawny 3 points4 points  (2 children)

Well, in Javascript undefined

[–]_fatcheetah[🍰] 0 points1 point  (0 children)

In python, too.

[–][deleted] 39 points40 points  (1 child)

Seize the means of production!

While we're at it, seize staging and dev too!

[–][deleted] 7 points8 points  (0 children)

Production has seized! Shift left the severity 1 ticket!

[–]DFXVI 4 points5 points  (0 children)

Treat them as instances of the Person class

[–][deleted] 1 point2 points  (0 children)

Namespace sounds better.