Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm writing to ask for some guidance on choosing a language and course of action in learning programming.

I've seen thread after thread with questions from newbies, asking, "What is the best language to start with?" and then it always starts a flame war or someone just answers, "There's no best language, it's best to pick one and start learning it." My question is a little bit more focused than that.

First off, I've been programming my whole life, in very limited capacities. My deepest training was in C++. Whilst in my EECS degree program, I resolved to never be a software developer because I couldn't stand not interacting with people for such long periods of time. Instead I realized I wanted to be a math teacher, and so that is the path I have taken.

But now that I'm well down that path, I've started to realize that perhaps I could develop my own software to help me in the classroom. If I want to demonstrate the Euclidean algorithm, what better way than to have a piece of software that breaks down the process? Students could run that software as part of their studies, and the advanced students might even develop programs for themselves. Or, with an Ipad in hand, why not have an app that lets students take their own attendance? It would certainly streamline some of the needs of classroom management.

There's obviously a lot of great stuff already out there for math, and for education, but I want a way to more directly create things specific to my lectures. If I'm teaching a specific way of calculating a percent, I want to create an app that aligns with my teaching style, not just another calculator app that requires the student to learn twice.

The most I use in class right now is iWork Numbers/Microsoft Excel for my stats class. Students can learn the basic statistical functions, and turn some of their data into graphs.

I have dabbled a bit with R, and used Maple in college. I've started the basic tutorials for OS X/iOS development and have actually made good progress making an OS X app that takes a text string, converts it to numbers, and performs encryption using modular addition and multiplication. I sometimes use Wolfram|Alpha to save myself some time in getting quick solutions to equations or base conversions. I know of MatLab, Mathematica, and recently people have been telling me to check into Python or Ruby. I also know basic HTML, and while it's forgotten now, learned Javascript and PERL in college.

If I keep on the path of Obj-C/Cocoa, I think it will have great benefits. Unfortunately, anything I produced for Mac would only be usable on a Mac, so it wouldn't be universal for all of my students. Perhaps then learning a web language would be better. Second, I'm wondering if the primary use is mathematical, then perhaps my time would be better spent learning Mathematica Programming Language, or R, or something based less on GUI and more on simple coding of algorithms, maybe Python or Ruby?

It seems that Mathematica already has a lot of demos for different math concepts, so why reinvent the wheel is also a question I have. I think overall, it would be good to have more control and design things the way I need. And then, if I do want to make an "Attendance" app or something else, I would already have the programming experience to more easily design something for my iPad or MacBook.

The related question to this is what is a good language to teach to my students? In his TED talk, Conrad Wolfram says one of the best ways to check the understanding of a student is have them write a program. But if Mathematica does the math virtually automatically for them, then I'm not sure that will get the deeper experience of working out logic for themselves, like you do when you're writing C, or a traditional procedural language.

I know that programming takes time to learn, but I also know that at this point, my goal is not to be able to make an app like "Tiny Wings." With the app store ease, some of my work may be an extra revenue stream, but I see myself as more of a hobbyist, and now teacher looking to software development specifically for its ability to help me demonstrate mathematical concepts.

I think I will push ahead with Obj-C/Cocoa for OSX/iOS, but if anyone has some better guidance regarding all of the other available stuff, it would be much appreciated. I don't think I would want to go fully to the web (I like apps), but perhaps someone could suggest a nice way of bridging what I produce in XCode to a universal web version. For example, if you come up with an algorithm in obj-c is it easiest to transition that to ruby and run it online, or is there another approach that works better?

share|improve this question
Note that you can develop Cocoa applications using MacRuby. If you keep user interface separate from core algorithms, they should be easily ported to Ruby on Rails. – Bavarious Apr 19 '11 at 10:37
What abilities should the students have to write their own programs? Do you want them to be able to work on them at home, on their own machines? If you want them to be able to work at home, you want something free/open source like Python, rather than something more pricey like Mathematica or Matlab. – David Thornley Apr 20 '11 at 20:29

7 Answers

As others have advised you, I also recommend python. It's a nice development from C++ and will open your eyes to more programming concepts - the results you can achieve (per line of code) is remarkable!

For maths features and scientific computing, the well-known numpy package cannot be looked past.

share|improve this answer
You can write the Euclidean algorithm in 4 lines and it will read like pseudocode. – Andrea Apr 19 '11 at 12:19

If you can afford it: Matlab.

If you want free stuff: Octave (a decent Matlab clone). Some people also love R, AFAIR it has a statistics bent.

I wouldn't necessarily jump into Python as first choice. It's a general-purpose language, not specialized for maths applications.

If you really care about performance: Fortran.

share|improve this answer
1  
Matlab is the shortest distance between an idea and an implemented (math-based) idea. No stupid syntax to deal with, you learn three tricks (vectorizing, logical filtering, and matrix addressing/slicing) and the rest just kinda writes itself. I've written long programs in .net and c that later I replaced with 6 lines of Matlab. It's simply amazing. – Marcin Apr 19 '11 at 14:03

Pick something that has nice plotting and visualization capabilities. Mathematica and some of the open source alternatives like Octave, SciPy, Sage, SymPy, etc. Most of this stuff can be found at http://en.wikipedia.org/wiki/Category:Free_mathematics_software.

share|improve this answer

If I were in your position as a teacher I would investigate SAGE. It is an open source Python based piece of mathematical software that is written for Linux, runs natively on OS X and through a pre packaged virtual machine on Windows; it is also available online so any of your students can try it out easily.

The project is lead by William Stein who is currently the world's the leading mathematical computer scientist (or however you want to classify him), so it is a serious project. What is nice about it is that it brings together all of the various mathematical packages and software available and allows you to access it in one place; for example, if you have Maple installed, then you can use Maple functions inside it, but via Python syntax. There are lots of tutorials, there is an active development community who would probably be willing to provide some help and support, it uses Python so the language it uses is actually useful and well designed and it's free. Enough said.

One word of warning: on pain of death Do Not Use Mathematica. It is the worst programming language in the world. (Why? No concept of scope anywhere - yep that for loop with an i variable is the same i variable in every other for loop everywhere: No ability to debug - the standard error message is "error", useful! There are more reasons, but those should be enough)

share|improve this answer
Mathematica is useful mostly for symbolic calculations (where it rocks), not for numerical stuff. – quant_dev Apr 20 '11 at 19:45
2  
Agreed, it is pretty useful for rationalising equations and manipulating symbols. But if you'd been made to develop fluent human readable acceptance tests for mathematical procedures for a month in Mathematica, you would hate it as I do. – user23157 Apr 20 '11 at 20:46

Consider Maxima. http://en.wikipedia.org/wiki/Maxima_(software)

Descendent of Macsyma, if you ever heard of that.

Runs on Windows. Open-source.

LISP-like programming language, if I recall correctly (bonus, imo).

share|improve this answer
I tried it several times. When confronted with anything more complicated than a Pade approximant or a Gaussian integral, it goes belly up. – quant_dev Apr 20 '11 at 19:46

It depends quite a bit on the level of math you are teaching. Is it highschool algebra, or college level problem solving? I have two sons taking CS at university, and use a combination of C plus OpenGL to give them enrichment courses. But here the goal is understanding of computation/algorthims, so writing say a sort from scratch is preferred over finding someone elses implementation, because learning how to think alogorthmically, and to program, and to use graphics to debug your coding etc, is the point of the excercise. I do like JohnLs suggestion of using maxima, as it is nice to compliment numerical solution methods, with computer algebra. I do feel that easy coupling to graphics is important, so that partial results can be visualized. A lot of insight/intuition can be developed if good pictures can be made relatively painlessly.

share|improve this answer

I would recommend PHP. The syntax is as simple as python, and you're completely free in how big or small of a program you want to make, whether you use OOP or functional programming, etc. The documentation is very good, and there's a vaaaaast community available for when you run into problems.

An added bonus is that PHP uses the same syntax as C, C++, Javascript, and Java (in most ways). Learning PHP made it very easy for me to later learn Java and Javascript, and vice versa someone familiar with C++ would find PHP's syntax easier to grasp.

Installing PHP is a piece of chicken these days via WAMP if you're on windows. You simply run the setup and its installed, and later you can customize the configuration files just as easily, where needed.

share|improve this answer
Umm... PHP doesn't have the required libraries and even if it does its community is almost exclusively centered around web development, not mathematics. – davidk01 Apr 19 '11 at 21:37
@davidk Apart from Matlabs, every programming language is focused on web/software development and not on Mathematics. – Click Upvote Apr 19 '11 at 23:48
That's not true. Mathematica, Maple, Sage, SymPy, and many others are focused on computational aspects of mathematics and not web/software development. There are many other examples and wikipedia has an excellent list of programming environments specifically designed for mathematics. – davidk01 Apr 20 '11 at 0:14
@Davidk how is python more specific to maths than PHP? – Click Upvote Apr 20 '11 at 11:42
@Davidk check out these: php.net/manual/en/book.math.php and php.net/manual/en/book.bc.php – Click Upvote Apr 20 '11 at 11:56
show 8 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.