5 functional programming languages ​​you should know

If you take the time to learn programming trends on the Internet, youve probably heard of functional programming. Here are 5 functional programming languages ​​you should know.

If you take the time to learn programming trends on the Internet, you've probably heard of functional programming. So what is functional programming? Even when understanding functional programming, do you know which programming language is best suited for it? Not all programming languages ​​are the same, created for the same purpose. Although you can apply the functional programming model in many languages, there will be more appropriate languages. Here are 5 functional programming languages ​​you should know.

  • Top 5 programming languages ​​to develop AI
  • Top 5 languages ​​for blockchain programming
  • The world's 5 most annoying 'programming languages'

What is functional programming?

If you have a math background, you will easily use functional programming because the functional programming model handles computation as mathematical functions. If you don't know anything about math, you will feel confused when programming functions.

Basically, functional functions treat functions and data as immutable objects. When using data in a function, it usually returns that data to be converted or another data type. In functional programming, the function will never change the original data or program state.

There is a Unix philosophy (Unix philosophy) that each program does a good job of it. So is the function, it will not touch other parts of your program. Instead, it will take its input and give you an output. Ideally in functional programming, when given the same input, it will produce the same output.

Functional and object-oriented programming comparisons

In object-oriented programming (Object-Oriented Programming), you often have a base object with many different methods to change data or status (which is part of the object). This method may change data or status if not specified.

This makes program maintenance more difficult because it is unclear whether the status and data have been changed. But with functional programming you will no longer worry about this problem.

1. JavaScript

JavaScript allows functional programming, you can use functional programming model that can use object-oriented method. There are many functional programming models built into JavaScript like the higher-order function. This is a function that can take another function as an argument.

In addition, JavaScript has some functions that work with arrays such as map (), reduce (), filter (), etc., all of which are higher-order functions. This means you can string them together to quickly implement the methods in an array.

Although JavaScript initially had some problems with transformability, newer versions of the ECMAScript standard provided fixes. Instead of using the var keyword to define variables, you can use const and let . The first keyword allows you to define constants as implied names. The second keyword let, limits the scope of a variable in the function it declares.

2. Python

Like JavaScript, Python is a general language that you can use any programming model. Any language has pros and cons, but functional programming is not one of Python's disadvantages.

You can find many built-in functions in Python language such as map (), filter (), reduce (), etc. . Just like JavaScript, these are all higher-order functions that can take other functions as an argument. In Python, programming functions in the form of lambda keywords, this is an advantage over other languages.

You can use lambda expressions in a number of ways such as using it as shorthand (shorthand method) for simple functions. When assigned to a variable, you can call the exact lambda expression exactly like a standard Python function. The real advantage of lambda expressions is when using them as anonymous functions (anonymous functions).

Anonymous functions also work with JavaScript and other languages ​​on this list. They are especially useful when used with higher-order functions because you can identify them on the spot. Without an anonymous function, you must specify before addition to make bespoke function.

3. Clojure

Clojure is a 'dialect' of Lisp programming language that appeared in the late 1950s. This is the perfect language for functional programming.

Like variants of Lisp language, Clojure handles code like data. This means that the code can change itself effectively. However, Clojure can run on the Java platform and is compiled into JVM bytecode. Therefore it can work with Java libraries whether or not they are written in Clojure.

Unlike other languages ​​in the list, Clojure is a functional programming language, ensuring immutability in data structures.

4. Elm

One of the new languages ​​on this list, Elm is the pure functional programming language designed by Evan Czaplicki in 2012. This language has become popular among web developers, especially for the purpose. create user interface.

Unlike the languages ​​on this list, Elm uses static type checking, ensuring that no exception runtime error occurs, catching an error while compiling. Users will see fewer errors, this is a big plus for this language.

The compiler Elm uses HTML, CSS and JavaScript. Just like the way Clojure writes programs running on Java, you can write applications that use the JavaScript library with Elm.

One key difference between Elm and other languages ​​is that you won't find filter (), map () and similar functions. Instead, they are identified by data types like List.map or Dict.map.

5. Haskell

Haskell is a functional programming language, using static testing. Unlike Elm, Haskell has been around for a while. The first version of the language was designed in 1990. The latest standard is Haskell 2010 and the next version is expected to be released in 2020.

Haskell is a language designed for functional programming, so it is suitable for solving real-world problems even though the source of functional programming is in academia.

Haskell is used in widely used projects such as the Xmonad window manager written entirely in Haskell and Pandoc that convert different markup types into other formats that also use this language. You will find some standard functions like map (), filter (), reduce () and other higher-order functions.

Some of the above terms and languages ​​seem a bit confusing if you are not an experienced programmer. That's good, because discovering new things is one of the first steps to becoming a good learner. You can refer to the article Beginners of computer programming need to focus on what?

Related posts
Other Python articles
  • Learn Class and Object in Python

    python là một ngôn ngữ lập trình hướng đối tượng. không giống như lập trình hướng thủ tục nhấn mạnh vào các hàm, lập trình hướng đối tượng tập trung làm việc trên các đối tượng. bài viết này quantrimang sẽ đi sâu tìm hiểu về class và object, mời bạn đọc theo dõi.
  • Inheritance (Inheritance) in Python

    kế thừa trong lập trình hướng đối tượng cho phép chúng ta khai báo lớp mới sử dụng lại các hàm và thuộc tính của lớp cha cùng các chức năng mở rộng thêm. trong bài viết này, quantrimang sẽ cùng bạn học cách sử dụng tính kế thừa trong python.
  • Multiple Inheritance in Python

    kế thừa cho phép chúng ta khai báo lớp mới sử dụng lại các hàm và thuộc tính của lớp cha cùng các chức năng mở rộng thêm. trong bài viết này, quantrimang sẽ tiếp tục bài học cùng chủ đề kế thừa nhưng ở mức độ sâu sắc hơn, đó là Đa kế thừa và thứ tự truy xuất phương thức của các lớp cha (method resolution order).
  • Programming blockchain part 3: Python programming language

    guido van rossum, một lập trình viên người hà lan, đã tạo ra python vào năm 1991. python dựa trên một triết lý đơn giản: tối giản. một trong những điều đáng chú ý ở python là nó kết hợp tính đơn giản vào ngôn ngữ lập trình bằng cách sử dụng các khoảng trắng để biểu thị các khối mã thay vì dấu ngoặc nhọn hoặc từ khóa.
  • Stack operator in Python

    bạn có thể thay đổi ý nghĩa của toán tử trong python tùy thuộc vào toán hạng được sử dụng và ta gọi đó là nạp chồng toán tử. quantrimang sẽ tìm hiểu kĩ hơn về nội dung này qua bài viết. mời bạn đọc theo dõi.
  • Complex () function in Python

    trong python, hàm complex() trả về một số phức khi người dùng cung cấp phần thực và phần ảo, hoặc biến một chuỗi thành một số phức. cú pháp của hàm complex() như thế nào, nó có những tham số gì và cách sử dụng ra sao? mời bạn đọc theo dõi.
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup