Focusing Language and Learning Goals

Discussion in 'Mac Programming' started by drury, Apr 18, 2011.

  1. drury macrumors newbie

    Apr 17, 2011
    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?
  2. jiminaus macrumors 65816


    Dec 16, 2010
    Can I suggest Adobe Flash perhaps for creating highly interactive learning environments? It's web deployable and cross-platform. And, assuming Apple doesn't forbid it again, can be "re-compiled" for iPad.

    But if you want to take advantage of iPad's unique UI features, Objective-C/Cocoa is really the only way to go. For example, I don't know if Flash supports the complex touch gestures iPad users expect.
  3. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    I almost hate to say this, but you might be best off learning JavaScript.

    It has its quirks, but in its basic structure like if/else, loops, switch, it's perfectly fine. Algorithmically, it's much more sophisticated than most people give it credit for.

    All its arithmetic is carried out as floating-point double precision, even when it seems to be integers. This also has its quirks, but those quirks are pretty consistent across languages. In particular, unexpected imprecision with certain values, such as multiples of 0.1 or 0.01, etc. Those are fundamental to the binary floating-point representation, which is why they appear across languages.

    There are good and bad ways to learn and use JavaScript. A book that really opened my eyes was "JavaScript: The Good Parts" by Douglas Crockford. It contains some really mind-bending stuff, but it also has some really good basic principles that are worth following.

    For tutorials, the ones are fine. Very straightforward, and a decent Try It Yourself editing page for every exercise. You should start with basic HTML (which is the ever-present container for JavaScript). Then do basic JavaScript stuff. Then do the DOM tutorial (Document Object Model), which is what lets you refer to document objects like textareas, tables, divs, and spans in the HTML as if they were JS objects.

    The advantage of JavaScript is it's the closest thing you're going to find to a universally available programming language. You don't even need a website to write programs with it. All you need is a text editor and a web browser. You can write local HTML files that reference local JavaScript files, and the result runs entirely on the local computer.

    One of the downsides to developing in JavaScript is that there are no good free debuggers. At least none I've found. As a result, debugging tends to be done by printing stuff to the console log (pretty well supported in browsers these days, but possibly idiosyncratic). Or use the approach I usually take, which is to write my own "logging to an embedded textarea" elements. This means a certain skill level with HTML, and being able to write basic JavaScript well enough to bootstrap the debugging log into existence. The Try It Yourself editor in w3schools is also useful here, because you can use it for quick prototyping and testing.

    I have always found that creating simple diagnostic tools in a new language is a great way to get started. First, you learn about the language basics pretty quickly; it's not artificial, you're actually doing something practical. Second, you end up with something useful as a result. Third, it gives you something simple that you understand (because you created it), which you can fall back on when other people's code fails you in unexpected ways. It's the ultimate in being able to break things down to their essentials.

    I should also point out that you can run (or even write) JavaScript on iPad, iPhone, and iPod touch devices. Running it works great. I haven't tried editing it there yet.
  4. SidBala macrumors 6502a

    Jun 27, 2010
    If you were on windows, I would have suggested C#.

    But otherwise, maybe Java or Python.

Share This Page