<p>I can not answer directly because I know nothing about Python, but I first started to use C nearly 4 decades ago, and have used it for some really complex stuff. I love C# (I use it in the context of ASP.Net) and think it is very well designed and implemented. So, I would be biased no matter what, as you know, because you never forget your first language, which in my case was somewhere in the murky past of Basic, PDP-11 shell scripting, APL and Fortran, with punched cards and without...</p>
<p>Anyway: I would suggest that the concept of <strong>Notional Machine</strong> should be the absolutely most important consideration when first teaching anything about programming. Without a notional machine informing their understanding, students will know basically nothing about computing, and with a good foundation in one, they will know everything they need to know to learn new languages, systems, frameworks, etc, forever.</p>
<p>So, choose a language that actually teaches computing in a way that is <em>generative</em>, <em>extensible</em>, with <em>sound metaphors</em> and which has a <em>small grammar</em> that is not too powerful. In other words, something like C without too much preprocessor tricks or frameworks thrown in. Frameworks are the sauce, teach then how to cook first (colorful metaphor).</p>
<p>The problem is that there is such a forest of layers and tools now that actually seeing the machine in a way that contributes to notion-formation is very hard now. I would rather that students learn how to write simple command-line programs than know how to make a web site, because a lot of web site work is not really programming in any sense, it is just setting a lot of switches. And sadly, that misses the whole point of why we invented computers in the first place.</p>
<p>Without the idea of program, they are technicians, not creators. So choose wisely.</p>

CC BY-SA 4.0
2021-05-01T20:56:45.240Z
And you should teach quality while you are at it.
Scott Rowe
CC BY-SA 4.0
2021-05-02T01:05:33.903Z
When people assert that 'state' is the primary obstacle to understanding computers, this just completely dumbfounds me. Well, what more IS there to a computer than state? Really? What is a computer without state? A fancy set of lightswitches. People, please... get a clue.
Scott Rowe
CC BY-SA 4.0
2021-05-02T02:11:10.373Z
+1 I like this answer a lot, thanks for writing it.
Daniel R. Collins
CC BY-SA 4.0
2021-05-01T20:54:11.527Z
2021-05-01T20:54:11.527Z
Scott Rowe
<p>In Python, if a program which is fed certain inputs produces certain outputs, then in the absence of deliberate randomness, those outputs will determined by the program and its inputs.  While it's possible that a program might be erroneous and yet produce correct output for some inputs (e.g. if a program is supposed to accept a number and output its square, but instead it simply multiplies the number by 3, such a program would produce correct results when fed 0 or 3 as input), the fact that a program is observed to ever produces correct results for a particular input would generally imply that it would always produce correct results <em>when fed that same input</em>.</p>
<p>In C, by contrast, there are a wide range of constructs over which the Standard waives jurisdiction, which will almost always be processed in sensible fashion, but might occasionally have arbitrary disruptive side effects.  Suppose a program would sometimes call a function like:</p>
<pre><code>unsigned mul(unsigned short x, unsigned short y) { return x*y; }
</code></pre>
<p>for values of <code>x</code> in the range <code>INT_MAX/y+1</code> to <code>UINT_MAX/y</code>.  Should the function be viewed as &quot;perfectly normal when targeting any machine designed in the last few decades&quot;, &quot;correct but non-portable&quot;, or &quot;erroneous&quot;?  Should it be expected to to be free of side effects in any build that isn't expressly configured to trap overflows, or should it be recognized as potentially affecting the behavior of calling code in weird and bizarre ways?</p>
<p>Such issues don't exist in Python.  Having as a first language one where constructs are unambiguously correct or erroneous seems better than having one where an implementation might process a construct in an expected manner 99.99% of the time, but <em>by design</em> process it nonsensically under rare and unpredictable circumstances.</p>

CC BY-SA 4.0
2024-02-12T19:48:55.787Z
2024-02-12T19:48:55.787Z
supercat
<p>At this moment, definitely <strong>Python</strong>. Because it's very easy to learn, understand and implement. Also very big and huge community around the world in terms of any help and support needed at any point of time, Large number of packages available based on the need, which simplifies and make programmers life easy, specially beginners. Also there is no need of programming concepts to be known/aware, while start learning <strong>Python</strong>.</p>

CC BY-SA 4.0
2021-05-20T05:59:46.063Z
2021-05-20T05:59:46.063Z
Ranjeet Kumar
<p>The question is actually more complex than it might  appear, and really the answer can depend on the context. For example, at what age are the students when they are first taught to program? Is this in Primary School, High School or part of an undergraduate programme? The answer might be different in each case.</p>
<p>It also depends on the purpose of teaching the initial programming language (IPL). Is the purpose to lead towards a practical skill (vocational programming), or is it to enable the teaching of some knowledge of algorithms (pedagogic programming), is it to enable the functioning of some devices (engineering programming) or is it to prepare students for further study? Each of these questions could lead to a different language as an IPL.</p>
<p>For a very early age start of programming one does not have to worry about employment or future curricula so something engaging is important, so tools such as MIT Scratch have a role. For later childhood Python fills a nice niche, particularly as it can run on a wide variety of inexpensive  platforms (such as Arduino's, Raspberry Pi and so forth) which  provides accessibility and make it within the reach of the classroom and individual students.</p>
<p>Conversely, if one is looking at an undergraduate IPL then it may depend on which degree programme is being considered. Is it a degree in Computer Science, Engineering, Biology, Chemistry or Physics? One would then need to take into account what graduate employers might be looking for and tailor to that market.</p>
<p>Python might have value in some of these programs but the students would also have to learn other languages at some point. For example, Computer Scientists would need a wider experience that would embrace C#, C++ (among others). Electronic Engineers might need <strong>C</strong>, but Computer Scientists less so. Biologists might need <strong>R</strong>, Chemists and Physicists might still  need Fortran!</p>
<p>However, I would say that I might never recommend <strong>C</strong> as an IPL, and would start at C++ even for the most hardened Electrical Engineer. I only show Computer Science students <strong>C</strong> in specific contexts (like working with flex and bison)!</p>
<p>One thing I say to my students in the course where I look at Languages is that there is no one <strong>best</strong> language. The choice of language for any particular situation is so very context dependent on resources available, skills available, the purpose of the programming and the end goal of the task, and for an IPL that advice still holds true.</p>

CC BY-SA 4.0
2021-04-23T20:33:28.977Z
Hear, hear!  I second "C only in specific contexts" -- languages are the second choice you make, with learning goals as the first choice -- and there are very few learning goals for which C is the best choice.  We use C in two different contexts within our 4-year program, and both are for well-considered reasons and fairly limited in scope.
Ben I.
CC BY-SA 4.0
2021-05-02T01:09:43.543Z
I thought it was funny that you used the abbreviation **IPL**. Of course you know what that meant for mainframe computers - deliberately loading the OS in a separate step between powering it on and then running user programs. So, teaching the initial programming language is exactly the same thing for students: you load the OS of how to program in to their heads. As we know, if you don't know where you are going, any road will get you there. People have learned to program using all sorts of languages and systems. We are very good at figuring things out.
Scott Rowe
CC BY-SA 4.0
2021-05-28T15:31:18.460Z
Never C or C++ as a first language. C++ only after you have mastered Object Orientation. And only for very specialist uses. I am not even sure that ever is the best for kernel, device-driver, fast-code, definitely not compilers. C may be good when studying HOW thinks work. Or defining the output of a compiler.
ctrl-alt-delor
CC BY-SA 4.0
2021-04-23T20:24:08.817Z
2021-04-23T20:24:08.817Z
Brian Tompsett - 汤莱恩
<p>I started teaching Python at NCSSM in  2004.  Here are some reasons I chose it.</p>
<ol>
<li><p>It is direct and simple, and there is not a whole ton of boilerplate to deal with at the beginning.  Hello, World looks like this</p>
<p>print(&quot;Hello, World&quot;)</p>
</li>
</ol>
<p>We all know what it looks like in Java (enclosing class needed) and C.</p>
<ol start="2">
<li><p>Delimitation occurs via whitespace.  Students who begin with Python tend to have excellent formatting habits when they learn other languages, because Python requires them.  There is a direct visual connection between the flow of a program and its appearance.</p>
</li>
<li><p>It's a professional tool.  Students don't &quot;outgrow&quot; Python.  It has a rich standard library and numerous third-party libraries that make it an awesome tool.</p>
</li>
<li><p>It supports OO, functional, and imperative programming paradigms</p>
</li>
<li><p>Memory management on the heap is largely abstracted away.</p>
</li>
<li><p>The built-in types provide a significant creative palette.   We teach our students to &quot;use wheels, not re-invent them.&quot;   An exception to this is when we are &quot;dissecting&quot; something to gain an understanding of how it works.</p>
</li>
<li><p>It runs on everything and web interfaces for it are freely available.</p>
</li>
</ol>
<p>Long experience shows that Python is an excellent language for beginners.</p>
<p>C is not great for beginners. However, it is very important.  In many ways it is the &quot;Latin&quot; of computer languages.  Every programmer should know it, because it lurks beneath the surface in so many places.  We teach it to students who are already proficient programmers.</p>

CC BY-SA 4.0
2021-05-18T13:03:32.263Z
+1 good answer..
Free Palestine
CC BY-SA 4.0
2021-05-18T12:48:48.777Z
2021-05-18T12:48:48.777Z
ncmathsadist
<p>Python is a fine language for learning algorithmic thinking and problem solving (see e.g. Downey's <a href="https://greenteapress.com/wp/think-python-2e" rel="noreferrer">&quot;Think Python&quot;</a> (Green Tea Press, 2nd edition 2016)). Python has an <em>enormous</em> ecosystem, including all the range of packages for simple tasks up to heavyweight systems like <a href="https://scipy.org" rel="noreferrer">SciPy</a> for all sorts of scientific computing, <a href="https://numpy.org" rel="noreferrer">NumPy</a> for numerical computation (included in the previous one) and <a href="https://www.sagemath.org" rel="noreferrer">SageMath</a> for  wide range of mathematical tools. It is also extensively used to program front-ends for administrative tools on many Linux distributions. Very far from a toy language, it usually ranks in the first places of language popularity.</p>
<p>C is a simple, low(ish) level language, very useful for tasks that require intimate access to the machine, like operating systems and all sort of system programs. There are good compilers available, that generate very efficient code. It's low-level nature with loopholes to allow fondling hardware at your heart's content, (somewhat) strict type system and lack of amenities like automatic garbage collection makes it harder to use (and a nightmare for newbies). Almost all software that you use daily is written in C.</p>
<p>Both have their place, which one to select depends on the time available (pick Python if there is time for learning other languages later on as needed; pick C if time is at a premium and that will be the later language of choice, but be prepared to spend a lot of time getting e.g. pointers and arrays across).</p>

CC BY-SA 4.0
2021-05-02T23:45:38.840Z
thanks... I like your answer
Free Palestine
CC BY-SA 4.0
2021-05-03T12:26:35.917Z
"Almost all software that you use daily is written in C" -- this doesn't seem right.  Most of the software we use on a daily basis has some C components, but it's often a tiny minority of the actual code.  (That's not to understate the *importance* of the code that tends to get written in C!)  Windows, for instance, has the kernel in C and... that's it.  Only one major browser uses C at all, and that only within the JavaScript engine.  While Android is built atop Linux, virtually none of what we actually *think of* as Android is built in C.  C is often an important minority.
Ben I.
CC BY-SA 4.0
2021-05-02T22:37:19.067Z
2021-05-02T22:37:19.067Z
vonbrand
<p>These days everybody is learning Python. I remember when we first started programming we were taught C Language. As a teacher which language should be taught first these days, C Language or Python?</p>

CC BY-SA 4.0
2021-04-23T20:38:02.497Z
This is a strangely constrained choice.  None of the above.  Why only these two?
Ben I.
CC BY-SA 4.0
2021-04-24T11:14:00.533Z
Maybe, also more context would be nice: What age? Are the students already into computers or do you want to excite them for the topic or do you want to give them something they could practically use later on the job? I also agree with Ben: why only these two? I would at least add in Javascript as choice to not confuse them with unnecessary things like classes.
DarkTrick
CC BY-SA 4.0
2021-04-24T12:35:42.467Z
I put only these two languages for choice as in some of the Asian countries like India etc. C is the first language that is taught to students. They learn the syntax, core concepts, and even the advanced concepts like pointers. In ICSC syllabus format they even use Java for grade 9, 10. and advanced Java with data structures like binary trees, etc. in grade 11, 12. But, now Python is being introduced to students...
Free Palestine
CC BY-SA 4.0
2021-04-25T23:15:54.317Z
I would only teach C before assembly -- to teach pointers and memory allocation, which are obscured in other languages, but not for a first language.
Erik Eidt
CC BY-SA 4.0
2021-05-03T19:07:25.150Z
Possible duplicate: https://cseducators.stackexchange.com/questions/212/is-it-more-effective-to-teach-low-level-languages-before-high-level-ones-or-vice
BrDaHa
<python><c>
First programming Language : C or Python?
# First programming Language : C or Python?

(Asked by: username_0 on 2021-04-22)

These days everybody is learning Python. I remember when we first started programming we were taught C Language. As a teacher which language should be taught first these days, C Language or Python?

**Tags:** python, c

> **Comments:**
> **username_1**: This is a strangely constrained choice.  None of the above.  Why only these two?  
> **username_2**: Maybe, also more context would be nice: What age? Are the students already into computers or do you want to excite them for the topic or do you want to give them something they could practically use later on the job? I also agree with Ben: why only these two? I would at least add in Javascript as choice to not confuse them with unnecessary things like classes.  
> **username_0**: I put only these two languages for choice as in some of the Asian countries like India etc. C is the first language that is taught to students. They learn the syntax, core concepts, and even the advanced concepts like pointers. In ICSC syllabus format they even use Java for grade 9, 10. and advanced Java with data structures like binary trees, etc. in grade 11, 12. But, now Python is being introduced to students...  
> **username_3**: I would only teach C before assembly -- to teach pointers and memory allocation, which are obscured in other languages, but not for a first language.  
> **username_4**: Possible duplicate: https://cseducators.stackexchange.com/questions/212/is-it-more-effective-to-teach-low-level-languages-before-high-level-ones-or-vice  

---

## 6 answers

### Answer by username_9 on 2021-04-23. Score: 11 | Accepted answer

The question is actually more complex than it might appear, and really the answer can depend on the context. For example, at what age are the students when they are first taught to program? Is this in Primary School, High School or part of an undergraduate programme? The answer might be different in each case.

It also depends on the purpose of teaching the initial programming language (IPL). Is the purpose to lead towards a practical skill (vocational programming), or is it to enable the teaching of some knowledge of algorithms (pedagogic programming), is it to enable the functioning of some devices (engineering programming) or is it to prepare students for further study? Each of these questions could lead to a different language as an IPL.

For a very early age start of programming one does not have to worry about employment or future curricula so something engaging is important, so tools such as MIT Scratch have a role. For later childhood Python fills a nice niche, particularly as it can run on a wide variety of inexpensive platforms (such as Arduino's, Raspberry Pi and so forth) which provides accessibility and make it within the reach of the classroom and individual students.

Conversely, if one is looking at an undergraduate IPL then it may depend on which degree programme is being considered. Is it a degree in Computer Science, Engineering, Biology, Chemistry or Physics? One would then need to take into account what graduate employers might be looking for and tailor to that market.

Python might have value in some of these programs but the students would also have to learn other languages at some point. For example, Computer Scientists would need a wider experience that would embrace C#, C++ (among others). Electronic Engineers might need **C**, but Computer Scientists less so. Biologists might need **R**, Chemists and Physicists might still need Fortran!

However, I would say that I might never recommend **C** as an IPL, and would start at C++ even for the most hardened Electrical Engineer. I only show Computer Science students **C** in specific contexts (like working with flex and bison)!

One thing I say to my students in the course where I look at Languages is that there is no one **best** language. The choice of language for any particular situation is so very context dependent on resources available, skills available, the purpose of the programming and the end goal of the task, and for an IPL that advice still holds true.

> **Comments:**
> **username_1**: Hear, hear!  I second "C only in specific contexts" -- languages are the second choice you make, with learning goals as the first choice -- and there are very few learning goals for which C is the best choice.  We use C in two different contexts within our 4-year program, and both are for well-considered reasons and fairly limited in scope.  
> **username_5**: I thought it was funny that you used the abbreviation **IPL**. Of course you know what that meant for mainframe computers - deliberately loading the OS in a separate step between powering it on and then running user programs. So, teaching the initial programming language is exactly the same thing for students: you load the OS of how to program in to their heads. As we know, if you don't know where you are going, any road will get you there. People have learned to program using all sorts of languages and systems. We are very good at figuring things out.  
> **username_10**: Never C or C++ as a first language. C++ only after you have mastered Object Orientation. And only for very specialist uses. I am not even sure that ever is the best for kernel, device-driver, fast-code, definitely not compilers. C may be good when studying HOW thinks work. Or defining the output of a compiler.  

---

### Answer by username_11 on 2021-05-18. Score: 6

I started teaching Python at NCSSM in 2004. Here are some reasons I chose it.

1. It is direct and simple, and there is not a whole ton of boilerplate to deal with at the beginning. Hello, World looks like this

   print("Hello, World")

We all know what it looks like in Java (enclosing class needed) and C.

2. Delimitation occurs via whitespace. Students who begin with Python tend to have excellent formatting habits when they learn other languages, because Python requires them. There is a direct visual connection between the flow of a program and its appearance.
3. It's a professional tool. Students don't "outgrow" Python. It has a rich standard library and numerous third-party libraries that make it an awesome tool.
4. It supports OO, functional, and imperative programming paradigms
5. Memory management on the heap is largely abstracted away.
6. The built-in types provide a significant creative palette. We teach our students to "use wheels, not re-invent them." An exception to this is when we are "dissecting" something to gain an understanding of how it works.
7. It runs on everything and web interfaces for it are freely available.

Long experience shows that Python is an excellent language for beginners.

C is not great for beginners. However, it is very important. In many ways it is the "Latin" of computer languages. Every programmer should know it, because it lurks beneath the surface in so many places. We teach it to students who are already proficient programmers.

> **Comments:**
> **username_0**: +1 good answer..  

---

### Answer by username_12 on 2021-05-02. Score: 5

Python is a fine language for learning algorithmic thinking and problem solving (see e.g. Downey's ["Think Python"](https://greenteapress.com/wp/think-python-2e) (Green Tea Press, 2nd edition 2016)). Python has an *enormous* ecosystem, including all the range of packages for simple tasks up to heavyweight systems like [SciPy](https://scipy.org) for all sorts of scientific computing, [NumPy](https://numpy.org) for numerical computation (included in the previous one) and [SageMath](https://www.sagemath.org) for wide range of mathematical tools. It is also extensively used to program front-ends for administrative tools on many Linux distributions. Very far from a toy language, it usually ranks in the first places of language popularity.

C is a simple, low(ish) level language, very useful for tasks that require intimate access to the machine, like operating systems and all sort of system programs. There are good compilers available, that generate very efficient code. It's low-level nature with loopholes to allow fondling hardware at your heart's content, (somewhat) strict type system and lack of amenities like automatic garbage collection makes it harder to use (and a nightmare for newbies). Almost all software that you use daily is written in C.

Both have their place, which one to select depends on the time available (pick Python if there is time for learning other languages later on as needed; pick C if time is at a premium and that will be the later language of choice, but be prepared to spend a lot of time getting e.g. pointers and arrays across).

> **Comments:**
> **username_0**: thanks... I like your answer  
> **username_1**: "Almost all software that you use daily is written in C" -- this doesn't seem right.  Most of the software we use on a daily basis has some C components, but it's often a tiny minority of the actual code.  (That's not to understate the *importance* of the code that tends to get written in C!)  Windows, for instance, has the kernel in C and... that's it.  Only one major browser uses C at all, and that only within the JavaScript engine.  While Android is built atop Linux, virtually none of what we actually *think of* as Android is built in C.  C is often an important minority.  

---

### Answer by username_5 on 2021-05-01. Score: 2

I can not answer directly because I know nothing about Python, but I first started to use C nearly 4 decades ago, and have used it for some really complex stuff. I love C# (I use it in the context of ASP.Net) and think it is very well designed and implemented. So, I would be biased no matter what, as you know, because you never forget your first language, which in my case was somewhere in the murky past of Basic, PDP-11 shell scripting, APL and Fortran, with punched cards and without...

Anyway: I would suggest that the concept of **Notional Machine** should be the absolutely most important consideration when first teaching anything about programming. Without a notional machine informing their understanding, students will know basically nothing about computing, and with a good foundation in one, they will know everything they need to know to learn new languages, systems, frameworks, etc, forever.

So, choose a language that actually teaches computing in a way that is *generative*, *extensible*, with *sound metaphors* and which has a *small grammar* that is not too powerful. In other words, something like C without too much preprocessor tricks or frameworks thrown in. Frameworks are the sauce, teach then how to cook first (colorful metaphor).

The problem is that there is such a forest of layers and tools now that actually seeing the machine in a way that contributes to notion-formation is very hard now. I would rather that students learn how to write simple command-line programs than know how to make a web site, because a lot of web site work is not really programming in any sense, it is just setting a lot of switches. And sadly, that misses the whole point of why we invented computers in the first place.

Without the idea of program, they are technicians, not creators. So choose wisely.

> **Comments:**
> **username_5**: And you should teach quality while you are at it.  
> **username_5**: When people assert that 'state' is the primary obstacle to understanding computers, this just completely dumbfounds me. Well, what more IS there to a computer than state? Really? What is a computer without state? A fancy set of lightswitches. People, please... get a clue.  
> **username_6**: +1 I like this answer a lot, thanks for writing it.  

---

### Answer by username_7 on 2024-02-12. Score: 1

In Python, if a program which is fed certain inputs produces certain outputs, then in the absence of deliberate randomness, those outputs will determined by the program and its inputs.  While it's possible that a program might be erroneous and yet produce correct output for some inputs (e.g. if a program is supposed to accept a number and output its square, but instead it simply multiplies the number by 3, such a program would produce correct results when fed 0 or 3 as input), the fact that a program is observed to ever produces correct results for a particular input would generally imply that it would always produce correct results when fed that same input.
In C, by contrast, there are a wide range of constructs over which the Standard waives jurisdiction, which will almost always be processed in sensible fashion, but might occasionally have arbitrary disruptive side effects.  Suppose a program would sometimes call a function like:
unsigned mul(unsigned short x, unsigned short y) { return x*y; }

for values of x in the range INT_MAX/y+1 to UINT_MAX/y.  Should the function be viewed as "perfectly normal when targeting any machine designed in the last few decades", "correct but non-portable", or "erroneous"?  Should it be expected to to be free of side effects in any build that isn't expressly configured to trap overflows, or should it be recognized as potentially affecting the behavior of calling code in weird and bizarre ways?
Such issues don't exist in Python.  Having as a first language one where constructs are unambiguously correct or erroneous seems better than having one where an implementation might process a construct in an expected manner 99.99% of the time, but by design process it nonsensically under rare and unpredictable circumstances.


---

### Answer by username_8 on 2021-05-20. Score: 1

At this moment, definitely **Python**. Because it's very easy to learn, understand and implement. Also very big and huge community around the world in terms of any help and support needed at any point of time, Large number of packages available based on the need, which simplifies and make programmers life easy, specially beginners. Also there is no need of programming concepts to be known/aware, while start learning **Python**.


---

