The Nature of Concise Code; Declarative Programming

The Nature of Concise Code; Declarative Programming

Understanding its benefits, and the transitioning from Javascript to React. The need for web developers has become far more critical, as many companies are moving, or intending to move, their services online.

The need for web developers has become far more critical, as many companies are moving, or intending to move, their services online. Many people seeking to enter this career are baffled by the sheer number of programming languages and frameworks out there today. Understandably so, it can definitely be overwhelming.

With this article I hope to tackle and clear some questions you may have about declarative programming, how it compares to imperative programming, and the transitioning from Javascript to React, which in turn, I believe can serve as a good jumping-off point into the world of coding.

What is Declarative Programming?

Let’s start off by defining “declarative programming”. According to Wikipedia, it is, at its core:

“— a style of building the structure and elements of computer programs — that expresses the logic of a computation without describing its control flow.”

That makes sense, right? Totally! Or maybe you’re like me, and found that explanation to be super vague. For now, let’s leave it at that! A few more things to clarify first.

I will be using Javascript(JS) in my examples, because that’s my preference, as I have grown to favor it over other languages.

Image for post

Source: Link

This is something you will learn soon enough about web devs; they all have their preferred language. In time, you will also find yourself leaning towards your own inclinations for a preferred language.

I have also highlighted(in bold letters) some key words throughout this article, which I feel will prove invaluable in your continued learning of subjects related to programming. I’d suggest writing them down, and maybe looking them up at a later time. They are all terminology that you will continue to see in your ventures to becoming a web developer.

Declarative vs Imperative Programming

To reiterate what I quoted before, declarative programming is “conveying the logic of a process, without necessarily defining its course for execution”.

I hear you, still confusing, and still not quite there in terms of understanding. Okay, stay with me, I can do better!

declarative-programming javascript programming react functional-programming

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

From imperative to declarative JavaScript

In this post, I will explain why declarative code is better than imperative code. Then I will list some techniques to convert imperative JavaScript to a declarative one in common situations.

Function Expression vs Function Declaration in JavaScript

In this article, we will acquaint ourselves with three simple terms: function declaration, function expression, and hoisting.

Functional Programming in Javascript 

The mystic term of Functional Programming (FP) must be familiar to any JS developer. The first impression when we say “JS supports functional programming paradigm”.

Functional Programming in JavaScript

Let’s talk about the raw way of writing functions. Functions perform certain set of actions according to our requirements which could include fetching data, updating State, changing a set of mutable values and updating the DOM and so on.