Posted Jun 29, 2012 5:17 UTC (Fri) by Cyberax (✭ supporter ✭, #52523)
[Link]
It might be better to skip plain C simply to avoid picking up bad habits (like using raw pointers).
Why learn Fortran?
Posted Jun 29, 2012 15:25 UTC (Fri) by dskoll (subscriber, #1630)
[Link]
I disagree. You need to learn about pointers or else C++ will be completely mysterious... you won't have a good understanding of what's really going on under the hood.
Why learn Fortran?
Posted Jun 29, 2012 17:38 UTC (Fri) by daniel (subscriber, #3181)
[Link]
You can learn about pointers and arrays perfectly well in C++. In fact nothing stops you from writing C in C++ to your heart's content. However for the inveterate C programmer such as myself there is just so much more that you will never fully understand without actually doing it.
Why learn Fortran?
Posted Jun 29, 2012 22:45 UTC (Fri) by dskoll (subscriber, #1630)
[Link]
Again: The title of the article is "Why learn C?"
I'm a programmer, not a teacher, but it seems to me a pretty reasonable way to learn C++ is first to learn C and then to learn what C++ adds on top of C (as well as the points of difference between the languages.)
Why learn Fortran?
Posted Jun 30, 2012 8:35 UTC (Sat) by HelloWorld (guest, #56129)
[Link]
> I'm a programmer, not a teacher, but it seems to me a pretty reasonable way to learn C++ is first to learn C and then to learn what C++ adds on top of C
C++ doesn't just add on top of C, it replaces tons of stuff in the sense that while these things still exist, their use is frowned upon due to the presence of better alternatives. Therefore, it actually doesn't make sense to learn C first. Been there, tried that.
Why learn Fortran?
Posted Jun 30, 2012 13:24 UTC (Sat) by dskoll (subscriber, #1630)
[Link]
You cut out the parenthetical part of my statement pointing out the areas of difference.
Tell me, are you a teacher or a programmer? Have you taught anyone to program?
I am not a teacher, but I have taught a few people to program, and IMO learning C first and then C++ makes a whole lot of sense, especially if it's a non-programmer doing the learning.
Why learn Fortran?
Posted Jun 30, 2012 13:52 UTC (Sat) by HelloWorld (guest, #56129)
[Link]
> You cut out the parenthetical part of my statement pointing out the areas of difference.
That's because the issues I am referring to aren't an area of difference. Malloc exists in C++ and works the same as in C, so clearly there is no difference in that regard, and yet, malloc shouldn't be used in most C++ code.
There are areas of difference between C and C++ (such as the implicit conversion from void* to foo* and a few others), but that really isn't the issue.
> I am not a teacher, but I have taught a few people to program, and IMO learning C first and then C++ makes a whole lot of sense,
Just tell me why. I don't think that teaching people tons of stuff that they'll inevitably have to unlearn later on makes any sense.
Why learn Fortran?
Posted Jun 30, 2012 21:30 UTC (Sat) by dlang (✭ supporter ✭, #313)
[Link]
Good programmers should learn many programming languages, as such the first one they learn should not need to be the one they will be using to make a living.
C has the advantage that it's small enough that you can teach the complete language in a short time (when was the last time you saw a language book as small as the K&R C book?, or even one only double it's size?)
That's a huge advantage for a first language.
The fact that other languages work differently just means that when you move on to those languages, you should be learning the new stuff, but already have a solid grounding in the basic stuff.
My High School computer classes started by teaching Basic, then had a class in algorithms, and then covered assembly, and only then branched out to other languages. It resulted in a much more solid grounding, and much more flexible thinking than would come out of any of the College programs I have seen.
Why learn Fortran?
Posted Jul 1, 2012 10:45 UTC (Sun) by HelloWorld (guest, #56129)
[Link]
> Good programmers should learn many programming languages, as such the first one they learn should not need to be the one they will be using to make a living.
>
> C has the advantage that it's small enough that you can teach the complete language in a short time (when was the last time you saw a language book as small as the K&R C book?, or even one only double it's size?)
The Little Schemer, the Lua 5.1 Reference Manual. If the goal is to learn programming in general, I'd say that these language make much more sense than C -- no need to bother with memory management, mysterious bugs due to out-of-bounds memory access or C's idiosyncratic syntax and the preprocessor.
On the other hand, if your goal is to learn C++, learning C first doesn't make any sense either due to the reasons mentioned earlier. So unless you actually want to read or write C code, I don't see a reason to learn C.
Why learn Fortran?
Posted Jun 29, 2012 16:33 UTC (Fri) by tshow (subscriber, #6411)
[Link]
A colleague of mine and I once spent a week building a memory allocation annotation system to track down a heisenbug that turned out to be a C++ class miscast. C++ will not save you there.