What programming language should I learn?

In summary, the conversation discusses the individual's background as a mathematical physicist and their plan to transition into industry. They mention their lack of computer skills and ask for advice on what languages to learn. Suggestions are made for C++, Java, and Python, as well as web and mobile programming. Books on object-oriented analysis and design and design patterns are recommended. The conversation also touches on the importance of learning multiple languages and paradigms for a successful programming career.
  • #36
I second D H's roadmap: A numerical language such as MATLAB, a set of scripting languages (Python/Perl + bash + make), and an OO language such as C++/C#/Java. LaTeX has been the single most useful skill and productivity enhancer in my life, both in university or out of it. SQL is particularly useful and I wish I had learned more of it. Many seem to have missed out on the importance of the concurrent paradigm and distributed systems (e.g. via Erlang), and I feel this is what will really give you an edge in the coming half a decade, whatever you plan to be doing.


D H said:
Sure there was.

Perhaps you aren't aware of this, but Wall Street and PhD physicists are: The very same numeric codes that describes what happens inside a star also can be used to describe what happens to a hedge fund. Wall Street has hired lots of physics PhD graduates to work as quants because of this.

Upsides: A six digit starting salary, sometimes with a non-unitary leading digit, and working at the very heart of the engine that drives our economy.

Downsides: Ridiculous work hours (no chance to spend that huge salary), living in New York City with its high cost of living (that huge salary isn't as big as it seems), and working at the very heart of one of the more despised industries in the country.
 
Physics news on Phys.org
  • #37
I forgot to comment on D H's blurb on finance. I preface that I speak with limited authority (I'm not as familiar with the sell-side as the buy-side) in this area, but I've recently had the misfortune to go through the regulatory red tape of forming a hedge fund. D H's post is mostly true, except I don't see a close relation between physical processes in stars and hedge fund liquidity - I'm not ruling out the likelihood that someone has created a model that associates the two, but this is not commonly used in practice. What's useful though, are a combination of quantitative skills and personality traits that an astrophysicist typically has.
 
  • #38
D H said:
Agreed, but this is not the typical "someone" I targeted with my list. My list is aimed at physics graduate students whose research involves computation and who want to make themselves marketable as a programmer / numerical analyst as a backup plan in case the climb up the academic ladder doesn't pan out.
The OP did not restrict the set of possible careers to classical numerical programming, let alone to the "academic ladder".

But even for the "academic ladder" - learning Fortran for that purpose means learning Fortran by using netlib libs.
Those libs are highly efficient but provide no role-model for how to code in yrs(2010: ).

But e.g. Bjarne Stroustrup, provides very good advice for coding maintainable numerics in the small chapter of his famous The C++ programming language; advice which will also be valuable if you need C++ just to collect data to push it into a Fortran maths kernel or interface via MPI.
 
  • #39
D H said:
I disagree. You'll at best have what you need to code poorly in languages similar to the ones you already know. Learning to program as opposed to code in that new language takes effort and time. Learning to program well in that new language means learning the language's idiosyncrasies and idioms.

Learning to program in a language that represents a programming paradigm dissimilar to those you already know is tougher yet. A person who knows only imperative, procedural languages can move to yet another imperative, procedural language with some ease but is going to face an uphill battle in moving to another paradigm such as object oriented programming or functional programming. C programmers who have just started learning C++ doesn't really write C++. They write a pidgin dialect better named C plus or minus. It takes a good amount of time to make the transition from pure procedural programming to object oriented programming. The transition to functional programming or data driven programming is harder yet.


No, it's not. An if statement in Lisp looks and behaves like the ternary statement in C/C++ rather than a C/C++ if statement. A Haskell program chock full of if statements is a sign of a noob who doesn't really know how to program in Haskell. There's not much need for if/then/else in Haskell.



Yes, I did abuse the notion of "language" in that list. However,

Bash and tcsh are Turing complete. They are programming languages.

Why it's handy to learn (as opposed to hunt and peck your way through the command line): Suppose that after some fits and starts, you successfully execute a sequence of shell commands, including some loops and if statements. Suppose you need to do this all over again sometime later. How to preserve that work so you don't have to go through all those fits and starts? Simple: Pipe your command history to a file, edit that file, perhaps generalizing a bit, and tada! you have a handy shell script that you can run again at that later time.


Huh? C is a file format. C++ is a different file format. Python, yet another. Make is a language. Some versions of make are even Turing complete. The make language is an example of the logic programming paradigm, somewhat akin to how Prolog works. One key difference: Make rules are not recursive. To get a make that is Turing complete, you'll have to use a version of make such as gnu make that supports lambda expressions (functional programming paradigm). With lambda expressions it's turtles all the way down.


A rather important one, particularly for a math or physics PhD candidate. Learning to use it properly to write a thesis is a significant undertaking, as hard as learning a new programming language. Not that you'd want to program in it, you can. It is Turing complete. Fun and games with TeX/LaTeX: Here's the (in)famous xii.tex (build as plain TeX rather than LaTeX).
Code:
\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP
A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP
AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfi
Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx
:76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL
RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse
B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI
I71Fo71dPA!FRgiePBt'el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;
;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%
s$;z zLqs'.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G
LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.'oL.Rtrul;e
doTsW,Wk;Rri@stW aHAHHFndZPpqar.tridgeLinZpe.LtYer.W,:jbye


The distinction between interpreted and compiled is a bit arbitrary. There are C and Fortran interpreters, and there are Matlab and Python compilers. That Matlab isn't suitable for developing standalone applications: Tell that to the developers of multiple spacecraft control systems that each wrote their entire system in Matlab/Simulink.

This is quite ridiculous. Try convincing a prospective employer that Make and LateX are programming languages. Chances are you won't last 2 minutes into the interview.
 
  • #40
Solkar said:
The OP did not restrict the set of possible careers to classical numerical programming, let alone to the "academic ladder".
Put yourself in the shoes of an employer who has an opening for an entry level, code monkey programming position in which there's not one lick of numerical programming in the target application. A freshly minted PhD mathematical physicist is simultaneously overqualified and underqualified for that position.

Typical mathematical physicists are underqualified because the programming skills are largely self learned and just cover the basics, with little knowledge of structured programming, structures and algorithms, parallelism, and all the other stuff that a computer science major learns as an undergraduate. They are overqualified because there are other jobs out there that represent a much better match between skills and job needs and that pay double the salary of that entry level code monkey position.

Most employers are reluctant to hire someone who is either overqualified or underqualified. Both simultaneously? Not a chance.


Regarding my list: It was aimed not just at the OP, but also at others in a similar boat. That said, starting to work on the "what do I do after I get my PhD" backup plan just a few months before graduating is far too late a start. My list (or something like it) is best suited for incoming candidates who plan on research that involves using numerical programming to solve a problem in physics. The sooner one gets started on that post-graduation backup plan, the better.

Having some kind of backup plan is essential. The math demands it. Academia produces far more graduates in the technical fields than academia itself needs. There's nothing wrong with this. What is wrong is for grad students to expect that they will get one of those rare jobs in academia once they graduate and jump through the post-doc hoops.


But even for the "academic ladder" - learning Fortran for that purpose means learning Fortran by using netlib libs.
I should have qualified my recommendation to learn Fortran with but only if you need it for your thesis work.

Learning Fortran is not something to be done after getting that PhD. It's something to be done along the way to getting that PhD, and as I said above, only if it's needed. Knowledge of Fortran is irrelevant to climbing the academic ladder. The only things that count for that are the number of papers one has published and the number of research grant dollars one has obtained.
 
  • #41
physwizard said:
This is quite ridiculous. Try convincing a prospective employer that Make and LateX are programming languages. Chances are you won't last 2 minutes into the interview.
Oh please.

Have you evaluated resumes? Interviewed? I wouldn't blink at someone who listed on their resume "Languages and tools" as including C++, Fortran, python, bash, make, and LaTeX. I might poke during the interview to see if they really know those, but I wouldn't scoff.

The advice to learn a new language a year isn't mine. It isn't even from Andrew Hunt and David Thomas, although they did write this very advice in their book The Pragmatic Programmer. I had heard this recommendation multiple times, from multiple people, long before that book came out. Does SQL count? Of course it does. It's an important skill, and it requires a different kind of thinking. Make? Of course. Using make right requires a different kind of thinking. LaTeX? Of course. LaTeX is a macro language. Write your own macros and you'll definitely agree that LaTeX is a computer language.
 
  • #42
Just a bit of advice. The way I see it is that anybody getting into a physics program (either undergraduate or graduate) should do it because he/she wants to learn physics and not because he/she wants to get a job. Once you get your degree you're satisfied(hopefully, if the education system at the particular university is satisfactory) that you've learned what you wanted to learn. If you don't get an academic job after your degree, a bit of advice - just forget that you are (or were) a physicist and focus on getting skills which will get you any kind of job. You should be able to envisage this situation(not getting an academic job or even a physics related job) even before you get into a graduate or undergraduate program.
 
Last edited:
  • #43
physwizard said:
Just a bit of advice. ... If you don't get an academic job after your degree, a bit of advice - just forget that you are (or were) a physicist and focus on getting skills which will get you any kind of job.
That is terrible advice in my opinion. Broaden one's perspective? Yes. Absolutely. Forget that you are (or were) a physicist? No.

There are plenty of places where PhD physicists can work as physicists outside of academia. Both government and industry need those PhD physicists. There are plenty of places outside of academia that need the strong analytic skills that PhD physicists have learned over the course of their academic careers. There is absolutely no reason the throw all of that away and try to land a job as a web developer, as some have implied in this thread.
 
  • #44
D H said:
That is terrible advice in my opinion. Broaden one's perspective? Yes. Absolutely. Forget that you are (or were) a physicist? No.

There are plenty of places where PhD physicists can work as physicists outside of academia. Both government and industry need those PhD physicists. There are plenty of places outside of academia that need the strong analytic skills that PhD physicists have learned over the course of their academic careers. There is absolutely no reason the throw all of that away and try to land a job as a web developer, as some have implied in this thread.

I think his justification is mainly the scarce amounts of physics-relevant employment available to phd's (although it's greater than it is for any undergrad). I don't disagree with his sentiments about forgetting one is trained as a physicist when it comes to a job hunt if one's training ends at the BS level though, it definitely eases the feelings of failure many of us who don't get to progress onto graduate studies have and helps us stay motivated in the job hunt for unrelated employment.

But I agree with everything else you say. The right question to ask is what languages. I learned the basics of programming in Labview, did lots of numerics in scilab(a freeware MATLAB clone) and Fortran, have played with Python, and completed a senior thesis in Latex. I know very well that I still need way more formal programming experience and more exposure to web-developer languages or C++ to be employable.

In a recent job interview I had (for a temporary summer research position), I got a slight bit of flak for not knowing the precise difference between a function and subroutine in fortran (I was asked to write a function on the spot that did a certain thing, which did its job correctly, but I declared it as a subroutine). I'm afraid I will not get the job.
 
Last edited:
  • #45
Lavabug said:
I know very well that I still need way more formal programming experience and more exposure to web-developer languages or C++ to be employable.
If you want to be employable as a web developer, yes. If you want to be employable as someone doing numerical programming, not necessarily.

There's an optimal point in the concept of broadening one's perspective with regard to future employment. If one thinks the only way to be happy with life is to be a theoretical physicist at MIT, that's too narrow a perspective. The odds are vastly against ever landing that dream job. On the other hand, happily taking any job that comes ones way is too broad a perspective.

Going after specific jobs for which one doesn't have the skills is also perhaps a bit too broad a perspective. Looking for a job as a web developer or as a developer of a suite of multi processor client server applications is an example of this. The majority of the skills you learned in obtaining that degree in physics are orthogonal to the skills needed in these jobs. You are competing with people who have a big head start.

There are a number of jobs out there for which the ability to program is an essential but nonetheless secondary skill. Quantitative analysis has already been mentioned in this thread. Others include data mining, data fusion, remote sensing, navigation, guidance and control, and robotics. Here you have a advantage over a good percentage of computer science majors because many of them took the bare minimum of required math courses in getting their degree.
 
  • #46
D H said:
If you want to be employable as a web developer, yes. If you want to be employable as someone doing numerical programming, not necessarily.
Do jobs like these even exist for physics majors at the undergrad level? My recent job hunt leads me to believe anything that falls under scientific or numerical programming is strictly for stem phd's, while every single entry-level programming job ad typically expects proficiency specifically in java, SQL (what I was referring to as webdev languages) and/or C++, skills which are in general absent from physics bachelors programs but common/mandatory for engineers and CS.

Most of everything else you mention sounds like work at a defense contractor or the military, which makes sense as I know they snatch up physics graduates (unfortunately I do not meet the citizenship requirement at all the posts I've found at the doe, dod, contractors, etc.).
 
  • #47
There are plenty of places where PhD physicists can work as physicists outside of academia. Both government and industry need those PhD physicists.

I think this is highly dependent on your subspecialty. Hardly any of the physics phds I know work as physicists (and all of us tried) anywhere, but my subspecialty was HEP theory. I imagine condensed matter experimentalists have a different job market experience.

Order of magnitude, it seems very likely there are more physicists then jobs where physicists can work as physicists, so a lot (perhaps most) of us seem to retrain for very different work.

There is absolutely no reason the throw all of that away and try to land a job as a web developer, as some have implied in this thread.

I know more physics phds developing iphone and android apps then I do working as physicists. This is because people follow the jobs- find something it seems like you would like, and learn to do it.

I feel lucky to have the statistical work that I do, but pretty much nothing specific I learned while getting my phd has been useful, and I was only able to land the job after much self-study, and by replacing most of my physics related job skills on my resume with machine/learning statistics skills. Some of the experience with technical writing/giving presentations has been helpful, but I would have gotten that same experience almost anywhere.
 
  • #48
D H said:
Put yourself in the shoes of an employer who has an opening for an entry level, code monkey programming position in which there's not one lick of numerical programming in the target application.
(emphasis mine)
I do not intend to do so; a company where people are considered "code monkeys" (your words) is the wrong company. Regardless of whether the applicant is a PhD or not.

D H said:
They are overqualified because there are other jobs out there that represent a much better match between skills and job needs and that pay double the salary of that entry level code monkey position.
Knowing graduate level physics but no CS is not an "overqualification" for a software development job; it is no qualification at all for that job.

D H said:
I should have qualified my recommendation to learn Fortran with but only if you need it for your thesis work.
Your company will not care about you having finished your thesis and think learning Fortran is obsolete afterwards. When you e.g. have to fit whatever to some data; they will expect from you that you get you hands "dirty" as much as needed.

Where is this
D H said:
Learning Fortran is not something to be done after getting that PhD.
etched in stone?
 

Similar threads

Replies
27
Views
989
Replies
2
Views
1K
Replies
37
Views
7K
Replies
16
Views
4K
Replies
4
Views
1K
Replies
4
Views
2K
Replies
2
Views
2K
Replies
4
Views
3K
Replies
20
Views
2K
Back
Top