Earlier quoted context omitted.
Ruby is written in C Python is written in C Lua is written in C
I don't write Python in C /s You meant Ruby, Python and Lua have their reference implementations written in C. They all also have other implementations written in other languages.
Why Learn to Program in C?
101–110 of 123 posts
Re: Why Learn to Program in C?
#102Earlier quoted context omitted.
I hesitated to say that, but to me the most important part is paradigm and structures/patterns. lisp will teach you untyped tree recursion and metalevel perspective. ml/haskell will teach you typed composition. prolog goal based space exploration. forth stacks. APL arrays. C/Pascal etc are supposed to teach you 'imperative' but I believe imperative is mostly a conflation of lots of things, mutable state.. at best you…
I agree with you but I think paradigms are more of a "second" language problem than a "first language" problem.
Re: Why Learn to Program in C?
#103Earlier quoted context omitted.
Learning to program is about solving problems using a computer. Any programming language allows this, however some languages make it harder than others, and C is in that category. A language like Python has very little quirks that will stump a person coding for the first time in their life; in C they'll wonder "what does int main(int argc, char argv) mean?", "why is there a & before my variable in a scanf but not in…
>in C they'll wonder "what does int main(int argc, char argv) mean? They'll only wonder that if the book / course / instructor teaching them C, does NOT explain it to them. Which would be more of a reflection on said book / course / instructor than on the C language or the students.
Re: Why Learn to Program in C?
#104Re: Why Learn to Program in C?
#105Earlier quoted context omitted.
Which languages ? How common is it for people to get better understanding by travelling in other programming cultures ? My personal experience goes this way but I rarely hear it.
I'm not the parent poster but in my opinion, any language that doesn't frustrate the beginner is fine. The most important thing for learning is practice and if that is not fun people will end up quiting to do something else.
Re: Why Learn to Program in C?
#106Earlier quoted context omitted.
>in C they'll wonder "what does int main(int argc, char argv) mean? They'll only wonder that if the book / course / instructor teaching them C, does NOT explain it to them. Which would be more of a reflection on said book / course / instructor than on the C language or the students.
For students who are just learning to wrestle with the programming concept, python is far superior because it lets the student focus more on what to express and when, and less on remembering silly things like curly braces and semicolons.
Second, your point may (or not) be correct, but it is at best tangentially related to the point I was replying to, or to mine.
Re: Why Learn to Program in C?
#107Earlier quoted context omitted.
> hardware support for base+displacement addressing Not sure exactly what you mean by the "hardware support" part, unless it is machine instruction support of some kind for C syntax. (But I thought that a basic level of support for that was present in most processors - things like base + offset addressing mode, indirect addressing via the value in a register, etc.) But: a[i] is equivalent to star(a + i) in C. (The K&…
> Not sure exactly what you mean by the "hardware support" part, Yes I should have been clearer, and said no penalty or minimal penalty, support for base+offset address calculation. A fair number of machines a couple decades ago, had additional latency or throughput penalties for addressing modes that required address calculation. This is still true in some cases for more complex calculations. So the use of pointer a…
Re: Why Learn to Program in C?
#108In my last big C project it wasn't uncommon at all to find memory leaks and out of scope references to stack variables. You'd add a line of code and the whole thing would blow up because it changed the state of the stack and unmasked a problem in another module. I would find the culprit and figure out if they were being sloppy or they just didn't understand, and it was usually the latter. This from people who had been programming professionally for a year or two.
Re: Why Learn to Program in C?
#109Earlier quoted context omitted.
I'm not the parent poster but in my opinion, any language that doesn't frustrate the beginner is fine. The most important thing for learning is practice and if that is not fun people will end up quiting to do something else.
Yeah exactly a simple language like Python, with simple rules, one way to do a thing, and not the opposite.
- tiny set of builtins: list, dict, set - literal - slices - small syntax, and canonical indentation - simple mapping between some operators and class methods
you have enough to abstract a bit but not too much without drowning in details.
Re: Why Learn to Program in C?
#110Earlier quoted context omitted.
For students who are just learning to wrestle with the programming concept, python is far superior because it lets the student focus more on what to express and when, and less on remembering silly things like curly braces and semicolons.
First, braces and semicolons are not silly. They are just a different form of syntax than indentation. (And I say that as a Pythonista of many years, who also learned and then used C a lot before learning Python.) Second, your point may (or not) be correct, but it is at best tangentially related to the point I was replying to, or to mine.
If the student doesn't have to focus on remembering whether or not you need a semicolon or a colon on switch statement cases, they can focus more on actually grokking the process of translating thoughts and algorithms to code.