TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: best languages to learn as a newcomer

16 pointsby stevejalimalmost 16 years ago
A friend with an astrophysics and maths background is looking to get out of her current gig in journalism and into software. She's got minimal programming experience (beyond BASIC in the 80s), but has a startlingly sharp mind, so I don't see lack of experience as a major barrier. She's asked me what language/s is/are worth learning.<p>I've suggested Ruby or Python just to get the fundamentals down, BUT (and this is where it differs from previous Ask HN threads similar to this), she wants to use her maths/physics knowledge towards creating industrial/scientific applications. With that last bit in mind, what language(s) are worth her investing time in?

21 comments

mdasenalmost 16 years ago
I personally think Python would be best. Python will allow her to understand conditionals, loops, variable assignment, etc. really simply and quickly.<p>Once you have that down, it's a lot easier to start dealing with things like static types, memory management, pointers, null bytes, and so on.<p>I learned the other way around (with C being my introductory language), but that was a useless way to learn. When you don't know exactly how to use a conditional, there's no reason to throw in things that can trip you up and have nothing to do with your understanding of a conditional.<p>And, to be honest, Python will do nicely for lots of applications. If she's going to be joining a company, she'll have to use what they want her to use, but if she's independent, Python will be fine unless the calculations are so complex that they are time constrained. Even then, Java isn't so hard to pick up if you know Python<p>It's a lot easier to add on CS concepts little by little than to have to deal with everything all at once.
评论 #626759 未加载
评论 #626803 未加载
评论 #627782 未加载
评论 #626916 未加载
mnemonicslothalmost 16 years ago
<i>she wants to use her maths/physics knowledge towards creating industrial/scientific applications.</i><p>The functional programmer in me is really happy that so many people are saying "Haskell!" but based on my own experience in applied physics, it's a terrible idea.<p>Programming in the sciences is all about numerics. That means giant fiddly matrix manipulation libraries, adaptive conditioning, stability bounding, and adjustments for the phase of the moon.<p>There's a pretty simple reason for all the gobbledygook. Often, the <i>entire solution</i> to a given problem is expressed as one giant matrix equation (i.e. y = A<i>x), because that's an easy format for a big computer to chew on. The trouble is, there are lots of possible ways such computations can return a result that looks right but is actually completely buggered. Finite precision floating-point numbers is one, but there are others. And since inverting one giant matrix is pretty much the </i>only thing* that happens in a computation, you don't have a lot of debugging options when something goes wrong. So boutique languages like Haskell won't be all that useful except for prototyping because nobody else will trust the numbers you produce.<p>There really aren't that many mainstream choices. Matlab is the all-singing, all-dancing prototyping tool that you <i>must</i> know if you want to have any dealings with scientists. Matlab can compile its code to C or Fortran (I'm pretty sure, anyway), which are your two other choices.
评论 #626902 未加载
megaduckalmost 16 years ago
It depends. If her interests are highly focused, there's a few problem domains where niche languages (R, Matlab, Haskell, Fortran) really shine. However, if she wants more general purpose tools, I've got a few strong recommendations:<p>Ruby - I'd start here. Ruby is an amazingly flexible language, with a gigantic "feature set". Learning Ruby will get her up to speed on imperative programming, functions, objects, libraries, DSLs, regexps, and some functional programming (via closures). The community is friendly, the docs are plentiful, and the available libraries (gems) are pretty comprehensive. Best of all, the learning curve is gentle and it gets you writing productive programs quickly. However, unlike many "beginner's languages", it's not particularly limiting. If you really need to, you can always call out to C or Java (via JRuby). Possible alternative: Python. Never worked with it, but I understand it offers a lot of the same benefits.<p>Java - If she wants to do a variety of scientific or industrial programming, she's eventually going to have to learn Java. Java has largely replaced C++ as the academic language of choice, and most industries have migrated to either Java or C# for general development. While some people scream about the "yuckiness" of Java, it's actually not that bad, especially for a beginner. It's highly object oriented and strongly typed, teaching a lot about those concepts. The verbosity is often helped by access to a lot of kick-ass dev tools. Best of all, though, is the libraries. The amount of open-source code that you can tap is HUGE, especially in the scientific and industrial arenas. Oh, and Java 6 is wicked fast, at least in comparison to Ruby and Python. :)<p>C - I would recommend C for two reasons. First, it teaches you a lot about how the underlying machine works. If your friend is doing scientific computations on large datasets, she's eventually going to run into some weirdness with memory. Knowing C helps (forces?) you to understand what's happening "behind the scenes" in these VM-based memory managed environments. If you dig far enough down, you're almost always going to find some C code, and it's helpful to know how that works. Secondly, there's some problem domains where still C reigns supreme, namely anything that demands extreme performance. The combination of Ruby and C can give you the best of both worlds, using Ruby for most of the "glue code" and C for stuff that needs rocketship speed.<p>NOT RECOMMENDED - C++. Almost everything done in C++ is better done in either C or Java. C++ is super-complex, verbose, error-prone, and you still have to manage your own memory. Unless she needs to work with legacy code, your friend's time is best spent learning more modern tools.
评论 #626944 未加载
评论 #628256 未加载
RiderOfGiraffesalmost 16 years ago
Python + SciPy (which uses NumPy)<p><a href="http://docs.scipy.org/doc/" rel="nofollow">http://docs.scipy.org/doc/</a><p><a href="http://numpy.scipy.org/" rel="nofollow">http://numpy.scipy.org/</a><p>Many operations are fast, being implemented in C, an the facilities include all sorts of numerical operations, as well as graphing/plotting and other visual interactions.
tomh-almost 16 years ago
Haskell will be a perfect fit for these math/physics kind of projects. Writing these programs in a functional language is very close to how the theory in math/physics is explained so that is a nice fit.
评论 #626717 未加载
baguasquirrelalmost 16 years ago
Try a small diverse set of languages? Here's an interesting anecdote for you. I have two friends from CMU, both who have a CS degree. The first person was an ace at C. Could handle everything with ease, but faltered a bit when it came to ML/Haskell. The second person managed to screw up the "easy" C class, but she scrubbed off ML/Haskell as if it were trivial, but hated all other programming classes she took. At the time of this writing, the second person is on equal or greater footing than the first person, and both are in industry.<p>Whether because of personality or because of the actual underlying mental thinking involved, people who tend to be good at C aren't good at Matlab or Haskell, and folks who are good at Matlab aren't necessarily good at either C or Haskell.<p>In light of this, I think it'd be really sad if your friend tried just one language, and wrote off programming forever because it was a bad experience.
gamachealmost 16 years ago
With a background in physics and math, she might do well in a functional language, or in a language which supports functional development well. Python is a good choice due to its math libraries and ease of learning. I was also going to suggest Clojure but that basically requires knowing an amount of Java.
评论 #626707 未加载
splatalmost 16 years ago
Though it's probably not a good first language, if she is going to be writing code for any astrophysical applications she will have to learn IDL at some point. It's a language that's rarely used in any other field, but in astrophysics it's the language of choice.
rmaccloyalmost 16 years ago
Somebody mentioned Clojure, which is a great language but has some baggage.<p>If she's coming from a rigorous background, I highly suggest Scheme and the book Structure and Interpretation of Computer Programs (SICP: <a href="http://mitpress.mit.edu/sicp/." rel="nofollow">http://mitpress.mit.edu/sicp/.</a>) For some people using a language with more batteries (and thus instant gratification) is better to learn programming, I think, but for learning to think about <i>computation</i> I think Scheme is pretty hard to beat.<p>Scientific programming might mean C/C++ (that's where the fast math libs are, to be sure), but it might mean Matlab or Forth or lots of R, who knows.
评论 #626741 未加载
mahmudalmost 16 years ago
PLT Scheme is clean, free, well documented, widely supported and beautiful. It has a decent numeric tower, and a good GUI toolkit for writing simple interfaces.<p>I taught most of it to my 15 year old nephew over two weeks, this last winter holiday.<p>There is zero configuration; you double click on the downloaded package, it self installs, and you have 5+ different programming languages and levels of Scheme in one package. You can get help right from within the IDE.
carbon8almost 16 years ago
Ruby or Python, leaning toward Python only because it's used more widely in physics applications and, as a result, has more developed libraries for scientific computation.
iigsalmost 16 years ago
<i>looking to get out of her current gig in journalism and into software</i><p>Is this for commercial/employment purposes? If so I'd consider looking at the job market for desirable positions and selecting a tool set from there. Even if the idea is to build products for sale/use from scratch herself it's probably worth understanding the field as it stands now before diving headlong into a programming environment that isn't going to be a good fit for the applications in question.<p>Python is a good starting point for intro to computer programming, but at very least (and I'm out of my league here), she should tour and understand the differences between popular FORTRAN environments, Python environments (scipy), Java environments (I don't know where to start), Mathematica, Scilab, Octave, and R.
TomOfTTBalmost 16 years ago
It depends what platform she wants to develop her solution for.<p>If she's doing web based development I'd suggest Javascript. Javascript has a lot of superflous non-sense in it but if you learn it the right way it's a very powerfult language. More importantly if she wants to develop web applications that do a lot of math calculations she's probably better off learning a browser based technology (so the burden for all those calcs won't be on the server)<p>Anyway, I'd suggest Javascript: The Good Parts as a book to start with if she goes that way.<p>If she's doing desktop apps I'd probably suggest learning Actionscript and Adobe AIR (which provides the most cross-platform bang for the buck)
aneeshalmost 16 years ago
If you want to create industrial/scientific applications, libraries are going to be pretty important. For that reason, I'd recommend Python (see SciPy and NumPy).<p>I'd also recommend learning R if you're at all interested in scientific data analysis.
keefealmost 16 years ago
Java is pretty prevalent and has an awfully large set of nice libraries. Once you write some utility classes to deal with reflection and some of the other annoyances - including tweaking eclipse to speed workflow - it's a great language to work in.
swombatalmost 16 years ago
For the easy learning curve and everyday scripting, Ruby/Python would do well.<p>For the heavier stuff, C++, Erlang, Java...
ErrantXalmost 16 years ago
C++<p>If she has a sharp mind she will pick it up easy enough and that is where she wants to be with the ultimate aim.<p>Alternatively Java might be an option: purely if she fancies looking at distributed apps. I hate Java like crazy but it has some good background in distributed computing.
评论 #626760 未加载
评论 #626700 未加载
hsalmost 16 years ago
i did a lot of matrix analysis during my grad study, from statistics (general linear model, projection, pseudo inverse, design of experiment, etc) to dynamic system (control, state space, etc) using matlab -- i even used it to generate random distribution from uniform for simulations<p>the closest thing to matlab is python+numaray+matplotlib (maybe it changes name to scipy?)<p>i think she will face matrix calculation ... so, use python (matlab is easier, but less flexible) ... i didn't go too far with R but from my experience it's less flexible than python<p>NB: i did those 5 years ago so don't trust my words too much
menloparkbumalmost 16 years ago
Python's one of the easiest ways to get started in programming in general, and is widely used in science these days. It's the new Fortran in scienceland...
progLikeralmost 16 years ago
Thinks she have som objectives with programming.<p>I'd download the java tutorials with full source, buy Core Java to her, Install a pretty minimal version of Eclipse nicely set up with the workspace for eclipse osculating the java tutorials source and Core Java source, give her a bookmark to javadocs, java tutorials - big index, java ranch, and just let her go.<p>She should be able to learn that with a minimum of assistance, and have fun too. The only alternative which can be more fun and rewarding would be Visual Basic I think. So java is it for obvious reasons.
metatronscubealmost 16 years ago
C
评论 #627195 未加载
评论 #626832 未加载