[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tutor] beginning to code

Stefan Ram wrote:
> Bill <BILL_NOSPAM at whoknows.net> writes:
>> "Essential Reference", and I would say that Python is definitely a
>> bigger, and more complicated language than C++.  In some aspects it has
>> simpler syntax.  But consider all of the ways that you can pass
>> arguments to a function, for instance. There are definitely alot more
>> options than in C/C++. I like the way that both of these languages
>    In C++, you can pass:

I used the word *arguments*, not parameters.  FWIW, *const* seems to 
correspond to immutable, pretty well.  I find Python to be more more 
like Java, with regard to "passing objects by reference".

>      - by value (with a const or non-const parameter)
>        (where the value can be a pointer or a non-pointer
>        or a pointer-to-member or a unique_ptr or a shared_ptr)
>      - by reference
>      - by const reference
>      - by rvalue reference
>      - by universal reference
>      - by name (in macros)
>      - you can overload functions with the same name
>        but different numbers of parameter or different
>        types for their parameters
>      - you can write templates for functions with ranges of types
>        for a parameter
>      - default values can be declared for parameters
>    In Python, you pass
>      - by value
>    The section 6.3.4 on calls "in The Python Language
>    Reference, Release 3.6.0" encompasses 1? pages.
>> You are sounding like a "know-it-all" again.  I am familiar with such
>> examples.  One could code in C++ for a long time without a definitive
>> need for templates.
>    Ok, so if we exclude from C++ everything that you have not
>    learned yet, than, what is left over, is "much easier" for
>    you to read "at a glance". It seems that you want C++ to be
>    adjusted to your knowledge of it and your assertions about
>    it. I think that one should instead adjust one's assertions
>    to the reality.
> The Python Language Reference, Release 3.6.0         146 pages
> latest ISO-C++ draft (without the library part)      464 pages

Bear in mind that you don't have to know every feature of a language to 
make good use of it, unless, perhaps, that is your job.  I don't believe 
reading the latest "ISO-C++ draft" would be a good use of my time; it 
sounds like a document geared more to compiler designers. I don't even 
try to memorize <cmath>. If I need a function, I search for it.

There is a reason that C++, Java and Python all coexist. It might be 
helpful for you to try to appreciate that.