What I Hate About Your Programming Language
chromatic writes "Perl programmers like punctuation. Python programmers like indentation. Every programming language has its own syntax, stemming from its philosophy. What I Hate About Your Programming Language examines the issues that shape languages as they grow. It's not advocacy, I promise."
Never learn to program with ASP. The worst programmers I know started with that abomination of a language.
And of course I'm stuck using it to bring home the bacon
~:-\
"I can not bring myself to believe that if knowledge presents danger, the solution is ignorance" - Isaac Asimov
I hate all your programming languages because they arn't just a .wav file of my dictating what I want it to do.
PS.
I don't program for a living
Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
He complains that the Java philosophy says 'Operator Overloading is bad,' and still overloads strings. However I think that its the wrong way to look at the concept of operator overloading. Because adding operator overloading to a language is like giving the programmer the ability to change and mutate the language to her desires. In other words, giving a programmer the ability to overload operators, gives them the ability to create their own subset of a language. Similar to macros, operator overloading adds a whole new layer of complexity to what was supposed to be a simpler, easier to understand way of programming.
Hate to tell you - but all three of those work in PHP. In fact, lots of good PHP programmers use all three for different kinds of comments -
// is for instructions
# is for copyrights
/* is for
multiple lines */
i disagree. he did not complain about the lack about regexes in java, he complained about the fact the interpreter and standard library are one big package.
also i think he correctly talked about 3 key issues: syntax, usage, and extra features (libraries/tools). what's important about a language besides that ?
If it takes you over a hundred lines of java code to check for a web page modifiation then you shouldn't be writing java or any other language for that matter.
He also forgot (V)B... the language that no-one (at least in slashdot) admits to use but that majority of developers use.
As the article points out many languages have a lot of quirks. While the pragmatic programmer is one of my favourite books on coding I dont think learning a new language every year is a particularly useful thing to do. There is a world of difference between just 'learning' a language and gathering the experience over an extended period of time to become truly proficient in it. I already code in serval languages and while I might have a passing interest in reviewing a couple more just to see how they work I really dont want to invest the time required to learn them properly when I dont see them appear in job adverts.
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.
Better would be languages which are self-documenting... you don't need to read the comments because the purpose is clear anyway.
Class or package specifications are an improvement over having to plough through masses of functions; there are bound to be methods of making plain code easier to read in the specification of the language too.
Phil
"Cattle Prods solve most of life's little problems."
Actually, I kind of like VB for certain purposes. I am not, nor do I have any wish to be a programmer, but sometimes there are things you just can't do in a batch file, and dammit if VB isn't a nice way to get around this limitation. Not to mention that it looks a bit cleaner, and certainly less scary, to the average end user, than a command prompt. Plus the ability to send windows messages (logoff and the like) can be really damn useful.
So yes, VB is another MS product, but it can still be a very useful tool if you live in a windows world, and don't want to bother with becomming a programmer.
Necessity is the mother of invention.
Laziness is the father.
Well, I rather suspect that the main reason why you see a lot more Java bashing is because most CS students used to have to learn C++; now they have to learn Java. Since /. is mostly high schoolers and college kids, you have a whole bunch of people that were forced to learn the language in the last few years. Obviously, you're going to end up with quite a few people that don't like it.
There's not really all that much bashing of any other non-free stuff (the exception being Microsoft, but that's mostly because they're still beating up on the penguin.) I don't see it as being the primary reason for Java bashing.
How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
I think PHP coders generally lack the ego that non-PHP'ers have. Case in point...parent
JavaScript is a really nice language. For starters, Waldemar Horwat sure knows his stuff. He seems to give a lot of thought to new features before introducing them (check out the project page) and has managed to write an interpreter that can be configured to accept varying language versions (as in language="JavaScriptXXX"). Then, the whole idea of a prototype-based object-oriented language becoming mainstream should have made the Self team green with envy. It supports very powerful constructs, like dynamically attaching behavior to built-in objects via __prototype.
Besides, JavaScript inconsistencies between browsers is mainly a DOM issue, not a language one. Chromatic should have blamed the browsers, not the language.
It is easy to rip on an article with the sort of vacuous criticisms you fired off, but you really did not address a single real issue in the article. First off, you make it sound like he is advocating JS, which in reading the article is clearly not the case.
Secondly, covering your criticisms:
When he said that working with anonymous structures or structures by reference can be ugly, you interpreted 'ugly' as 'looks like.' But the ugliness in 'my $count = keys %{ $self->{groups}[HACKERS] };' is ugly in more than just looks.
The poster above already pointed out your gross oversimplifications regarding Java.
Finally, your point that "there are much worse things to complain about languages, besides syntax, and inappropriate usage," is correct, and the article itself does just that.
In short, your analysis is overly simplistic, and full of fluff.
Hyperbole is the worst thing ever.
Perl is a reaction to the flaws of many different languages. Unfortunately it reacted by imitating all the worst flaws of all the worst languages. People who think Perl is great are totally ignorant of other languages, and have extremely bad taste. They are desparate about their job security, which is why Perl is the best choice for corporate parasites looking to drum up busy-work to justify their salary.
PHP is a reaction to Perl, used by amateurs who were burned by Perl, but actually want to get work done, however they don't know any better languages. Perl (mis)taught them that programming languages were extremely difficult to learn. But they couldn't stand Perl, so they switched to PHP because it seemed "simpler", without realizing how much better other programming languages are. So they stick with PHP because they're afraid to learn another programming language, having been traumatized by Perl, and tranquilized by the incredible mediocrity of PHP. PHP was designed to recruit disillusioned Perl programmers.
C++ is a baroque overreaction to C, whose designers were obviously ignorant about programming language design, learnability, usability, readability and maintainability. So all those lessons had to be (mis)learned again, the hard way. Which brings us to...
Java is a moderate reaction to C++, that still ignored much about programming language design that C++ designers never bothered to learn (so as not to drive off C++ converts by forcing them to learn new concepts). So if you know C++ but don't know Lisp or any other reasonable language, you think Java is great. Java was designed to recruite disillusioned C++ programmers.
So PHP is to Perl as Java is to C++. The lesson: You can't fix a badly designed, fatally flawed language by imitating it.
-Don
Take a look and feel free: http://www.PieMenu.com
Visual Basic programmers like masturbation.
~~~
i'd have to say one of the things i hate the most about VB is the huge runtimes.
oh how much would i pay for the front end of VB that compiled to a stand alone exe comparable to asm coded executables.
Other than that, the language is just like the favorite couch - it doesn't really matter where you sit, but that one just happens to be more comfortable.
That's one of the reasons .NET is cool. It provides a unified runtime library that caters to any number of languages, as long as someone has bothered to port them. The end result should always be the same. We joke about COBOL.NET, but the reality is, it's made possible by this - dare I say - revolutionary idea. Soon we'll have Python.NET, Perl.NET, Ruby.NET, PHP.NET, etc, etc.
You will be assimilated =)
I think that this won't happen, partially for Mr. Kringle's comment above, but mostly because there is a difference between what you do and why you did it (and again from why you didn't do it a different way). You can see function, but you can't necessarilly see the intent of the programmer. There are many times in my programs where a single line (often, less than 10 characters long) will result in several lines of comments explaining why it is done that way. That way, the poor boob who inheirits the job of extending/fixing the program (who is usually me) has a fighting chance of figuring out my intent, not just my procedure.
you should read everything on the internet as if it had "but I'm probably talking out of my ass" appended to it.
Curse you, Microsoft, for resurrecting Basic.
If you overload + so that it suddenly means "Multiply by 34 and truncate to the nearest prime", that's not the language's fault: that's your own fault for being a damnfool idiot. Just like if you overload + for complex numbers so that it does complex arithmetic, it's not to the language's credit: it's to your credit that you used an appropriate overload.
Look at LISP, in which pretty much any part of the language can be overloaded. Nobody's ever complained that this linguistic flexibility has harmed LISP; in fact, this linguistic flexibility is almost universally hailed as one of LISP's strengths.
Parting thought for the overloading-is-bad crowd:
C overloads, too.
After all, you can do:
... I mean, come on. C overloads, so "overloading is evil" is a meme which you really ought to know better than to propagate.
Overloading isn't evil.
Stupid overloading is evil.
And you will never, never, never, succeed in creating a programming language in which it is impossible to do stupid things.
Amen to that! I used to think that tabbing as a form of indent was a major sin, but since most IDEs these days (and every text editor worth its weight in salt) will allow you to adjust tab length/replace tabs with spaces/replace spaces with tabs, I don't see what the big deal is any more, and in fact I think tabs are a better choice.
I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.
This is probably true, and I'm as much as an anti-MS guy as you can get really, but I have my reasons for not liking VB. I did a few projects with it in the past year (ASP/VBScript with VB COM components, MTS, etc), so I speak from experience.
I went into it thinking it would suck, but I quickly found it being okay for gettings things done. "Hey, maybe these guys are onto something I think...". Then the project gets more complex and I realize why I like langauges that are far more strict regarding what you can and cannot do.
If (ErrorState = True) Then
CLEANUPCOMMONOBJECTS
End If
If I had good exception and a good GC I wouldn't have even needed this though.
It's a short list, but it's been a while since I coded in it.
Common Lisp is the union of all Lisps.
It's not a matter of one sucking and the other ruling. They're both much better than most other languages. Because missions come in different sizes, it's great having a choice between a light fast sports car and a huge urban assult vehicle.
Python's design was wisely inspired by Lisp. It's somewhere between Scheme and Common Lisp in complexity, and rates extremely high on the practicality scale (integration, library support, community, portability, footprint, design focus, long term plan, etc). But Python isn't as useful as Lisp for metaprogramming (because it doesn't have a real macro system).
-Don
Take a look and feel free: http://www.PieMenu.com
What we can conclude from this article is that Delphi roxors :)
Very true, and very good points.
I used to -despise- Javascript...then I started hacking on Mozilla/Firebird extensions. Once I realized that it was the provided API (via the browsers) that was crippled, and not the langauge, I really came to love it.
Of course, I still hate using it in webpages.
Let's start this off nice and flameworthy: what is the point of using C anymore? Nearly any valid C program is a valid C++ program, and C++ gives me the option of selectively using much higher-level abstractions than C can support, with little or no overhead, in a much safer and easire-to-debug way than any pure-C approximation. And most of the projects which are coded in C these days shouldn't even be coded in C++; they should be coded in something higher-level like Java or Python.
C++
Java
Perl
Python
By far the biggest problem with Python is the user community. There's something about Pythoneers that make them glom onto the language with religious zeal, and then go around telling every one else that their own language of choice isn't elegant enough. Many Python users have the mistaken impression that Python is a carefully worked-out work of modern programming cleanliness like Scheme. In fact, Python was an unremarkable in-house procedural "little language" that, rather than dying the graceful death that most such languages eventually experience, was hyped to a larger audience and has been loaded down with all kinds of trendy features. Unfortunetely, due to it's humble roots, these features have gone in rather awkwardly.
All this would be fine, in fact, it would be similar to Perl's story, if it weren't for the singular nature of Python apologists. Python is perhaps the only open-source language whose users will proudly and vehemently defend a language flaw as a feature. The best example is the post-facto rationalization of the extra "self" argument to methods, which the Python FAQ helpfully explains was simply an artifact of the way OO was hacked into an originally procedural language. This fact doesn't deter the fanatics however, who will happily tell you that it was an intentional feature and that it somehow makes Python better.
Other examples of Python's awkward growing pains and the inexplicable attitude of it's users: the fact that Pytho defines private variables as variables whose
--
CPAN rules. - Guido van Rossum
Someone please explain: why does this feature make you so upset? How could it possibly make your life more difficult to know for a fact that the interpreter sees the blocks the same way you do on the screen?
I disagree. New functions are just that--they're new. They do not override any preconceived notions about what they're supposed to do. Operators, however, do have preconceived notions. Imagine if we applied the same reasoning to English and said, "the conjunctions 'and' and 'or' sometimes behave differently depending on the nouns they're chaining together." All of a sudden the sentence that reads, "Beer and dogs aren't pretty," is not comprehensible unless one refers to the dictionary, where it reads:
Now the sentence means, Dogs drenched in beer aren't pretty. Significantly different from the first.
I agree that overloading operators is more powerful for the code writer, but any reading of it will generally suffer, since it relies on knowing every other object's behavior.
After more than a few commerical projects where people don't know the meaning of whitspace (or commnets for that matter) I'll take Python's forced whitespace any day.
Here's how I see it:
Appropriate use of whitespace makes code more readable. I'll give that to Python fans.
However, the meaning of whitespace is a fuzzy thing. It shouldn't have exact meaning. Whether I happen to use 4 spaces instead of 3 shouldn't affect the syntactic correctness of my code.
The best analogy I can think of is nonverbal language--gestures, gesticulations, etc. Gestures help in interpreting spoken language, but they are not essential to it. Waving my hands makes it clear I feel strongly about something. However, if I don't feel like waving my hands as much one moment, it doesn't affect the meaning of what I say.
Similarly, whitespace helps visually clarify what is happening in the code. But it shouldn't be critical to interpreting the code.
This is all compounded by the fact that whitespace, whether we like it or not, is interpreted by most people as a noncharacter. Things that aren't shouldn't be important to interpreting the things that are.
There are all sorts of things surrounding this issue that are related to human perception and our ability to keep track of things. Whitespace is something that's just difficult for most people to keep track of. It's very similar to why most people can't can't stand Lisp: parentheses are logically a very elegant way of demarcating computational "sentences", as it were--but perceptually, they're very difficult for humans to keep track of.
Ok begin flaming me but I love what I've seen of C# so far. I'm not a very experienced programmer, but I was forced through C, C++, MIPS assembly, shellscripts, and Java in college. Since then I've done C# and PHP on my own. So far I like C# the best.
Why? C is an ancient ugly mess that needs to adapt or die. I'd hate to do more than a 200 line program in it because I'd get lost without objects. "Oh but you can use objects in C by doing blah blah struct blah blah kludge etc." No thanks, it took me years to figure out what the big deal with objects was and how to use them without overusing them, and I'm never going back now for anything serious.
C++ has objects you say, but they always feel like it's grafted on to C. Granted it works, and it's still reasonably portable, which is C's main advantage these days, but some things are still just ugly. How about an array who's size you don't know until runtime? Welcome back to pointers 101. Sure you can use new and delete instead of malloc and it looks nicer, but alot of things just don't have really elegant solutions, and the standard libraries are too sparse for what modern apps do with modern languages.
Java... everything you hate about C++ fixed the wrong way! Yay we have big useful libraries now... but they're constantly changing, bitching that what you just used is now "depreciated", doing things you're not allowed to do etc. No I do not want to use something called "vector" to replace a linked list, give me a freaking "linked list" object! Even if it's just a renamed vector at least it doesn't confuse people into thinking I'm going to have calculus and matrices popping out in the next few lines. This may have been the fault of my instructor but he loved crap like this. "Don't use the Stack class, use vector to make your own stack!" Oh and just because I don't want to do something with pointers if I can help it doesn't mean I don't EVER want to use pointers, I'd like to code without a babysitter please. If I screw up at least it's me to blame. Everything must be a class! Umm yeah that's great when I just want a struct with an int and a float so I don't have to write half a dozen methods to implement a "proper" class with private data and constructor and operators and copy... Put up with all this and you're rewarded with 10x slower performance and maybe cross-platform execution on alternate tuesdays when it's raining and the moon is waxing.
PHP seems nice, though I haven't really written much of anything in it yet. Some things kinda weird me out like how nothing cares if your variable is an int, float, string, etc. It's kinda nifty but extremely unsettling at the same time. At least it's easy to spot variables since they all start with $. I really don't have much else to say about it yet.
By now everyone's waiting for why I like C#. I like it because it fixes the things I hate about C++ and Java and just seems to make everything work smooth. Want to use pointers? Sure, just put it in an unsafe section for the over paranoid. Want to use objects? It's easy. Want to do threading? We've got this easy to use library for it. How about resize an array? No problem. Arrays remember their own sizes. They can even sort themselves. They can even sort themselves and another array at the same time based on the values in the first array (someone PLEASE show me how to do this with qsort() in C++ elegantly). Networking? Got it. Performance? Eh, about 20% hit from C++ on my machine, less if you use ngen to precompile it. Still too bad? Ok, put your critical sections in C++, C, or even ASM libraries and link them seamlessly. GUI apps? Tons of easy to use stuff there, though it's mostly windows specific. The downside is you don't get the portability of other languages... yet.
Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!
I'd have trouble calling C's type system "strong", personally.
Well, there's strong like Gandhi and there's strong like a bull in a china shop... The term is a bit vague and so I don't begrudge them its use as long as Lisp gets to use another.
Kent M Pitman
Philosopher, Technologist, Writer
Maybe I was also put off by the fact that the author's statement, that "Lisp is very much the lambda calculus".
Yeah, he pretty much lost all credibility with me there. Basically anyone who's used modern lisp knows that the language has mutated far beyond its initial inspiration by the lambda calculus. And, indeed, anyone who's studied the lambda calculus knows that lisp gets its static scope wrong--and in a language as minimal as the lambda calculus, that's enough to hardly make them related.
The author seems to name drop functional and logic programming languages to make it seem as if he has programmed in more than just C-derived languages, yet what little he mentions indicates that he doesn't have more than a general knowledge that such languages exist. (Functional languages have no variables??)
Ada allows you to write what your program does as code. Most other languages make you kind of sneak up sideways on what you want the program to do, tricking the language into doing your desire. Then you have to add comments to say what it is you really wanted. I write quite a few comments in programs to remind myself (and in some circumstances others) what the program does. In Ada, I'll write the code, look at it, realize that it says what it does, and not need to write comments. My best code has no comments, and no need for them. (Except for hypertext pointers to design and requirements documents.)
I don't understand about the "hemmed in on all sides by language rules." Ada has fewer rules than, for example, Java. That is, the syntax and semantics can be expressed in significantly fewer definition constructs (BNF, VDL, whatever). For me, moving back to Ada after a stint programming in Java or C++ is like coming out of a dark and stuffy room into a nice spring afternoon.
Python was designed by a guy who is both a computer geek and a math geek.
So was APL. Ever seen APL? It's essentially encrypted at the source.
Take a hundred-line snippet of Python code. Stick it into a web page. Copy&paste the web page to an email. Post the email to a programming mailing list. Have a lengthy thread about the code, quoting and requoting the original.
Now, let an intermediate Python programmer try to take the mangled code from the end of that thread and reformat it so that it works as intended. If it were in a language with explicit block syntax, chances are it would run as intended with nothing more than the removal of any quoting prefixes that mail clients have added. And a decent programmer would be able to whip up a script that would automate the transformation from mangled code into nicely indented code. Not so for the Python code.
The problem is not so much that whitespace is signifigant by default; it's that there is no way to modify this behaviour in order to generate "portable" code which can survive whitespace mangling.
But frankly, all things considered, whitespace signifigance is by far the least of Python's worries.
--
CPAN rules. - Guido van Rossum
VB6 Error handling is pathetic.
on error resume next
if (0/0=5) then Msgbox "Yes, 0/0=5"
Because the evaluation blows up, the next instruction (yes, the condition!!) executes!
- - - - -
Nulls are big trouble...
Result=Strin & " This won't be concatenated"
The correct way to fix it is...
Result=(Strin & "") & " An empty one works??"
- - - -
The whole language is inconsistent, illogical, and worst of all, almost downright compatible to GW Basic, and of course QuickBasic.
- - - -
VB components/OCX's aren't descendant classes, they're individual objects (ok, OLE descendants). If you already know Kylix or Delphi, you will hate all the inconsistency. At least DAO/ ADO/ ODBCDirect/ Whatever-name has some hirearchy. Even MS Access is somewhat more organized.
- - - - - -
Anyway, maybe the real VB virtue is that it's usful with those common "Our client gave one month, last month. Today we tell you you have two days to design and program a working demo".
MS Access let you do quicker prototypes, altough it's very tricky, and it has some nasty limitations. Reports are much much easier to do than VB's. Of course, with complex databases and more than 8-10 users, you must forget the nice wizards and begin thinking how to avoid LAN congestion.
Delphi is much better, altough Pascal is very strict and the database part is somewhat more difficult to use.
Corrections:
- PHP can be used in a non-web application. Why do you think they have GTK linkage? I run PHP cron jobs every day.
- "PHP just doesn't cut it"? What kind of statement is that?
- PHP is no less maintainable than Python.
What amazed me most in the article was that XSLT was included as a programming language. Even though the definition for programming language is as follows (from WordNet):
programming language
n : (computer science) a language designed for programming computers [syn: {programing language}]
And even if at some level XSLT matches that. I still think that XSLT is not a programming language and in such shouldn't be judged by it's format. eXtensible Stylesheet Language, is by it's name a way to define a style for an XML document, and it's not for programming applications.
Although, i agree that XML is not the best way of representing applications and XPath itself is quite complex to use for even the simplest queries.
Perhaps that (bad code available everywhere) is part of it... but a big part, perhaps more important, is the environment. Most programmers think an IDE is something that gets in the way, or simply gives you a hotkey for running make. With Smalltalk (or Lisp, Dylan and other languages with a badass IDE), the IDE very much contributes to this self-documenting aspect. Hell, I'd go so far as to say that a well-done IDE is 50% responsible for making a language self-documenting. Most of the rest if a simple language with sensical stylistic traditions.
But yeah, it certainly doesn't help when people simply download packages written by others which are poorly done. Especially when both the the interface/API is bad and the code is messy, no good.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
I really don't care if no one uses Ada right now. It has got so many advantages over C that it is well worth learning. I use it for my personal coding. I have several projects cooking. Once they are stable ( and documented, even Ada need good documentation!) I will be releasing them GPLed. If the community ignors them because of the language, so be it. I don't care. I want secure maintainable code. The only real problem with Ada is that which is common to all strongly typed languages and that is it is easy to get carried away defining types. As more project leaders come to the conclusion that the most of the problems with modern code can be traced to errors that are a direct result of the characteristics of C/C++, the appeal of Ada will increase. The only other contender is Java but it carries too much baggage.