9 ms·
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?
- __d 8y agoI don't mean this pejoratively, but is your goal pure education? Or more training for employment? 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. 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.
- vinni2 8y ago> I don't mean this pejoratively, but is your goal pure education? Or more training for employment? 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.
- gtycomb 8y agoI agree with you very much so. A little story -- when my son was in his 3rd grade elementary, I showed him a little Python with turtle graphics. He absorbed it in like his Sponge Bob. I still remember the day when he took an old duck taped laptop of mine to school and his teacher had him do a demo before the class, explaining the python constructs that drove the turtle. The school made Python available at its labs for all students after that. Times changed so much from where I started! 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.
- arthev 8y agohttp://matt.might.net/articles/what-cs-majors-should-know/ http://matt.might.net/articles/what-cs-majors-should-know/ 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.
- vinni2 8y agoThanks for the link.
- scarface74 8y agoI 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 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.
- matt_the_bass 8y agoI think it is important to produce students who are fluent in the fundamental concepts of software engineering and computer architecture. So being fluent in things like pointers, circular buffers, memory management, stack vs heap, etc. is really important. 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.
- bjourne 8y agoJava is according to Tiobe the most widely used language and has held that position for close to 20 years. So not teaching the students that language would be doing them a disservice. You could argue that other languages are similar, but them being able to put the Java tag on their resumes will make it a ton easier for them when dealing with recruiters.
- sjg007 8y agoJava. They need to understand pointers etc... C/C++ segfaults are difficult to debug. Most undergrads have a difficult time compiling software especially with esoteric tool chains. I would say though JavaScript might be more useful career wise today.
- neilalexander 8y agoI think there's still very good reasons for learning C, not least because you are forced to learn to "think like the computer". Debugging segfaults in C is an exercise in understanding the memory space you are working with and a great way to learn to work through problems step by step.
- potta_coffee 8y agoI'm self-taught. I love C. It's ubiquitous, understanding C has helped me tremendously when learning other languages, especially since many languages are basically abstractions built on C. I think every serious programmer should learn C.
- aldanor 8y agoOne language where you can get a proper segfault. C, C++, maybe Rust. Knowing C is always good as it’s fundamental to many other things. 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.
- allenleein 8y agoFor learning to program functionally, my no.1 recommendation would be The Structure and Interpretation of Computer Programs (SICP). 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/projects/9 https://github.com/allenleein/brains/tree/master/Zen-of-Functional-Programming https://github.com/allenleein/brains/tree/master/Zen-of-Func...
- sixhobbits 8y agoDo they do more languages in third year? I did Python, Java, C, C++, MIPS, Haskell (at least one full course of each) and then a crash course in a bunch of older languages (1 week each) as part of a compilers course across 3 years of undergrad and I think it was a great balance. 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.
- ThrowawayR2 8y ago> What programming languages a CS undergrad should know? 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.
- 666lumberjack 8y ago> 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/ https://kennytilton.github.io/whoishiring/
- ThrowawayR2 8y agoTouché, I keep forgetting what a weird bubble HN exists in. 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.
- user5994461 8y ago>>> Is it bad if a fresh undergraduate doesn't know C, C++, Java or C# ? 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.
- kojeovo 8y ago> He's basically unemployable as a developer 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.
- mtnGoat 8y agoi am currently hiring developers and none of those languages are even remotely required. FWIW.
- potta_coffee 8y agoReally? No - I started with Python and Javascript. I didn't go to college btw - but I never learned anything about C / C# / Java before getting a job. I know about those languages now but it's definitely not a prerequisite for employment. Of course that may be affected by your location.
- scarface74 8y agoAny language they learn now may not be around for decade. More “modern” languages are still not as in demand as the “old” languages. 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.
- talltimtom 8y ago> it still doesn’t seem popular outside of large enterprise type companies What an odd argument for not learning language. A lot of these students will go on to work in large enterprise companies.
- Symbiote 8y agoJava is popular in large enterprises, but also on Android, in smaller enterprises (in my experience, lots of public sector work), and is fairly common for open source software. If you're already teaching Java, there's no reason to add C#.
- scarface74 8y agoAs a decade plus C# developer, I think an experienced Java developer could pick up the language with one of the “dummies” books. I would then tell them to study Linq. It would probably take a few days to get comfortable with Web API or EF on top of that if that’s part of thier jobs. 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).
- ggregoire 8y agoI hated learning Java but I have to admit it teaches a lot of basics: - 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
- danmg 8y agoThe features of the languages you pick should be orthogonal so they see different ways of thinking: Java, Fortran, Prolog, ASM. You just don't want them to memorize slightly different variations of Algol syntax.
- dasmoth 8y agoYep. “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.
- danmg 8y agoLISP/Scheme usually gets covered in pretty good detail in the standard "let's make an interpreter" required class. 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.
- dasmoth 8y agoAPL could be interesting, but the last time I checked everyone wanted real money for APL that you could run on modern hardware. There are definitely some options today: There's a GNU APL implementation (https://www.gnu.org/software/apl/ 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 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 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/ https://kx.com/connect-with-us/licenses/).
- scarface74 8y agoA language that doesn’t affect the way you think about programming is not worth knowing 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.
- shuri 8y agoTo maximize learning: - 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.
- andymoe 8y agoIt’s not super great to have to learn a new language and “advanced programming” (whatever that is) so I’d stick to something a prerequisite has used. I’m hopeful advanced programming includes testing and the “clean code/SOLID” concepts or something software engineering related. I’d say those advanced concepts are more useful than a specific language. Go or Python is fine.
- deleted 8y ago[deleted]
- PopeDotNinja 8y agoElixir/Erlang is pretty good at forcing one to learn concurrency.
- sloaken 8y agoLike many have said, a variety is important. Back in the day when I went to school we learned a primary language to do most things - compiler writing, algorithms etc. We then learned an assembly language. Then we learned a bunch of algorithms, then a bunch of topics. In my school we had 4 different specialty areas: Science - ie fortran, Systems - no additional language, Business - Cobol (yuck), SPSS, and SQL, And Architecture - you had to learn micro code. 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 ....
- bigasscoffee 8y agoNot knowing C/C++ and Java is ridiculous. Working with either of those for a few semester gives them the ability to teach themselves Python or Rust or whatever. Java is C#/OOP (many jobs want this), and C is the underlying basis for Python and similar to Rust/Go. Make an elective course where they do 2 weeks of Rust, Go, Python, Haskell, etc and learn about languages and compilers.
- chudi 8y agoC for the c convention and how to translates to machine code and how you can use this convention to interact with libs. 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.
- gt2 8y agoC, Java, and Python. And various projects in each to get exposed to why each are used. > 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.
- tropo 8y agoTeach modern C, with "restrict" and with the new-style initializers and aggregate immediates. Put a good deal of effort into showing how people get burned by undefined behavior. (strict aliasing, signed overflow of intermediates, etc.) Put a good deal of effort into giving students a feel for what the compiler can and can't optimize, and a feel for what the hardware has trouble with. You should be introducing and insisting on the use of tools like Coverity, VTune, Klocwork, valgrind, OProfile, perf, LTTng, Coccinelle, Astrée, Polyspace, and Frama-C. 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.
- diegoperini 8y agoIs this sarcasm or are these advices overkill?
- tropo 8y agoIt certainly isn't sarcasm. 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.
- richardknop 8y agoC, Python and one of C#/Java is what is considered a basis for graduates I think. Maybe a taste of one functional language so they have some idea about the concept. Nobody expects fresh graduates to be experts in programming languages as they will probably specialise in 1-2 languages in their first and second job and that will guide their career. It could be they end up using some totally different niche language in their job so better to stick to couple of major languages during university computer science courses.
- schindlabua 8y agoMy big 5 are C/C++, asm, Haskell, Prolog, and some LISP. They cover a broad spectrum of languages, each encouraging a different way of thinking.
- apexkid 8y agoUniversity curriculum should not focus on teaching programming languages. It should focus on teaching programming and computer science fundamentals in general. Languages are just a means to implement the theory. 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.
- potta_coffee 8y agoI'm not in academia, but in my experience, abstract thinking and problem solving skills matter way more than language syntax knowledge. I've learned Python, PHP, Javascript, C#, SQL, VBScript, Java and some other things in the course of just working for different clients and companies. I was able to learn these things because I know how to learn. 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.
- openfuture 8y agoI think teaching java or c++ to people who are just getting started programming is absolutely stupid. These languages have every possible paradigm crammed in to them so it's an absolute cognitive overload. Same thing can be said about JavaScript. I would teach rust as a low level language because the compiler forces you to internalize a very specific pattern of thought that is also useful when applied in other languages. Likewise I'd teach clojurescript rather than js for similar reasons and maybe also ReasonML in the future. It'd give students a taste of the different (popular) syntaxes (curly brackets, lisp and ML) and clean minimal mental models. Then when they go work in java or whatever they will benefit from having a clear way of thinking which can be applied in any language (because they'll know to only use 'the good parts'). I see too many people that are intimated or afraid of looking deeper because they were taught basic programming in environments that have grown into some sort of cthulhu. Another thing I'd have on the curriculum is a subject dedicated to learning your text editor (you'd pick an editor and over the semester learn to customize it in various ways, learn about modal keybindings vs. modifier keys etc.).
- vinayms 8y agoFor ego, and niche market, Scheme, Haskell and their friends. For job, FORTRAN, C++, Python, JavaScript and WebAssembly. For insight, APL, Forth, Erlang, Eiffel and brainfuck.
- AnimalMuppet 8y agoYou have two kinds of graduates: those who will work as computer scientists, and those who will work as software engineers. Those two groups have different needs. The computer scientists probably need a functional language (Haskell might be the best current choice). They should probably know Lisp, possibly Prolog, and probably C. The software engineers currently need C/C++, Java, Python, and JavaScript. They also need to know SQL. Go and Rust might be the future (and therefore "good to know"), but they're not yet the present (and therefore "have to know"). But I think that software engineers need more than languages. They need to know how to use source code control systems, debuggers, and static analyzers. They need to know what it's like to work in an existing million-line codebase after the original authors are all gone (because they need to know not just programming, but programming at scale, and they need to know why documentation, coding conventions, and good naming matter so much). Note that, of your graduating class, maybe 5% will go on to work as computer scientists. The rest will become software engineers. Keep that in mind as you design your curriculum.
- nyberg 8y agoNewer languages build on the concepts of the older thus students will be able to easily pick the older languages up later. I suggest Agda/Idris/Haskell in addition to C as it's rather trivial to write your own assembler in functional languages then use C to write missing parts of a full runtime system. This also allows students to explore writing their own compilers to better understand languages like C, C++, and even Java (bytecode isn't far away).