r/AskProgramming • u/[deleted] • Jan 18 '21
Language What is the worst programming language?
5
u/wrosecrans Jan 18 '21
English.
0
23
u/mikeyj777 Jan 18 '21
Objective C. Guarantee the guy who wrote this was dropping acid heavily.
4
4
u/OutOfTempo_ Jan 18 '21
Good thing Swift exists now.
Thought I feel sorry for people with dev jobs who have obj C in their codebase :(
2
u/pragmojo Jan 18 '21
Eh I worked with ObjC quite a bit for a period, and I didn't find it so bad. It had some cool features, like the best C interop of any language I have worked with (being a superset of C and all).
Don't get me wrong, I would not choose it for any project, but I feel like once you get past the weird syntax it's not that different than Java - if anything a little bit nicer to work with.
0
Jan 18 '21
[deleted]
4
u/mikeyj777 Jan 18 '21
Lol, I spent a year developing an app in objC before I even really understood oop. Dreadful...
11
u/vorpal_potato Jan 18 '21 edited Jan 18 '21
A valid INTERCAL program must have some of the lines begin with the PLEASE keyword, as this is polite -- but not too many, as that would be obsequious. A variety of control flow constructs are provided for your convenience; although GOTO is not available, you will find that COME FROM has a multitude of uses. Numeric output is, by default, in a nonstandard variant of Roman numerals.
1
u/wikipedia_text_bot Jan 18 '21
The Compiler Language With No Pronounceable Acronym (INTERCAL) is an esoteric programming language that was created as a parody by Don Woods and James M. Lyon, two Princeton University students, in 1972. It satirizes aspects of the various programming languages at the time, as well as the proliferation of proposed language constructs and notations in the 1960s. There are two maintained implementations of INTERCAL dialects: C-INTERCAL (created 1990), maintained by Eric S.
About Me - Opt out - OP can reply !delete to delete - Article of the day
This bot will soon be transitioning to an opt-in system. Click here to learn more and opt in. Moderators: click here to opt in a subreddit.
1
u/VirtualLife76 Jan 18 '21
Duno why, but I would love to see PLEASE as a keyword in languages. Like maybe when asking for a promise.
1
u/KingofGamesYami Jan 18 '21
You'll be happy to know LOLCODE has 'PLZ' (shorted form of please) as a keyword
7
u/Poddster Jan 18 '21 edited Jan 18 '21
Javascript
The design is objectively terrible and it's the only choice for client-side code on a browser. I can't wait for WebAssembly to take the throne.
The infrastructure around it and complete lack of a browser-side standard library also means that every web page is bloated to hell.
Bash / shell scripts.
I write a lot of these for work and they're basically impossible to do correctly, especially if you're going for full POSIX compliance with no gnu extensions (i.e. running on busybox).
"How to iterate a directory that contains files with spaces in them" is basically impossible, as far as I can tell. Sure, you can do it with some specific kludges, e.g. changing lots of environment variables... but those then have impact on the other things inside of the loop and it's just a massive headache.
Reading some parameters is also a massive code bloat. Sure, you can use $1 and so on, but to do it properly and portably requires a bunch of unreadable nonsense. * Infact everything about shell scripts is a massive headache.
C.
Again, I write a lot of C for my job and, despite having done it for 15 years now, I really hate how dangerous it is. It's as bad as shells scripts in terms of allowing you to do many things, yet doing something correctly takes a lot of work. It'a clearly a relic of the 60s and that's such a shame, as the abstract model it's working on is so out of date.
If you've heard of "stringly typed" then I believe C to be "intly typed". If you're working with POSIX then there's 500 integer types all with slightly different ranges that you need to constantly be keeping track of to ensure there's no truncation. To combat this you can turn on every GCC warning, but then, due to implicit promotion rules, it turns out that there's possible bugs everywhere! The biggest problem is that, like with Javascript, there's often no other choice for some of the platforms I work with.
Related to this is how the compiler writers have taken over the standards committee. The compilers for K&R C were very straight forward and would allow you to write code that would compile into the equivalent assembly. You could more-or-less guess at what it would produce. However, in the name of performance, compiler writers have abused the notion of "undefined behaviour" to result in some truly impressive performance gains, but at the massive cost of being an incredibility confusing language to work with. Let's say you want to add two numbers in C and check if they overflow. OOPS, you can't. Despite your target platform supports this via the 'overflow' flag there's no way to do this. Any naive code you write to check for this is probably wrong. You basically have to do exactly as CERT C say and compute the number twice.
There are so many pointless warts in the language that could easily be trimmed. Allowing people to specify array parameters is nothing but a pointless newbie trap. It will never work the way they expect, yet the spec and the compilers allow you to do it just fine.
This kind of thing doesn't look to be going away, either. The C committee refused to make any useful changes because of legacy code in one of it's members codebase (who refuse to simply use an older version of the spec...), and because the compilers writers wring their hands about "performance".
I'd love a C replacement that's just C with more type safety, statically ranged integers, and some simple rules that allow the compiler to tell you You're doing it wrong. Except every C replacement I've looked at ends up actually being a C++ replacement and that's not what I need!
Gradle / Groovy
Getting an entire Java project to compile takes like 3 lines of boilerplate gradle. The rest is all gradlemagic. But if you want to tweak something a tiny amount then you have to reimplement everything and now you're doing 500 lines of some insane, dynamic, declarative language with poor documentation, running on some crazy compile model that no-one understand. At that point I'd be wishing for make scripts.
nmake
The amount of tedious problems I've had with nmake scripts because of a newline in the wrong place. ARGH.
1
u/raevnos Jan 18 '21
"How to iterate a directory that contains files with spaces in them"
for file in /path/to/directory/*; do # something with "${file}" doneLet's say you want to add two numbers in C and check if they overflow. OOPS, you can't.
Not standard C, but https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Integer-Overflow-Builtins.html
1
u/Poddster Jan 18 '21
for file in /path/to/directory/*; do
# something with "${file}"done
I'm amazing that this works and is so simple. It also looks completely POSIX/busybox compatible. And I'm amazed that it's not on any of the stackexchange sites answering this!
edit: Ah, it doesn't handle
.dotfiles. TOO GOOD TO BE TRUE :( I could just do two loops, one for dots, one without, but it's still a PITA.Which also illustrates my point about bash being a PITA. Iterating files in a bulletproof way is really difficult. e.g. if they contain a \0 as well.
Not standard C, but https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Integer-Overflow-Builtins.html
I use this often :) (I don't really program to portable C, I program to the gnuC standards as the compiler intrinsics and attributes are so useful compared to the standard)
1
u/raevnos Jan 18 '21
Hidden files aren't expanded by glob patterns unless specifically asked for (though you can tweak that in many shells including bash). Still only requires one loop, with two patterns, in portable sh, though.
And 0 bytes aren't valid characters in filenames.
1
Jan 19 '21
[removed] — view removed comment
1
u/Poddster Jan 20 '21
It's on the list, along with Nim, but I've yet to have time to check them out by making an actual program with them.
Instant turn-offs are that they don't look exactly like C. e.g. Why put types after the
:???1
Jan 20 '21
[removed] — view removed comment
1
u/Poddster Jan 20 '21
It's one thing for me to take up Zig, but it's another to convince people who've been using C for 30 years to switch.
It's easier if, like D or Java, it looks exactly like C!
23
u/birdsandberyllium Jan 18 '21
Not counting anything that was intentionally made to be terrible, three immediately come to mind:
JavaScript. I can't even think of anything concrete that I dislike about it. It just feels wrong.
C, not so bad for something small, but with any decent sized project the constant casts, reference gymnastics and header files will have you seeing stars (pun very much intended) and wishing for anything slightly more modern.
Shell scripts, again just fine for doing that list of stuff top to bottom. Pass in some arguments and env variables? Sure. Start adding input parsing, loops and logic too? I'm instantly screaming out for anything that vaguely resembles a real programming language, even the above two.
10
u/caboosetp Jan 18 '21
I think the issue with javascript is it feels like the quick and dirty language, but it does that really well. Then someone was like, "Let's build entire frameworks out of this" and some other people were like, "OK, this is the ONLY thing that runs in any browser" and the rest of us cried.
2
u/starcrafter84 Jan 18 '21
Coming from a strongly typed background and being an intellisense fanboy, the woolynesss and flexibility of JavaScript and for that matter python makes me hurt inside. Typescript is a definite improvement on top of JavaScript even if it only compiles down to JavaScript in the end. I kind of feel like there should be a progression to something better than JavaScript supported in all major browsers this decade. Every other language domain has seen progress except browsers, who have been stuck with client side JavaScript since forever. Time for a change I think.
1
u/caboosetp Jan 27 '21
The problem is that people use old browsers. Recent projects I've had still need support for IE11. Whatever the big change is will also need to compile to JavaScript. Hoping something like typescript gets native browser support to solve the issue.
2
u/starcrafter84 Jan 27 '21
It’s a bad situation when you have to factor in multiple old browsers OS‘s and pcs etc. I feel like we should be able to purposefully not include older configurations, if for no other reason than to force people to update. The advent of mobile and Tablets has only made it worse i feel as the notion of standard really has went out the window especially with phones that rotate amongst other things. No wonder testing is so difficult to do.
1
u/caboosetp Jan 27 '21
The problem with that is then people just don't use your product. I've had to test public facing sites on over a dozen browsers before. Big pain.
2
u/Poddster Jan 18 '21 edited Jan 18 '21
Our answers are nearly identical! Except for this:
Pass in some arguments and env variables?
passing
environment variablesscript arguments in shell is often the point at which I switch to a python script, if possible.2
u/birdsandberyllium Jan 18 '21
This sounds odd to me because in most contexts where I'm running shell scripts env variables aren't really even being passed through, they're just always there to begin with. Even setting them and passing them around between scripts is very easy, as long as everything is running in the same context.
1
u/Poddster Jan 18 '21
I meant "arguments" but I somehow read the trailing "env variables" in your response and parroted that.
Parsing command line args is a pain. :)
1
u/birdsandberyllium Jan 19 '21
If passing in arguments to your script gets anymore complex than $1 $2 $3 etc. then absolutely, get me a real argument parser ASAP.
1
u/WarInternal Jan 18 '21
The only thing I think shell scripts do better is job control. In at least some shells you can run things in parallel just doing:
cmd1 & cmd2 & waitMost real programming languages require quite a bit of work to accomplish something similar.
1
13
u/Superbead Jan 18 '21
Imagine the top doctor in your country (surgeon general, chairman of medical council, etc.) sent his 'computer-savvy' nephew off to a remote island for a couple of years with an old PDP-11, all expenses paid, to come up with a new programming language. On his return, his powerful uncle declares that half of all medical applications will be written in this bizarre, alien script/database crossover that has fuck-all to do with any other modern language or development practice.
Though in reality it had a more ordinary genesis, that language is MUMPS.
2
u/Darwinmate Jan 18 '21
Jesus Christ. I can't believe now widely it's used in America
1
u/Superbead Jan 18 '21
It's all over the UK too. Intersystems have managed to market Caché (based on MUMPS/M) against all odds. Saying that, people still buy Oracle stuff.
2
u/msieurmoustache Jan 18 '21
So happy to see MUMPS here. I'm in Canada and had to replace a 30-year old lab software written in MUMPS a few years ago. The IT Director started on replacing it when everyone that was even able to read any of the code retired.
2
26
u/EternityForest Jan 18 '21
Oh fun! A flamewar starting thread! Let's play!
C could possibly be the language that has caused some of the most trouble. Obviously, it's considered the current best solution for some problems, but it's pretty terrible for application programming, and it has a problematic culture built around it.
With no package management, and no nice syntax for encapsulation, it kind of discourages reuse and makes people write more code themselves. It also has tons of ways to create bugs, mostly due to the lack of GC and direct pointer use.
It's not exactly a bad language, but it's widely dragged out of the high performance low level stuff it's good for, and used in applications.
One language I have a very hard time imagining myself ever wanting to use, for anything at all, is FORTH.
I know you can write interpreters in a few kb, for very constrained platfoms, and it would be cool if cheap off the shelf electronic junk had a command shell and could be programmed, but thee best use cases for it don't seem to have enough demand to interest the busisness people.
Like C, it encourages a particular way of thinking, shrink your software down to nothing.
The big example FORTH advocates point to, is the CAD program supposedly better than fancy SPICE models.
What happened was the pro software said a chip wouldn't work, his own stuff it a few screenfuls of forth said it would, and then the chip did. But what was the yield like? How's the noise sensitivity, stability over temperature, etc?
I suspect what happened is the supposed simulator was mostly just simulating the very basic high level logic, and relying on the designer's intuition for the analog effects, and he was good enough to get it working without computer help.
But, the SPICE model probably didn't trust it for a reason, and I wouldn't consider it a real good design unless it works in a wide range of conditions, reliabily, for 100k hours like we expect from modern chips.
FORTH could be cool, but building interpreters into tiny devices isn't a popular thing to do, so any use for it is probably some "real programmer" nonsense, or some ultra-niche work.
Lua is another suspicious language. It's design is full of little annoyances and WTFs. The usual implementations are not quite small enough to fit on an AVR or that kind of thing, and anywhere Lua fits, Python or JS would too. Is it really worth the bizzareness?
And then there's the whole class of languages that you just wrote yourself. They're probably garbage, and even if they're good, nobody will want to use them without a lot of industry wide support, and I don't blame them.
Java is obnoxious. The one file per class concept splits everything up into tiny files, littered all over the place. It's almost always harder to find where something is in a Java project than other languages.
But, there's so much wonderful software like LibreOffice written in it, they're probably doing something right, and they were pioneers of portability, and backwards compatibility(most of the time).
I've never used COBOL, but it doesn't seem too bad. Because it works at the application level, and that's what really matters, and it doesn't seem to encourage concern for "code quality" over application reliability.
Most popular languages have some redeeming qualities. You can understand why someone would choose them.
Even FORTH probably has legitimate uses!
But even though it's not really a language, there's one "language" that I try to avoid whenever I can: analog electronics, mechanical parts, and individual wires carrying signals.
Strangely pneumatics often seems to be fine, besides the energy use, but I've had way more failures with "old fashioned" stuff than any code. So I might say the worst programming language is trying to do something complex with no computer at all.
7
u/11fdriver Jan 18 '21
Interesting take!
Forth, imo, is the epitome of "it's not bad, just different", except that Forth is Really Really Different. I've been learning it recently, just for fun, and I've never seen anything like it. You don't really program for an application, you write a sort-of DSL that does it for you.
It's not the language for the next killer app, but it's surprisingly easy to build up a program, once you get past syntax. Where Forth works incredibly well is in low-memory applications. I also think it's both useful and pretty cool that the REPL-like programming environment runs directly on the microcontroller that I'm targeting.
If Lisp says that code is data, then Forth says that data is code. Bad explanation, but it sounds cool.
If I had to choose the worst programming languages, then I choose Fortran77 (but not 90/95 onwards), or Matlab.
2
u/EternityForest Jan 18 '21
Forth almost seems like it was made for learning just for fun. Like, it would be perfect for making a robotics competition a little more interesting or something. I also hear that people like it for testing undocumented hardware by trial and error.
But I'm a bit biased, I rarely write any code at all if it's not at least theoretically aimed at "next killer app" status. I'm much more likely to just use existing tools than to bother with any custom otherwise. And if it's a personal project, 99% of the time I'll just shelf it entirely till I find a library that would be perfect for it, or an app I could write the whole thing as a plugin for, etc.
If I was in the habit of writing small standalone programs, forth might be a bit more appealing.
11
u/A_Philosophical_Cat Jan 18 '21
I have to amen C here. It's memory managemen is egregious to the point of malpractice. It's almost impossible to write non-trivial.applications without pulling some ridiculous bullshit. And because it's a vaguely useful tool for teaching the behaviour of a computer (though due to how modern CPUs work, it doesn't even do that we'll), it's often taught first, and it poisons the mind of all those poor souls. Software is all about building atop abstractions, and C's memory model makes pretty much all but the most trivial ones leaky as hell.
3
Jan 18 '21
Yea we learn C in my university’s machine architecture class just to get a good feel for how memory allocation works before learning about assembly and caches and registers
6
u/A_Philosophical_Cat Jan 18 '21
Oh yeah, people should definitely learn C. It makes a great third language, after you've already seen that programming doesn't need to be miserable.
1
u/kreetikal Jan 18 '21
CS50: Starts teaching C before anything else
1
u/A_Philosophical_Cat Jan 18 '21
IMO, that's an awful, all too common approach. The first language taught in a university setting should be a reasonably approachable LISP like Racket. That way, you can begin with the basics of CS, without boring half the class.
1
u/kreetikal Jan 19 '21
I think it's actually a good idea, here are his reasons
https://www.youtube.com/watch?v=xCOj6vTqMxU1
u/A_Philosophical_Cat Jan 19 '21
I agree with him on the upside of having a small language to start with. I strongly disagree that there is any benefit to having students fight with manual memory allocation in a 101 course.
From hearing him speak, I think the main difference in opinion here, is that he considers how computers are implemented to be fundamental to computer science. IMO, which I share/steal fragrantly from Dijkstra amongst others, computer science is about laying out algorithms, and data structures, and thus lies significantly closer to math in that respect. People who think CS is about programming computers would consider C to be the rational starting point. People who think physical computers are simply a way for our programs to be executed would lean towards a simple language based around a fundamental model of computation, such as LISP.
0
u/that_which_is_lain Jan 18 '21
Gotta weed them out early.
2
u/pragmojo Jan 18 '21
I think it's actually a good call. You gotta have an intuition about how memory works if you want to be a good programmer.
2
u/EternityForest Jan 18 '21
The worst part is that students and professionals share subreddits, so you'll get someone advocating C, and if you don't look closely, you won't notice that the main reason they like it is just because of what it teaches you.
But if you just quickly glance, you might get the impression that it's a good tool for practical use.
Coding discussion has no separation between education and industry anymore. The people building cool stuff don't have time for coding forums, so all the online discussion is dominated by people coding for code's sake, who want low level control for philosophical reasons.
1
u/A_Philosophical_Cat Jan 18 '21
And they're shitty philosophical reasons. Writing software is vastly closer to math than the electrical engineering C tries to make it. Want a nice philosophically pure language? Learn Scheme.
0
u/hugthemachines Jan 18 '21
I imagine some of those "C++ should be used for everything because of performance!" type of comments come from that.
Just in case anyone gets upset, I am not against using C++ for the right things, I just mean there are other languages that have high enough performance for the applications we often use them for. Like Java or C#, for example.
0
u/JNelson_ Jan 18 '21
I think a big part of why people recommend C++ is just to flex how they know a "hard" language.
0
5
u/JMurph2015 Jan 18 '21
Man this post isn't even worth a response but sure I'll bite.
Forth is primarily (afaik) used as a first-level bring-up language. It's the simplest language that people typically implement C compilers in. So you compile your Forth C compiler and now you have a C compiler for your platform. Then you can compile compilers and interpreters for basically whatever you want so long as you make the necessary modifications to them for your platform.
C is definitely a language with drawbacks, but your characterization of "OH NO IT DOESNT HAVE A GARBAGE COLLECTOR, WHATEVER SHALL I DO" is just dumb. C is challenging to correctly write high-level software in because it's a low-level language. C is used to implement those memory management niceties that you complain it lacks. You can't write an OS kernel of any use in Python.
Java is many things including verbose and obtuse, but it's also one of the few languages that expresses strong API contracts well and inspired a host of other advancements in language design to the point Microsoft basically said "we want that, but invented here" and made C#.
1
u/balefrost Jan 18 '21
C is definitely a language with drawbacks, but your characterization of "OH NO IT DOESNT HAVE A GARBAGE COLLECTOR, WHATEVER SHALL I DO" is just dumb.
That wasn't their characterization. In fact, they recognize that C is good for low level things:
It's not exactly a bad language, but it's widely dragged out of the high performance low level stuff it's good for, and used in applications.
2
u/JMurph2015 Jan 18 '21
Even used in applications, there are a great number of reasonably safe C server level and even application level applications out there. Is it the preferred language for your <insert user application>? Maybe not, but people can and do make it work.
1
u/FloydATC Jan 18 '21
Many people use the word "application" to mean "GUI application". That's one area where C is pretty useless, not because of the language itself can't do it but because GUI libraries tend to be written for C++ and other languages with native OOP.
0
u/balefrost Jan 18 '21
I interpreted the comment you originally responded to as talking about general trends. C's lack of a garbage collector makes it more suited some types of applications and less suited for others. The original comment claimed that C wasn't particularly well suited as an applications programming language, but pointed out that it's good for lower level programming.
Sure, that doesn't preclude people from building high-level applications in C. Some people make it work. Heck, some people have built complex GUI applications in assembly. But just because a language can be used for a particular purpose doesn't mean it's a good match for that purpose.
I dunno, I think the original comment was tough but fair. C has use cases for which it's a good match, but it's often used in cases where other languages would work better. Sure, that's not a problem with C itself. Still, C has faults and those faults are exposed especially when it's taken out of its comfort zone.
1
u/JMurph2015 Jan 18 '21
I suppose I was a little hard on them. Just seems like those "some applications" are quite a bit larger and more numerous than the phrasing gave credit, especially to land it on a worst languages round up.
3
u/__Ambition Jan 18 '21
What's up with Lua. All I can think of is variables being global by default and long keywords like local.
1
u/balefrost Jan 18 '21
My biggest problems with Lua are:
A syntax that's not derived from C (e.g. keywords instead of braces)
Indices start at 1
TINY standard library (e.g. AFAIK no
maporfilterfunctions)Second-class Unicode support (i.e. strings are always arrays of bytes, not arrays of codepoints, so you have to use library code to interact with UTF-8 strings).
On the other hand:
Coroutines! And no goofy "async" vs. non-"async" functions.
The metatable concept is very flexible
EXCELLENT reference manual (it's so small!)
Very easy to embed and has a fairly simple but effective native API
AFAIK it has a rather efficient runtime (up until a few years ago it was faster than V8, and may in fact still be).
When I first used JavaScript like 15 years ago, I also had some knowledge of Lua. My attitude back then is that Lua was what JS wanted to be when it grew up. JS has changed quite a bit in that time, and now I think Lua is showing its age. (Though I'm happy to see that they've continued adding new things to the language.)
Ultimately, I feel like Lua's biggest weakness is that it's "weird". It's sort of a shame. With just a few small tweaks, it could have been a really strong language.
2
u/raevnos Jan 18 '21
Allow me to push tcl for the simple, easily embeddable scripting language role that people use lua for.
Indexes start at 0. Reasonable standard library. Native unicode (As long as you stick to the BMP; lack of support of the full range is a weak point). Coroutines. Extreme flexibility, to the point where you can define your own control structures. Good documentation. Pretty efficient bytecode engine.
Also not derived from C syntax-wise, but it does at least make heavy use of curly brackets.
1
u/balefrost Jan 18 '21
TCL's cool. It's been a while since I used it.
I think my biggest problem with TCL is as far as I know, it doesn't really have any "pointer" or "reference" notion. This makes it hard to build complex data structures. Sure, you can work around it - you can store elements in a list and then use list indices as pointers. Or you have to do something like TK does, where "objects" end up being commands, though those end up polluting the global namespace.
I think all of this derives from TCL's attitude that "everything has an authoritative string representation".
I should mention that I could have this wrong. Like I said, it's been a while since I used TCL and I might have forgotten something. (In fact, I thought that there was some way to get an opaque reference to another variable, but it might have been something in the C API, not in the language itself.)
1
u/raevnos Jan 18 '21
There are ways to associate a pointer with a value in the C api, yeah, but native tcl code has to use hash tables and lists to build data structures (a lot like perl that way), plus call by name for commands to modify values passed to them.
1
1
Jan 19 '21
Indices starting at 0 is a funny C-ism that caught on and is now in every language, but really seems like a mismatch. When humans talk about elements in a list, we talk about the 1'st element first, not the 0'th. When talking about mathematical series, we usually start at 1. In physics, they'll sometimes subscript a value with a zero, like x_0, but usually because it is a special starting position/boundary condition/ground state type thing.
But if you are thinking of the index as a value to be multiplied by some constant to generate the memory offset from the first element, of course, starting at 0 is the obvious thing to do! I love C, but that's the kind of problem that it and few other languages really care about.
1
u/balefrost Jan 19 '21
Dijkstra actually wrote a fairly well thought-out essay on how to deal with ranges:
https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
His conclusion:
0 <= i < Nis the representation that has the nicest set of properties.-1
Jan 18 '21
I second your complaint about Java. Seriously, what language doesn't have an input class until version 5 (Scanner)? Seriously?
That said, Lua's advantage is that it's blazing fast to interpret so it's popular for game scripting. Sure you could embed JS or Python but the latter is slow as molassass and the former is a behemoth. Embedding Lua is easy peasy in comparison and the way to hook into it is very intuitive.
6
5
21
11
u/VirtualLife76 Jan 18 '21
Assembly. Just a bitch to code in.
2
1
u/Poddster Jan 18 '21
It's verbose, but you know exactly what everything does and there's no real "gotchas".
2
u/hugthemachines Jan 18 '21
Well you kind of have all the gotchas since you are at the lowest level. You can actually mess up in all the ways you can mess up in any programming language since you work at a lower level than them all.
1
u/Poddster Jan 18 '21 edited Jan 18 '21
Well you kind of have all the gotchas since you are at the lowest level. You can actually mess up in all the ways you can mess up in any programming language since you work at a lower level than them all.
I think we're talking about different things. What you're talking about is just normal poor programming / poor logic.
A gotcha is something that LOOKS like it does one thing, but actually does another. Or worse, it works in cases X, Y, Z but not ABC. Higher-level languages are full of them do to their complex syntax and semantics.
The nearest equivalent I can think of for most asm operations are trampling of flags, or an implicit register use. But they're usually pervasive to the entire ISA.
edit: I guess the whole spectre thing could be seen as a gotcha :)
18
u/A_Philosophical_Cat Jan 18 '21
Personally, my vote is for JavaScript. It's not a good programming language, and I can't completely blame the creator for that. He was hired with the promise of making a Scheme for the browser. He then was forced to pivot to make it Java-like on a break-neck schedule, and ended up making a ton of fuckups along that route.
A programming language should fail hard and fast if something goes wrong in its logic. Instead, we get undefineds that slither through the code until you try to use them in something that doesn't like it. Don't even get me started on all the things that ought be syntax errors that aren't. And then, because it has a monopoly on client side scripting, you end up with abominations like server side JavaScript, written by and for people too lazy to learn a better language for the job.
2
1
u/calsosta Jan 18 '21
server side JavaScript, written by and for people too lazy to learn a better language for the job.
Isomorphic JavaScript makes things more efficient so we can focus on making JavaScript more complicated.
6
6
u/c3534l Jan 18 '21
If you go by bug-prone, you'll find C has the most bugs. But C obviously serves a purpose of exposing the hardware as faithfully as possible without just being Assembly, so bugs are an inevitable and necessary part of that language. C is good at what it does.
If you go by the dumbest syntax decisions, the original Fortran wasn't whitespace sensitive. Now, most people think whitespace means newlines. No, OG Fortran removed all whitespace. ALL whitespace, including spaces. So there were all sorts of syntax errors that results from reserved words and things like being accidentally formed when you introduce variable names. But Fortran was a trailblazer, and they updated the language and its no longer like that. Fortran is one of the first programming languages ever created and for what it was, it was lightyears ahead of other languages.
If you go for the most maligned, obsolete, useless language today maybe you'd suggest COBOL. COBOL is absolutely ancient and weird and not at all how we program today. But honestly its not that bad. Its just associated with awful legacy applications still running on mainframes in neglected government departments. I think if people bothered to learn a little COBOL, not seriously, just out of curiosity, they'll find that its not so bad, its time has simply passed. It was useful at the time, its still around today because some old things are still working as intended.
If you ask me which one I personally hate the most, its Lisp, because I like functional programming where it keeps rearing its ugly head. But Lisp has a repetitive syntax that makes it less readable than XML. And it has a smug culture that is entirely misplaced and cult-like in its denial of reality. But parsing used to be hard and you can appreciate it for being different. It was probably an interesting language so many years ago.
Maybe when Flash and related were still on the web, I'd have suggested that, but now that we've past that and successfully killed it for the security hole that it is. And we fixed our webstandards so we didn't need it, so now its just a thing that was good for a while when that sort of internet content was being pioneered, but overstayed its welcome.
The worst language is PHP, because it has no excuse for its crimes. We knew how to make better programming languages when PHP was made. We can't get rid of it, it is a cancer that infects web programming. Its not ergonomic, its syntax is stupid, its constantly breaking and brittle. The tooling is so awful that its baffling. Composer doesn't even let you uninstall a package, just install them.
2
u/Poddster Jan 18 '21
But C obviously serves a purpose of exposing the hardware as faithfully as possible
Really?!
How do you work with segments on a 386 in C?
Or how do you read the CPU flags on any machine ever?!
C is nothing like the underlying machine!
If C wanted it could abstract and expose 99% of the CPUs in use by people, but it doesn't, it exposes its crappy abstract machine vaguely based on a PDP-whatever :(
1
u/wice Jan 18 '21
What’s wrong with Flash? I mean from a language point of view. ActionScript was quite pleasant to work with, as far as I remember.
2
u/Urtehnoes Jan 18 '21
Totally my opinion, and I'm aware most of the world disagrees, but I despise Javascript. I absolutely appreciate what it does and all that, but actually writing it in is just obnoxious. And the concept of the prototype chain, while not unique to JS, irks me somehow.
It probably all stems down to the fact that I think looping through dictionaries has ridiculous flaws to it. Or at least, it did the last time I wrote JS ~3 years ago.
TypeScript isn't as bad though, as the enforced types does add some sanity to the noise. I just feel like JS gives you far too much freedom, and very little controls to guide the rollercoaster once it goes off the tracks. But I am NOT an expert in it so I might be missing something.
2
3
u/11fdriver Jan 18 '21
I think this is an interesting question when approached from the opposite perspective. There were some languages I hated that I started to enjoy once I started using them properly.
C++ is easy to hate, but it's widely used in industry, and seems to have a cult following, as well as cult opposition. The language itself seemed to work against me, deliberately tripping me up, and then screaming at me incomprehensibly. Turns out, I was reading outdated tutorials, not using good patterns, and - most importantly - not using the right tools. For some reason I thought I wouldn't need an IDE, but it made things much more manageable. I wouldn't use Vi to write Java, after all.
I'm also excited by the recent additions to the standard, such as C++ concepts, which are sorta like Haskell's typeclasses, or D's template constraints, by my understanding.
Perl also gets a lot of flack, but I think it's bad reputation comes from being used where it shouldn't. Perl shines at being able to get something working quickly with what you already know, hence it's loose syntax. Perl code should be replaced later, but will be forgotten until it breaks. By then, nobody can even read what it should do. After all, it was written in 4 minutes by a sleep-starved intern. Used well, it's as fine a language as many another.
Furthermore, there's been effort recently to add some healthy restrictions and enforce better standards. Never forget, use strict; use warnings;.
Some languages I don't think that I will ever truly like are Fortran77 and Matlab.
Fortran77 code isn't too readable at the best of times, imo, and a lot of the ancient code still in use isn't exactly clear. Luckily Fortran 90 onwards is surprisingly lovely!
I rarely have to write Matlab, but occasionally have to read it. Matlab has pretty annoying ideas around syntax and structure anyway, but combine that with the best code-obfuscators: mathematicians, and you have a recipe for disaster.
3
u/DecisiveVictory Jan 18 '21
From the commonly used ones
Visual Basic
PHP
Perl
Though:
Objective C
Delphi/Object Pascal
are also sad.
2
u/electrodude102 Jan 18 '21
I hear a lot of shit about PHP, but I don't see anything wrong with it :/
imho Delphi is a pretty nice language but i kinda wish i had switched to C++ C# etc sooner
2
2
2
2
2
u/Sohcahtoa82 Jan 18 '21
Haskell -- I don't know which is worse, the language itself, or its fans, which act like it's such an amazing language because you can do a Quicksort in only two lines, as if any other language with functional features can't do the same.
Perl -- A language that people actually joke about being a "write-only" language because it's so hard to read is basically by definition a terrible language. And again, it's another language where the fans are the worst, because they emphasize cleverness over maintainability. I've always treated Perl as the antithesis of Python. What I mean by that is take Zen of Python and invert all the statements, and you'd get a Zen of Perl, especially the line about readability.
PHP should just be renamed to "RCE-as-a-Service". It's not so much that PHP is a terribly insecure language, but that it has a LOT of foot-guns, and junior developers aren't told about them, so they do silly things like let users choose a language for the page to get displayed in, set it in a cookie, then do include("./translations/" . $COOKIE['language']); and BAM. You've got LFI and an attacker is now reading your /etc/passwd or whatever other juicy info you have.
1
u/alpacarln Jan 18 '21
I won't count old languages that are still used like Cobol or Fortran and focus only on "modern/popular" languages.
Despite all the praise of Go is getting, I hate it. I find Rust much better and easier to write from the long term perspective.
Other language I hate is Kotlin. I find it weird and partisan.
1
u/myearwood Jan 18 '21
The languages can be abused. I saw the work of a coder who was eventually institutionalized. It hurt my brain.
-3
u/JMurph2015 Jan 18 '21 edited Jan 18 '21
Of the unironic programming languages, I'd contend PHP. Never had to work on it because the generation of programmers before me so universally hated it so much that they actually bothered to phase it out.
Edit: a distant second for me is JavaScript but it at least has redeeming qualities of some sort. JSON was truly revolutionary in the uniformity and universality of it's object representation.
-6
-4
0
Jan 18 '21
[deleted]
5
u/balefrost Jan 18 '21
I don't think Dart's quite dead yet. I'm pretty sure it's still key to Flutter, though I feel like Flutter never really took off either.
1
Jan 18 '21 edited Jan 18 '21
I interviewed and hired someone who used to work on the Dart team at Google. It's dead. The team has shrunk significantly and the only investment is keeping what's using it at Google running.
5
u/A_Philosophical_Cat Jan 18 '21
Personally, I think the PHP hate is overhyped. It's designed as a super simple way to do a little bit of server side code. In that use case, it's pretty good. It's big problem, like many other languages, is that due to how easy it is, people push it out of its wheelhouse into abominations.
Like Python. Great scripting language. Absolute insanity to use it for anything computationally intensive, or inherently concurrent, like a web server.
1
u/Fidodo Jan 18 '21
PHP has improved greatly since so much legacy net was written in it. Early PHP was absolutely horrible though.
1
u/pragmojo Jan 18 '21
It's designed as a super simple way to do a little bit of server side code.
I only ever dabbled in PHP, but my feeling was that it was a language which was never designed at all.
Like you just had all of these functions like
do_some_very_specific_thing()and there was no rhyme or reason to how anything worked. It's like a messy kitchen drawer of a language1
Jan 18 '21
It wasn't designed at all. PHP literally stands for "personal home page". It was Lerdorf's personal project that somehow gained momentum because it had built-in mysql functions (that didn't use prepared statements and led to thousands of compromised DBs across the web).
1
0
Jan 18 '21
[deleted]
2
-4
u/timschwartz Jan 18 '21
PHP is not easy, I'd say it's by far the most difficult language to learn and use
Anyone who thinks that must be a bad programmer.
0
4
u/tornado9015 Jan 18 '21
It's pretty easy to learn, it's highly supported, it's highly flexible, it has pretty good hash map manipulation inbuilt. Overall seems pretty good for a simple server language for most use cases. Do you have any languages you think are better for a typical web server?
11
Jan 18 '21
PHP is a really awesome language if your product is security vulnerabilities and "what-the-fucks".
I prefer typed languages, because they are much easier and safer to refactor and change, but literally anything else is better than PHP. In the land of dynamic languages Javascript, Typescript, and Python are all easier, safer, and less wtfy. Ruby's my least favorite, but I'd still take it over PHP. Hell, I'd even take Perl over PHP, at least the Perl sigils mean $omething.
3
u/raevnos Jan 18 '21
PHP looks like someone started with perl and copied it without understanding why perl does the things it does. I will never understand how it took off the way it did, considering perl did everything it does even back in the 90's and even more so these days.
3
u/tornado9015 Jan 18 '21
What security vulnerabilities do you find inherent to PHP?
Javascript is less strictly typed than PHP it seems weird that you prefer it on it's typed benefits. If you're worried about type casting there are is_type functions for all types. You can also enforce types in function signatures now. I'm still not understanding your actual problem.
Also if you're complaining about sigils weird that you prefer a bunch of languages that don't have sigils.
7
Jan 18 '21
There's tons of wtfery in PHP. I won't go through it all since it's easily found elsewhere, but I'll point out one common function: fopen.
This function is the stdlib function to open a file. If the file does not exist or permissions are wrong or something else errors the runtime keeps executing. Almost all other high level languages will fail with an unchecked error in that case.
Many PHP functions have similar error handling and there's no built-in way to catch missed error handling, instead you have to configure a linter or something to make sure errors are being caught. Hope your beginner coder learning to code knows how to configure a linter or even that they should be running one.
The fopen function for some reason. will also open a network connection and download content if passed a url, hope your beginner coder thouroughly read the manual about that or knew to turn that feature off in the incredibly long list of complicated configuration options you need understand to securely configure a PHP server.
0
u/tornado9015 Jan 18 '21
I asked about security vulnerabilities. All languages have weird shit. If we want to complain about insanity a go-to of mine is javascript hoisting.
But if you're suggesting that a junior dev can't validate successful opening with an if($file === false) then I'm generally worried about the current state of junior devs.
If we're passing user controlled variables into fopen I'd also hope enough thought was placed that fopen handling a url is probably not some catastrophic vulnerability.
It seems like you're looking for things to be upset about, these issues seem to have incredibly simple solutions and are generally pretty low on my concern priority list.
6
Jan 18 '21
Well, use PHP then I don't really care, but in my opinion PHP is the worst of the dozens of languages I've used in my career and there are dozens of other dynamic web languages that fit the same use-case so there really isn't a reason I'd choose it for anything.
2
u/tornado9015 Jan 18 '21
It's what I'm paid to do currently so I will continue to. Other than Asp.net I think all major server languages are fine generally. Node can pose significant benefits at scale, but for most usage php seems pretty good.
I would choose it for anything where rapid development is of significant priority and async tasks and millisecond performance optimizations are not of high priority. Security wise it's generally pretty easy to hang yourself in any language and I haven't seen php fall significantly shorter than any other language in this area.
1
u/sternold Jan 18 '21
Other than Asp.net
What's wrong with ASP.NET?
1
u/tornado9015 Jan 18 '21
The last time i worked with it (a few years ago, so these points may or may not still be true.) Support was terrible, learning resources were terrible. Deployment was not flexible or convenient. Local development ranged between frustrating and nightmarish. Trying to integrate a product which used asp.net into an existing lamp stack was probably the most time i've ever spent being unable to work on any actual progress due to constant environment problems.
→ More replies (0)3
u/vaibhav-kaushal Jan 18 '21
Have used PHP a lot. Used Ruby for a good time, still do. Used JS both Node and Frontend stuff. Using Golang these days. PHP is nowhere close to bad. Slow, maybe. Bad - no. You are talking about PHP 4 or maybe 5.2 or something. You should upgrade to 7.3 at least. Ruby is the sweetest one I ever worked with. It almost reads like English and makes perfect sense. Java and JavaScript are easily the worst I ever used. One is Garbage centric (collects and keeps tramping over). The other dude (JS) tries so hard to not crash that it makes life miserable. I have been a victim of [] + [] = “” Where both arrays came from two libraries and were “added” in the third one and for a particular rare user input both were blank and I got this empty string. This thing doesn’t have a good type system.
0
u/JMurph2015 Jan 18 '21
I agree, my post was like "it was so universally hated, I didn't was never even forced to use it because everyone migrated away, it's that bad"
0
55
u/Koooooj Jan 18 '21
There's a whole family of intentionally terrible programming languages.
The grandfather of the group is brainfuck, which demonstrates Turing completeness with only a handful of esoteric symbols.
A related language is Cow, which adds a couple of flow control commands, then for flavor every command is some capitalization of Moo (except a few, like oom and OOO). It is a language that purports to be readable by cows.
In a similar vein there's whitespace, which has a handful of commands, each made up of a sequence of a couple of spaces, tabs, or line feeds--every printable character is ignored. Whitespace is notable for being impossible to print on paper--you have to make whitespace characters visible to even begin to read it, and that's before addressing the difficulty in formulating a program in the language.
A final language of note is Malbolge, which is a terrible programming language where a lot more design went into making it unusable. It operates in trinary to alienate programmers who are used to binary, and to determine what command to execute the program it goes through a convoluted process of computing essentially (in C notation)
(*c + c) % 94, after which only 7 of the 94 possible results actually does anything (one of them ending the program). To make things worse, it scrambles each instruction after running it, making loops exceptionally painful to devise.Languages that aren't designed to be terrible are usually much, much better, but that's not to say they're all good. I haven't been too offended by mainstream languages, but in working with some embedded devices I've run across a few languages where it's clear someone threw together a language without really understanding what makes a language good or bad. The worst offended, which I won't name to protect the innocent, comes from an embedded device that's responsible for some task but allows users to additionally run their own code alongside that task. Features include:
You can use
=,==, orequalsin your program. Each of these is completely identical. They each mean either assignment or a check for equality, which must be deduced from context.There are comments, like in any good programming language. Some of these comments do things. It's up to the programmer to know which comments are actually comments and which ones are code that is put into a comment block.
The language allows you to define variables that represent only a single bit of some larger variable. It also allows you to check these against what appear to be constants named "ON" and "OFF." This is great for simple cases, where you could set up a variable named input to represent a single bit of a digital input, then check
if input = ON. The struggle comes from combining these: if you have input1 and input2 then checking if they're both in the same state can't beif input1 == input2or evenif (input1 equals ON) && (input2 = ON). Logically that's correct, but= ONdoesn't resolve to 1 or 0--it just bitmasks and leaves the result in whichever position. You have to write out the entireif ((input1 = ON) && (input2 == ON)) || ((input1 equals OFF) && (input2 = OFF)).It's a language and a product that ultimately get their job done, but man I'd love to go and clean up some of their design decisions.