Go homepage(回首页)
Upload pictures (上传图片)
Write articles (发文字帖)

The author:(作者)归海一刀
published in(发表于) 2014/5/27 8:46:30
Clojure: exciting programming language

Clojure: programming languages-Clojure,Clojure exciting programming, programming languages-IT news Clojure: exciting programming language

Lately I've been trying to write a little something about Clojure impulses. But what happens is, there is a greater impulse occurs frequently, that using Clojure language to rewrite my this blog site, which this article came out was delayed for some time. So, let us begin to chat about this programming language Clojure!

I was the first programming language actually used to be Ruby. Currently still using Ruby for client development work, most Rails applications. Gives Ruby development prototype--this is a very beautiful language, though the programmer of programming takes a lot of self-discipline to avoid some common pitfalls.

I am concerned about Clojure language for a long time, and read a number of books about this language, language of a lot of talk about this video, but most of the time is a little. A few weeks ago, I had an opportunity, written in Clojure is a small and simple for a client server program, and it made me have a completely different experience. From then on, I began to write programs using Clojure make prototypes and more naturally comfortable. Here's my feelings and ideas obtained during the development of the language, and why Clojure will now become one of my favorite most used programming language. First a disclaimer, I am neither a Clojure programming language master, there is no guarantee that everything I say is right--these are just my short time in a limited number of projects using the experience gained in the course of this programming language.

Clojure gives people the feeling that has been carefully designed

From Ruby, which is a characteristic of Clojure shocked me the most. Clojure language went through two full years before the publication of design (no code is generated entirely on the paper). You can first contact in the process can feel them.

When used in a programming language, I usually encounter--of failing to understand why write code and not in accordance with the desired output. When this situation occurs, such as using JavaScript, and ultimately clear where results were very frustrating – most of the time when I seek help from a more experienced JS programmer, he will say:

"HA HA, of course not! You see here, in JavaScript, which is a special case. You need to do it. ”

This makes me very depressed. I can't think of it as a knowledge, it is only a viable alternative in this language skills. It doesn't look like an intellectual.

In Clojure, I usually want to know I was wrong (for example, the sequence as a lazy sequence common to deal with), which in some ways for you to get things done. I feel like if I asked Rich Hickey (inventor of the Clojure language), he will tell me:

"HA, HA, of course not! Think again – everything should be based on a run the way it should be. You used the wrong function, you used the wrong data structure. ”

This is the real knowledge, it would make me very happy.

Clojure simple and elegant

Clojure is not a pure functional programming language, usually this will make it easier for most people to accept and learn the language. But it's still very functional, it makes the language very elegant, simple, and powerful.

Using Clojure programming, I found myself going to develop very small and reusable functions, and then subtly combine them, built into a larger program. It's super simple modular system that makes you very easy to sort out your program modules and their dependent modules.

Also, at any time, when I wrote the interface has an ugly place, or where there are duplicate code, I could clearly feel, and want to think about it, find a way to refactor it, which will drive you to find the best programming scenarios. It used to fight with those programming languages you're totally not the same. It will help you achieve the most simple and most elegant programming strategies. For me, a Ruby,C had been heavy use of language and JavaScript programmers is the unprecedented sense of novelty.

Clojure development process of the program its amazing

In my understanding, programming one of the most troubling issue is that we a lot of brainpower wasted on waiting for program feedback over and over again. Using Clojure development program process to solve this problem. If you use the Lisp language, it would not have surprised about this.

Using Clojure programming your editor (can be Vim,Emacs,Light Table ...) Real-time and operating environment EDI. Developed, tested, modified to function you can receive immediate feedback. Your brain is programmed in the flow state, the slow feedback will break your logical thinking, this is unacceptable. That is the reason most likes Clojure.

So, these are my current feeling about this programming language Clojure. If you haven't tried it, I highly recommend you give it a try: into the official site to see how to start with.


(

Clojure:让人兴奋的编程语言 - Clojure,Clojure编程,编程语言 - IT资讯
Clojure:让人兴奋的编程语言

最近我一直有想写一点关于Clojure的东西的冲动。但不巧的是,还有一个更大的冲动经常出现,就是要用Clojure语言重写我的这个博客网站,这也就让这篇文章的出炉延迟了一段时间。那么,下面就让我们开始聊聊Clojure这种编程语言吧!

我真正用到的第一种编程语言是Ruby。目前仍然每天在用Ruby为客户开发工作,大多是Rails应用。用Ruby大量的开发制作原型——这是一种非常帅的语言,尽管对编程的程序员需要极大的自律性来避免落入一些常见的陷阱。

我关注Clojure语言很久了,读了不少关于这种语言的书,看了不少谈论这种语言的视频,但大多时候都是浅尝辄止。前几周,我遇到了一次机会,要为一个客户用Clojure写一个小的简单的服务程序,这让我有了完全不同的体验。从那以后,我开始感觉用Clojure制作原型和编写程序变得更自然顺手。下面就是我在用这种语言开发过程中获得的感受和想法,以及为什么Clojure现在会变成我最喜欢最常用的编程语言。先免责声明,我既不是一个Clojure语言编程高手,也不能保证我说的都是正确的——这些只是我短期的在有限的一些项目中使用这种编程语言的过程中获得的体验。

Clojure给人一种经过精心设计过的感觉

从Ruby中出来,这是Clojure最让我感到震惊的特征。Clojure语言在发布前足足经历了两年的设计(甚至没有任何代码产生,完全在稿纸上)。你可以在第一次接触它的过程中就能感受到这些。

在使用一种编程语言的时候,我通常会遇到一些情况——无法理解为什么写出的代码并没有按照预期的结果输出。当这种情况发生时,比如使用JavaScript,最终弄清问题出在什么地方的结果让人非常的泄气——大多数时候当我向一个更有经验的JS程序员求助时他会说:

“哈哈,当然这样不行!你看这里,在JavaScript里,这是一个特殊情况。你需要这样做才行。”

这让我很郁闷。我不能把这当成学到了一种知识,这只是在这种语言里的一个变通技巧。这并不像是一种知识。

而在Clojure里,我通常会想明白是我错了(比如,把lazy序列当成普通序列来处理),这种语言会以某种途径让你去把事情做对。感觉就像,如果我询问Rich Hickey (Clojure语言的发明人),他会告诉我:

“哈哈,这当然不行!再想想——每个东西都应该按照它自己应该的方式运行。你用错了函数,你用错了数据结构。”

这才是真正的长知识,这会让我很开心。

Clojure简洁且优雅

Clojure并不是一种纯函数式编程语言,通常这会让这种语言更容易为大多数人接受和学习。但它仍然是非常函数式的,这使得这种语言非常优雅,简洁和强大。

使用Clojure编程,我发现自己会先开发出非常小且可复用的函数,然后巧妙的组合它们,构建成更大的程序。它的超级简单的模块化系统使得你非常容易的理清你的程序的模块和它们的依赖模块。

还有,无论何时,当我写的接口有丑陋的地方,或什么地方有重复的代码,我都能明显的感觉到,而且要去思考它,想办法重构它,这种语言会驱动你寻找最佳编程方案。这跟以前的跟那些编程语言做斗争的感受完全不一样。它会帮助你实现最简洁、最优雅编程策略。这对于我,一个曾大量使用过Ruby,C语言和JavaScript的程序员来说,是空前的新奇的感觉。

Clojure程序的开发流程让人惊叹

在我的认识里,编程工作中一个最让人头疼的问题是,我们大量的脑力浪费在一遍又一遍的等待程序反馈中。而用Clojure开发程序的流程解决了这个问题。如果你使用过Lisp语言,相信不会对此惊奇。

使用Clojure编程,你的编辑器(可以是Vim,Emacs,Light Table…)一直和运行环境实时联通。你对函数的开发、测试、修改能立刻得到反馈。你的大脑在编程中处于流状态,缓慢的反馈会打断你的逻辑思维,这是不可接受的。这也是最喜欢Clojure的原因。

所以,这些就是我目前对Clojure这种编程语言的感觉。如果你还没有尝试过它,我高度推荐你试一试:到官方网站看看如何入手。


)


If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)





QQ:154298438
QQ:417480759