Philosophy basics for programmers: linguistics basics
Subject and predicate on Aristotelian logic
Today I’m starting a new series of posts about the basics of philosophy that I think programmers needs to know to be able to excel on his career. Some of the things that I’ll say you might learn with other names. We programmers gave new names for things that is already established in other areas. However, even if you already know how something is applied to coding, that doesn’t mean that you shouldn’t learn its original meaning and where the term comes from.
For this series I’m starting with basic concepts and build from them. The first two concepts that I want to talk about is subject and predicate. They are more known on the linguistics/grammar area, but they are fundamental concepts to understand the basics of logic and also about how we talk about things.
Logic (and programming, in someway) deals with a specific type of sentence, declarative sentences. Declarative sentences are sentences that affirm something about an entity and that the full phrase is either true or false. This means that logic doesn’t deal with questions or phrases that don’t state that an entity is or isn’t something. Other terms that you’ll see philosophers and logicians using are proposition and statement.
All declarative phrases can be separated in two parts. Subject and predicate. Subject is the entity that a phrase talks about and predicate is what is talked about that subject:
The subject can be either a single entity, a group, an abstract being, a fictional character or a class. It doesn’t matter for us programmers. We can write a software that deals with things that has a direct impact on the material world or we can be writing a game. On both cases, all beings that our code says is something or can do something is a subject.
The second part of a proposition, the predicate, is the part that says something about the subject and that makes the full phrase calculable. On the phrase above, we can answer the proposition “Socrates is a man” with true or false. The predicate can be either an action, a verbal predicate (like “the girl runs” or “the dog barks”), or a nominal, a nominal predicate (like “my name is Ford Prefect” or “this dog is perfect”).
If you are used to Object-Oriented Programming (OOP), you might be able to see how this relates to classes. A class has attributes, which we are calling here nominal predicates. Like a User class has a name, a password, an email, a preferred color. A class has also methods, which we called verbal predicates. Back to the User, he can have a login and logout methods. These are actions that a User can take.
Aside from programming paradigms, we use the concepts of subject and predicate all the time. We evaluate declarative sentences on every boolean value. Every time you add an if or test for a bolean, you are asking the system is a subject has a specific predicate. So your if (user.password === input) is evaluating the sentence “the user’s password is input”, asking if the you can add the predicate “is input” to the subject “the user’s password”.
While the knowledge we are talking here seems basic, you’ll be able to see how much useful it is to understand relation between qualities we give entities and relations we create inside of our software. Every attribute, method and calculation we do inside of our softwares are creating relations between subjects and predicates, be it on the digital world only or even on the real one.


