It turns out that the world of the program is far better than I thought.

Source: Internet
Author: User
All pxx in this document refer to Erlang Program The page number in the book design, where the book information is placed Article Last.

People say that the ignorant are fearless. Have I been so fearless over the years? What's more, continue to be fearless?

Since it is fearless, it doesn't matter. What do you mean? Don't prohibit comments, but laugh at me. Violators delete IDs ~~~ Hoho ~~~~~~~

I read Erlang Program Design recently and found that the world of the original program is far better than I thought. When I was in high school, I started to learn a little C language and a little VB. After I went to college, I continued to develop my skills. (In fact, I did not want to graduate because I did not pass the test: $.) I also learned some. net, I learned a little about PhP and Java. By the way, I made two websites using ASP. After graduation, I continued to devote myself to VB a year later. net. This led to a deep-rooted idea: Program-less sequential programming of C series, Web Page scripting programming such as ASP and. net/Java and other so-called object-oriented programming. It was not found until Perl was learned last year that the original scripts were not all like ASP/PHP! Fortunately, some Perl is supplemented first, so it is quite natural to accept powershell. But in the final analysis, the program is nothing more than tossing the heap variables with various control structures. There are two very important concepts: Variable & Loop.

Until Erlang is seen the other day, the original variable is incorrect, and the original loop is not needed ~~~~~ Faint ~~~ The world seems to change suddenly?

X return:
Let's take a look at the passage in Erlang programming: (p12)

When I was in junior high school, the math teacher told me that "if there is X in different places of the same equation, then these X points to the same thing ". The equation depends on it, for example, we have x + y = 10 and X-Y = 2, then according to the two equations can be obtained: X is 6, Y is 4.
But when I learned the first programming language, I saw the teacher write this statement on the blackboard:
X = x + 1
Everyone else said, "This is an unsolvable equation ". But the teacher said, we were wrong. We should have forgotten what we learned in mathematics. X is not a mathematical variable. It is like a cage ......

 

How is it? I did not think about this problem when I first studied it. I think it's natural (so it's getting started soon ?), But now, I have to go back and think about it. Well, the math teacher has been saying, "mathematics is very important. If you are not good at computer learning, you can't do anything at that time, it's totally different from mathematics! Fortunately, Erlang, "in Erlang, the variable restores its mathematical meaning. When you associate a variable and value together, you actually make an asserted, that is, a statement of a fact. What is this variable ." What does this mean? It means:In the Erlang world, once your variables are assigned a value, they cannot be changed anymore ~~~~~

Do we really need:
Really, there is no for loop in Erlang. Is it interesting? When I first saw this, I was thinking that variables cannot be changed, and even a for loop does not exist. How can these people write programs? Then, in fact, Erlang can easily write great programs. This is interesting, but I don't know what to say, so I skipped it:Let programming return to mathematics: pattern matching and high-level functions.

 

PS some outstanding Erlang features:

1. Super Large computing, too BT, never seen any language so powerful (P11)
2. x = 1234. In this formula, X is not a variable, and = is not a value assignment operator (p12)
3. = indicates a pattern matching operation. The reason why "X" is changed to "1234" is only to "make the statement effective" (P13)

 

The above is just something interesting, and I am not very clear about the real powerful Exception Handling, concurrent programming, and distributed programming, I just think this is a completely different programming experience, and it is also a very interesting and powerful way. If you are interested, you can go and have a look.

Today, I have learned a little about Erlang and know that there are other things that are different from what I used to know. What about tomorrow? I must be brave enough to continue ......

This book is recommended for brute force attacks:

Dangdang network purchase address: http://product.dangdang.com/product.aspx? Product_id = 20398803
Zhuo Yue network purchase address: http://www.amazon.cn/mn/detailApp? Qid = 1230041969 & ref = Sr & sr = 13-2 & uid = 168-4868547-7142652 & prodid = bkbk864629
China-Pub address: http://www.china-pub.com/301677

PS: Zhuo Yue's website is really evil. It's not like a programmer's masterpiece ~~~~

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.