In this article we'll look at some software development terms that confuse even the most senior developers. Ask any developer to define the difference between a framework and a library and most of the time they will get it wrong. The difference is quite simple and does not need a long description of what the library or framework should contain. To understand these 2 fundamental terms we must also understand language and environment too, so these are also added.
Library or Framework?
The questions "What is a library?" or "What is a framework?" come up so often I've decided to create a small article explaining them.
In simple terms:
You call a library, a framework calls you.
So, if you include or import something in your code, then run it, it is a library. However, if you add your code to something that runs first, then when it's ready, runs your code, then it's a framework. The difference is nothing to do with what is in the library or framework and some frameworks can be simple (like one you create yourself) and some libraries can be complex like React or jQuery.
The next thing people seem to have problems with is the language. People say html is not a language or PHP isn't really a language when they most certainly are languages. A language is simply how we communicate with the machine and there are many types of language including scripting, modelling and query languages.
Language
There are 2 types of language, high-level which is easier for humans to understand and low-level which are closer to machine code. High-level languages can be broken down into types like:
- Scripting - These need a separate program to run like a browser or server and include PHP or JavaScript.
- Markup - Used to annotate, defining structure and include languages like HTML, SGML or XML.
- Query - Used to manage and retrieve and include languages like SQL or GraphQL.
Environment
Now we bring the whole thing together. Everything. That is the Environment. There are many types of Environment, you may have heard of LAMP which is Linux Operating System, Apache server, MySQL database and PHP language and you may have heard of Node.js which is also an environment, but this a a 'runtime environment' running on the operating system, but containing everything else needed to run JavaScript.
Environment does not usually contain the Integrated Development Environment (IDE) that the developer actually uses to 'type' the software, but it can.
