

The way you learn C++ - snmf
http://newyearphd.tumblr.com/post/107793158916/the-way-you-learn-c

======
akersten
> why on Earth I must know what parameters should I have for compilation from
> the very beginning if just want to print something?

Herein lay the trouble of learning higher-level languages first, which hide
all of the complexity and real work from the programmer. I'm not sure the
author recognizes how much goes on under-the-hood while "just" printing
something, and it's out of order to blame C++ for exposing the complexity when
C++ is a language specifically designed to allow for complex, close-to-the-
metal programming.

------
techjuice
Some things of top quality and value are not noticed immediately. Just because
someone tells you a Lamborghini, Buggati or Rolls Royce are top of the line
and like no other car you have experienced you will not be able to comprehend
what they are saying until you have learned to drive the car and have
experienced it for yourself. The favorite languages and operating systems of
many are built in C and/or C++ because of many of their exceptional qualities
for the jobs they are being used for. Instead of saying it is hard it is
better to choose the right tool for the job or what you are capable of
learning for what you want to do.

You do not learn C or C++ if your goal is to become a regular Joe developer
and you are not heavily focused on high performance and security. If you are
more focused on security and performance there is a good chance you learned C
and C++ so you could create modules for the web server, middle ware, operating
system, etc. that you are using to improve performance and or security. You
also need to know C and C++ to troubleshoot bugs or performance issues that
may occur which will require you to go under the hood and review the source
code for the language which is normally in C or C++, and if your using a
debugger you will need to know some assembly from time to time.

It is always ill advised and frowned upon to become another copy paster and
not understand what you are doing especially when using a programming language
with full access to everything the operating system has to offer. It is like
going to a job interviewing saying you know C++ and have never programmed any
production quality code in C++ and the only thing you have done is some
tutorials online. When some tough problems come up you will not be able to
troubleshoot the problem first and be on hold waiting for someone to update
your question online with something you hope is correct but you will
unfortunately not be able to trust and verify the solution.

It is always the best course of action to take something you see as hard and
take it as a challenge to learn it and become proficient so you are at least
at an intermediate stage and are not struggling with the basics of the
language. This will give you the ability to talk with others on a more
professional level to solve any problems that will come up so the conversation
will be constructive. It also feels good when you look back at something you
thought was so hard and develop highly secure and high performance
applications that you thought were not possible when you wrote your first few
lines of code.

------
neikos
I don't think the points raised are valid. There are /many/ great tutorials
online on learning C++. It is not the job of the tool to try and guess what
its user wants to do.

~~~
snmf
Indeed, there are many sources where you can learn C++, but I think most of
them fail to convince a beginner that it's worth trying to learn the language.
When you see the results immediately, it encourages you to learn how it works.

~~~
neikos
Something I have been struggling with is the non formal approach to computer
programming. Lately I find myself more and more convinced that if I had
learned Programming in a more formal context I would have seen results faster
than not. While I agree that seeing results is important to the learning loop
I think that correctly learning is the way to do that. Programming produces
code, solutions to problems produce results.

So if you want to see results you will have to first find a problem and solve
it without thinking on how to program it. Sure 'outputting text' is a valid
problem, however not very useful. "Reading a text file" might be a bit more on
par and will immediately give you several tutorials on how to achieve that.
And the way to go is to solve problems and not to 'program' you will just find
yourself in a corner, unsure on what to do next. One could e.g. search on how
to pass over a parameter to a program, how c++ handles file inputs, I/O
Streams.

~~~
snmf
Different approaches to learning lead to different results. The approach I
recommend is more about Get Things Done manner, hoping that it will create
enough incentives to delve in "theory" of the language after you got some
results.

------
nvader
I found this a very personal and honest explanation about the limitations of
one approach to learning a programming language or framework. Without
prejudice, lets call it the "agile approach" to learning-> you want to get
started quickly and then iterate to a better place.

In my own experience, I've always been dissatisfied with this approach. It
builds too slowly, and you either reinvent the wheels that already exist in
the language, or fail to take full advantage of transformational abilities of
the language. Assuming you already know how to program in language X, you end
up "Writing X in Y" (as in, "writing Java in Ruby"). I do prefer the
alternative, which is to spend some time reading the language manual and
references, fully understand the language before going off to do some damage.
Learning is process that is never completed; however the "RUP" approach to
learning gives you a much more strongly connected belief network on which to
hang concepts you'll be introduced to in the future. This is opposed to having
to take new lessons as standalone facts to be memorised: see the article's
confusion regarding pointers and references.

However, we often don't get to spend that time upfront learning things.
Sometimes the project deadline requires you to pick up that new framework and
get something working -right now-. Alternatively sometimes I need to work with
something that I don't want to spend all that energy learning, and it's easier
to just hack along, rather than actually commit to a deep learning of the
framework.

There are two questions this raises for me. 1) As an engineer who claims to
value craftsmanship, how do I reconcile with the fact that I don't really know
at least a few of the tools I use? Is the _right_ action to actually invest my
own time in learning new frameworks, no matter how skeptical I might be of
their value outside this one project? This risk-reward calculus is especially
exacerbated in an ecosystem with a lot of churn in frameworks and libraries.
In such a situation, what is the _right_ approach for me?

2) As a producer of knowledge tools for other developers (libraries, APIs,
maybe one day programming languages), how should I define my interfaces
knowing that some of my users will not bother to learn them? Do I have a
responsibility towards them?

Slightly more speculatively, I wonder how this would affect language design?
One of pg's aphorisms is that tools designed for use by people the designers
consider inferior will generally be poor quality. However, that doesn't stop
such tools from being popular. I don't think we've truly plumbed the depths of
a language "designed for lazy and/or sloppy people", and I'm willing to bet
that executed well, such a language could be very popular.

~~~
snmf
Agree with you. For me it's crucial to get results as fast as possible and I
found this approach is the most satisfying and productive. The problem with
C++ (unlike python, for example) that it is really hard to experiment with the
language: you change one minor detail of the code, and you have to rewrite big
chunk of the program eventually. That's why I first want to get results and
then read how it works.

By the way, could you briefly describe RP approach?

~~~
techjuice
This is not a problem with the language but the one programming in the
language not having a more in depth understanding of the language. Rushing for
results without working out a proper solution or really understanding how to
get from point A to B to get those results may end up with a false result. How
do you prove and verify your work if you are taking short cuts to get
something you hope is the correct answer. How do you know what you just copied
and pasted is the most efficient way of solving the problem. When moving to C
or C++ there are normally faster ways to accomplish tasks then what is
possible with higher level languages due to the built-in limits of the higher
level language.

It is similar to learning Calculus, Statistics, Number Theory, etc. you start
at the beginning with basic math and move up the later, trying to skip these
foundation and using what you find online without the capability to verify is
a grave mistake. Those that skip the base foundation will be those that make
grave errors in the future that can cost lives, time and or money.

Once you take the required time to learn C and or C++ you will eventually
understand the power you have at your fingertips and what you once thought was
hard or cumbersome will no longer be that way. A benefit of learning C and or
C++ is that you will understand the languages they are built in better.
Especially if you want to optimize the higher level code for performance or if
you unfortunately find a security hole you will be able to assist with
submitting a more detailed security report.

I see you are focused on seeing results as fast as possible, if you learn C
and or C++ more in depth you will get the results faster when you run your
professional grade code. On your note about having to rewrite a big chunk of
the program eventually this is not true if you know what you want to do,
design it properly up front and insure it is not heavily coupled with other
parts of your code. C++ is a great language to get deep into object oriented
programming and C for functional programming, learning both in depth will open
your mind up to more battle-tested solutions that you can apply in higher
level programming languages.

Just give it time you will see the light and it will help you in both lower
and higher level programming languages.

