Skip to content

Commit

Permalink
new blog post: “Classes are a Dumping Ground [...]”
Browse files Browse the repository at this point in the history
  • Loading branch information
ehamberg committed Jan 29, 2014
1 parent b652662 commit b6b58c6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions posts/2014-01-29-classes-as-dumping-ground.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Classes are a Dumping Ground for Language Features
description: When classes are the only structuring mechanism, they tend to accumulate features
tags: programming
...

I am currently reading Benjamin C. Pierce's [Types and Programming
Languages](http://www.cis.upenn.edu/~bcpierce/tapl/) (2002), and in chapter\
18 -- on imperative objects and classes -- he offers an off-hand comment about
why the class features in most OOP languages are so complicated.

As someone who have spent countless hours writing C++ (and to some extent,
Java), this immediately jumped out at me:

> The class mechanisms in real-world object-oriented languages tend to be
> complex and loaded with features---`self`, `super`, visibility annotations,
> static fields and methods, inner classes, friend classes, annotations such as
> `final` and `Serializable`, etc., etc.

> The main reason for all this complexity is that, in most of these languages,
> classes are the *only* large-scale structuring mechanism. Indeed, there is
> just one widely used language---OCaml---that provides both classes and a
> sophisticated module system. So classes in most languages tend to become
> dumping ground for all language features that have anything to do with
> large-scale program structure.

0 comments on commit b6b58c6

Please sign in to comment.