Skip to content

elewa-academy/programming-paradigms

Repository files navigation

Programming Languages and Paradigms


Programming: What's that, friend?

We're good at understanding the world and coming up with strategies for achieving what we want.
Computers are good at doing very very very fast arithmetic. At it's very base programming is an intermediary between these two processes:

  1. Finding a goal you'd like to achieve in the real world.

    • Allow cat enthusiasts to share clips across time and space.
  2. Dreaming up a strategy for achieving this dream.

    • A free website where people can host and view cat videos.
  3. Write your strategy in a programming language or two.

    • Create your HTML, CSS, JS. Test it. Set up your hosting service. Deploy your app.
  4. Let the JavaScript compiler do it's magic and translate your thoughts into numbers that a computer can add together very very very fast.

    • Variables are stored in physical memory where they can be retrieved later.
    • The right steps are executed at the right time because your machine manages it's callstack according to your code.
    • Videos are stored, compressed, expanded using principles form signal theory and information theory.
    • The cat video data base is searched for us, we don't have to watch a snippet of each one to find the grumpy cats.
  5. Procatinate.

All of the magic takes place after you've saved your code and entered 'node file.js' in your terminal. Let's take a closer look at the two important players - Programming Languages and Programming Paradigms.


A Deeper Dive

Programming Languages
From the computer's side we have programming languages. A programming language is designed from the bottom up to communicate with your computer - to compile to machine code and be executed. At one conceptual end of a programming language is machine code, at the other is human-decipherable syntax. JS for example.

Programming Paradigms
From the human's side we have developed paradigms that rephrase algorithms into something we can begin to grasp with our intuitions.

Intuitions are created when we internalize the rules by which some system operates. Humans have enormous capacity for intuition; you can ride bikes and drive cars without thinking, you can talk without planning every word, you can guess what others are thinking or feeling. Unfortunatly for you there is very little in life that works anything like coding, so its rare to have strong intuitions for coding. Some rare people just do have the right intuition, don't worry about them. Every other good programmer has developed their intuition for programming by spending enough focused time to allow their brains to build an intuition.

Programming paradigms emerged to address this issue. By thinking of algorithms as 'like x' you can understand them more effectively. There are many paradigms out there, and each one has a host of programming languages that support their way of thinking: HTML fits a declarative paradigm, Java supports OOP, Haskal supports functional programming, Cat supports concatinative programming, ... The list is nearly endless and each one encourages programmers to think slightly differently. The best strategy depends on the person, the machine, and the need.

JavaScript is a strange mutt, it natively supports much of what is needed for the most popular paradigms. The three we'll be learning about specifically are Procedural, Object Oriented, and Functional. What it doesn't support natively, someone has written a library to implement. As a student this puts you in a tricky position; You'll have to be extra diligent or you could slip very easily into very bad habits. With power comes responsibility.


Resources



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published