Vocab and syntax: a programming language is still a language

TweetApex

Disclaimer: I am not a fully-functioning programmer, yet, so please don’t look to me as an authority, by any stretch. What I am is curious and interested in languages, which gives me a unique perspective on things like programming *languages*.

I am not multi-lingual. I can only speak English fluently, although I can muddle my way through French, still retain my knowledge of syntax and many vocabulary words for Japanese, and I’ve been chipping away at my grandparents’ native tongue, Italian. Maybe Maltese eventually, to nab the other side.

I’ve worked through enough foreign languages, though, to understand how to go about learning them. Practice, obviously, but I’m not going to be pedantic here.

There are, honestly, a few ways to do it. You can focus on vocabulary first, learning words and how they, individually, translate into your native language. You will likely learn a lot of words this way, but language is more than just phonemes and morphemes. The other way to learn is by learning grammar. If you understand the function of a noun, pronoun, direct object, indirect object, conjunction, etc., you will be better equipped to handle the structure of a complete thought in your new language.

Most classroom foreign language instruction works on both at one time, in tandem. That’s difficult to achieve when learning in your spare time (trust me on that).

It follows, then, that learning a programming language functions the same way.

You must learn the vocabulary and the syntax. The order depends entirely on you. If you feel comfortable with grammar and parts of speech, then it makes sense to start with syntax. You can comfortably fit in placeholders.

; refers to a full stop. () asks for a direct object. {} implies that there is a conditional clause or conjunction.

Syntax also includes the meta-language, if you will. What is a verb called in object-oriented programming? A method.

Vocabulary are the words that fill in around the syntax. My nouns, for instance, are things like integers and strings. These are things. They can serve as adjectives, as well, and they may be the subject (a Class, for instance), or they might be an indirect object (a set that is receiving an input of integers).

So if I see List<String> Vocab = new List<String>(); I can break this down.

I know that I am dealing with a complete sentence here because I have a ; at the end. I will be receiving a direct object, a noun of the string type, which I know because it’s in <>, which I think of as a way to indicate that my noun is acting as an adjective. I am saying that when I mention the proper noun Vocab, I am referring to a new list of strings that I will define.

Once I learn my syntax and my vocabulary, I can read a text more fluently. I can still read French, even though my ear is not as sensitive to the nuances of the language as it once was.

As you begin to read, you can start to translate and write.

This brief explanation of how I’ve started to become more comfortable with Apex is in no way complete. As with any other language, there are shortcuts and dialects that might change here and there – exceptions to the rule. But everyone must start somewhere, and this seems as good a place as any.