How do you think C ++ is becoming more and more like Python?

Source: Internet
Author: User
Link: C ++ HasBecomeMorePythonic Chinese link: Do you think I'm learning C ++? In fact, I am studying Pytho-related links: C ++ Has Become More Pythonic
Chinese link: Do you think I'm learning C ++? Actually, I'm learning Python Reply: a python beginner asked the Zen master why a dynamic language is not a static language, in an application field, more languages in the shell/php and java fields are compared with C ++ every day?
The Zen master picked up the Xinhua Dictionary and pasted his face.
Beginners suddenly realized: Yes! The essence of programming is nothing more than code, just like a dictionary that cannot be escaped from various literature.
The Zen master jumped up and said, I mean, your faces are as thick as the dictionary! Let me talk about the original intention of translating that article.

In fact, there are two words: Fun.

It will be quite fascinating to Python, and I have been using C ++ at work. I suddenly found that I used C ++ to imitate some Python features, that is, I exercised the C ++ encoding capability and became familiar with the new Standard C ++ syntax, I also learned about the basic syntax of Python and some "tricks and tricks ". This mixed learning method is quite novel and suitable for beginners.

At the end of my article, I gave two links that were not found in the original article:
  • How can we program a solution to a prime number of less than 100? -Answers from Milo Yip
  • Ryanhaining/cppitertools · GitHub
People who play this game have long been there. Is it really interesting for me alone?

Never imagined that this could also be a battle of language...
Never imagined that this would turn into a black one...

It's a joke to describe such a gameplay in an uncertain language. It's still a seemingly serious argument...
I don't know the original author's real thoughts, but I certainly won't believe "C ++ imitates Python...

Don't always be so boring.
You have to face up and talk about this brain, that dish.
Let's take a look at some interesting things. Python is just a joke. If you just give a feature that has been learned by Python, you can say that a certain language is becoming more and more like Python ......

  • Range Loop is good, but isn't the C ++ syntax Java.
  • The only similarity between Python dynamic types and C ++ 11 static type + type deduction is that you do not need to explicitly declare the type. In addition, it is simply a matter of two.
  • I am ashamed to be able to supplement BS because of a syntactic sugar. I am also drunk 」. It is good to provide a set of default list/tuple/dict implementations at the language level, but it is too naive.
  • Lambda turned into a big Python artifact. Sorry, I'm sorry, you guys will laugh.
  • Isn't the library of this level of severity configured in this year.
  • For Variadic functions, C has ...... But this is exactly the same as initializer_list's homogeneous list.

This kind of unknown frog Python brain powder, you let him write for two days Haskell he will shut up.

Don't tease me. It is clear that both C ++ and Python are learning Lisp (escape from begging for python to produce concept mapping with the template to be special (Dynamic language should be called Open Dynamic multiple dispatching ), when the two come out, I will admit it. Haskell said that the example features in the article should be available in modern advanced languages. It cannot be said who copied the c ++, but is carrying the shackles of high performance to catch up with the scripting language, so don't compare it. it's meaningless. Isn't that true?

You can also say that creating a Dictionary in Python is as simple as what it is. MyDict = {5: "foo", 6: "bar"} print (myDict [5]) cut, C ++ itself has the map type, now there is another hash table unordered_map, more like: auto myDict = std: unordered_map
  
   
{5, "foo" },{ 6, "bar" }}; std: cout <myDict [5];
  

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.