Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to recognize Clojure programming language

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to understand the Clojure programming language. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Let's start talking about Clojure as a programming language.

At present, we are still working with Ruby for customers every day, mostly Rails applications. Prototyping with a large number of developers in Ruby; this is a very handsome language, although programmers need a lot of discipline to avoid falling into some common pitfalls.

I've been following the Clojure language for a long time, reading a lot of books about the language, watching a lot of videos about the language, but mostly dipping into it. A few weeks ago, I had an opportunity to write a small and simple service program for a customer using Clojure, which gave me a completely different experience. From then on, I began to feel that prototyping and programming in Clojure became more natural and convenient. Here are the feelings and thoughts I got from developing in this language, and why Clojure has now become my favorite and most commonly used programming language. For the disclaimer, I am neither a Clojure programmer nor can I guarantee that what I say is correct; these are just my short-term experience of using the programming language on a limited number of projects.

Clojure gives the impression that it has been carefully designed

Coming out of Ruby, this is the most shocking feature of Clojure. The Clojure language went through two years of design before it was released (not even any code was generated, entirely on manuscript paper). You can feel this when you touch it for the first time.

When using a programming language, I usually encounter situations where I can't understand why the code written doesn't output as expected. When this happens, such as using JavaScript, the result of finally figuring out what the problem is is very frustrating; most of the time when I ask a more experienced JS programmer for help, he will say:

", of course it won't work! look here, in JavaScript, this is a special case. You need to do this."

It makes me depressed. I can't think of this as learning a knowledge, it's just a flexible technique in this language. This is not like a kind of knowledge.

In Clojure, I usually figure out that I'm wrong (for example, treating lazy sequences as normal sequences), and the language will somehow get you to get things right. It feels like, if I ask Rich Hickey, the inventor of the Clojure language, he will tell me:

", of course not! think again; everything should run the way it should. You used the wrong function, you used the wrong data structure."

This is the real long knowledge, which will make me very happy.

Clojure is simple and elegant.

Clojure is not a purely functional programming language, which usually makes it easier for most people to accept and learn. But it is still very functional, which makes the language very elegant, concise and powerful.

Using Clojure programming, I find myself developing very small and reusable functions, and then skillfully combining them to build larger programs. Its super simple modular system makes it very easy for you to sort out the modules of your program and their dependent modules.

Also, whenever I write an interface that is ugly, or where there is repetitive code, I can clearly feel it, and I have to think about it and find a way to ReFactor it, the language will drive you to find programming solutions. This is completely different from the previous experience of fighting with those programming languages. It will help you implement the most concise, elegant programming strategy. This is a novel feeling for me, a programmer who has used the Ruby,C language and JavaScript extensively.

The development process of Clojure program is amazing.

In my opinion, one of the biggest headaches in programming is that we waste a lot of brainpower waiting for feedback from the program over and over again. The process of developing programs with Clojure solves this problem. If you have used the Lisp language, you will not be surprised.

With Clojure programming, your editor (which could be Vim,Emacs,Light Table) is always connected to the runtime environment in real time. You can get immediate feedback on the development, testing, and modification of the function. Your brain is in a state of flow in programming, and slow feedback interrupts your logical thinking, which is unacceptable. That's why I like Clojure best.

So, that's how I feel about Clojure as a programming language right now. If you haven't tried it yet, I highly recommend you give it a try: go to the official website and see how to get started.

The above is the editor for you to share how to understand the Clojure programming language, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report