11 ms·
> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative lan
by iamevn 6y ago
> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide.
At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using Java or Python depending on who taught which of the courses in that first series.
People found it frustrating how much work it'd take to get their programs to even compile but that's a good thing in my view. If it wasn't compiling, that was normally because the compiler found an error that would still be there at runtime in another language.
- MaxBarraclough 6y ago> People found it frustrating how much work it'd take to get their programs to even compile Makes sense if they're students working on small projects. Ada is explicitly designed to make large programs readable, and willingly trades off on writeability when the two come into conflict. It isn't going to shine if you're writing small 'single shot' applications, that isn't what Ada is for. (Ada also commits to using many English language words where languages like C use symbols. SQL does this too. I'm not sold on the idea that this improves readability. Of course, there's far more to Ada than the skin-deep matter of its wordy syntax.) This is similar to the readability/writeability tradeoff of moving from JavaScript (more writeable) to TypeScript (more readable and more refactorable). See the current discussion thread at [0]. Interesting reading (for some of us at least): the original Ada design rationale document, from 1986 [1]. [0] https://news.ycombinator.com/item?id=26314756 https://news.ycombinator.com/item?id=26314756 [1] https://apps.dtic.mil/dtic/tr/fulltext/u2/a187106.pdf https://apps.dtic.mil/dtic/tr/fulltext/u2/a187106.pdf
- Blikkentrekker 6y ago> (Ada also commits to using many English language words where languages like C use symbols. SQL does this too. I'm not sold on the idea that this improves readability. Of course, there's far more to Ada than the skin-deep matter of its wordy syntax.) Wasn't the hypothesis behind COBOL that this would allow managers to gain a certain level of understanding of the code? I find that it made COBOL code notoriously unreadable.
- andi999 6y agoC is actually middle ground, if you consider APL.
- rsj_hn 6y agoI really think a semantic facelift would do wonders for ADA, and shouldn't make much of a difference for readability. I know a lot of people are turned off by this.
- KMag 6y ago> I really think a semantic facelift would I think you mean a syntactic facelift, without changing semantics. You mean making the syntax look more like TypeScript, Kotlin, or something, right?
- rsj_hn 6y agoYes! Thanks for the correction!
- MaxBarraclough 6y agoI suspect overhauling the syntax is the kind of change that the committee would see as rather dramatic and with limited payoff. Introducing an optional alternative syntax alongside the existing one, would likely be seen as opening the door to syntactic inconsistencies, more likely to harm readability than to enhance it. The Python community has a relevant saying: There should be one -- and preferably only one -- obvious way to do it. [0] I don't think it's a serious problem that Ada uses and then rather than &&, and uses or else rather than ||. It's the kind of thing you can get used to with time. [0] https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/
- Lucretia9 6y agoand then and or then are shortcut operations, not the same as && and ||, those are and and or.
- MaxBarraclough 6y agoIn C and C++, the && and || operators both short-circuit. For eager semantics in C/C++ you could make do with the bitwise operators & and |, keeping in mind that they're bitwise and not logical. You could do something like (!!first_int) | (!!second_int). You'd be better off forcing eager evaluation by saving the results to local variables, and then use the short-circuit logical operators. Ada's and and or operators have no direct equivalents in C or C++. https://en.wikipedia.org/wiki/Short-circuit_evaluation#Support_in_common_programming_and_scripting_languages https://en.wikipedia.org/wiki/Short-circuit_evaluation#Suppo...
- throwawayboise 6y ago> after my year they switched to either using Java or Python They do this because of intense negative feedback from students who don't like having to learn languages for which there is no job market.
- mmcdermott 6y agoWhich is fair, but also kind of funny. In theory, what most of us do day to day is software engineering and computer science is a niche corner of mathematics. But the broader expectation is that the math-niche teaches day to day programming.
- iamevn 6y agoI'm not sure this was the case for us, there were plenty of other courses in the major that involved both widely used language and more niche ones. I think it was more that we didn't have enough professors who were bought-in to Ada to handle the volume of students in those initial courses. The professor who used to teach all the intro courses (and was the biggest advocate for Ada there) became the department chair and let other people take over those courses so he could focus what time he had on some of the upper level courses. Pretty sure they still use Ada in their concurrent programming course too. Edit: Got curious and I think this is all the languages I used as part of an undergrad CS degree in approximately the order I first used them: Ada, Racket, C, Make, x86 ASM, Java, Bash, batch script, PHP, JavaScript, MySql, Python 2, Inform 7, Blender Game Engine visual scripting, ICON, Lua, Erlang, and ROBOTC I'm honestly surprised how much variety there was despite the only academic language being Racket.
- goatlover 6y agoThere's something wrong with the idea that you go to college for a computer science degree just for the job market, and not the science. If getting a job is all that matters, surely a trade school or boot camp is the better route. But then I'm of the opinion that college shouldn't be in the market of mass producing future workers.
- flukus 6y agoThe problem is employers require computer science degrees, especially for entry level jobs. Then there's things like coding tests about inverting binary tries and such that tends to be less thoroughly covered in trade schools. When employers have more realistic demands we might see some change. At the same time colleges are morphing into expensive trade schools, their advertising is full of phrases like "preparing you for the real world".
- bee_rider 6y agoI help beginner python students. Python might be a nice easy scripting language for bashing out NUMPY scripts, but I'm beginning to suspect it is terrible for teaching. The "what type is this variable, and will this function automatically convert it for me" game is not very fun at all for beginners.
- dTal 6y agoI agree that Python is a bad language for beginners. It is conceptually heavyweight and full of opaque behavior. We lost a lot when BASIC stopped being the "standard" introduction to programming.
- Blikkentrekker 6y agoI feel that Python will be known in the future as the language that caused a generation to have a crippled sense of reasoning about how to design computer programs. It's lack of a normal, standard scoping model alone teaches a very flawed reasoning about computer programs.
- goatlover 6y agoI'd vote for Javascript over Python.
- Blikkentrekker 6y agoJavascript is not so often used as a teaching language. There are many languages which hammer worse practices than either such as POSIX shell scripts, but they are seldom used as a teaching language. Python is in the unique space of having made horrible design decisions but somehow often used as a teaching language. One would assume that programmers are to understand such concepts as block scoping rules and the difference between lexical and dynamic variables. — how is Python to teach them that?
- rsj_hn 6y agoJavascript is too weird to be a teaching language. Lexical scoping, invisible and sometimes unintuitive conversion rules, challenging runtime environments, and asynchronous code are important concepts but I wouldn't put them into an intro to programming class. IMO the ideal programming track would be as follows: Intro to programming track: * Assembly --> to understand the basics of how computers work and learn simple procedural and abstraction rules. * C --> more procedural code, more abstractions, and higher order memory management * Java --> to learn interfaces, object oriented code, and an introduction to functional programming concepts like lambdas, pure functions, the value of immutable objects * {Racket/LISP or Favorite functional language} --> to gain intuition with more pure functional programming Then, I'd have separate tools track: * web dev * database * embedded dev * AI, etc. Then a separate theory track: * context free languages, regular expressions, compiler design * algorithms and data structures * some network theory and fault tolerance results Then I'd have a professional track: * tools: learn source control systems, IDEs, debuggers, profilers, bug management systems, different dev systems, using Jenkins or other CIT tools. * skills: learn about secure coding (best practices for writing auditable code with known failure modes), efficient coding (calculating big O for a given code, fixing performance bottlenecks), maintainable coding (best practices for decoupling code, writing testable code, writing unit tests) * theory: track where you learn advanced algorithm theory, design patterns, hopefully centered around case studies. With elective tracks for things like OS theory, networking, etc. Too many people leave college with lots of information about data structures and algorithms but don't know how to write a unit test, how to use an IDE, how to write unit tests, how to write secure, maintainable code.
- ksec 6y agoI am not sure if this is still the case today, but Computer Engineering in EE Department used to teach Pascal / Ada / C as the first programming language. With the expectation that making a program to compile correctly is hard. Before you move off to something like Perl / Java / Python. While in CS they tends to start to Python or Java. And you start learning all the OO, Procedure or whatever paradigm before going into Web or other area of development with PHP. Where you get some results earlier. I used to think EE way of teaching sucks. Old fashioned, not following the industry trend. Boring. Teaching you about OSI Models while CS students were already having some fun with the higher level Web Development. Now I tend to think EE's way is far better.
- mmcdermott 6y agoI feel this. My CS program was in Java. After a few years in industry, I believe that CS should start with either C or Scheme. C to teach you about real machines, Scheme to ignore the machine and do math (algorithms).
- cgh 6y agoI get what you're saying, but learning C teaches you about the C memory model instead of "real machines". C was designed for portability across different architectures and, believe it or not, was considered high-level and abstract at one time. But I agree that learning C is valuable because I believe that learning about manual memory management is valuable.
- Kototama 6y ago> But I agree that learning C is valuable because I believe that learning about manual memory management is valuable. You need to do it in Ada too :-)!
- mmcdermott 6y agoAnd that's fair. I tend to view C as high-level assembler which does mean some loss of fidelity from pure assembly. It seems like a case of being "close enough", I suppose, because switching to pure assembly would make it a lot harder to cover the subject matter in a standard semester.
- jandrese 6y agoWhen I went to school the instructor talked a bit about Ada, but as far as I know there weren't any compilers available that mere students could afford. This was in the mid-90s. I remember doing a bit of comparison of the syntax between languages, and Ada's lack of anything like a switch/case statement stood out, but the instructor did talk up the idea that if you could get it to compile it would run in Ada, assuming you didn't hit a compiler bug. Apparently getting the compilers working properly was a problem at the time.
- Jtsummers 6y agoI don't know when it was added, but Ada does have a switch/case equivalent construct and I can't imagine it wasn't available early on. case X is when 1 => ...; when 2 => ...; when 3 | 4 | 100 => ... when others => ... end case;
- okl 6y agoIt was always part of the language, http://archive.adaic.com/standards/83lrm/html/lrm-05-04.html#5.4 http://archive.adaic.com/standards/83lrm/html/lrm-05-04.html...
- jandrese 6y agoI have no idea what my professor was on about then. I remember him showing a slide of this ridiculous looking if/then/elseif... chain compared to a C switch statement.
- Lucretia9 6y agoI was at uni in 1995, they used gnat 3.15p.
- Lucretia9 6y agoA lot of Universities and company's were bribed by Sun to start using Java.
- SeanLuke 6y agoDo you have any evidence for this? As an early university adopter, I sure would have liked to know how to get in on that sweet Java bribe money.
- fulafel 6y agoIn universities there were steep educational discounts of Sun hardware. At the time administering labs full of PCs was a nightmare, and a lot of departments were culturally predisposed towards Unix anyway, so a natural result in many places was Sun workstations or Sun Ray terminals where Java was well supported and was portable enough to also run on the student personal PC. This is a well known pattern in services now too, lots of platforms are buying user market share by offering free/cheap service for college students and reaping the revenue when the students move on / generate invites. I wouldn't call this bribes but you can make an argument that it's buying mindshare that you wouldn't get on your own merits.
- SeanLuke 6y agoIn 1996-1997 I ran Java 1.0 or 1.1 on Solaris, MacOS 9, and Windows. I developed for, and on, all three. It was available on a number of other Unix implementations, including Linux and DEC. In addition to HotJava, Java applets ran on Netscape. In 1997 Symmantec had a popular free JIT that ran on most everything. These platforms dwarfed Solaris installations. How exactly were these minor Solaris boxes helping sell Java again? Quite to the contrary. If anything, Java was helping sales of future Sun boxes, rather than the other way around. Sun worked hard to make sure Solaris ran Java efficiently and stably, so if you were a Java developer you might consider Sun boxen professionally.
- pjmlp 6y agoOur university started to use Java right way in 1996 for compiler design and distributed systems. Sun didn't need to bride our teachers, doing the same in C and C++ was such a pain with 1996 compilers and POSIX, that they didn't thought twice about changing into an interpreted language.
- d3ntb3ev1l 6y agoAda was also taught at my Comp Sci program back in 1987
- ardit33 6y agowhat school did you go to? My university (Radford) did teach Ada as well the first year, way back in 1999, and switched to Java after it. I liked Ada a lot, but Java gave me employment after school.
- nantes 6y agoThey were teaching Ada in the Intro to Computer Science classes at Truman State in the mid-2000's as well. I think they eventually switched to Python sometime after I graduated 2008.
- iamevn 6y agoWestern Washington University. I think they dropped Ada from the first courses in 2012 or 2013. Would be curious to see how those courses heavily featuring Racket have changed in the last decade while Racket was rapidly improving.
- agumonkey 6y agoI think there's a pedagogic void here. Everybody enjoys quick returns. be it a lisp repl, php f5 refresh or bash .. the desire to have clear mental model of your program state comes after (unless you have both brain power, talent and/or passion for that)
- 7thaccount 6y agoThere's a lot of Python dislike on here, so I thought I'd add my anecdotal story. I learned Basic, C, Assembly, and Matlab in college (in that order). However, I was never a very good programmer. After graduating, I bought an intro to Python book and read it cover to cover and did the examples. I then started writing scripts and it all kind of clicked. I found it really simple to build stuff. There's lists, tuples, dictionaries, functions, iterating, easy branching...etc. There wasn't a whole lot to remember. I did find it confusing at first why some things used function syntax min(a) and other things used object oriented notation like mylist.sort(), but it wasn't too hard to remember all the stuff I actually needed. I was able to start using classes when I felt I was ready. Since then I've read books on and played around with Clojure, Common Lisp, Haskell, APL, Forth, Prolog, Ada, Powershell, Perl, Bash, Awk, Julia, C#, SQL...etc. During that time, I've found that Python holds it's ground in being very expressive, while easy for others to understand and performant enough for most uses with libraries like Numpy. Each time I try to move to a "grown-up" language like Java, I'm shocked at how verbose and clunky everything is. Sure it's great for production systems, but it's awful at just getting stuff done. Python is used almost exclusively by all engineers at my company (some C#) in hundreds of automation scripts. Some programs are 10,000+ lines of code and are still maintained and easily read by others. We're mostly electrical engineers too, so everyone picked up coding on their own and we find most codebases are still pretty consistent. I think Ada is a neat language for high reliability systems, but I don't think I'd choose it as a teaching language due to a lot of the friction with getting simple programs to work and wrestling with types. I've had very few issues with types in Python. I generally just use string, int, and float conversions when needed.
- pkolaczk 6y agoI started the other way round and came to Python long after I coded a lot in statically typed languages like Object Pascal, C++, Java, Scala and Rust. My feelings about Python are quite opposite to yours. I'm actually quite surprised how clunky Python is from my perspective. I expected a small, simple beginner-friendly language, optimized for gluing stuff together, but I've found a huge number of overlapping features and idioms, more ways to do the same thing than in Scala, half-broken libraries with poor inline documentation, lot of "stringly" typed code everywhere where programmers don't seem to know other types than strings, ints and dicts, no ADTs / pattern matching, package version conflicts and all that with no help from the type system and unreliable help from IDE autocomplete. Type annotations help a bit, but they are still far behind what's available in modern statically typed languages. I've also run into a few things that were weirdly complex to do compared to other languages - e.g sending rest requests in parallel. Something I'd expect a glue language shine at. It just feels like a major step backwards at least vs Scala and Rust which I used most recently. So maybe it is a matter of earlier experience, familiarity and expectations?