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

Source: Internet
Author: User
RELATED Links: C + + have become more pythonic
Chinese Link: Do you think I'm learning C + +? Actually, I'm learning Python.

Reply content:

A beginner python asked the Zen master: Why a dynamic rather than a static language, a field of application is more in the shell/php and Java language every day and C + + comparison ah?
The master picked up the Xinhua dictionary and put it on his face.
Beginner dawned: Yes! The nature of programming, but it's all code. Like all kinds of literature can't escape a dictionary.
The Zen master jumps up a burst: I mean, you have the gall to be as thick as a dictionary! Tell me the original intention of the article.

In fact, the two words: fun.

That would be fascinating for Python, and it's working on C + +. Suddenly found that in C + + to imitate some of the characteristics of Python, that is, the training of C + + coding ability, familiar with the new C + + standard syntax, but also understand the basic Python syntax, and some "artifice". This blend of learning methods, personal feel quite new, and very suitable for beginners.

At the end of my article I gave two links that were not in the original text:
    • How do I program a prime number within 100? -Milo Yip's answer
    • Ryanhaining/cppitertools GitHub
The people who play like this are already there. Do I really think it's interesting for me alone?

Never thought, this can also be the language of the struggle ...
Never thought, this can also become black the black that ...

Using a very playful, non-tight language to describe such a play, it is still understood as a seemingly serious argument ...
I do not know the original author's true ideas, and I certainly will not be "C + + imitation Python" believed that ...

Can not always be so boring.
I have to say that this is a brain remnant, that dish.
Take a look at some interesting things, le ah le ah won Bai. Python would have been a handyman, you can just give a feature to be learned by Python to say that a language more and more like Python ah ...

    • The Range Loop is good, but the C + + syntax is not Java.
    • Python dynamic type c++11 static type + type deduction the only similarity is that you don't have to explicitly declare a type, except that it's a different thing.
    • Can brain repair BS dad would be ashamed of a grammar candy, "drunk". The language level provides a set of default List/tuple/dict implementations is good, but blowing into this is too naive.
    • Lambda actually becomes Python's big artifact, sorry everybody I go out to laugh.
    • This is the level of the standard library is not a food and clothing level of configuration.
    • As for Variadic function,c, there are ... But this is not the same thing as initializer_list the homogeneous list.

This is nothing to understand the frog in the head of Python brain powder, you let him write two days Haskell he shut up quietly.

Don't tease, obviously is C + + and Python are learning Lisp (escape kneeling for python out of concept mapping with template bias (dynamic language should be called open dynamic multiple dispatching), these two made out, I will admit. Haskell says laughter without words the characteristics of examples in the article should be modern high-level language have, can not say who copied who C + + but burdened with high-performance shackles chasing scripting language Oh, so don't compare, no meaning. Is it really not in the dark?

可人又说了,Python 里创造个 Dictionary 简单的跟什么一样6。myDict = {5: "foo", 6: "bar"}print(myDict[5])切,C++ 本身就有 map 类型,现在又多了个哈希表 unordered_map,更像了:auto myDict = std::unordered_map
  
   
    
   { { 5, "foo" }, { 6, "bar" } };std::cout << myDict[5];
  
   
  • Related Article

    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.