Dave said:
I can fake knowing a language after 1 week too, but I will make
beginners mistakes that cause maintainence problems. This isn't a
problem for homeworks and projects, since they get thrown out after the
due date, but most software gets shipped to users on the due date, and
the users do more interesting things with the software than grade it
and throwing it out.
It depends on what you call "learning a language". If you call being
able to write compilable, error-free code in a language "learning", 1
week is all it takes. I saw it in my first year in college. We had C for
our programming course. I had C++ in school for 2 years, and before that
I had done a lot of programming in BASIC (my first language). So the C
course was pretty easy for me. However, I saw my batch mates struggle.
Most had never done any sort of programming before. But they did write
workable code in the first week itself, if only after a lot of
compilation errors and segmentation fault:core dumped s. By the end of
the semester, they were producing working solutions of the standard
problems. And OP here says he has a lot of experience in Java. Shouldn't
take him more than a week to start programming in C++.
This is a general guideline I consider: If given an algorithm, you can
convert it into code in a particular language, you know that language.
If you can devise the algorithm also, such that it suits that particular
language, you know that language well. Programming ultimately boils down
to algorithms, and at its core, it is nothing but implementing and
interconnecting algorithms into a working program.
I was, but I have limited experience with this supposed phenomenon of
learning entire programming languages in a week. The only language I
was ever forced to learn for a course was Scheme, and Scheme does not
really count. Besides, you were talking about modern imperative
languages with significant standard libraries.
I had other courses that required a language, either C, C++, or Java,
but I knew the languages before I took the courses. I also, invariably,
wrote much better code, much more easily, than anyone else. I doubt
this is because I am a phenomenal genius. I am smart, but not orders of
magnatude smarter than an entire undergraduate program. Actually
knowing the language lets you write more, better code, much faster.
Imagine that.
Knowing the language will help you write more code. Yes, definitely. You
will spend less time spotting compiler errors and warnings. And in C++,
where the errors the compiler gives usually have no relation to the
actual error, this is a big help. Better code ? Doubtful, but probable.
Depends on what you call better code. If two programmers implement the
same algorithm in a language, and one knows the language better than the
other, the former will write faster, smaller code. But as with almost
everything, it too follows the law of diminishing returns. A person with
4 months experience will write a lot better code than one with 1 month.
However, the difference will be much less marked in a person with 4
years experience, and another with 1 year.
However, if the person with less experience is more experienced in
programming theory, he may choose a better algorithm, giving much more
efficient results than the person with more experience. So it depends.
-Arijit