So for my robotics course in school I'm currently having to work with a language from 1991 to program our robot and it is just awful compared to any modern languages so I was curious what language does everyone dislike the most of the ones you've used? Please give the language name and why you don't like it.
FANUC KAREL (based off of PASCAL)
This language just isn't flexible or intuitive at all it's usage is very strict and has the oddest quirks. On top of it's rules it also doesn't implement many things which make other language much easier for example this code in my TIC TAC TOE code for class
(Now how I had to do it trying to shorten the code as much as possible)
FOR index1 = 1 TO 3 DO
FOR index2 = 1 TO 3 DO
winPnt[index1][index2] = (9 - index1) - ((index2 - 1) * 3)
ENDFOR
ENDFOR
FOR index1 = 4 TO 6 DO
FOR index2 = 1 TO 3 DO
winPnt[index1][index2] = ((index1 - 4) * 3) + index
ENDFOR
ENDFOR
FOR index2 = 1 TO 3 DO
winPnt[7][index2] = 1 + (index2 * 2)
ENDFOR
FOR index2 = 1 TO 3 DO
winPnt[8][index2] = 1 + ((index2 - 1) * 4)
ENDFOR
Oh teh noes, you have to use "to" instead of a comma and "endfor" instead of "end". I'll assume there's more to it than that, but your example code doesn't exactly look "painful".
I'd pack it down a bit more, though:
FOR index1 = 1 TO 3 DO
FOR index2 = 1 TO 3 DO
winPnt[index1][index2] = (9 - index1) - ((index2 - 1) * 3)
winPnt[index1+3][index2] = ((index1 - 1) * 3) + index
ENDFOR
winPnt[7][index1] = 1 + (index1 * 2)
winPnt[8][index1] = 1 + ((index1 - 1) * 4)
ENDFOR
Is the use of "index" (as opposed to "index1" / "index2") on that one line intentional?
Edit:
Ah, I see, you're trying to rebuild the array.
In that case, my answer is: don't. Just use the code to check for your victory condition directly. Don't try to force a square peg into a round hole.
Edited by Bomb Bloke, 25 February 2015 - 12:50 AM.
I've spent a lot of time in the QB IDE, which applies the caps automatically after you enter each line. No extra work on your part, and keywords become obvious (even on a monochrome display).
Also very useful in that if the IDE fails to parse the line, it can't change it - so if you hit enter and the case stays as you typed it, you know you've got a mistake to go back and fix!
Most painful language... so first question is serious or esoteric? Because Esolang has a hitlist of programming languages designed to be difficult to write in. I've only tried one or two of these but some are truly horrible, both to write and to debug. I've only tried one or two of these but for some of them, just getting printed output is utterly painful.
If we're talking about integrated languages, as in languages that work directly with a development environment rather than being able to run standalone, I would cite AS3 as perhaps the languages I have the most experience with hating. It's not that the language itself is terribly ugly, AS3 code is perfectly legible and C-like, it's just the way that all programs have to be structured around Flash scenes and things like scoping are completely obtuse to the user. Sometimes runtime behaviour is inconsistent or reliant on some property of the document that is unclear given the way the language works, and it can take awhile before getting it to perform consistently (along with a ton of other issues, like no web page debugging tools etc.) But that's not so much AS3's fault as the environment's fault.
But if we're talking about a language that is painful based on it's own merits rather than the tools needed to use it, I think the language I've found the most painful to write is probably PHP. On it's website I've seen it described as "glue", and that's about how I'd describe programming in it too; tedious and sticky, like tying strands of spaghetti together. This blog post is pretty old now, but it was current when I was doing PHP and sums up my feelings reasonably well. Perhaps not an original choice and there are languages I've had a harder time writing in, like Prolog for example, but in retrospect that probably isn't the fault of the language.
I'm a boring example though. There are programmers out there I've known that have worked with COBOL, custom database languages and other things that are the stuff of nightmares.
nitrogenfingers, on 25 February 2015 - 05:04 AM, said:
But if we're talking about a language that is painful based on it's own merits rather than the tools needed to use it, I think the language I've found the most painful to write is probably PHP. On it's website I've seen it described as "glue", and that's about how I'd describe programming in it too; tedious and sticky, like tying strands of spaghetti together. This blog post is pretty old now, but it was current when I was doing PHP and sums up my feelings reasonably well. Perhaps not an original choice and there are languages I've had a harder time writing in, like Prolog for example, but in retrospect that probably isn't the fault of the language.
Yeah. Despite having spent hours in PHP sometimes I really hate it to bits. Since going completely OOP with it I've found it less annoying, and maybe that's just because I find non-OOP ways messy and hard to use, but you really have to do almost everything yourself. This is particularly true when dealing with form inputs.
I'm also really not a fan of AppleScript. It's just too 'Englishy' for me, you just don't really know what word to use. Oh, and this might be pretty controversial, but every time I try Java I storm off in a range. Generally because of the atrocity that is their million types of lists, arrays and the like. Objective-C has it pretty good with dictionaries and arrays, and Lua does too in it's simplified but super powerful system.
Yeah. Despite having spent hours in PHP sometimes I really hate it to bits. Since going completely OOP with it I've found it less annoying, and maybe that's just because I find non-OOP ways messy and hard to use, but you really have to do almost everything yourself. This is particularly true when dealing with form inputs.
You should look into functional programming like Haskell (not like JavaScript). Once you get the hang of it, it's beautiful.
oeed, on 26 February 2015 - 07:44 AM, said:
I'm also really not a fan of AppleScript. It's just too 'Englishy' for me, you just don't really know what word to use. Oh, and this might be pretty controversial, but every time I try Java I storm off in a range. Generally because of the atrocity that is their million types of lists, arrays and the like. Objective-C has it pretty good with dictionaries and arrays, and Lua does too in it's simplified but super powerful system.
AppleScript might be the worst language I've ever, ever used. The syntax is seriously nonsense. It's impossible to go into a program with an idea of what you want to do, and just write it. You have to be constantly googling just the syntax for how to write different things, because it's so complex. And usually, if you find something online that's similar to what you want to do, the syntax is completely wrong for the slightly different task you actually want to do. And the libraries and data types or horribly undocumented and vague. It's just awful... I don't like JavaScript, but I'm glad Apple added it for os automation because it's way better than AppleScript.
Edited by ElvishJerricco, 26 February 2015 - 05:18 PM.
INTERCAL. Hello World example taken from wikipedia:
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP
This entire language's purpose is to annoy the programmer. READ OUT is print, WRITE IN is read. You have to insert PLEASE into your code now and then because the compiler won't compile impolite code. On the other hand, if you use it too much, you will be considered excessively polite. There also are no strings, which means you have to deal with the individual bytes, not even characters. Oh and did I mention that there are no errors? The language will roll with anything you throw at it, so to make a comment, just write invalid code.
INTERCAL. Hello World example taken from wikipedia:
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP
This entire language's purpose is to annoy the programmer. READ OUT is print, WRITE IN is read. You have to insert PLEASE into your code now and then because the compiler won't compile impolite code. On the other hand, if you use it too much, you will be considered excessively polite. There also are no strings, which means you have to deal with the individual bytes, not even characters. Oh and did I mention that there are no errors? The language will roll with anything you throw at it, so to make a comment, just write invalid code.
That PLEASE would rip my head off. Since when does a compiler check if you need manners? Useless and frustrating.
INTERCAL. Hello World example taken from wikipedia:
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP
This entire language's purpose is to annoy the programmer. READ OUT is print, WRITE IN is read. You have to insert PLEASE into your code now and then because the compiler won't compile impolite code. On the other hand, if you use it too much, you will be considered excessively polite. There also are no strings, which means you have to deal with the individual bytes, not even characters. Oh and did I mention that there are no errors? The language will roll with anything you throw at it, so to make a comment, just write invalid code.
That part with politeness made me laugh so much. PLEASE READ OUT
There is another language basedon Morse, I don't remember the name, just search "most annoying esotheric languages". The idea is that you program in morse. It's so hard that the author of the language didn't feel like finishing the "Hello world" example.
Bomb Bloke&, on 25 February 2015 - 12:42 AM, said:
Oh teh noes, you have to use "to" instead of a comma and "endfor" instead of "end". I'll assume there's more to it than that, but your example code doesn't exactly look "painful".
Mainly in that example code I was pointing out you can only define one item at a time and as reference for even more annoyance to that one at a time issue if you don't initialize all used variables quickly enough on start the program will error out.
nitrogenfingers, on 25 February 2015 - 05:04 AM, said:
Most painful language... so first question is serious or esoteric?
I was mainly referring to serious languages although esoteric ones can be included too />
also for anyone who is curious to see the final outcome of this frustrating language heres how my final ended up looking
Spoiler
PROGRAM tictac
VAR
notbox : INTEGER
ltpli : INTEGER
ltpls : INTEGER
ballline : PATH
index1 : INTEGER
index2 : INTEGER
index3 : INTEGER
plays : INTEGER
waslog : INTEGER
perch : JOINTPOS
boxset : ARRAY [9, 3] OF JOINTPOS
boxplay : ARRAY[9] OF INTEGER
winpnt : ARRAY [8, 3] OF INTEGER
fingame : ARRAY[2] OF INTEGER
tactic : ARRAY[9] OF INTEGER
ROUTINE jntswap
BEGIN
IF $SPEED < 750 THEN
$MOTYPE = JOINT
$SPEED = 750
ELSE
$MOTYPE = LINEAR
$SPEED = 200
ENDIF
END jntswap
ROUTINE getball
BEGIN
MOVE TO ballline[1]
jntswap
MOVE TO ballline[2] NOWAIT
DOUT[3] = TRUE
DELAY 1000
MOVE TO ballline[1] NOWAIT
MOVE TO ballline[3]
DELAY 400
jntswap
MOVE TO perch NOWAIT
END getball
ROUTINE place
BEGIN
plays = plays + 1
boxplay[ltpli] = ltpls
MOVE TO (boxset[ltpli, 1])
jntswap
MOVE TO boxset[ltpli, 2] NOWAIT
MOVE TO boxset[ltpli, 3]
DOUT[3] = FALSE
DELAY 1000
MOVE TO boxset[ltpli, 2] NOWAIT
MOVE TO boxset[ltpli, 1]
jntswap
MOVE TO perch NOWAIT
getball
END place
ROUTINE plmove
BEGIN
pl1::
FOR index1 = 1 TO 9 DO
IF (DIN[index1] = TRUE) AND (boxplay[index1] = 0) THEN
ltpls = 1
ltpli = index1
place
RETURN
ELSE
IF DIN[index1] = TRUE THEN
DOUT[4] = TRUE
DELAY 300
DOUT[4] = FALSE
ENDIF
ENDIF
ENDFOR
GOTO pl1
END plmove
ROUTINE wingame
BEGIN
IF fingame[1] <> 0 THEN
MOVE TO boxset[fingame[index1], 1]
jntswap
MOVE TO boxset[fingame[index1], 1]
jntswap
FOR index1 = 1 TO 5 DO
DOUT[6] = TRUE
DELAY 250
DOUT[6] = FALSE
ENDFOR
ELSE
MOVE TO boxset[9, 1]
jntswap
MOVE TO boxset[7, 1] NOWAIT
MOVE TO boxset[1, 1] NOWAIT
MOVE TO boxset[3, 1] NOWAIT
FOR index1 = 1 TO 5 DO
DOUT[5] = TRUE
DELAY 250
DOUT[5] = FALSE
ENDFOR
ENDIF
jntswap
MOVE TO perch
ABORT
END wingame
ROUTINE logic
BEGIN
FOR index1 = 1 TO 8 DO
index3 = 0
FOR index2 = 1 TO 3 DO
IF boxplay[winpnt[index1, index2]] = 2 THEN
index3 = index3 + 1
ELSE
notbox = boxplay[winpnt[index1, index2]]
ENDIF
ENDFOR
IF index3 = 2 THEN
ltpls = 2
ltpli = notbox
place
fingame[1] = winpnt[index1, 1]
fingame[2] = winpnt[index1, 3]
wingame
ENDIF
ENDFOR
END logic
BEGIN
notbox = 0
ltpls = 0
index1 = 0
index2 = 0
index3 = 0
plays = 0
waslog = 1
ltpli = 1
FOR index1 = 1 TO 9 DO
boxplay[index1] = 0
tactic[index1] = 0
ENDFOR
fingame[1] = 0
fingame[2] = 0
FOR index1 = 1 TO 8 DO
FOR index2 = 1 TO 3 DO
winpnt[index1, index2] = 0
ENDFOR
ENDFOR
FOR index1 = 4 TO 6 DO
DOUT[index1] = FALSE
ENDFOR
FOR index1 = 1 TO 9 DO
boxplay[index1] = 0
ENDFOR
tactic[5] = 5
FOR index1 = 1 TO 3 DO
tactic[index1] = 5 - index1
tactic[index1+6] = 9 - index1
ENDFOR
FOR index1 = 1 TO 8 DO
FOR index2 = 1 TO 3 DO
winpnt[index1, index2] = (9 - index1) - ((index2 - 1) * 3)
winpnt[index1 + 3, index2] = (((index1 + 3) - 4) * 3) + index2
ENDFOR
winpnt[7, index1] = 1 + (index1 * 2)
winpnt[8, index1] = 1 + ((index1 - 1) * 4)
ENDFOR
tactic[4] = 1
tactic[6] = 9
$TERMTYPE = NODECEL
$SPEED = 750
MOVE TO perch NOWAIT
getball
ltpli = 5
ltpls = 2
place
l1::
plmove
logic
ltpli = tactic[ltpli]
ltpls = 2
IF plays = 9 THEN
fingame[1] = 0
fingame[2] = 0
wingame
ENDIF
GOTO l1
END tictac
list of annoyances in this code
*(most) whitespace is required and cant be changed such as including a space or not OR using tab instead of several spaces.
*the inconsistent need that some items ALWAYS be lowercase while others ALWAYS be uppercase
*numbers cant go past 255
*any defined names including the name of the program cant have more than 8 characters
*the size of an array has to be predefined and cant be changed after. You can use a wild card size "[*]" however the max size still needs to be defined at the start of the program so its rather pointless in my opinion...
*if you use any string variables you need to define the length of the string similar to how you define the length of an array
*array indexes can only be defined one at a time
*arrays can only be a max of three dimensional (though this didn't end up being an issue for me)
and the one I found most annoying of any of the other issues with this class
in lua (and most languages that i know of) this is accepted
a = function()
b()
end
b = function()
number = 1
end
a()
however in karel if we attempt something similar...
PROGRAM foo
VAR
number :INTEGER
ROUTINE a
BEGIN
b --#Will error here because b wasn't defined yet even though technically we don't call out b until after it is defined
END a
ROUTINE b
BEGIN
number = 1
END b
BEGIN
a
END foo
This made it really tedious trying to organize my code so nothing referenced another routine before the routine was defined in the code.
Well, I think it is a good practice to first define your variables and then use them, at least their definition, not value in any language. Improves readability