learning Modern C++

A

arnuld

Victor said:
Nobody can answer this but you. And nobody knows the future, even
you. What usually happens is you put some effort into learning and
then the time comes to contribute. If you feel strong enough, you
will contribute. If you don't, you won't.

now that is really very *strange* for me but you, Victor, carry a wider
experience of *Life* than me therefore i will follow you here.
It's not the end of the
world if you can't contribute to an open source project.

for me, at least, this is the end. no company giving me a job because i
do not carry any "Project Experience".
Prioritise your goals.

1.) C++ (Stroustrup/Eckel)
2.) OOA & D (Booch, Rumbaugh)
3) IceWeasel, HURD/L4 or something else but definitely the destination
is GNU.
4.) Effective C++, Exceptional C++, Modern C++ Design, Generic
Programming & STL
5.) step 3 & half of 4 will take at least 6 mothst to 1 year.
6.) get a C++ job in my country
7.) apply for an immigration

i only priortised my goals when you asked. before that moment i only
had a vague idea. thanks
As to eligibility, I have no idea. Have you tried asking the project lead (if any)?

yes but 1 year ago when i was complete-100%-newbie to programming. i
wanted to contribute to HURD. when i asked they said at least 2 years
of experience in doing C & since i wa s anovice to programming they
also advised me to learn some "higher-level langugae" first like Scheme
or Python & 2 years project work with C.

i have not made any contact with "IceWeasel" developers but i
downloaded the source-code, it is written in C++.
 
L

LR

Noah Roberts wrote:

If it takes you longer than 6 months to learn C++ in its entirety

Is this even a possible goal?
> you
may as well just give up and learn Java.

Why? Is it possible to learn Java in six months in its entirety?

I'd say that it's possible to learn a useful subset of either language
in six months. But to learn the entire language?

LR
 
V

Victor Bazarov

arnuld said:
Victor Bazarov wrote: [..]
It's not the end of the
world if you can't contribute to an open source project.

for me, at least, this is the end. no company giving me a job because
i do not carry any "Project Experience".

Since open source projects are not widely known by commercial companies,
having contributed to any of [potentially very obscure] OS projects may
not give you what you expect. Have you asked if OS projects will be
good enough for a company to consider it "experience"?

As to not getting a job, have you tried talking to a recruiter? They
usually know much more of how to succeed in job seeking.
Prioritise your goals.

1.) [..book titles redacted..]


We'll call the above "learn enough C++ to get a job". Subgoals are
good to have.
5.) step 3 & half of 4 will take at least 6 mothst to 1 year.

That's not a goal. That's a risk.
6.) get a C++ job in my country
7.) apply for an immigration

i only priortised my goals when you asked. before that moment i only
had a vague idea. thanks

You need to work a bit on those, still. Add risk assessment to your
activity, identify the necessary resources (and the risks of not
finding them), and you're going to learn more about getting a job
than if you just learn C++.
As to eligibility, I have no idea. Have you tried asking the
project lead (if any)?
[..]
i have not made any contact with "IceWeasel" developers but i
downloaded the source-code, it is written in C++.

The simplest way to start contributing is to get the list of bugs
and try fixing any of them. Once you find a solution, contact any
of the developers on the team and make your suggestion. If it is
accepted, you have contributed.

Good luck!

V
 
A

arnuld

Victor said:
The simplest way to start contributing is to get the list of bugs
and try fixing any of them. Once you find a solution, contact any
of the developers on the team and make your suggestion. If it is
accepted, you have contributed.

ok, i have joined their mailing-list & will post my intentions there.
but still, i am not able to resist & hence ask, i can fix bugs only if
i know C++ which i dont.
 
D

Daniel T.

arnuld said:
1.) why a function returns an /int pointer/ rather than an /int/ ?

It, of course, depends on the specific function's purpose. However,
generally when a function returns a pointer, the caller is responsible
for lifetime management of the object returned. For example, it is
returning something that was passed into it as a parameter or something
that was created using "new" within the function.
2.) why a function takes arguments as: /const string& s, char c/ rather
than /string s, char *c/ or /string *s, const char *c/ etc. etc. ?

Taking a const reference (i.e., "const string& s") generally has better
performance characteristics than taking a value (i.e., "string s") if
the object is larger than an int.

For chars, "const char*" and "char*" has special meaning as they refer
to c-style strings. Therefor they are generally not used unless one
wants to pass a c-style string.
 
A

arnuld

Daniel said:
It, of course, depends on the specific function's purpose. However,
generally when a function returns a pointer, the caller is responsible
for lifetime management of the object returned. For example, it is
returning something that was passed into it as a parameter or something
that was created using "new" within the function.

now i understood *something*.
Taking a const reference (i.e., "const string& s") generally has better
performance characteristics than taking a value (i.e., "string s") if
the object is larger than an int.

For chars, "const char*" and "char*" has special meaning as they refer
to c-style strings. Therefor they are generally not used unless one
wants to pass a c-style string.

ok, but what is the difference betwen using /int* x/ & /int x/ as an
argument to a function?

why someone should prefer one over the other?
 
D

Daniel T.

arnuld said:
now i understood *something*.


ok, but what is the difference betwen using /int* x/ & /int x/ as an
argument to a function?

Generally, "int* x" refers to an array of ints or it serves as an
indicator that the called function must take responsibility for the
destruction (calling delete on) the object passed in.
why someone should prefer one over the other?

These are primarily minor issues of preference for the programer in
question. If, for example, you now ask between "int* x" and "int& x" for
a single 'x' object, I would have to say, "It depends on the programer."
 
V

VJ

Noah said:
If it takes you longer than 6 months to learn C++ in its entirety you
may as well just give up and learn Java.


I forgot the exact name of a book. It is called "learn C++ in 10 years",
or something like that.
Anyone know name of this book?
 
A

arnuld

Daniel said:
Generally, "int* x" refers to an array of ints or it serves as an
indicator that the called function must take responsibility for the
destruction (calling delete on) the object passed in.

Ok, you are talking about /arrays/ & /detruction/. so one uses /int*
x/, it means he is using Dynamic-Memory-Allocation instead of Static &
hence faster/efficient use of hardware. right?

/int* x/ refers to /arrays/. what does /int& x/ refers to?
These are primarily minor issues of preference for the programer in
question. If, for example, you now ask between "int* x" and "int& x" for
a single 'x' object, I would have to say, "It depends on the programer."

it means, ther is no need to fear from them. i always thought they were
*technical* issues.
To send me email, put "sheltie" in the subject.

what is that?
 
V

Victor Bazarov

Daniel said:
[..]
Generally, "int* x" refers to an array of ints or it serves as an
indicator that the called function must take responsibility for the
destruction (calling delete on) the object passed in.

REALLY? <shaking his head in disbelief> And I always thought that
it's because the integer needs to be filled in by the called function,
but the argument is essentially "optional"...
These are primarily minor issues of preference for the programer in
question. If, for example, you now ask between "int* x" and "int& x"
for a single 'x' object, I would have to say, "It depends on the
programer."

Damn! And I thought it depended on the task at hand... Damn!
 
V

Victor Bazarov

arnuld said:
Ok, you are talking about /arrays/ & /detruction/. so one uses /int*
x/, it means he is using Dynamic-Memory-Allocation instead of Static &
hence faster/efficient use of hardware. right?

/int* x/ refers to /arrays/. what does /int& x/ refers to?

I know it's difficult at the beginning, when you're just starting to
grasp the stuff, but try not to give into developing misconceptions.

Passing 'int*' just means passing an address of an integer, which can
actually be a null pointer. It also can be an address of a real int
variable or an address of an element in an array of int (or even the
address of an imaginary element "one-past-the-end" of an int array).

V
 
A

arnuld

Victor said:
I know it's difficult at the beginning, when you're just starting to
grasp the stuff, but try not to give into developing misconceptions.

ok, but does everyone faces such problems in the beginning?
Passing 'int*' just means passing an address of an integer, which can
actually be a null pointer. It also can be an address of a real int
variable or an address of an element in an array of int (or even the
address of an imaginary element "one-past-the-end" of an int array).

it looks like an approch to solve some problem. so it means, i will get
a better picture by solving some real-life problem.
 
D

Daniel T.

arnuld said:
Ok, you are talking about /arrays/ & /detruction/. so one uses /int*
x/, it means he is using Dynamic-Memory-Allocation instead of Static &
hence faster/efficient use of hardware. right?

One need not use dynamic allocation to warrant the use of int*. For
example:

void foo( int* values, int num )
{
for ( int i = 0; i < num; ++i )
cout << values << " ";
cout << '\n';
}

void bar( int* consumable )
{
cout << *consumable << " consumed.\n";
delete consumable;
}

int main() {
int v[4] = { 10, 20, 30, 40 };
foo( v, 4 );
bar( new int( 12 ) );
}

/int* x/ refers to /arrays/. what does /int& x/ refers to?

int& (when not const) is generally used when the object passed in is
also being used for output. It serves as an alternate way to return
information. The calling code is expected to manage the lifetime of the
object. An example:

void foobar( int& x ) {
cout << "x currently equals " << x << '\n';
x = x + 22;
}

int main() {
int in = 2;
foobar( in );
cout << "'in' now equals " << in << '\n';
}
what is that?

If you want to email me, you can, but you have to put "sheltie" in the
subject of any email you send me. Otherwise my spam blocker will toss it
in the trash.
 
N

Noah Roberts

LR said:
Noah Roberts wrote:



Is this even a possible goal?


Why? Is it possible to learn Java in six months in its entirety?

If you aren't an expert in Java in 21 days then maybe you're better off
flipping burgers.
 
D

Daniel T.

Victor Bazarov said:
REALLY? <shaking his head in disbelief> And I always thought that
it's because the integer needs to be filled in by the called
function, but the argument is essentially "optional"...

Hmm... Look at your sentence again. The integer *needs* to be filled in,
but the argument is optional? How can the integer get filled in if it
doesn't exist?

I understand that int* can be use when one wants to allow passage of
nothing (i.e., NULL) but that is an extremely rare occurrence in my
experience.
Damn! And I thought it depended on the task at hand... Damn!

Really? The only reason references were added to the language was to
facilitate operator overloading (D&E), in every other context where
references are used, one can use a pointer. So then, in those cases
where a reference can be used (other than operator overloads,) it is
purely a matter of programmer preference between use of a reference or a
pointer. I personally use pointers to indicate the passing of ownership
and reference when the called function doesn't want to accept ownership,
but that's just a style of mine, nothing in the language requires it.
 
A

arnuld

Victor said:
Since open source projects are not widely known by commercial companies,
having contributed to any of [potentially very obscure] OS projects may
not give you what you expect. Have you asked if OS projects will be
good enough for a company to consider it "experience"?

no, i just did a search on www.monsterindia.com. now, i will look for
email addresses of their "hiring managers" & will ask them.
As to not getting a job, have you tried talking to a recruiter? They
usually know much more of how to succeed in job seeking.

i live in a Town.no recruiters are here. i can go to a city but one is
at least 120km away & others are at least 370 kms. i will check if
anyone available online for the cities where there is an opprtunity to
work.
Prioritise your goals.

1.) [..book titles redacted..]


We'll call the above "learn enough C++ to get a job". Subgoals are
good to have.
5.) step 3 & half of 4 will take at least 6 mothst to 1 year.

That's not a goal. That's a risk.

did not get it.
 
V

Victor Bazarov

arnuld said:
[..]
5.) step 3 & half of 4 will take at least 6 mothst to 1 year.

That's not a goal. That's a risk.

did not get it.

What didn't you get? Are you setting a goal to spend a particular
amount of time on those? I see a statement saying "blah will take
so an so much time". That's called "risk assessment". Basically
you say, "We have time delay here before the task is complete; the
longer the delay, the more shit can happen and alter our universe,
so, the more time we allocate, the more risk we're taking (in shit
happening)". What goal are you setting here? Not to allow shit to
happen? You can't. You have very little influence on that (if at
all).

If you intended to limit yourself to a certain study period, then
you need to rephrase. Something like "spend no more than 6 months
on this before re-evaluating the list of goals", and make it part
of the goal describing studying. There has to be a set of
measurements that would help you understand whether the task has
been accomplished. Like, "I finish all exercises in book A and
50% of exercises in book B successfully". Or, "I join an open
source project and fix two bugs satisfactorily". Otherwise, how
do you know you reached your goals?

We seem to be going waaaay off topic here. Perhaps you need to
get a copy of "management 101" textbook (or some such). That's
where they teach proper processes for setting goals and verifying
hitting them, and reviewing them, and...

V
 
B

BobR

arnuld wrote in message
ok, but does everyone faces such problems in the beginning?

No, because most of us read a book [1] instead of arguing on an NG!! :-}

Try:
'You Can Do It!' and "You Can Program in C++"
see http://www.spellen.org/youcandoit

Try some code. When you expect it to do "ahh", but it does "duh", and you
want help, this is the NG to consult.

[1] - ...the WHOLE book!!
example: In "Thinking in C++", Mr.Eckel will often show you how to do
something, but explain it much later in the book. You don't have 'the big
picture' until you hit the last page.
 
T

Tony

Victor Bazarov said:
It will. So? Many of us who use C++ professionally do not get to
employ all possible features of it in our daily programming/design.

"do not get to"? Well, then you're a well-managed project then maybe
(read, someone enforces a coding standard, which of course should
indicate what C++ features will be allowed and how). I'm being facetious
because I don't believe anyone does that (the C++ feature leash thing)
(?), but I believe such a thing
would be not only good, but a boon (whatever a "boon" is!). The most
recent enlightening thing I've found was the coding standard that
B. Stroustrup's website has on it. That I'm going to reread every few
months until every good idea in it is in my own codebase.

So a coding standard like that is good, but controlling the zeal of
programmers that want to do magical stuff with the C++ mechanisms is
even more important. Someone is going to have to maintain that code
afterall, and many times it is not its creator. The concept of
"C++ on a leash" is a good one IMO.
That means many parts even when "learned" first, tend to slip away
and need to be re-learned years later, thus stretching the learning
curve significantly.

Those are probably the things that should be in the exclusion list!
It is unrealistic to learn _all_ of C++ in less than a year (and have
a life at the same time).

C++ is a smorgasbord, eat what you like.
You cannot become an expert without
actually doing the stuff.

That sounds like a focus on the intricate mechanisms rather than an
applied focus (actually building something simple and elegant).
And if you are doing it, you just don't
have enough hours in a day to do it all during one year (*and* have
a life)... So, either you give up living a normal life (which you
shouldn't) or you give up hope in becoming an expert in too short of
a time. I chose the latter. I am still learning.

Personally, I think there are enough "language lawyers". How many are
really needed?? The names read like the C++ books at Borders. On my
shelf is Stroustrup, Coplien, Meyers, Koenig/Moo... and I've spent a lot
of time reading many passages of books at Borders.

I'll leave the above paragraph there, but now that I'm thinking about it,
I don't think I'd be able to afford any of those people to act as a lint
tool on my products' code before release. So yeah, there's probably a
lot of those kinds of people needed. Or some fancy tool from Parasoft?
I believe they had a tool that analyzed code for Meyer's "Effective C++"
best practices, yes?

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top