Ask Slashdot: What Are the Strangest Features of Various Programming Languages? 729
itwbennett writes: Every programming language has its own unique quirks, such as weird syntax, unusual functionality or non-standard implementations -- things that can cause developers new to the language, or even seasoned pros, to scratch their heads in wonder (or throw their hands up in despair). Phil Johnson has rounded up some of the strangest — from the + operator in JavaScript to the trigraphs in C and C++ and indentation level in Python. What programming language oddities cause you the most grief?"
Re:Lua[0]? (Score:5, Funny)
Bookkeepers, shepherds, scientists and mathemaitcians have for centuries counted starting with 1. It is recent computer scientists that started this crazy standard break, as if they knew better how to count.
Re:Powershell (Score:5, Funny)
I'm from a different generation. When I was learning things there were attempts made to make languages somewhat failsafe by avoiding ambiguity. Then I saw the C syntax.
- if (a = b) assigns the contents of b to a and executes the code following if b <> 0. Who the hell thought that would be a good idea?
- sizeof(string) (I may have got the name of the function wrong) returns the length of a single byte rather than the length of the entire string. Who the hell thought that would be a good idea?
- strings terminated by a binary zero rather than their physical size. Who the hell thought that would be a good idea?
Kids grew up with this idiocy, I program in Fortran, Cobol, even Assembler to avoid that mess. Oh, and buffer-overruns have been a serious security problem for years now. Well what a f****** surprise.
If you print a lot and want a ink spare language (Score:5, Funny)
use whitespace [wikipedia.org]. Be warned, several problems have been reported [slashdot.org] when posting source code to the internet.
Re:Powershell (Score:5, Funny)
Powershell is just enough like Bash to make me groan after ten minutes and ask "Why the f--- didn't they just make an integrated Bash shell?"
Powershell - the ugly the bastard child of Bash and Batch.
Re:Null Terminated Strings (Score:5, Funny)
Nonsense. C is a more elegant weapon for a more civilized age. It's a shame that mass-produced coders have to rely on blasters.