JFamily
Posts: 27
Joined: Tue Aug 11, 2015 1:40 am

Learn C or Python first?

Fri Jan 06, 2017 6:39 pm

Hello, I'm interested in getting back to programming. My history has always been with web development, the languages I've learned (several years ago) are: (x)HTML(5.0)/CSS, PHP, SQL, and javascript (very basic).

I want to learn both C and Python, I just don't know which one I should start with so I'm making this post as a bit of a poll.

I understand C is a much more top level (correct term?) language, in which other languages and entire OS's have been written with. Where Python is a much more basic language in which I could make a simple game, calculator, or whatever, but will never roll up my own OS or do anything truly ground breaking with it.

Without actually spending any time reading existing Python code, and only reading some C code, I would venture to say Python will be much more natural to pick up on. My fear is, will it make me more hesitant to get deeper into programming, and learn C?

What languages have you all learned, what order did you learn them in, and would you do it the same way again?

My ultimate goal is, that I want to learn more about Linux, eventually contribute to any applications I pick up an interest in, and possibly develop my own application(s) if I ever come up with an original idea. I also want to have some more fun with the Raspberry, I have home automation projects in mind, replacing the stereo and HVAC controls in my car, etc. At this point, all my Pi's do is play movies and occasionally retro games, I want to expand that to something less 'end-user'

I'm leaning towards C because I already have an appreciation for languages on the same-ish level as Python (PHP), so the only thing Python would do is put another language under my belt -- but also help me transition into application, rather than web programming -- hence my hesitation
I'm notoriously terrible at being concise.
RaspberryPi 3 / SanDisk Ultra 8GB Class 10 / Raspbian Jessie / Kodi v15.2
RaspberryPi 2 / SanDisk Ultra 8GB Class 10 / Raspbian Jessie / PleXMBC (wip)

User avatar
buja
Posts: 507
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: Learn C or Python first?

Fri Jan 06, 2017 7:25 pm

Funny, I would say things are the other way around: C is the more basic and low level language and Python is the high level language that will get you going a lot faster than C does in terms of programming effort (number of programming instructions/program lines). Python will take care of a lot of details that you will have to program yourself in C.

Both are general programming languages. C programs will be faster because they are compiled, but pure execution speed may not be the most important factor when all you want to do is control some hardware though the GPIO's.

I learned Pascal in technical college years ago and later C on my own, and I am trying to pick up Python now. Pascal and C are very similar, but Python is quite different.

On the Pi I would recommend learning Python first, because it has excellent support on the Pi. In fact, almost every hardware extension has great support in Python, but only limited support in C (for example Explorer HAT, Sense HAT, etc.).

User avatar
DougieLawson
Posts: 36515
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Learn C or Python first?

Fri Jan 06, 2017 7:29 pm

Once you've learned one language the next twenty five are just a case of learning the differences and syntactic anomalies.

Python being an interpreted language gives instant gratification: edit, save, test, repeat. The compiled languages have a longer sequence: edit, save, compile, edit out the compiler errors, save, compile, test, repeat.

I dislike python because there's the inconsistent differences between python2 and python3 and the insane use of lefthand white space as a syntax construct. 99.9% of problems on here with python are one or the other of those. The remaining 0.1% are due to failing to read the docs for a python library function.

If you're going to learn python assume that python2 never existed.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

jahboater
Posts: 4824
Joined: Wed Feb 04, 2015 6:38 pm

Re: Learn C or Python first?

Fri Jan 06, 2017 7:34 pm

JFamily wrote:I want to learn both C and Python, I just don't know which one I should start with so I'm making this post as a bit of a poll.
Good choices IMHO - they are both the "go to" languages when you want to realy get things done. They are included as standard on the Pi and there is good support for them. The main GPIO library support is for C and Python.
JFamily wrote:I understand C is a much more top level (correct term?) language, in which other languages and entire OS's have been written with.
I'm not sure I'd call C "top" level. Its fairly close to the machine with a good correspondence between its data types and operations and those of the hardware. So it is very fast. Yet at the same time portable.
Yes, it is widely used for the "system" software you mention and more. In fact over half the worlds software is written in C.
JFamily wrote:What languages have you all learned, what order did you learn them in, and would you do it the same way again?
Pascal, Fortran, B, Algol 60, Algol 68, Forth, various assemblers, BCPL, REXX, C, Lisp and others I cant remember. Mostly long ago. Now I generally use C, with a little bit of python, and some assembler for fun.
Last edited by jahboater on Fri Jan 06, 2017 8:41 pm, edited 1 time in total.

User avatar
bensimmo
Posts: 4187
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Learn C or Python first?

Fri Jan 06, 2017 7:48 pm

Whatever happened to C++?
When I was young fresh out of Basic and looking to self teach the next thing. C++ and Pascal were always the ones mentioned and C was the one not to do.
(Must be early/mid 90s)

Heater
Posts: 13859
Joined: Tue Jul 17, 2012 3:02 pm

Re: Learn C or Python first?

Fri Jan 06, 2017 8:11 pm

@DougieLawson,
Once you've learned one language the next twenty five are just a case of learning the differences and syntactic anomalies.
I know what you mean. In my time I have had to learn and use: BASIC, Algol, C, C++, Pascal, Ada, Coral 66, PL/M 86, Lucol, and no doubt a few others I forget.

That was fun along the way but at some point I realized I have wasted thousands of hours of my life learning new syntaxes for the same old concepts. Same old "structured programming" with a different emphasis on types and such here and there. It's depressing.

On the other hand. There are languages that are genuinely different. Presenting new concepts, not just syntactic differences. For example:

lisp, scheme, haskell, forth, erlang, occam.

How I wish I had been paid to learn those different views of programming with some of those different languages.

Python, meh, same old, same old. Worse it has no recognized standard and keeps changing.

No, what you want is Javascript. It's event driven model is wonderful. No fussing with stupid types and such. Has high level concepts like first class functions, lambdas, closures etc that languages like Java and C++ are only now catching up with.



@bensimmo,
Whatever happened to C++?
Still going strong. C++ is what people write Python and Javascript run times in. After they have done that there is little need for the rest of us to use that freak show of a language.
Memory in C++ is a leaky abstraction .

jb63
Posts: 131
Joined: Mon May 11, 2015 6:41 pm
Location: Chicago, USA
Contact: Website

Re: Learn C or Python first?

Fri Jan 06, 2017 8:52 pm

I started with Fortran 77 (anyone remembers that?) then moved onto C (Kernighan & Ritchie), then Visual C++, and ultimately I ended up using Matlab more than any others (for work). At home (hobby), it's primarily C (Arduino) and Python (RPI).

Now, as others have said on here, C is a very 'low-level' programming language, in the sense that you can do bit/byte level manipulation (very powerful), accessing hardware, etc rather easily. BUT, while some see this as powerful, others see it as prone to errors and a recipe for disasters.

If you're after manipulating large data sets (e.g. multi-dimensional matrices), then with C, you need to learn about pointers and handles (pointer to a pointer), then you have linked lists, ... and it gets even more involved. There are libraries you can call/use but typically those need to be purchased. Also, a C program is NOT always the easiest to read. In fact, I recall some competitions many years ago where the contenders were to write the most 'confusing' piece of code, to do the simplest of tasks (increment a counter).

In contrast, if you're after 'readability' of your code, then Python is the way to go.

I see them (C/Python or C/Matlab) as complementary. If you have ambitions to write serious code to access hardware, graphics, etc ... then C is the way to go. If you're after quick calculations and visualization of your data, stick with Python. Ideally? .. learn both :)

Oh, one more thing:

- Python (and Matlab) is an interpreted language, where instructions are read one at a time and executed
- C must be compiled first, and that typically makes it run FASTER than Python.
Last edited by jb63 on Fri Jan 06, 2017 8:57 pm, edited 1 time in total.

JFamily
Posts: 27
Joined: Tue Aug 11, 2015 1:40 am

Re: Learn C or Python first?

Fri Jan 06, 2017 8:56 pm

buja wrote:Funny, I would say things are the other way around: C is the more basic and low level language and Python is the high level language that will get you going a lot faster than C does in terms of programming effort (number of programming instructions/program lines). Python will take care of a lot of details that you will have to program yourself in C.
Cool, that's more or less what I was trying to express
buja wrote:On the Pi I would recommend learning Python first, because it has excellent support on the Pi. In fact, almost every hardware extension has great support in Python, but only limited support in C (for example Explorer HAT, Sense HAT, etc.).
That's the direction I was leaning; I'm just afraid I'll learn Python, be satisfied, and not go any deeper.
DougieLawson wrote:Once you've learned one language the next twenty five are just a case of learning the differences and syntactic anomalies.

Python being an interpreted language gives instant gratification: edit, save, test, repeat. The compiled languages have a longer sequence: edit, save, compile, edit out the compiler errors, save, compile, test, repeat.
True. After I had a pretty good grasp on PHP, I started reading ASP code and quickly saw that they are more or less the same language with different syntax and rules. With a good understanding of PHP, I could easily read and understand ASP code (I just couldn't write it)
DougieLawson wrote: If you're going to learn python assume that python2 never existed.
Noted :)
bensimmo wrote:Whatever happened to C++?
When I was young fresh out of Basic and looking to self teach the next thing. C++ and Pascal were always the ones mentioned and C was the one not to do.
(Must be early/mid 90s)
When I was young (in the mid 90's, about 3rd/4th grade), the first language I tried to take a crack at was C++. I learned a bit, wrote some hello world, a simple game, and some other stuff I can't remember. But was ultimately turned off from the language (not really sure what turned me off about it... I was young though). So I dropped it, and began my path to learn internet languages. I'm happy this happened, because it quickly evolved to building a 'server' (old computer w/ linux, apache, php, mysql installed), and of course learning about/how-to-use linux.
Heater wrote:Worse it has no recognized standard and keeps changing.
:shock:
Heater wrote:@bensimmo,
Whatever happened to C++?

Still going strong. C++ is what people write Python and Javascript run times in. After they have done that there is little need for the rest of us to use that freak show of a language.
Maybe that is what turned me off, and I just didn't have the words for it!


Thank you all for the responses! I can now mull it over a little more :)
I'm notoriously terrible at being concise.
RaspberryPi 3 / SanDisk Ultra 8GB Class 10 / Raspbian Jessie / Kodi v15.2
RaspberryPi 2 / SanDisk Ultra 8GB Class 10 / Raspbian Jessie / PleXMBC (wip)

JFamily
Posts: 27
Joined: Tue Aug 11, 2015 1:40 am

Re: Learn C or Python first?

Fri Jan 06, 2017 9:06 pm

jb63 wrote:I started with Fortran 77 (anyone remembers that?) then moved onto C (Kernighan & Ritchie) ... ultimately I ended up using Matlab more than any others.

Now, as others have said on here, C is a very 'low-level' programming language, in the sense that you can do bit/byte level manipulation, accessing hardware, etc rather easily. BUT, while some see this as powerful, others see it as prone to errors.

If you're after manipulating large data sets (e.g. multi-dimensional matrices), then you need to learn about pointers and handles (pointer to a pointer), then you have linked lists, ... and it gets even more involved. There are libraries you can call/use but typically those need to be purchased. Also, a C program is NOT always the easiest to read. In fact, I recall some competitions many years ago where the contenders were to write the most 'confusing' piece of code, to do the simplest of tasks (increment a counter).

In contrast, if you're after 'readability' of your code, then Python is the way to go.

I see them (C/Python or C/Matlab) as complementary. If you have ambitions to write serious code to access hardware, graphics, etc ... then C is the way to go. If you're after quick calculations and visualization of your data, stick with Python. Ideally? .. learn both :)
Indeed. I was backwards in my phrasing (left-handed problems?). I've been down the quick calculations, visualization of data, save-test-edit-save-test-edit road with PHP. I'm definitely planning to learn both, just trying to decide which to learn first.

I've been reading the Unix philosophy. I would/will/have strive(d) to make readable code. Nothing gets me more excited than being able to read a chunk of code and completely understand it without digging through 30 different included files. Some of my biggest mistakes when learning PHP involved making something overly complex.
I'm notoriously terrible at being concise.
RaspberryPi 3 / SanDisk Ultra 8GB Class 10 / Raspbian Jessie / Kodi v15.2
RaspberryPi 2 / SanDisk Ultra 8GB Class 10 / Raspbian Jessie / PleXMBC (wip)

Sleep Mode zZ
Posts: 319
Joined: Sun Aug 19, 2012 5:56 am
Location: Finland

Re: Learn C or Python first?

Fri Jan 06, 2017 9:46 pm

JFamily wrote: Without actually spending any time reading existing Python code, and only reading some C code, I would venture to say Python will be much more natural to pick up on. My fear is, will it make me more hesitant to get deeper into programming, and learn C?
There are many Pythonistas who have extended their interests into C. The standard Python interpreter is written in C - so you will learn C if you get interested in the implementation details of the interpreter. Or, alternatively, you might end writing a Python program that just is not fast enough for you - and, instead of writing the whole program in a faster language, you might write a Python module in C and use that in your Python program to speed things up. Or maybe you would need some functionality for your Python program but there just is not a library available and you have to write your own - in C. The Python/C combo is a natural one, and should be very powerful.

peterlite
Posts: 720
Joined: Sun Apr 17, 2016 4:00 am

Re: Learn C or Python first?

Fri Jan 06, 2017 10:12 pm

Read MagPi, https://www.raspberrypi.org/magpi/, pick a project of interest to you then learn the language used in the project. Learn the other language when you work on a project using the other language.
https://www.raspberrypi.org/magpi/issue ... ials-c-v1/
https://www.raspberrypi.org/magpi/issue ... ames-vol1/

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Learn C or Python first?

Fri Jan 06, 2017 10:13 pm

JFamily wrote:I want to learn both C and Python, I just don't know which one I should start with My fear is, will it make me more hesitant to get deeper into programming, and learn C?
I would start with bash and do the sorts of simple scripts, or not simple ones, that everyone needs to improve their use of their systems. Then you can learn by doing and that makes it more interesting. Since bash is a million times crazier than Python and C combined, figure it out and you'll be fine anywhere.

I think before you do a project in C, you should justify why you are doing it in C. If it's just to learn C, fine, but it is going to be harder than a more modern and helpful language when doing higher level things. Low level things are where C makes a lot of sense.

As pointed out already, there is a lot of noise from Python 2.7 on google, which is still heavily used, and since you should be learning Python 3.x, this is just added trouble. You can't really just ignore it though because sometimes the answer will be given to you in Python 2.7 and you'll have to change it a little to make it work in 3.x. The same sort of problem has happened with Perl 5.x and Perl 6, although it seems the uptake rate to version 6 there is about ten times worse.

ejolson
Posts: 3792
Joined: Tue Mar 18, 2014 11:47 am

Re: Learn C or Python first?

Sat Jan 07, 2017 10:39 pm

JFamily wrote:I want to learn both C and Python, I just don't know which one I should start with
I learned BASIC before C, which is similar to learning Python first. However there is a lot to recommend learning C, especially of you are an adult and already have some computer experience.

On Unix and Unix-like systems such as Raspbian the C programming language plays a unique role of being the system programming language. In particular, the Linux kernel, device drivers, supporting libraries, X windows and many user-space programs such as ls, cat and grep are written in C. All this legacy code demonstrates that C is a productive language which is likely to remain relevant for some time. Moreover, knowing how to read and write C programs allows one to start understanding how all that software actually works.

C itself has been kept up to date with addition of type-safe prototypes in 1989, stack-allocated variable-length arrays and complex numbers in 1999 along with Unicode variable names and who knows what else in 2011. There has also been significant investment in creating high-quality compilers for new computer architectures. Finally, knowing C is a reasonable start to understanding a whole family of C-like programming languages: C++, C# and Objective C for object oriented programming, OpenCL, MPI, CUDA and Cilk for parallel programming. Even Java, Swift and Go have notable similarities with C.
Last edited by ejolson on Mon Jan 09, 2017 6:23 am, edited 1 time in total.

jahboater
Posts: 4824
Joined: Wed Feb 04, 2015 6:38 pm

Re: Learn C or Python first?

Sun Jan 08, 2017 12:14 am

+100%

Thanks for the well written post!

jb63
Posts: 131
Joined: Mon May 11, 2015 6:41 pm
Location: Chicago, USA
Contact: Website

Re: Learn C or Python first?

Mon Jan 09, 2017 9:35 pm

ejolson wrote:Moreover, knowing how to read and write C programs allows one to start understanding how all that software actually works.
Absolutely correct. I 'understood' many of the computer's architecture/logic from simply learning/using C. Then, the idea of files stored in non-contiguous locations haunted me for sometime, until I discovered some tools that not only confirmed that, but offered a way to de-fragment files. Possibly the best 'introductory' example is that of pointers in C. It took a while, but once you understand that, many more ideas open up 'naturally'.
ejolson wrote: stack-allocated variable-length arrays and complex numbers
I wrote a DOS-based application for machinery diagnostics back in 1989 ... but back then it was dynamic memory allocation with malloc and realloc ... and the error codes returned by such function calls were everything but trivial.

User avatar
Michiel O.
Posts: 178
Joined: Mon Dec 12, 2016 12:06 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 1:21 pm

DougieLawson wrote:Once you've learned one language the next twenty five are just a case of learning the differences and syntactic anomalies.
That'll go a long way indeed. But... the 26th will be Clojure, the 27th will be Haskell, and the 28th PROLOG.
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes

User avatar
Michiel O.
Posts: 178
Joined: Mon Dec 12, 2016 12:06 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 1:30 pm

jb63 wrote:Python is an interpreted language, where instructions are read one at a time and executed
Python is compiled to bytecode, just like Java and C#. Then, a 'virtual machine' or a 'runtime' executes the bytecode. This is different than for example Shell or Tk, where the source instructions are parsed again and again and again, which makes them much slower.
C must be compiled first, and that typically makes it run FASTER than Python.
The reason that C runs faster is that it is much closer to the metal. Some would call C even a 'glorified assembler language'. There are tons of things Python does for you which C doesn't, like memory management and garbage collection, very nice data types and collections, object orientation throughout, dynamic typing.

There's good reason Python has grown so popular in the last 25 years. It optimizes for programmer time, not runtime. And when computers get faster and faster, it's the time that someone has to put into programming what matters the most.

I find that I can often write the same program roughly ten times quicker in Python than in C.
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes

User avatar
Michiel O.
Posts: 178
Joined: Mon Dec 12, 2016 12:06 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 1:35 pm

Heater wrote:C++ is what people write Python and Javascript run times in.
Not sure about JavaScript, but the Python runtime (CPython's runtime at least) is not written in C++, but in plain C.
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes

Heater
Posts: 13859
Joined: Tue Jul 17, 2012 3:02 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 2:11 pm

Michiel O.
but the Python runtime (CPython's runtime at least) is not written in C++, but in plain C.
Interesting. I guess that makes it easier to add C functions to Python programs.

Mind, I don't make much distinction between C and C++ now a days. Happy to use both as lonk as I can keep away from the unintiligible stuff in C++ (Most of it).

Anyway, I thought the OP's question over and come to a conclution:

Learn C first.

Skip Python and move onto something standardized and more universal. Something that will introcduce you to whole new styles of programming ("paradigms" as they say): Javascript. See node.js.
Memory in C++ is a leaky abstraction .

jahboater
Posts: 4824
Joined: Wed Feb 04, 2015 6:38 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 2:14 pm

Michiel O. wrote:Python is compiled to bytecode, just like Java and C#.
C must be compiled first, and that typically makes it run FASTER than Python.
The reason that C runs faster is that it is much closer to the metal.
It is, but think about this: Python is compiled into bytecode on-the-fly probably a line at a time. That means the compilation must be quick with little optimization or the program would run terribly slowly. It certainly cannot take into account surrounding code. As noted above, C compiles the entire program first, with no time constraints. That means the whole program can take part in the optimization and many complex passes can be done leading to some very clever optimizations.

The fact that the Python run-time is written in C doesn't surprise me, but it is sad when a general purpose language (which is so powerful you can code things ten times as quickly :D ) cannot even run itself but has to depend on another, supposedly inferior language.

Finally, C has been around for some 45 years, with new standards, but no one change broke it as badly as the Python2 vs Python 3 nonsense.

Actually this debate is wrong, both languages are good, just intended for very different purposes, and so should not be compared.

Heater
Posts: 13859
Joined: Tue Jul 17, 2012 3:02 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 2:53 pm

jahboater,
Python is compiled into bytecode on-the-fly probably a line at a time. That means the compilation must be quick with little optimization or the program would run terribly slowly.
I have no idea what Python actually does but it is terrible slow. An order of magnitude slower than Javascript. At least when comparing the "python" command on a Raspi to "node".

This is such a problem Google built a Python to Go "transpiler" https://github.com/google/grumpy
The fact that the Python run-time is written in C doesn't surprise me, but it is sad when a general purpose language (which is so powerful you can code things ten times as quickly :D ) cannot even run itself but has to depend on another, supposedly inferior language.
I used to think that as well. "Interpreted languages, bah, useless, they cannot even rebuild themselves"

I don't worry about it so much anymore. Javascript is built in C++. They are very different languages. I would not want to modify JS such that it could rebuild it's own run time. Because then JS would end up looking like C++ and who would want that nightmare?!

Or perhaps it's because JS manages to run upto 65% the speed of compiled C++.

Actually... In theory one could transpile the C++ source of the Clang/LLVM C++ compiler into Javascript using Emscriten. Then run that new compiler under node.js. Use that compiler, running under node, to rebuild the node.js run time. In that tortuous way I believe JS could actually rebuild itself....
Memory in C++ is a leaky abstraction .

User avatar
Michiel O.
Posts: 178
Joined: Mon Dec 12, 2016 12:06 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 3:54 pm

it is sad when a general purpose language (which is so powerful you can code things ten times as quickly :D ) cannot even run itself
It can. There exist many implementations of Python. However, most of the time when people say Python, they mean CPython. PyPy is written in Python and can compile and run Python, and do optimisations, and when the program runs the JIT compiler will convert the running program to machinecode.
...but has to depend on another, supposedly inferior language.
C is not inferior to Python, it just has a different place in the spectrum of programming languages. It is somewhat less high-level than Python, Swift and Ruby etc... but certainly not inferior. It depends on what you want to do with a language. If you need to do data extractions from relational tables in a database you'd probably use SQL instead of machine code. But if you have to write a boot program for an embedded system, machine code is the way to go.

In what language do you think the GNU C Compiler is written in?
Finally, C has been around for some 45 years, with new standards, but no one change broke it as badly as the Python2 vs Python 3 nonsense.
Yeah, C was my fourth language (after assembly, FORTRAN, Basic). Your statement about Python seems a bit biased to me, it isn't that bad. I write both and the differences are minimal from the perspective of an application programmer.
Actually this debate is wrong, both languages are good, just intended for very different purposes, and so should not be compared
I agree! I switched to Python from C++ because of the nice, clean data structures and lack of arcane syntax. The indent-by-whitespace I found ridiculous, but only for 20 minutes or so. I was used to correctly indenting my source codes anyway, regardless of language.
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes

jahboater
Posts: 4824
Joined: Wed Feb 04, 2015 6:38 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 4:23 pm

Michiel O. wrote: C is not inferior to Python, it just has a different place in the spectrum of programming languages.
Well said!
In what language do you think the GNU C Compiler is written in?
Its actually in C (of course) though I believe the "official" language changed to C++ a few years ago.
Finally, C has been around for some 45 years, with new standards, but no one change broke it as badly as the Python2 vs Python 3 nonsense.
Yeah, C was my fourth language (after assembly, FORTRAN, Basic). Your statement about Python seems a bit biased to me, it isn't that bad. I write both and the differences are minimal from the perspective of an application programmer.
I agree its not too bad. But the fact is there is still this division, old libraries in v2 that cant be updated, questions on the forum "shall I learn python 2 or 3", basic arithmetic (/) changing meaning, and so on. You didn't see any of that when C11 appeared.

Heater
Posts: 13859
Joined: Tue Jul 17, 2012 3:02 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 4:51 pm

Michiel O.

Man that PyPy thing is complex. From wikipedia:

"The PyPy project has developed a tool chain that analyzes RPython code and translates it into C code,which is then compiled to produce a native interpreter."

So Python still relies on a C to be able to reproduce itself.

According to the PyPy site the JIT only works on x86.
Memory in C++ is a leaky abstraction .

jahboater
Posts: 4824
Joined: Wed Feb 04, 2015 6:38 pm

Re: Learn C or Python first?

Tue Jan 10, 2017 4:56 pm

Heater wrote: "The PyPy project has developed a tool chain that analyzes RPython code and translates it into C code,which is then compiled to produce a native interpreter."
Which then has to interpret the Python code.
Yes, a tortuous route.

Give me C, compiled straight into machine instructions!

Return to “General programming discussion”