Member-only story

Reviewing basic computer science concepts: Strongly typed and weakly typed

Alonso Del Arte
5 min readMay 9, 2023

--

Photo by Ally Griffin on Unsplash

While it’s important to learn new and advanced concepts in computer programming, sometimes it’s good to step back and review some of the fundamentals.

I was talking to an iOS developer at some event, and I casually tossed off the terms “strongly typed” and “weakly typed.” He knows what those are, but I guess that’s not the terminology he knows these concepts by.

I’ve come to take these concepts like these for granted, forgetting that there’s some nuance here that’s worth reviewing.

A strongly typed programming language requires all variables and constants to have explicitly declared types, or have cues from which their types can be readily inferred. Also, functions have explicitly declared parameter types and return types. These types can’t be changed arbitrarily.

For example, if a function takes a calendar date and returns another calendar date, we can’t just turn around and treat the returned calendar date as if it were a Boolean, nor can we send that calendar date to a function that expects a device rotation event.

Well, we could try that with casting, but at runtime it would probably incur some kind of class cast exception. That exception is probably a subclass of a more general exception class.

--

--

Alonso Del Arte
Alonso Del Arte

Written by Alonso Del Arte

is a Java and Scala developer from Detroit, Michigan. AWS Cloud Practitioner Foundational certified

No responses yet