6 ms·
It seems the only argument for pushing Python is that it sidesteps the need to understand fundamental programming concepts. Sure Python is easy to read and easy
by Cakez0r 12y ago
It seems the only argument for pushing Python is that it sidesteps the need to understand fundamental programming concepts. Sure Python is easy to read and easy to write, but that's not really the point. To teach somebody print "hello world" in Python is not really teaching them much at all... Teaching someone the C equivalent would cover functions ("what is 'void main()'?"), entry points and how programs are loaded by the OS ("why do I need void main"), libraries ("what is cout and where did it come from? iostream!", "what else does iostream have?"), operators ("if cout is a function, what is this << thing?"), etc... The verbosity is helpful because it allows the student to ask questions that lead to a more holistic understanding of computer science. If a student with no programming knowledge asked me about how print worked in python, it'd be hard to know where to start explaining!
- possibilistic 12y agoWhy do you have to teach them the boring stuff first? The point is to get them interested in programming. They can learn how the hardware, compilation, linking, and algorithms work later. Above all, get them interested. If you capture their imagination, they'll be receptive to--even independently curious about--the details. I'm speaking anecdotally now, but please do not bore young students. There's no way I would have stuck with it if C was my first language. Javascript and Python are excellent starting points that easily let kids create games and websites and fun things. We probably wouldn't start someone off with Haskell, but to me C seems on the same level of impracticality for a young beginner.
- Cakez0r 12y agoWell if somebody is in higher education for computer science, I'm assuming their imagination has already been captured. I'm all for using whatever has the lowest barrier to entry in order to get young people interested in programming.
- j2kun 12y agoThat's not a very good assumption. A lot of students get their first experience with programming in college.
- nightski 12y agoSorry but hardware, compilation, linking, and algorithms are anything but boring. Even as a beginner I was very intrigued by all of them, even if I did not understand them as well.
- eddiedunn 12y agoYeah, sorry, but that's you. I can bring my own anecdotal evidence to the table and say that for me, compilation, linking and algorithms were very secondary to the thrill of typing in "commands" to the computer and have it do all the work for me automagically. Programming, which I learned in college, was a very pleasant method of getting around all that boring math by letting me figure out how to solve the problem and then having my computer do the mechanical calculations.
- nightski 12y agoThrill does not allow you to solve problems (beyond what a competent engineer has solved for you behind a pretty API). In order to succeed at solving problems you must enjoy it in the first place. If you do not care about the underlying algorithms behind those calculations programming is always going to be boring.
- solipsism 12y agoProgramming languages are tools that are useful to many more disciplines than just computer science.
- lbarrow 12y agoThis is like saying that when teaching people how to cook, you should start with chemistry lessons. Sure, at some point you have to have some understanding of chemistry in cooking, but does that really mean you have to start out there? Yes, every programmer should eventually learn about the things you're talking about. But C is a terrible first language.
- Cakez0r 12y agoI would disagree that you need an understanding of chemistry to cook... (although it doesn't hurt). However, if you want to teach somebody to cook, you don't teach them how to use the microwave :)
- grayclhn 12y agoI was about to disagree with this criticism of C, since I loved it as the introductory language in college. But then I remembered that Basic was my first programming language, and Pascal was the first language I was actually taught, and I'd been programming for a long time before actually getting to college. So I totally agree. Python probably makes sense if most undergraduates don't have programming experience any more. And the ones that do probably have experience in JavaScript.
- antoinec 12y agoI think it all depends of your goals, if you learn to cook in order to impress your friends, no you probably don't need chemistry lessons, but if you plan to win 3 Michelin stars for your restaurant, you probably need to. Same for programmation, if you just want to ease your work, compute quickly some math formulas, etc, you can start with Python. But if you plan to write the next big OS, you better start with C...
- lbarrow 12y agoNo, you absolutely don't need to start with C. You need to learn C (or some equivalently low-level language) eventually.
- 12y ago
- lomnakkus 12y agoGiven actual practical experience of e.g. Software Carpentry that's an absurd view. You actually do not need to know how "print" is accomplished. Print is not a leaky abstraction unless you go into what is (these days) an absurd scenario like a serial console.
- cgag 12y agoInstead of teaching them about function composition, recursion, data abstraction, and all the interesting concepts of computer science you end up teaching them a bunch of incidental stuff about memory locations and syntax. Python suffers from this less than C, but still much more than Scheme. I really can't imagine advocating for something other than some dialect of scheme (maybe racket) for an intro undergraduate course. For kids I can see choosing something like Javascript (as terrible as it is) just for the immediate feedback that someone before me mentioned.
- icebraining 12y agoMemory locations? In Python? I don't even know what you're saying.
- cgag 12y agoa = [1,2,3] b = a b += [1] => a == [1,2,3,1] a and b point to the same piece of memory even if you don't have to explicitly deal with pointers, you need to reason about them
- icebraining 12y agoYou just have to explain that "b = a" means that you're adding a new name to the thing/object named "a". Whether it's in the same memory location or not is an irrelevant implementation detail.
- na85 12y agoThese aren't computer science students. Most of them won't find recursion and data abstraction interesting in the slightest. If their primary interests were in computer science I'm sure they would have gone into a comp sci program. These students are there to learn programming as a tool to help them solve problems. The elegant recursive algorithm isn't really a goal they have. Their goal is to get a reasonable answer to a problem so they can move on with more important things.
- 12y ago
- na85 12y ago>Sure Python is easy to read and easy to write, but that's not really the point. That is the point. This isn't for comp. sci. students, this is for engineering students. I know that in America, unlike other countries, "engineer" is a non-protected term and that lots of guys who don't actually have engineering degrees (such as comp sci majors) call themselves engineers. But "actual" Engineers, i.e. the people who have engineering degrees or are in engineering programs, the people to whom this article pertains, are applied scientists. By definition, their professional concerns aren't the inner workings, or developing a holistic understanding of computers. That's for a specialist, i.e. a computer scientist who has more appropriate training. An engineer's job is to develop a solution that surpasses the design requirements (physical as well as budgetary) by the minimum amount. As a crude example, anyone with a high school education could, with unlimited funds, build a bridge that would stand up. But only a trained structural engineer can build a bridge that will just stand up. I'm a mechanical engineer, and for people in my field the programming aspect is most often a means to and end; you're writing a simulation to give you better insight into solving a physical problem, or you're writing a program to crunch a shitload of data, or you need to plot things and present them in a particular way or output the results to a particular tool, etc. The performance of the algorithm or your code is not really paramount. If it's "good enough" then it's good enough, because the code you write is just another tool in your toolbox along with your digital multimeter, your impact driver and your wrench. I recently wrote a quick one-off to iteratively determine the asymptotic limit of a set of physical functions with many interconnections and shared variables, subject to 4 different constraints and involving numerous irritating physical constants. To write that program successfully, I don't have any need whatsoever to understand the intricacies of file IO, the specifics of how libraries are linked at compile time, or how the print function actually prints to the screen. All I need is for it to print a number to the console so I can compare it to my far rougher hand calculations. Anything else is a waste of my time. Had I written that one-off in python, the knowledge that "print prints things to the console" would be perfectly adequate for me to do what I need to do in order to move on to more important things. The inner details just aren't important.
- zo1 12y agoYou have quite a few muddled definitions that you trip yourself over in your post. First you say that you're an engineer, which means you're an "applied scientist". Then afterwards you go on to claim that computer scientists aren't really "engineers" by your definition. Then further down you go on and say that they're instead "specialists". Sounds like you just had to find another word other than "Engineer" there, so you picked specialist. Then again... You mention that the job of an "engineer" is to "develop a solution". Well, that's pretty much what a software developer or software engineer would do. They're all grey, and it sounds like you're not quite sure of your own definitions. I can't tell if you're just confused about what all these terms mean to you, or you're just hurriedly trying to justify your own internal view of superiority over "non-engineers" because you're a "mechanical engineer" and don't like being on the same plane as them. All in all, I should probably disclose that I've had this argument a few times with "engineers" in the physical sciences. They all had a vested interest in protecting the term engineer because if they didn't, it would devalue their worth and the degree they hold. And the government-body given "accreditation" that they lord over people for higher pay.
- j2kun 12y agoWhat makes 'void main()' fundamental to programming? And the syntactic sugar of cout and operator overloading? Come on. If there's anything fundamental about programming it's not the particular design choices made in your favorite language. What makes Python good is that it allows one to focus on learning to translate ideas into programs before having to deal with all the other junk that goes into programming in other languages.
- analog31 12y agoI wonder if there are differing schools of thought as to what are the fundamental programming concepts. Is it more fundamental to expose students to, or isolate them from, the innards of the computer, when they are first learning to program? Short of settling that issue, the next best thing might be to expose students to at least a couple of different approaches. Python and C would be my choices. I'd teach C on a microcontroller target. Some isolation is necessary. I doubt that I could completely explain how either print or printf turns the pixels on and off on the display.
- rat87 12y agonote: void main should be int main(at least in c++) You could just give from __future__ import print_function import os def main(): print("hello world from:" + os.name) if __name__ == "__main__": main() as the hello world that covers functions(main/print), entry points(python runs the code top to bottom defining classes and functions at the top level and running any other code it encounters, to allow importation of libraries we put the code we wish to run in a special block that only runs it when the script is the only being directly run, not imported), we imported os and used os.name to demonstrate a library, + is an operator.