Skip to main content

Questions tagged [classes]

Use this tag for questions about the design or implementation of classes in a programming language, including syntax and functionality.

6 votes
1 answer
483 views

I am an object-oriented developer professionally, but I have researched functional programming and (believe that) I understand the key principles which to varying degrees are applied in FP languages. ...
Daniel Vernall's user avatar
11 votes
1 answer
988 views

Many languages have some form of expressing "user-defined duck typing": defining a type by its behavior, rather than anything about the structure or data of an instance of the type itself. ...
apropos's user avatar
  • 1,295
11 votes
3 answers
404 views

In some languages, all classes have an implicit superclass. For example, Object in Java/Python and Any in Kotlin. All classes ...
FireTheLost's user avatar
  • 1,661
11 votes
1 answer
553 views

Taking this question to its logical extreme. Some languages like C++ and Python use class for everything. Python classes are classes, interfaces (both nominal and ...
Silvio Mayolo's user avatar
8 votes
7 answers
2k views

Some languages have a concept of classes separately than structs. In C++ the only difference is whether the members are public or private by default. This seems redundant. Why have a separate ...
CPlus's user avatar
  • 10.5k
2 votes
4 answers
470 views

Some languages such as Java and C# (since last I checked) require all functions to be inside of a class. Some simple programs are procedural by design, such as command line tools. And requiring a ...
CPlus's user avatar
  • 10.5k