What’s a generator? How it can be helpful? Are there concrete and practical use cases for generators?

computer code on a widescreen desktop monitor

Types of Functions in JavaScript

Run-to-completion functions

Let’s look at this function:

Once invoked, this function will run until the last line: an unstoppable or run-to-completion function. Execution context will be released after completion.

Run-to-completion functions are about the present: We need the result right away.

What if operation1's execution takes a long time? Since JavaScript…

What is a closure, why is it an important concept, and how is it helpful?

A curry

A Quick Reminder About JavaScript Scopes

What is a scope?

Scope gives the ability to limit access to a variable or function and prevent meddles. What does that mean?

Take a look at the example below:

The visibility of two , count and run2 is limited to function border. …

Know when software complexity arises and how to handle it

ruins of a stone building overlooking a bay

Why Is Code Complexity an Important and Serious Topic?

“The central enemy of reliability is complexity. Complex systems tend to not be entirely understood by anyone. If no one can understand more than a fraction of a complex system, then no one can predict all the ways that system could be compromised by an attacker.” — Practical Internet Security

A visual introduction to functional programming

Building photographed from a sideways angle

What’s Functional Programming?

Functional programming is a pipeline of pure functions.

What does that mean?

To understand this definition, we will use a real-life example. Let’s assume that we have a shipping warehouse and a large store containing a variety of products (books, clothes, certain canned food products, household appliances, etc.).

How do…

What is modularity, and what metrics are available to measure modularity?

Diagram showing dependence on outside or external coupling.

Introduction

In this article, I’ll talk about modularity: What is modularity? Why is it important? And how can we measure modularity?

Modularity consists of dividing a system into separate and independent parts called groups or modules.

In this story, we will see together the different aspects of Elixir Pattern Matching: tuples, list, map and multiclause function.

Tuples

Let’s assume that we have a function that return the gps coordinates (latitude, longitude) for a given country : get_gps_coordinates.

defmodule ElixirPatternMatching.Examples do
def get_gps_coordinates(country) do…

WASM (WebAssembly) or not in frontend projects ?

What I want to do ?

I’m trying to find approach to enhance the performance of my frontend projects.

My frontend projects are mostly websites for many and different purposes.

I have always complex logic to do like filtering and transforming big backend response in frontend side. …

What we will do ?

In this story, we will see together how to make a Rust Rest API using :

  • actix as http server.
  • mongo db driver to dialog with mongo database.
  • postman to test our endpoints.

Project configuration

Create & init new project

cargo new rust-rest-api
cd rust-rest-api
cargo init

Project structure

Héla Ben Khalfallah

I love coding whatever the language and trying new programming tendencies. I have a special love to JS (ES6+), functional programming, clean code & tech-books.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store