I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Its 20-100x times faster and uses 20-100x less RAM?
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Probably because compared to Python it's 20-100x harder to learn
55:55:44:44:4C
52:4C:52:42:41
Rose tinted glasses are difficult to see through.
52:4C:52:42:41
Rose tinted glasses are difficult to see through.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
I don't know... Basic cycles and other logic is almost same everywhere + not THAT hard...
You can do for example Fibonacci numbers in anything.
If someone want good readability I would expect they use Object Pascal with all its
type x := int
Begin
ReadLn(x);
WriteLn(x);
End
You can do for example Fibonacci numbers in anything.
If someone want good readability I would expect they use Object Pascal with all its
type x := int
Begin
ReadLn(x);
WriteLn(x);
End
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
- mahjongg
- Forum Moderator
- Posts: 14486
- Joined: Sun Mar 11, 2012 12:19 am
- Location: South Holland, The Netherlands
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
don't get me started on the uses of semicolons in Pascal.
An interpreted language will always be slower than a compiled language, but for learning (and much else) that doesn't matter.
An interpreted language will always be slower than a compiled language, but for learning (and much else) that doesn't matter.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
I am with you 100% on that one. Especially when it comes to CS schools that should be teaching the fastest most effecient way to do things, and how to figure out how to do it even better.Musketeer wrote: Its 20-100x times faster and uses 20-100x less RAM?
Have you ever looked at Perl and Python? They are way harder than C, I have yet to figure out how to do indirection (eg poitners) in Python, and indirection simplifies a lot of algorithms.Imperf3kt wrote: Probably because compared to Python it's 20-100x harder to learn
At university level?mahjongg wrote: An interpreted language will always be slower than a compiled language, but for learning (and much else) that doesn't matter.
Not to mention that using an interpreted language that is harder to learn than the compiled alternative??
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
I will admit, personal opinion heavily swayed my response, but yes, I have looked at all the languages mentioned here.
Python is my personal language of choice as it is easiest to me.
I frequently use Python, almost daily I am writing something with Python, even written games using a Python based engine (though I will admit, that is written in C and Cython as well)
55:55:44:44:4C
52:4C:52:42:41
Rose tinted glasses are difficult to see through.
52:4C:52:42:41
Rose tinted glasses are difficult to see through.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Musketeer,
When you are teaching a beginner about programming you want to start with simple things 'print ("Hello world")', then move step by step to more complex concepts, numbers, variables, assignment, statements, conditionals, loops, functions, etc. After all, all of programming is nothing more than: sequence, selection, iteration.
Starting from those simple beginnings, getting kids to write a main() function, and use the required includes, and have to worry about semi-colons, and explain the not obvious commands to compile and run the program, etc in C will be a lot slower and more confusing for them than just typing into a Python or other REPL.
Besides, that requires a C compiler and and a compilation step. At which point you have used far more RAM and run time than typing into a REPL and instantly getting a result.
It's the same reason BASIC was invented back in the day, and used successfully to introduce a generation or two of kids to programming.
Of course, I agree, soon after that initial experience they should move on to more efficient things. After all, Python causes global warming and climate change when used on a large scale.
I refute your premise there.Its 20-100x times faster and uses 20-100x less RAM?
When you are teaching a beginner about programming you want to start with simple things 'print ("Hello world")', then move step by step to more complex concepts, numbers, variables, assignment, statements, conditionals, loops, functions, etc. After all, all of programming is nothing more than: sequence, selection, iteration.
Starting from those simple beginnings, getting kids to write a main() function, and use the required includes, and have to worry about semi-colons, and explain the not obvious commands to compile and run the program, etc in C will be a lot slower and more confusing for them than just typing into a Python or other REPL.
Besides, that requires a C compiler and and a compilation step. At which point you have used far more RAM and run time than typing into a REPL and instantly getting a result.
It's the same reason BASIC was invented back in the day, and used successfully to introduce a generation or two of kids to programming.
Of course, I agree, soon after that initial experience they should move on to more efficient things. After all, Python causes global warming and climate change when used on a large scale.
Memory in C++ is a leaky abstraction .
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
@Heater:
The OP indicated they were talking about at university level, far from beginning programmers. The University level indication is in the title of the thread itself.
The OP indicated they were talking about at university level, far from beginning programmers. The University level indication is in the title of the thread itself.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Languages like python just lets you get stuff done far more easily than C (or even C++). You can run the code immediately rather than having a compile step. You can even experiment with calling functions interactively and inspecting the results. You can just write the code to do what you want to do rather than spend ages messing around with data structure design and memory management. When you make a mistake or misunderstand the interface to a library things are far more likely to fail cleanly rather than flying off into memory corruption hell.
Now the price you pay for that is lower execution speed. There are certainly cases where the effort to take a bunch of python code and rewrite it in C are worthwhile, but equally there are many cases where it is not. An awful lot of coding is just tying together libraries that do the heavy lifting and there are python wrappers for a lot of libraries.
Now the price you pay for that is lower execution speed. There are certainly cases where the effort to take a bunch of python code and rewrite it in C are worthwhile, but equally there are many cases where it is not. An awful lot of coding is just tying together libraries that do the heavy lifting and there are python wrappers for a lot of libraries.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Every time I look at these interpreted languages I keep yearning for the simplicity and precision of C.
There have been vast numbers of posts about xxxxBasic on this forum, but despite there being a fairly recent ISO standard (2008), none of the BASIC developers seem to abide by it (most I suspect are not even aware of it). So we have discussions about how a for loop should behave. Randomly chosen syntax at the whim of the developers. Weird syntax for doing things that are trivial and clean in C.
Then we have the Python 2/3 nonsense. That would not be acceptable in for C with its vast amount of existing code. The C standards progress slowly and carefully over decades. You may for example still use the old K&R style function definitions from 40+ years ago in modern C code (not that you would want to).
Then I see Javascript (and others) where I cannot look at the code and understand how basic arithmetic is being done. In C with its static typing, standardized type promotions etc, it is exact and well understood.
I see these languages being heavily reliant on anther language to get difficult stuff done (usually C).
Which adds the complication of mixing two languages and doesn't lead to confidence in the main language.
Even Fortran had a separate ISO standard just covering interoperability with C.
If I want to know precisely how something works in C, I can look at the ISO standard document. It is definitive and complete and the compilers follow it to the letter. They have to or they are defective.
There have been vast numbers of posts about xxxxBasic on this forum, but despite there being a fairly recent ISO standard (2008), none of the BASIC developers seem to abide by it (most I suspect are not even aware of it). So we have discussions about how a for loop should behave. Randomly chosen syntax at the whim of the developers. Weird syntax for doing things that are trivial and clean in C.
Then we have the Python 2/3 nonsense. That would not be acceptable in for C with its vast amount of existing code. The C standards progress slowly and carefully over decades. You may for example still use the old K&R style function definitions from 40+ years ago in modern C code (not that you would want to).
Then I see Javascript (and others) where I cannot look at the code and understand how basic arithmetic is being done. In C with its static typing, standardized type promotions etc, it is exact and well understood.
I see these languages being heavily reliant on anther language to get difficult stuff done (usually C).
Which adds the complication of mixing two languages and doesn't lead to confidence in the main language.
Even Fortran had a separate ISO standard just covering interoperability with C.
If I want to know precisely how something works in C, I can look at the ISO standard document. It is definitive and complete and the compilers follow it to the letter. They have to or they are defective.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Other fun part - lots of Javists tell you "C is hard to learn!" yet their API is like 99.99 % bigger! 
C is pure = it is simple!
C has "just enough" language + tools to do anything.

C is pure = it is simple!

C has "just enough" language + tools to do anything.
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Every CS student should write just a few lines of assembler so they quickly understand whats really going on under the cover. Maybe a hundred lines or so would be enough.
Then concentrate on popular HLL's.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
They could write something simple in various languages and see the speed.
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
DavidS,
Besides, as noted by Eben Upton when he tells the story of why he conceived the Pi, and as noted by myself when watching the online videos of undergraduate CS courses at Berkeley and MIT, those kids coming to university to study CS have no idea about programming. They get remedial programming education from the ground up in Python, and a version of Scratch last I saw. Ten years ago it was Scheme.
That is the CS guys, for those studying other sciences it is even less likely they know anything about programming when the hit "science school"
I think my technical school had it right back in 1974. Us teenagers were introduced to programming with BASIC. After a few weeks of that we were taught assembler. We had to do projects in both and at the end of the year we were examined in both.
Following that was university, guess what, the under grads were being taught BASIC. I had to go my own way to pursue ALGOL.
No they did not. The only mention of "university" here is by you.The OP indicated they were talking about at university level, far from beginning programmers. The University level indication is in the title of the thread itself.
Besides, as noted by Eben Upton when he tells the story of why he conceived the Pi, and as noted by myself when watching the online videos of undergraduate CS courses at Berkeley and MIT, those kids coming to university to study CS have no idea about programming. They get remedial programming education from the ground up in Python, and a version of Scratch last I saw. Ten years ago it was Scheme.
That is the CS guys, for those studying other sciences it is even less likely they know anything about programming when the hit "science school"
I think my technical school had it right back in 1974. Us teenagers were introduced to programming with BASIC. After a few weeks of that we were taught assembler. We had to do projects in both and at the end of the year we were examined in both.
Following that was university, guess what, the under grads were being taught BASIC. I had to go my own way to pursue ALGOL.
Memory in C++ is a leaky abstraction .
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Heater wrote: ↑Thu Jul 11, 2019 12:15 pmDavidS,No they did not. The only mention of "university" here is by you.The OP indicated they were talking about at university level, far from beginning programmers. The University level indication is in the title of the thread itself.
Besides, as noted by Eben Upton when he tells the story of why he conceived the Pi, and as noted by myself when watching the online videos of undergraduate CS courses at Berkeley and MIT, those kids coming to university to study CS have no idea about programming. They get remedial programming education from the ground up in Python, and a version of Scratch last I saw. Ten years ago it was Scheme.
That is the CS guys, for those studying other sciences it is even less likely they know anything about programming when the hit "science school"
I think my technical school had it right back in 1974. Us teenagers were introduced to programming with BASIC. After a few weeks of that we were taught assembler. We had to do projects in both and at the end of the year we were examined in both.
Following that was university, guess what, the under grads were being taught BASIC. I had to go my own way to pursue ALGOL.
I used this as kiddo: https://en.wikipedia.org/wiki/Karel_(pr ... _language)
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
That I did not know, could you provide a link to the ISO standard for BASIC? Also how does it compare to the ANSI Standard (which was based on structured Darthmouth BASIC 5).jahboater wrote: ↑Thu Jul 11, 2019 8:01 amEvery time I look at these interpreted languages I keep yearning for the simplicity and precision of C.
There have been vast numbers of posts about xxxxBasic on this forum, but despite there being a fairly recent ISO standard (2008), none of the BASIC developers seem to abide by it (most I suspect are not even aware of it). So we have discussions about how a for loop should behave. Randomly chosen syntax at the whim of the developers. Weird syntax for doing things that are trivial and clean in C.
Agreed.I see these languages being heavily reliant on anther language to get difficult stuff done (usually C).
Which adds the complication of mixing two languages and doesn't lead to confidence in the main language.
Even Fortran had a separate ISO standard just covering interoperability with C.
If I want to know precisely how something works in C, I can look at the ISO standard document. It is definitive and complete and the compilers follow it to the letter. They have to or they are defective.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
https://webstore.ansi.org/standards/inc ... 91991r2005
However, that says it was revised in 2005, I am sure I read somewhere it was revised again in 2008.
I have read that ISO adopted the ANSI standard, so I am not convinced they are much different.
Here is list of standards from Wikipedia:
Code: Select all
ANSI/ISO/IEC Standard for Minimal BASIC:
ANSI X3.60-1978 "For minimal BASIC"
ISO/IEC 6373:1984 "Data Processing — Programming Languages — Minimal BASIC"
ECMA-55 Minimal BASIC (withdrawn, similar to ANSI X3.60-1978)
ANSI/ISO/IEC Standard for Full BASIC:
ANSI X3.113-1987 "Programming Languages Full BASIC"
INCITS/ISO/IEC 10279-1991 (R2005) "Information Technology – Programming Languages – Full BASIC"
ANSI/ISO/IEC Addendum Defining Modules:
ANSI X3.113 Interpretations-1992 "BASIC Technical Information Bulletin # 1 Interpretations of ANSI 03.113-1987"
ISO/IEC 10279:1991/ Amd 1:1994 "Modules and Single Character Input Enhancement"
ECMA-116 BASIC (withdrawn, similar to ANSI X3.113-1987)
Last edited by jahboater on Thu Jul 11, 2019 2:33 pm, edited 2 times in total.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
You don't really need pointers in scripting languages. You've got arrays (lists) and hashes (dictionaries). Both can be dynamic and you don't have to worry about allocation and cleaning up. Scripting languages also bring huge libraries of tested code that you don't have to spend years developing, so in their own way, you can get results much more quickly than in C.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
If you think you need pointers to program in Python you have totally missed the point (get it
)
I would wager that pointers make thinking about code harder and that historically errors using pointers is high up on the list causes of bugs, even among skilled, experienced programmers. Pointers certainly make any formal reasoning about the correctness of a program very hard if not impossible. Use of pointers in C and C++ can make it impossible for the compiler to perform many optimizations.
Apart from all that I like a good pointer as much as the next nerd.

I would wager that pointers make thinking about code harder and that historically errors using pointers is high up on the list causes of bugs, even among skilled, experienced programmers. Pointers certainly make any formal reasoning about the correctness of a program very hard if not impossible. Use of pointers in C and C++ can make it impossible for the compiler to perform many optimizations.
Apart from all that I like a good pointer as much as the next nerd.
Memory in C++ is a leaky abstraction .
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
I think you are saying that pointers are to data what goto's are to program control flow.Heater wrote: ↑Thu Jul 11, 2019 2:56 pmI would wager that pointers make thinking about code harder and that historically errors using pointers is high up on the list causes of bugs, even among skilled, experienced programmers. Pointers certainly make any formal reasoning about the correctness of a program very hard if not impossible.
But yes, its hard to imagine working without them.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
How would you describe Javist how much improvement of speed can be gained in program by using pointers in C?
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Instead of what? Using Java?
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Precisely, boss!
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!
Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
You could take a close look at the assembler code emitted by the compiler.
You can see that quite a lot of the time, the main registers will contain pointers (addresses) instead of other data values.
That's not saying you have to use pointers all time, its just interesting that the hardware totally relies on them.
BTW, In C, array[index] is the same as *(array + index), but the former is more readable. Interpreted languages don't have that sort of direct relationship with the hardware, so pointers are unusual, unless you count things like peek() and poke() in BASIC.
You can see that quite a lot of the time, the main registers will contain pointers (addresses) instead of other data values.
That's not saying you have to use pointers all time, its just interesting that the hardware totally relies on them.
BTW, In C, array[index] is the same as *(array + index), but the former is more readable. Interpreted languages don't have that sort of direct relationship with the hardware, so pointers are unusual, unless you count things like peek() and poke() in BASIC.