r/AskComputerScience • u/Jigglytep • Jan 25 '24
What is the point of programming languages course?
I’m in my last semester of CS and I’m trying really hard to figure out the point of the programming language class.
It’s taught from the “modern programming languages “ book.
The first chapters are about “grammar” and further in the book it discusses ML (not machine learning a language called ML).
I had some strange classes in my academic career but none of them did I think they were pointless.
I don’t see a point to any of this. I don’t see a point to studying grammar theory or a language that is not used anywhere in the industry.
Am I being short sighted?
31
u/Ok-Lavishness-349 MSCS Jan 25 '24
Well, grammars are used in developing compilers, so grammar theory is used by companies that develop compilers. Also, your curriculum is computer science, so a certain amount of theory is to be expected; if you just wanted vocational training, there are other routes for that.
7
u/AFlyingGideon Jan 25 '24
Well, grammars are used in developing compilers, so grammar theory is used by companies that develop compilers.
What some students may not realize is the generic utility of parsers. My wife wrote one, for example, for a cash register. I've written them for messaging systems.
Understanding grammars also helps one learn new programming languages.
5
u/Ok-Lavishness-349 MSCS Jan 25 '24
What some students may not realize is the generic utility of parsers.
Yes, this is true. I have written several parsers for applications other than compilers. And, I used Lex and YACC to do it, so I explicitly used grammars.
Understanding grammars also helps one learn new programming languages.
This is true too. And, grammars are essential in developing and documenting programming languages.
18
u/UntangledQubit Jan 25 '24
I do not think CS classes need to have industry application - I didn't see much application in my formal languages/automata class, but it is valuable knowledge in the field.
However, I do think that this class does have very practical applications. Understanding the internal mechanics of various kinds of programming languages is really helpful when learning or translating between programming languages. All software developers get this skill eventually, but this theoretical knowledge gives you an actual basis for it. Also, the class tends to involve writing short algorithms in an imperative, a functional, and a logic-based language, so you get some practical exposure to very different styles of programs.
11
Jan 25 '24
Well the point isn't to prepare for the industry. Computer Science is an academic discipline and the study of programming languages is a valid topic to do research in. This class is to prepare for that.
11
u/EatPb Jan 25 '24
You aren’t in a programming bootcamp. You are a computer science major. Computer science is a field of study. If you just want career practical skills, you could have skipped the CS degree and just took some programming courses.
Computer Science is an entire academic field beyond just writing code for a job lmao. It’s like asking why there are math majors that study theoretical math when most jobs are going to be computation.
I don’t know why you would waste your time doing the whole major if the theory/academic side doesn’t interest you. There are programs/classes that train just for industry skills
1
u/Objective_Mine MSCS, CS Pro (10+) Jan 25 '24
I don't know if things are different in different countries, but I don't think doing a major in CS is necessarily a waste of time even if your goal is just to do software development or other typical industry work. Sure, there are other routes and degrees such as vocational or lower-level college ones. A bachelor's in software engineering, while taking the time and effort of a bachelor's, might also be a tighter fit.
But including some of the more theoretical concepts or going a bit further into the maths can also be useful even just for software development. Just to give an example, understanding relational algebra might help understand database joins. Understanding joins better could lead to a better understanding of how queries can be optimized.
Understanding how significantly logarithmic growth differs from linear growth can help understand the importance of database indices.
Automata or formal languages theory might help understand why extended non-regular regular expressions can in some cases have exponential time complexity. Not necessarily a likely scenario to come across, but it doesn't hurt to have someone with that knowledge nevertheless.
And so on.
Some topics that a self-respecting CS programme includes are of course rarely applicable in software development, or at least in the vast majority of it. So for someone wanting to optimize fully for industry job applicability, it might not be the best fit. But there's also a lot in a CS degree that might seem theoretical but which IMO could actually be useful, even without going into the whole "science" part in "computer science".
14
u/madmaxx Jan 25 '24
The purpose of teaching ML is to show students a reasonable example of functional programming (even if it is an "impure" functional example). There are several models of representing logic for computing, and functional style programming is certainly one worth understanding generally.
Grammars, as a language construct, are also quite helpful for computer science students to understand. As you progress through a career in software, these meta concepts can be helpful to reinforce your understanding of whatever languages you use in research or production environments, and will likely end up useful in some system you are a part of designing.
We had an optional course in our program that was a language survey course, that was a follow-on to the programming languages course. We had to implement the same program in 7 languages in one semester. The vast differences in thinking between the languages was one of the most transformative steps in my learning. Some problems solve better (faster, simpler, safer, more elegantly) in specific types of languages. This is something easier to see with direct experience in at least a few different style of language.
It's not all that different from teaching grammar with any human language. Understanding how you communicate a thing to a human or computer will equip you better to come up with better ways of communicating, and possibly even new languages and tools in the future.
3
u/AFlyingGideon Jan 25 '24
The purpose of teaching ML is to show students a reasonable example of functional programming (even if it is an "impure" functional example).
It's been years since I learned it, but my recollection is that ML also does interesting things with typing that are worth understanding by a computer scientist or software engineer.
The vast differences in thinking between the languages was one of the most transformative steps in my learning. Some problems solve better (faster, simpler, safer, more elegantly) in specific types of languages. This is something easier to see with direct experience in at least a few different style of language.
Yes. I can recall prototyping something in LISP before producing a production version in C. C was the target language for various pragmatic reasons, but the algorithm was a more natural fit for LISP, and that let me play with the idea.
These courses should always be a part of a CS or SWE curriculum.
1
u/sohang-3112 Jan 25 '24
We had to implement the same program in 7 languages in one semester.
Do you remember which 7 languages were these?
2
u/madmaxx Jan 25 '24
This was in the 90s so my memory might not be perfect, but IIRC we covered Haskell, Smalltalk, Lisp, Prolog, C++, Assembly, and (I think) Erlang. There was an example language for most programming styles, and a few takes on functional programming. Haskell was the surprise of the group, as it solved the problem from the semester especially well.
7
u/wjrasmussen Jan 25 '24
Extremely shortsighted, but not likely in away that is obvious and nor in a uncommon way.
6
u/MathmoKiwi Jan 25 '24
It's about improving and expanding your skillset beyond simply the one or two languages you're using currently most of the time. So that you stop thinking of yourself as "a Python programmer" (or "a Java programmer", or whatever), and you're just simply "a programmer" able to think more abstractly and just use whatever is the best tool for the job.
3
u/phlummox Jan 25 '24 edited Jan 25 '24
Is it this book? If so, then your course is what in many other universities might be called "Programming Language Paradigms". The aim of a course like that is to expose you to paradigms other than the two most common (procedural and object-oriented[1]). ML is a language from the functional programming paradigm; other paradigms you might look at include logic programming and stream processing.
A computer science degree aims to equip you with the skills to choose the right tools and abstractions for any problem you might encounter. If you only know about procedural and OO languages, you might think that they are the best choice for all problems. But a well-educated CS graduate is familiar with other paradigms as well, and can recognise the circumstances where they would be appropriate.
(I'll mention that the textbook your professor has chosen sounds rather unexciting to me, and doesn't have terribly good reviews on Amazon. I studied using this one, and found it very good.)
[1] Although object-oriented programming is often taught so cursorily or badly that students come away with many misconceptions about it.
1
u/roman_fyseek Jan 25 '24
They want to know that you can actually piece-together what they've just taught you about computer science. If you can't, you've just learned some math.
1
u/EpitomEngineer Jan 25 '24
I have the degree and 0 lines of code in production. I work with large data systems and explain the technical concepts and constraints to business folks.
I have used this knowledge more than anything in the past 6 years of working. It has helped me understand code in languages I’ve never written and the thought patterns of how they are implemented.
Being able to translate the purpose of that code into the language of the business partners, read as paycheck holders, is big if you want to work in a big corporation. The same goes in reverse, translating the business needs into requirements for a data engineer, data scientist, front end developer, or infrastructure engineer. The way each language is structured influences how I write requirements. The goal is to communicate the requirements in the same thought patterns as the language.
And as you can tell from that paragraph, the order of thoughts matters when communicating effectively. If this were paid work, I’d edit that to tell a better story.
1
u/Tai9ch Jan 25 '24 edited Jan 25 '24
It sounds like the point of this class is giving you a small glimpse into a couple areas of the field of computer science that your other classes didn't really look at. This is hugely valuable, just so you have some idea what sort of things people have learned in those areas.
Here's some questions for you:
Can you write a computer program without bugs?
What would that even mean?
Can you mathematically prove a program has no bugs?
Is this one question, or are there a bunch of different ways to approach it that end up being different questions?
What limits are there on such proofs?
Does it matter what programming language you write it in? Can the language design make it easier?
What even is a programming language?
Are there cases where having such a proof would be very useful or even essential in practice?
1
u/Mango-Fuel Jan 25 '24
or a language that is not used anywhere in the industry.
hmm, ML is the basis for OCaml which is the basis for F# or something like that
also Facebook does at least some stuff internally with ML
(IIRC Eric Lippert worked at Facebook for some time, specifically working with ML, but he was later let go and his team disbanded and his project abandoned.)
1
u/shakerdontbreakher Feb 22 '24
It's so you can have a broader understanding of programming languages. For instance, you might not otherwise know about procedural, imperative, functional, or OO as categories. I think functional is very important and I don't think students would get exposure otherwise.
0
u/peabody Jan 26 '24
A programming languages course is trying to teach you how programming languages are implemented. You don't necessarily need to be an expert on how to make your own programming language, career-wise, but I think most people would understand that it's potentially important to have some background on some of those fundamentals. Somebody needs to be an expert on this stuff to help make our compilers and language tools.
-3
u/Miss_Understands_ Jan 25 '24
Ooo, snake eyes! I'm sorry sir. Next rollah please...
The Force is not with this one.
Not yet time for you to leave, grasshopper.
-5
u/ChooseMars Jan 25 '24
To make you feel like recruiters are idiots when they reject you because they think you can’t pick up a new language.
66
u/neomage2021 Jan 25 '24
You are majoring in computer science not code monkey programming.
You don't think understanding one of the foundations of the area you chose to study is important????