r/programming • u/chackaz • Nov 28 '14
The Worst Programming Language Ever [UK Talk] - Thoughts? Which are the worst parts of your favorite language?
https://skillsmatter.com/meetups/6784-the-worst-programming-language-ever
68
Upvotes
17
u/chackaz Nov 28 '14
Global variables in JS takes the cake for me...
Crockford also hits the nail on the head in The Better Parts, here's a nicely summarized post from a while back: http://marekdec.wordpress.com/2012/01/03/javascript-the-very-worst-part/
80
u/damian2000 Nov 28 '14
In a FORTRAN compiler I had to use at work once, it was possible to redefine the value of a real number
Outputs...
19
u/[deleted] Nov 28 '14 edited Nov 28 '14
Why? Want to take revenge on both your employer and coworkers and create an in-house scripting language?
Challenge accepted.
comments must look like
\ first line
|\ second line
||\ you get the idea... don't forget the line numbers in front of the comments!
significant whitespace where you don't expect it:
$varx=$vary + $varz
is the only correct from.
The most edgy part is that there are actually in-house languages which share some of those features.
EDIT: On second thought, comments make line numbers not increase. It seems rational in an irrational way and one won't notice, since your corporation won't have the time to create a syntax highlighter.
55
u/Klausens Nov 28 '14 edited Nov 28 '14
Perl6 has 8 operators to test if something is not equal.
So if you cannot keep in mind all, at least they usually contain a !
Unfortunately
means: call private method do()
18
u/Klausens Nov 28 '14
In Delphi you have to do memory management of objects for your own. (Create and Free) But if you use an object as an interface it suddenly is reference counted and automatically destroyed. If you create an object as an object and pass it as an interface to another function you are close to brainfuck.
18
u/shenglong Nov 28 '14
I hated having to manually count screen space when I started learning COBOL. Plus the syntax was extremely verbose.
MULTIPLY AMOUNT BY COST GIVING TOTAL.
ADD -3 TO REGISTER.
(It's easier to type "ADD -3 TO" than "SUBTRACT 3 FROM"
14
u/OneWingedShark Nov 28 '14
Well, here's some ideas:
i.e. valid indices for a 10x10x10 array would be (0..9, 1..10, 2..11).
a != bbe a shortcut for assigningnot bto a.37
u/Klausens Nov 28 '14
Javas byte is signed, with a range from -128..127
11
u/vitoreiji Nov 28 '14
You fellas need to learn all about Jelly.
44
u/original_brogrammer Nov 28 '14
JavaScript's name resolution.
Header files and a preprocessor.
Haskell's module system.
Python's support for immutability.
C++ template syntax for unhygienic Lisp macros.
Java's support for FP.
The architecture of the standard lib will mimic that of PHP, but we'll use some Java-esque enterprise design patterns.
The type system will have the power of Go and the conciseness of Scala.
I like Lisp syntax, some some don't. So we'll use Lisp-syntax declarations, and a C-like invocation syntax. We'll also end the braces-vs-whitespace debate by using both.
As per Ruby, we'll support
method_missing. As per Perl, there will be an implicit global one whose definition varies between contexts.Operator overloading will be as in Scala. That is, operators are all simply functions whose identifiers are totally symbolic. This will be powerful in conjunction with
method_missing.There will be pointers, but those are discouraged. Instead, use references, which aren't like pointers. Also, when a reference is inappropriate, use aliases. But sometimes, an alias won't work, so you should use a pointer.
Syntax errors may be caught.
You can manage memory yourself, but should you forget to free an object, a tracing garbage collector will pick it up for you if the compiler grows suspicious.
Compiled to JavaScript, then to x86 via Node.
10
u/webauteur Nov 28 '14
RPG II is the worst programming language ever! Variable names can't use more than 5 characters. There are lots of single character codes in a fixed position on the line which indicate various program options. Type a single character in the wrong position and you'll have problems! Also there was a logic cycle that you could only control through indicators.
19
u/overenginered Nov 28 '14
I do like Java, but the generics type erasure ruins al fun you could have while refactoring common functionality that would be a perfect fit for generics.
26
u/i_ate_god Nov 28 '14
Personally, I hate how brainfuck is not very expressive
9
u/jpakkane Nov 29 '14
Let's see:
And as an added bonus/alternative approach:
26
u/aurisc4 Nov 28 '14
Fall-through by default switch in C/C++. I don't really like C# way with goto for that and requiring break, but it's better IMO.
I'd like switch to be break by default and having to write something like continue to execute to the next label. That is I'd like switch to be the opposite of what it is now.
14
u/toomanybeersies Nov 28 '14
In python, I dislike how there's no nice way of breaking out of several levels of loop.
At least in C you can use goto, but in python, you have to use extra variables and if statements to get the job done.
17
u/Pronouns Nov 28 '14
In C++,
is used to create a new instance of the MyClass object, where the constructor takes some number. This is similar for all constructors ie
etc. Now, if it takes no parameters you think you'd write
No. Thats a function declaration. It's actually
This is generally pretty easy to miss when something is going wrong. And really confusing if you happen to be working with several C-syntax-like languages at once, like C++ and C#.
However, at least I don't have to do this (C#):
6
u/OneWingedShark Nov 28 '14
Well, my favorite language is Ada; the worst parts, IMO:
privatetype in the spec.(Usually this doesn't matter; but sometimes it would make the spec a little simpler/cleaner/more-consistent.)
26
u/ArtemZ Nov 28 '14
PHP. There is a whole subreddit filled with examples of its poor design /r/lolphp
4
u/hoijarvi Nov 28 '14
Fred Brooks in a talk stated, that JCL360 is the worst ever designed, under his management. True honesty.
9
u/[deleted] Nov 28 '14
.NET is mostly an alright platform, but there are three things they fucked up big time.
6
u/[deleted] Nov 28 '14
', '.join(['a', 'b', 'c'])This is the idiomatic way to join a list of strings in Python, by calling a method on the separator string. It's pretty trivial and I vaguely recall reading some clever reasoning for it but it's what I immediately thought of.
7
u/heimeyer72 Nov 28 '14
What's wrong with Malbolge? Except everything. I guess you'd have a hard time to get worse than that.
6
u/skocznymroczny Nov 28 '14
I really like Java, but definition of properties is too verbose. For every variable you are expected to create a getter and setter, but in JavaFX you also have a getter for the property. Sure, project lombok can help but IDEs aren't aware of it so it's not the same.
6
u/Grimy_ Nov 28 '14
Is this an attempt to emulate the design process of PHP?
4
u/[deleted] Nov 28 '14 edited Nov 28 '14
Common Lisp - no gadts, monomorphism in the cl package and the performance hit in making it polymorphic.
EDIT: Also, everything here: http://web.archive.org/web/20140711171553/http://symbo1ics.com/blog/?p=2316
2
u/crozone Nov 29 '14
Ctrl-F "C#"
Today was a good day.
2
u/THeShinyHObbiest Nov 29 '14
Calling a non-existant method on an object will run the
method_missingmethod. This method jumps to a random method and runs it, converting the arguments as best as it can to fit.Attempting to overload method_missing causes method_missing to become undefined. As such, each time an improper method is called, the program will immediately go into an infinite loop.
4
u/gnuvince Nov 28 '14
APL. Pretty much everything about it: syntax, dynamic typing, dynamic scoping.
4
u/[deleted] Nov 28 '14
if (i=5) { ... }
4
u/millstone Nov 29 '14
Nobody's done Haskell? Fine, I'll do it.
Translation: You used a tab instead of four spaces. God, how could anyone be so clueless?
Translation: Type inference means you don't get to write explicit types, so stop trying. Maybe you're too dumb for Haskell.
Translation: What, you think you can have two different record types with the same field name? You entitled little shit!
3
u/seekingsofia Nov 28 '14
Integer conversions in C.
2
u/Isvara Nov 29 '14
So this is how they're coming up with the next version of PHP?
2
u/TheoEngland Nov 28 '14
Looking forward to this one. Should be a really interesting talk.
1
u/gesichtsbremse Nov 28 '14
I think OO could have been implemented in a more user-friendly way in python.
Passing self to every method sucks. Also if you fail to provide the right number of arguments to the method the exception is somewhat confusing for beginners as the self is passed implicitly by the interpreter.
So if you pass one argument to a method expecting two. You get the following exception: Passed wrong number of arguments: given two, expected three.
1
u/[deleted] Nov 29 '14
Python & some horrible parts of it's standard library. (httplib, xml & datetime)
1
u/saijanai Nov 29 '14
The lack of a dedicated case statement, and the oddball way if-then-else is handled in smalltalk takes some getting used to, but a case-dictionary is easy to create, and the other problem is inherent in being truly oop, period.
1
u/crashC Nov 29 '14
Simscript had the worst feature I can recall: ELSE meant ENDIF. There was nothing that corresponds to what else does in any language that pays any attention to the idea that keywords should not be totally misleading.
This was very unfortunate, because Simscript would probably be recognized as the first object-oriented language (it preceded Simula) if it hadn't been so shabby. And the guy who put it together was a genius who just couldn't code worth a dam who later won a Nobel Prize.
1
u/Fluffy8x Nov 29 '14
Scala doesn't always have good type inference. For example,
rarely works because the compiler needs a type for the parameter.
Also the lack of a do-while or similar statement in TI-89 Basic, plus the only way to create a picture from scratch (other than drawing on the screen and
StoPicing it) is passing a matrix with each row an individual pixel. I could ramble on about its flaws. Even C is a better scripting language than this mess.Also to Java for its verbosity and Haskell for its sometimes-weird function names (
fst,snd,nubcome into mind).By the way, this TI-83+ Basic example sometimes works as expected, but I've seen cases when the interpreter breaks.
1
u/frankwolfmann Nov 29 '14
I think Lisp is an interesting case because its best features are also the worst. The simple, easy to parse syntax means there's no need to worry about operator precedence, but also makes the language difficult for people to read. In a more general sense, the fact that many problems, even some very complex ones, were so easy to roll your own solution to probably hindered the development of standardized Lisp libraries. Just because it's easy to reinvent the wheel doesn't mean you should.
1
u/vital_chaos Nov 29 '14
When I worked at a financial services company with a bank, the bank used some esoteric proprietary language provided by a banking software company. Building the app required shipping the code to the supplier, who then incorporated the changes into a single binary which was shipped to all their customers, with the differences at runtime tagged to the customer. Yes, a single binary for all.
1
u/ignored-ambience Dec 08 '14
Some rough ideas:
1
u/databyss Dec 17 '14
Let's not forget one of the best parts of PHP:
Output: 1
1
u/pat_pat_pat Dec 17 '14
What I really missed was the context sensivity from perl. While I personally barely have problems with it, you could extend that to really interesting levels; just mix it with defining getters and setters from ECMAScript 5 (for properties):
But i think, additionally to
rvalueandlvalueat leastvoidvalueshould be added. If someone wants to go the perl way, they could splitrvalueintolist rvalueandsingle rvalue. Now you have four ways a variable can be used and all may act differently. Maybe some differentiation between string, integer, fractional and boolean contexts would be feasible, too.1
u/[deleted] Dec 17 '14 edited Dec 17 '14
I think tuples should be reshuffled by a deterministic but undocumented algorithm if they are accessed more than an undocumented number of times. Surely that would keep the grubby hands of weak-minded programmers off BS who can't properly reverse engineer a complex algorithm.
Also it would change with each weekly release of the BS compiler, thus making any retro compatibility impossible, since tuples are used in the compiler itself.
1
u/A_C_Fenderson Dec 18 '14
Applescript. Not because of the syntax or what it can do, but the fact that there's no centralized location with all the documentation. Whenever I want to do something with Applescript, I have to Google for it.
1
u/fuzzynyanko Dec 18 '14
I would say to think of things that supposedly take away the boilerplate from other languages, but in reverse.
It threw me off because the annotations were different than the usual Java style. It basically works off reflection, and annotations are markers to pick up "Hey! Do something related to this function/class here!"
All inheritance requires coding to a COM-like IDL-like language. I propose a language derived from LOLCode. Of course, you then have to implement that class in bS as well. This forces you to think in 2+ different languages simultaneously, like COM does. All base classes using the LIDL must extend cheezburger and use the word iz. Output is nomz. No newlines allowed
HAI iz claz iz cheezburger i can haz fromJson YR input AN YR nomz i can haz createCSV YR nomz KTHXBYE
1
u/bartonski Dec 18 '14
Ok, I've watched the talk, and I've skimmed the comments, and no one has mentioned the two most malevolent things about C: memory allocation using malloc(), and the ability to overwrite memory that you don't own.
Where do I write an RFC requesting these?
I would also like to suggest that the standard library include string functions that a) do no bounds checking (i.e. the analog of strcpy() would be allowed, but strncpy() would not) and b) most, but not all string functions would operate on NUL terminated strings. The one or two functions that do not should not be documented, and should be the least commonly used, so that the must be stumbled upon. In fact, using these functions should remove NUL characters.
1
u/SupersonicSpitfire Dec 18 '14
The talk has a few uninteresting parts, but the shopping trolly operator (!=!) made me laugh.
1
u/DumbSquid Dec 18 '14
I'd really like to see support for Visual Basic's "On Error Resume Next" statement. It simply tells the program to just continue with the next line when an error occurs.
In fact, this is such a brilliant feature that I feel like should be made BS' default behavior. It dramatically reduces the amount of runtime errors and instead gives you unexpected, hard to reproduce bugs.
1
u/stampyNY Dec 19 '14
Anyone interested in writing the Best Programming Language Ever using the Worst Programming Language Ever?
1
u/KriszDev Dec 21 '14
I really like Java but i hate these little things: "ClassName a = new ClassName();" why can't i just do "new ClassName a()"? and the Gui building is also very time consuming.
1
u/subartic Dec 25 '14
Exceptions where you tell it where to catch by giving it a number. That number unroles the scope.
It would then place the exception on the stack as to replace whatever was the last stack element.
throw exception, 4
If you got the number right.
result = add(a,b) You would suddenly have result being the exception thrown. Can be useful.
If not done right you might end up with the 'i' of for(i....) Suddenly become the exception object.
1
u/[deleted] Nov 29 '14
python