Ask HN: What programming languages a CS undergrad should know?
I am a faculty member of a CS department currently designing a new "Advanced Programming" course for undergraduate students in their 2nd year. What programming languages are an absolute must to know when they graduate? Currently they learn Python, Matlab, Go in various courses. The dilemma we are facing is to choose between old languages like C/C++, Java, C# or move on to modern languages like Rust or functional languages like Scala, F#. Is it bad if a fresh undergraduate doesn't know C/C++ or Java? Are they here to stay for decades to come?
63 comments
[ 4.9 ms ] story [ 83.8 ms ] threadFor more pure education value, I would suggest that you teach C alongside a computer architecture course. In that way, a student comes to an understanding of what the hardware is doing at a fairly low level of abstraction, and how to control it using a language that's not far removed.
I would not suggest C++ simply because it's so big, and effectively crams multiple different languages into a single syntax. Perhaps as a 3rd year elective?
Similarly, I'd suggest either Scala or Haskell (or Scheme) to give them experience with something other than a procedural / object-oriented paradigm.
None of this will directly help them get a job, although it will be of ongoing benefit to their eventual employers for the duration of their careers.
If your institution's focus is more on training for employment, then Java, JavaScript and/or Swift are probably better options to add to their skillset, alongside Python and Go.
Yes, of course, Java, C# and C++ are here for decades to come, but a few weeks of nights and weekends at home or a couple of online courses will pick up their syntax if the student has had a sufficiently broad background.
The goal is to strike a good balance between them. Our priority is to train good software developers and data scientists but at the same time let them show some relevant skills on their resume.
> For more pure education value, I would suggest that you teach C alongside a computer architecture course. In that way, a student comes to an understanding of what the hardware is doing at a fairly low level of abstraction, and how to control it using a language that's not far removed.
They already have a Computer Architecture course which teaches assembly and a bit of C (not sufficiently detailed). Sorry forgot to mention that.
> Similarly, I'd suggest either Scala or Haskell (or Scheme) to give them experience with something other than a procedural / object-oriented paradigm. > None of this will directly help them get a job, although it will be of ongoing benefit to their eventual employers for the duration of their careers.
Yes this certainly makes sense. Which is why I mentioned Scala as well. Also even though the course has the title "advanced programming" the classroom lectures will be theoretical and they will have programming assignments / projects which apply those concepts and we need to pick a language for that.
> If your institution's focus is more on training for employment, then Java, JavaScript and/or Swift are probably better options to add to their skillset, alongside Python and Go.
I didn't mention it but we also have a web programming course which covers php and javascript. We probably don't want them to focus on any languages which are exclusive to specific platforms like Swift.
Now computer languages are poetry that we all can learn, and its a necessary tool for any career path. When we talk about _CS_ Undergraduate training though, languages are peripheral and we need to get much deeper -- theoretical and hands-on grounding in hardware, software, network architectures, mastering CS fundamentals that help tackle organizational complexities that new tools and methodologies bring upon us on a daily basis (today ES6, webpack, mobility, data science, networks, etc. ) along with a large legacy world running SAP, Microsoft, etc. out there...and don't forget having enough on accounting, economics, and management under the belt.
has a notion of what languages are relevant for broad knowledge.
I read an article once that made a very good point re. why trying to anticipate industry needs is a fruitless effort compared with providing deep education, which mentioned how little would be gained by a focus on cobol during earlier decades, but can't find it at the moment.
If it's an advanced programming course, I'd focus on weirder topics to expand the students' minds while possible. They'll presumably get all the industry language practice they need later on.
If a college started offering a Java course in 2004, because that was a popular language then, in 2008, they would have been employable. Ten years later, they could still find plenty of Java jobs. The same could be said about .Net in 2004.
If it's an advanced programming course, I'd focus on weirder topics to expand the students' minds while possible. They'll presumably get all the industry language practice they need later on.
Later on when? They are coming out of college with theoretical knowledge but no practical experience competing with outsourced developers who do know the language and people who come out of a 12 week boot camp who can hit the ground running - or at least walking.
I don’t think the specific language is that important. But completing the program being competent in (at least) one high level language and one low level language seems valuable to me. With a strong background in fundamentals, students to learn new languages pretty easily.
My personal favorites are python and c, but I don’t think those specific languages are too important.
I also think a strong understanding of practical dev tools is important. Things like:
- using version control
- user vcs in a team/distributed environment
- how to do code reviews
- unit tests
- etc.
Python. (because ML/numerics/data science/web servers/various automation tools) Then again, to understand CPython you need to know C.
One functional language, to know how it works. Maybe Haskell, or Ocaml, or F#.
JS is always a bonus these days I guess, but it’s more about knowing browser stuff than the language itself.
It’s an awesome introduction to CS in general and covers multiple different paradigms including functional, object-oriented and logic programming.
If you want to dive in to FP deeper. I think you can’t deeply learn to think in a functional style without learning Haskell.
Here are some free pdf books about FP:
https://github.com/allenleein/brains/projects/9
https://github.com/allenleein/brains/tree/master/Zen-of-Func...
Unfortunately since I left, the "training" people have won out over the "education" people and they do mainly C# and .net with a bit of F# thrown in.
I think you can get by without C++ or Java professionally already if you have some of Python, Go, Rust, JavaScript but I would still recommend C++ at least so that people have some better context of what problems Rust/Go aim to solve and get a better understanding of how memory works (useful to keep in mind no matter which language you end up using day to day).
At least one functional language - I think Haskell is the nicest to learn as a beginner.
That depends; what type of institution are you teaching for?
If it's a research university producing future researchers, go wild but cover at least one common language, e.g. Java or C#. The screening processes at a research university tend to be sufficiently stringent that you can expect your students to be bright enough and motivated enough to pick up additional languages on their own.
If it's a teaching college, nearly all jobs now are web front-end/web back-end jobs and those that aren't are mobile or desktop apps. JavaScript + Java/C# are the order of the day. Offer C/C++/machine language as an elective if you can.
> ...move on to modern languages like Rust or functional languages like Scala, F#...
I would estimate that the job openings that use those languages at less that one half of one percent. Skim the monthly "Who's hiring?" posts here on HN if you'd like to confirm it.
I used Kenny Tilton's whoishiring browser[0] to search the latest (Sep 2018) Who Is Hiring thread with the query "clojure or elixir or scala or haskell or ocaml or reasonml or lisp or elm or f#", which should cover most of the modern function languages, and received 101 matches out of 676 jobs. That's about 15% (14.94% if you want to be precise), so you're off by a factor of thirty.
[0] https://kennytilton.github.io/whoishiring/
That being said, if I sum up the languages you list in the TIOBE index, it amounts to less than 2% so by that measure I'm only off by a factor of 4. My point still stands.
Well, it's a disaster. He's basically unemployable as a developer.
Industry and outsourced work is almost exclusively in Java or C#. All embedded or older desktop applications are fully C or C++. Web requires JavaScript nodejs or ruby or PHP or sometimes python.
You mean as a C, C++, Java or C# developer.
Like you said yourself, web requires JavaScript and typically another for the server side (unless node ofc). You can be highly employable as a web developer without knowing the older languages in this case.
My suggestion?
- C not “C/C++”. C teaches you the fundamentals of how computers work on the lower levels. You can go your whole career without ever knowing C but it should be foundational to understanding how other languages work under the hood.
- C# - I wouldn’t bother teaching it. This is coming from someone who loves .Net. C# is tied to tightly to Microsoft and even though .Net Core is great and cross platform, it still doesn’t seem popular outside of large enterprise type companies. It’s definitely not what the cool, hipster, startup kids are using.
- Java. I hate Java with a passion but, it’s still popular with the enterprise, it’s a mostly pure OOP language and it’s a good teaching language. Besides, it’s used on the most popular mobile platform (Android).
- JavaScript. Again, not my personal preference, but JS isn’t going anywhere because it’s on the browser and it’s the most versatile. It can be used on the browser, server, desktop apps, and mobile. If you teach JS deeply, you also get into protypical inheritance and a different paradigm than classic OOP.
What an odd argument for not learning language. A lot of these students will go on to work in large enterprise companies.
If you're already teaching Java, there's no reason to add C#.
The last time I looked for a job, .Net was already considered “older tech”. The writing is on the wall. It’s not going anywhere. It’s not “dieing” but unless MS can turn things around, it’s not going to be adopted by the next generation of developers. I’m not trying to be in management so I have to look at where things are going in the next 10 years. I spent my first 12 as a C/C++ bit twiddler, and the next 10 in .Net with a little front end web/JavaScript work during the time.
And while JavaScript “full stack developer” jobs are also becoming increasingly commoditized and wages seem to have stagnated for them too, it’s still important for the typical developer to add that to their tool belt. What are the chance over the next ten years that the Web will transition from JS?
(FWIW, these days I’m mostly an architect/team lead either by responsibility or title depending on which way the wind is blowing in a given year).
- strong static typing (I saw a lot of my teammates without CS background struggling with that when we moved from JS to TS)
- compilation vs runtime
- OOP
- software engineering, including using a framework, using a database, managing dependencies, unit testing
You just don't want them to memorize slightly different variations of Algol syntax.
“A language that doesn’t affect the way you think about programming is not worth knowing.” —- Alan Perlis. Quite an old quote, but the principle seems sound.
I’d probably add a LISP and an APL-family thing as valuable alternative points of view.
APL could be interesting, but the last time I checked everyone wanted real money for APL that you could run on modern hardware. Maybe some golfed Perl 5 could be used instead.
There are definitely some options today:
There's a GNU APL implementation (https://www.gnu.org/software/apl/). And Dyalog APL has gratis licenses for personal and educational use (https://www.dyalog.com/prices-and-licences.htm#educational).
J is available under the GPLv3 as well as commercial licenses (http://jsoftware.com/source.htm).
There are options for getting gratis licenses of KDB+ for non-commercial use (https://kx.com/connect-with-us/licenses/).
With the average cost of college being as high as it is and more than likely the students will come out with a ton of debt, the languages worth knowing are those that will help them get a job and start paying back the student loan in 6 months.
As long as you're taking non-bullshit upper level courses you will have to use one of "those languages that will help them get a job." Systems will have you doing C and ASM. AI will have you doing Python. Scientific computing will have you do Matlab, Fortran, Python and R. Software engineering will have you do Java. Computer Vision will have you do C++.
Vocational training in a four year program is a side-effect, not a feature.
Why is computer science special? Most other degrees are meant to prepare you for a career.
Do you think most people can afford to spend tens of thousands in college to be a theoretical “better citizen of the world”?
What are the people who didn’t get an education that was going to help them get a job do?
False. Employability is a side-effect of those as well.
If you don't like that, don't get a four year degree. Many people don't and are successful.
If you want to be forced to have a broad background of different areas in computer science, learn theory, and do many-many projects, get a four year CS degree. Don't want to be pigeonholed into doing the latest-greatest variation of Visual FoxPro for the rest of your life? Get a CS degree.
And what are they suppose to do after they graduate with a degree that won't get them a job?
Don't want to be pigeonholed into doing the latest-greatest variation of Visual FoxPro for the rest of your life? Get a CS degree.
A CS graduate that learned Java, .Net, Javascript, and/or C++ -- all popular languages a decade ago -- would still find themselves highly employable using those same languages today.
Yes they have to keep learning, but at least they wouldn't be in their parents basement not being able to find a job competing with a bunch of boot camp grads and outsourced cheaper developers.
Medical and Law are professional post-graduate degrees.
Education in the US is heavily subsidized and incentivized to keep a pipeline of K12 educators coming in.
Journalism is a liberal arts discipline. What vocational skills are they coming out with? How to follow a style guide? Most of them have to be fully supported by their parents if they want to take a prestigious unpaid internship in an expensive city, and even then the job market is very bleak. I'm really not sure where you're trying to go by bringing up journalism.
I'm really not seeing what point you're trying to make. The vocational skills learned are incidental. You will be employable in the field if you didn't slack off and challenged yourself while getting your degree.
How are they going to compete when they get in the real world? Most companies aren't willing to train junior devs how to program and why should they when there are plenty of junior developers who came out of the equivalent of "Java schools" and boot camps that can immediately be somewhat productive?
Yes, I've told my sons that I won't help them pay for any degree that won't help them be employable when they get out of school -- basically their choices were STEM related, education, or the medical field. Liberal arts was not an option.
I was also okay with them choosing trade school.
Nice straw-man you built there. If these graduates have either fallen through the cracks for four years and not learned a damn thing, I don't see the point of holding everyone back and forcing them to have remedial write iOS and webpages classes for four years. Why would you assume the outcomes would be any better?
https://blog.codinghorror.com/why-cant-programmers-program/
I really don't understand the point you're trying to make.
It became a popular meme because it reinforced the idea that we needed to import more H1-Bs to fill these roles that are going unfilled. Please don't be so naive.
I’ve interviewed computer science grads who can’t do the equivalent of FizzBuzz - write a function that can tell if a number is odd. Even after you tell them what An odd number is.
Is it really that hard to understand the “point I’m trying to make”? When students come out of college most have to get a job. What do you think they go to college for?
I’m not totally against the idea that people should consider the likely financial value of education when choosing between courses. On the other hand it’s concerning if debt funding of university-level education is pushing peoples’ time horizons to be as short as you propose.
- Learning c/c++ which helps connect the high level concepts to how computers work. Other languages like Rust may give similar results but may distract from the main lesson.
- Some functional programming. Programming in a functional way takes time to wrap your mind around. The concepts are more important than the language.
- Some language like Scala which packs many modern ideas.
To empower:
- Python is just fantastic. It helps focus on coding and can take you anywhere from "scripting" to web apps, machine learning, distributed systems, embedded systems...
- Javascript (or Typescript) because it's just everywhere and building a nice frontend is irrationally satisfying / impressive.
For the "résumé":
- Java can be a nice to have but if you know c++, scala or even python, I don't think most would care.
Go or Python is fine.
Today things are different. IMHO the first language you learn should be fairly safe with a great debugger. Why? Well few things suck as much as when the program is due at 10 AM, you are trying to figure WTF at 3 AM, and thus cute little print statements you are using are not coming out in a logical fashion. You are trying to teach them, not weed them out, a good debugger helps a lot.
Second I would introduce them to something tough like assembly language. Teaches them some of the truly dark arts. Lets them appreciate what is happening. If you really want to educate them get into Micro code and nano code. Although my personal experience was 80% did not truly understand it.
Everyone needs to learn some SQL to be well rounded.
An object oriented class is a good thing. While specific language? I always like the 'With a good debugger' answer. It is more learning less crying.
I think a functional language is a great thing. Although I would insist that they already have a grasp of recursion. If not they will slide through the class and never grasp it.
Coding where they build a web page and code is run at the client and some of their code is run on the server.
And I agree with matt_the_bass about version control, testing, code reviews. But I would add in requirements gathering.
Also inflict them with a real world problem - George, the guy we liked better than you and paid more and gave a better office to, just quite (because he is a real shmoozer and BSed his way into a better job). He has left behind this wonderful code, which he almost had finished. You have to get it working. What he left was some half baked requirements, a design document that looks more like a drawing of Santa and his reindeer, code that has a few bugs coding and 2 syntax bugs that keep it from compiling. Test documentation that is surprisingly well done (because someone else did it). If needed I can provide a list of people who can provide code for this ....
Make an elective course where they do 2 weeks of Rust, Go, Python, Haskell, etc and learn about languages and compilers.
Smalltalk because it's pure, simplistic and there isn't many languages that lives in a image, it's truly a a different kind of oop.
Prolog because you try to understand what can you do with the computer if you just ask something to it.
Haskell or some functional to understand lambda calculus and why is it powerful.
> Is it bad if a fresh undergraduate doesn't know C/C++ or Java? Are they here to stay for decades to come?
It will be hard to truly know any of them deeply with just some study. If you haven't heard already, employers hire fresh undergrads based on their potential and a project or 2 they've done. You're going to be able to pick up and work in whichever language they use (and projects you switch to) on the job.
If there is time, which is unlikely:
Teach the ispc language. This C variant is a good way to get in the mindset of vectorizing.
Teach how to write a cross-platform JIT. Get it working on both Windows and on a Linux with SELinux enabled. Alternately, get it running on both x86-64 and aarch64.
Rust might be worthwhile. It's a gamble that could pay off well, or not. How are you at predicting the future? This could be headed the way of Tanenbaum's prediction of HURD on SPARC, or it could really take off.
The class is "Advanced Programming". If it isn't going to be advanced, then the name is improper. This could be a case of name inflation.
All of that stuff is great to learn. All by itself, the first suggestion makes one immediately employable.
Now lets talk about what students should know: - Basic programming principles. Loops, conditions etc. - Algo and Data Structure. - How a computer program is executed internally. - Compilation process - OOP - Programming paradigms: Static typing, dynamic typing, Functional, Interpreted, Compiled, etc.
Now lets see try to come up with the smallest set of programming languages to cover all these topics. 1) Python -> Learn programming, algo, etc 2) C -> Learn execution of program, pointers, internal details. 3) Java -> OOP, static typing, compiled etc. 4) Haskell -> Functional.
If I were teaching students the way you're trying to, I guess I'd start with Python because it's almost pseudocode which makes it a great medium for translating concepts and trying things out quickly. Then I'd teach my students C and get them hacking on Unix/ Linux stuff. Then I'd have them learn a functional language, but I don't really think it matters which one. I guess if I were to pick, I go with Clojure or Scala because there's at least some commercial value there.