What I Hate About Your Programming Language
by chromatic05/12/2003
Author's note: based on voluminous comments, I've clarified a few places where my original intent was unclear. Thank you all for the feedback!
At a very high level, all programming languages are similar. They all require you to describe a problem to solve. They all require similar skill sets — a good programmer in one language will find his or her skills will transfer to another language.
Of course, at a practical level, there are important differences between languages. Different language families make certain techniques easier than others. You'd rarely be able to write a useful procedural program without any variables, but it's common in functional languages. Expressing a logic problem in terms of objects and classes will require a different approach than that of an imperative language.
Setting aside those differences and looking at the popular languages for open source development today, there are many syntactic and otherwise superficial differences. At one level, all languages have a philosophical axe to grind. They exist for a reason. At another level, they're all just flipping bits and jumping around in a long chain of ones and zeroes.
Everything in between is a matter of taste, and that's where most of the messy details go.
Language Philosophy
The philosophy of the language designer shapes the language, its libraries, its ecological niche, and its community. Pascal was a teaching language. C is portable assembly. Lisp syntax is very much s-expressions. Perl is expressive glue.
Consider what happens when someone proposes a great new language feature. There are several possibilities; the language designer may reject it outright, saying that it doesn't fit in the language. (That leaves the door open for someone to write or modify the compiler or parser to support the feature.) The designer might include it in the language by adding a new keyword or by making some other change to the core functionality. The designer might suggest it's better made available through some extension mechanism, such as being added to a core library or an optional library.
Of course, a language with general-purpose features has a way of escaping its original ecological niche. That's why some people use PHP on the command line, server-side JavaScript, and even C for network applications.
To summarize, languages often embody a philosophy. If successful, they're used in domains that the original designer may not have intended. They're often extended in ways the original designer may not have intended. (That's probably a mark of success.) Do these facts suggest any way to evaluate a language's goodness?
Language Goodness
Deciding a language is "good" or not is largely a matter of personal taste.
I prefer dynamic typing and don't care much for the static typing found in C
and its descendants. Part of that is personal taste — it feels like
premature optimization to decide that a variable will always fit into eight or
16 bits. (Yes, I know judicious typedefs can lower some of the
maintenance costs.) It's also practical; I don't write a lot of code that
would benefit from static checking. (A buddy writes drivers at a semiconductor
company. Static checking saves him time and effort.)
Barring the issue of personal preference, we're still left with rather
subjective criteria. Within a domain, it's worth analyzing a language by how
well it solves your problem. I'd hate to write a CGI application in straight
vanilla C; I'd go crazy trying to manipulate strings. On the other hand, there
are amazingly accomplished C hackers writing web programs like
mod_virgule. Familiarity with and fluency in a language are very
important.
It's also worth asking how often the language gets in your way. I once wrote a program to send out update notifications when a web page had changed. My original program was a 10-line shell script running on a Unix box. For various reasons, the final version was a couple of hundred lines of Java running on a Windows machine. Granted, my Java wasn't so hot, but the shell script just glued together existing Unix commands.
Another good question to ask is how well the language supports writing good and maintainable programs. I don't really mean that a language that enforces literate programming is necessarily better than a language that doesn't require you to declare variables. On the other hand, support for lexical variables, encapsulation, reusable components, and other good programming techniques certainly make it easier to keep using a program. This can be taken too far; a language that could prevent really, really bad programmers from doing really, really stupid things probably wouldn't be useful for much else.
It's reasonable to consider a language's supplementary virtues. Can you imagine programming in Smalltalk without using the browser? Would anyone use Java without the class libraries? I suspect if I got used to a good IDE, I wouldn't notice the pain of a strong static language as much — that's worth keeping in mind. Where would Perl be without the CPAN? Can a good user community keep people using an otherwise mediocre language? You bet.
Beyond these criteria, it's really hard to come up with a set of guidelines that make a good language. It's hard to judge the suitability of a language without practical experience in it — where pointer arithmetic is familiar to a C hacker when manipulating arrays, it's terribly unidiomatic in a language with queues and stacks as available data structures.
Besides that, the general purpose languages are all reasonably equivalent. It's not difficult to solve many of the same kinds of problems in any language. Given a good set of libraries, some experience using them, and a good IDE if necessary, a competent programmer could write an equivalent program in several different languages with roughly the same amount of work. Consider how many of the programs written today do one of the following:
- Manage a web site.
- Control a small GUI application.
- Put stuff in a database, process it, display it, and update it.
Even for more difficult tasks, decent languages tend to allow you to use existing libraries for trickier tasks like very fast XML parsing. C is really the language of the Empire, for better or worse. If there's a C library that does what you want and the language lets you use it, you're at least halfway there.
What's left? It's largely a matter of taste. That's where the friction comes in. Maybe personal taste is a poor reason for choosing a language, but it's a major reason for creating a new language. Language philosophy is subjective enough that it might as well be personal taste. Besides that, the first things a new user will notice about a language are syntax issues — where the language philosophy is most evident.
Language Badnesses
Of course, choosing any one language for a project often means not choosing another language; sometimes that's the most compelling reason. I've had projects where a manager said, "We're going to use language X because that's what VCs expect us to use," where language X was, in my opinion, the wrong choice.
Going further, differences in language philosophy present a barrier to learning new languages. This doesn't just apply to existing programmers. It also applies to new programmers — learning to think like a programmer is difficult enough without bothering with syntax issues, editors, compilers, linkers, and distribution.
In the spirit of demonstrating language subjectivity, here are several of my opinions on popular programming languages I've used and how I feel about them. They're completely subjective. They don't bother everyone. What I dislike about one language may be something you love. That's fine.
What I Hate About Perl
The syntax for working with anonymous data structures and structures by reference is ugly:
use constant HACKERS => 2; my $count = keys %{ $self->{groups}[HACKERS] };Writing extensions in C can be Byzantine. Perl's internals are full of macros. Sometimes they make life easier; other times, they hide a lot of complexity that you really should know. XS is a hybrid of Perl macros, Perl, and C, and it can get quite complex. Inline can't always protect you from that.
What I Hate About Python
The special case syntax for constructing a one-element tuple has always bothered me; the trailing comma seems unPythonic.
Half-hearted closure support means that enclosed lexicals cannot be modified. I could emulate real closure support with objects, but sometimes the functional solution feels more natural.
The whitespace issue isn't a big deal (I use a good text editor), but I've spent too long debugging make files to be comfortable with invisible-yet-syntactically-significant characters. Python does have the advantage that it doesn't dictate how much whitespace to use, but I'm still leery of issues with copying and pasting code from a web browser or a newsreader.
What I Hate About Ruby
The sigils that mark instance and class variables always stick out visually in an otherwise clean language.
The available English documentation is still exceedingly slim, compared to Perl and Python.
What I Hate About PHP
I seem to run into lots of special-cased features. For example, I always seem to try
new dir( $path )instead ofdir( $path ).There's no namespace support yet, and I've never liked name mangling to get around this.
What I Hate About Java
The inconsistencies between what the language allows and what the standard library actually does bother me. If operator overloading is so bad, why does the
Stringclass do it?Interfaces get around part of the lack of multiple inheritance, but I'd like to be able to reuse common code in ways besides inheritance. Mixins that don't require inheritance would be a nice touch.
The libraries and the interpreter aren't cleanly separated. There are ways (involving decompilers), for example, to get regex support in 1.3, but I'd prefer to upgrade the standard library and the interpreter separately sometimes, rather than in one big chunk.
I like the idea of checked exceptions in some situations, but forcing every method to deal with (catching or throwing) all exceptions that its child calls or may call can be tedious. I'd rather be able to ignore an exception and let it propagate upwards. Sometimes, I'd rather not worry about exceptions at all.
What I Hate About C
It's often used inappropriately. Unless I'm writing a kernel, a device driver, a virtual machine, or an interface to a C or C++ library, writing in C is a probably premature optimization.
Thirty years of growth and patches to the standard library have produced many, many similar functions with similar, terse names. Quick, Unix coders, what are the differences between
execl,execlp,execle,execv, andexecvp? If you're not using these every day, you'll be hittingman 3 execwhenever you see them.
What I Hate About C++
I find the template syntax ugly. I have no idea how to make it more beautiful, though.
It feels funny to add code that does nothing to prevent the compiler from helpfully adding code that does the wrong thing. Consider the default copy constructor, for example.
What I Hate About JavaScript
Okay, I really don't hate very much about JavaScript. It's pretty good for manipulating DOM elements, and I really like bookmarklets. Working around browser bugs and incompatibilities scarred me for life, though.
What I Hate About XSLT
I'm familiar with functional programming, but XSLT still feels more theoretical than practical. I really understand the benefit of not having to write yet another language parser, but programming in XML, by hand, feels really wrong. Maybe using a better tool would help.
What I Hate About SQL
The extensions I find most useful for a database generally aren't portable to other databases.
The approach that feels most natural is often really, really bad. I don't naturally think in terms of set operations.
Acquired Tastes
These are my preferences, based on the kind of work I've done and continue to do, the order in which I learned the languages, and just plain personal taste. In the spirit of generating new ideas, learning new techniques, and maybe understanding why things are done the way they're done, it's worth considering the different ways to do them.
The Pragmatic Programmers suggest learning a new language every year. This has already paid off for me. The more different languages I learn, the more I understand about programming in general. It's a lot easier to solve problems if you have a toolbox full of good tools.
I've learned several new techniques from branching out. For example, Ruby supports mixins with surprising ease. It's a natural way to solve certain problems where you might otherwise use a Decorator pattern. Seeing how Ruby uses mixins led me to ask how I might solve the same problem in Perl — and it's incredibly easy. It's not exactly a built-in language construct, but it's trivially easy to add, and now it's part of my standard Perl vocabulary.
Over time, my taste in languages has evolved. I used to worry about performance and variable-typing, but working with dynamic (or "agile") languages and learning to love test-driven development has biased me against strong-typing systems. Maybe learning a language like Haskell would balance my thoughts.
Every language is sacred in the eyes of its zealots, but there's bound to be someone out there for whom the language just doesn't feel right. In the open source world, we're fortunate to be able to pick and choose from several high-quality and free and open languages to find what fits our minds the best.
chromatic promotes free and open source software for O'Reilly's Open Technology Exchange.
![]() |
Essential Reading How to Keep Your Boss from Sinking Your Project Like it or not, your project needs management. Yet few good software projects can survive bad management. If you're a programmer on a high-visibility project, this PDF offers five principle guidelines for managing upward that will help you help your boss make the right decisions about setting project expectations, working with users and stakeholders, putting the project on the right track and keeping it there. The PDF also covers what problems cause projects to fail and how to fix them, and what you can do to keep your software project from running into trouble. Read Online--Safari Search this book on Safari: |
Return to ONLamp.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 82 of 82.
-
Which language is best
2006-03-10 16:59:34 lowellD [Reply | View]
I'm one of those "retards" that uses the often slammed language called Visual Basic. I never went to programming school and I don't program professionally, but back before Windows I needed a program to do a specific task that was otherwise not commercially available. I wrote the program in QBasic because it came on the computer. Was I supposed to know any better? It was easy to learn. Why waste my time learning a bunch of wierd, non-intuitive coding conventions. The program was just for me. I never intended to sell it. But over the years many people saw the program and wanted it; more than 2000 people have purchased the program. Of course, the current version is no longer in QBasic. But is written in VB5 and has a full standardized GUI running on all version of Windows. I know VB has it limitations. Everybody seems to think the language they prefer is the best. It may be the best for what they do but not the best for what someone else does.
So, where can a layman go to get a simple straightforward comparison of the various languages? How about a comparison of useful functionality rather than technical stuff. Things like: easy to code, speed of operation, print preview, long documents with a variety of formatting, good communication with printer, connection to email and web, etc.
-
Lack of imagination wrt Perl
2005-12-29 08:55:33 mkcmkc [Reply | View]
As soon as I read "programming languages are a matter of taste", my first thought was "must be a Perl guy". :-)
The list of Perl annoyances seems awfully short. Google on "Perl Puzzles" to see a more complete list.
-
What do you hate about Forth, Lisp and APL?
2005-10-16 00:45:32 znmeb [Reply | View]
I maintain there are only half a dozen unique programming languages in the history of computing: macro assembler, FORTRAN, Lisp, APL, FORTH and SmallTalk. So ... what do you hate about those languages?
Oh ... learn a new language every year? That implies someone has to come up with a decent new language every year. I'm learning Ruby right now. I go about one language every two to three years. Before Ruby it was R and before R it was Perl.
I never did learn Python or PHP, and I don't really think I want to. And I don't think I want to learn any of the "theoretical" languages like Eiffel, Haskell, OCAML, etc. I'll stick with Lisp for that.
-
JavaScript
2004-08-16 18:38:40 wickline_ora [Reply | View]
Well, maybe you don't hate JavaScript for this, but I sure do...
The decision to use '+' for both addition and concatenation was very unfortunate. JavaScript is often used to validate/manipulate HTML form element values. Those values are not typed... they're just the value in the form.
If you '+' two form values (or a form value and something else) should you be interpreted as concatenating or adding?
Far too often, I've had to do foo.value*1 to enforce numeric interpretation and therefor addition instead of concatenation.
The same applies to using the same comparison operators for both numeric and string comparison.
Would it have killed them to add a separate concatenation operator and a few string comparison operators?
-matt
-
Don't forget ToonTalk!
2004-01-04 00:20:57 anonymous2 [Reply | View]
Yeah, C is nice for some things, and Haskell beats everything else for pure elegance. But I find I write most of my stuff in ToonTalk these days. Clients are always impressed by the animated helicopters and the mouse with the big hammer, two features you don't find in very many other programming languages (not to mention Dusty the Vacuum).
See http://www.toontalk.com and especially http://www.toontalk.com/english/computer.htm and http://www.toontalk.com/english/kidsask.htm
:) :) :)
-
Instead of a comment...
2004-01-01 08:44:57 anonymous2 [Reply | View]
...here are two links:
* All languages are not equivalent: http://www.paulgraham.com/icad.html
* It's better to be able to grow a language: http://prog.vub.ac.be/~wdmeuter/PostJava/FR-Steele2.pdf
-
have a look to Rebol
2003-11-01 10:41:19 anonymous2 [Reply | View]
Rebol isn't perfect but contains a lot of good ideas
- easy to install (run-time = 1 file ~ 400K)
- simple GUI
- a lot of predefined types
=> very short code
(I created REAL apps in 50 - 100 lines)
-
Why has nobody mentioned Eiffel ?
2003-06-19 02:59:27 anonymous2 [Reply | View]
Just a thought, I wonder why no one has mentioned Eiffel ?
I think it is a great general purpose language, nice and clean (like Ada).
Have fun.
<mr_jimmybob at lycos dot co dot uk>
-
Functionnal transducer languages vs. XSLT
2003-06-05 10:19:14 anonymous2 [Reply | View]
Some new XML oriented languages can replace XSLT and its lake of usability (XML syntax is... boring).
Take a look a XDuce (http://xduce.sourceforge.net/) and CDuce (http://www.cduce.org) this are functionnal languages with an ML-like syntax and nice pattern matching features (especialy CDuce...)
-
What about AWK?
2003-05-21 10:17:36 anonymous2 [Reply | View]
I have used awk for years, and I really can't find anything to hate in it. It's not a terribly powerful language, but you can do some pretty complex things with a few awk scripts piped together.
Anybody had a bad experience with awk?
-
Beside Taste
2003-05-19 02:54:17 anonymous2 [Reply | View]
Taste is not a good criteria for choosing a language. Environment seems another one.
Considering the number of mediocre programmers you can get compared to the number of good programmers, my preference is highly biased to a language which makes it hard to make mistakes.
Also most people arround are early trained in procedural thinking. Once you have forgotten the initial pain when you first learn to press every problem in a sequence of steps it seems to be hard to learn alternative ways. Strange enough.
The pointer is still a mistery to many people and they panic when they have look at a piece of C code using pointers. It's a pitty cause sometimes pointers can be cool, expressive and efficient. But at some point it seems to require knowledge of hardware design. And isn't the world full with memory overflow vulnerabilities. I wonder if people can not make it better or don't want to.
We're doing Java on the server side and I would not like to see what happened if we did it in something different than Java. And we have been very successfully using XSLT to separate layout from function. But training people XSLT is hard.
I try to look at a new language every other year. Unfortunately commercial environments do not let you change your major project language so fast, you have to stick to a compromise.
-
My favourite languages. (Objective C, OCAML and Ruby)
2003-05-17 05:47:49 anonymous2 [Reply | View]
Hangul, Latin and French.
Only joking.
Objective C is really worth checking out. It has most of the benefits of OO, with very little syntax change over C. It lacks class variables and multiple inheritence. Class variables are not really a problem because static variables can be used in the interface declaration files. Multiple inheritance is a pain. As the java user once said to the vicar. Either way, it's also a very well documented language and the memory management side effects of the model give a very smooth ride. Apple have hit the nail on the head by applying it to Cocoa. Although strictly speaking NeXt hit the nail on the head. You should check this out if you've done Smalltalk, because it uses very similar messaging protocols.
OCAML is seldom heard of but is piece of piss to learn if you've worked with LISP or ML or any functional language really. It's extremely fast, almost as fast as C and to boot has memory management. (http://www.ocaml.org - Free book available, GPL)
Ruby; one word blocks.
-
so many languages, so little time
2003-05-15 20:18:27 anonymous2 [Reply | View]
My favorite language is BLISS, but that's not a language for people who like complicated, difficult to master languages like C, C++, etc....
Fortran may be the most important language today; a very simple language which wasn't designed to be extended so the extensions came a cost.
FORTH is another simple language that is very powerful due to its builtin bootstrap nature.
G-code, aka RS-274, is a trip back three decades - only someone who have at least a few decades in the computer industry can truely appreciate its stunted development.
I haven't really thought about it for a quite some years, but I wonder if someone has updated Jean Sammett's computer language family tree.
It seems to me that the industry has stopped exploring the nature of computer languages, problems with and using programming languages, and all the interesting computer language discussions of the 60s and 70s...
-
better than C
2003-05-15 10:21:27 anonymous2 [Reply | View]
I read your article with deep regret. The most useful language I know of was not mentioned. I use PowerBasic everyday.
It produces faster and smaller code than C. It can address either complex or trivial problems in a snap.
Its chief, and only, deficiency so far as I can determine, it that it has a name that is unsuitable for mass appeal.
If "PowerBasic" had been called "Snap" or "Beano" or just about anything but "Basic" it would have been the longstanding hit of programmers. But the word "Basic" carries with it an implicit insult to programmers who know their own work is anything but "basic."
There would be justification for steering clear of PowerBasic if it were anything like VisualBasic, which I find to be so dreadful that it is unusable. There might also be lingering justifications for not using PowerBasic if it contained some of the limitations of its predecessors. But in its present versions for my purposes there is only one word to describe it: "ideal."
Since this is a statement in praise of PowerBasic. I would like to be clear that I am not associated with the PowerBasic company in anyway, except to be a customer.
Ike Jeanes
Pulaski,VA
-
PHP problems?
2003-05-15 09:14:17 anonymous2 [Reply | View]
PHP 5 is slated to have namespaces included. There's no test version yet to determine how well this will work, but that should fix one of his two complaints. The other is more of just familiarizing himself with the language. I doubt this can be fixed.
-
No RPG?
2003-05-14 22:27:55 anonymous2 [Reply | View]
I did RPG-II on an IBM System/34 in high school about 11 years ago. It was /interesting/ and not fun at the same time.
I migrated from screwing around in OCL to ARexx, and now to PHP-CLI. I'm very happy where I am.
-
Re: What I Hate About SQL
2003-05-14 19:25:41 anonymous2 [Reply | View]
Yes, SQL is often thought of as Not A Real Programming Language. I think there are two types of developers: those who think naturally in sets, and those who don't. Not that one is better than the other, but I think naturally in sets, and love the logic behind that approach. I tend to solve most of my biggest problems that way.
Really, I think SQL's biggest failing is that it is not set-oriented enough, nor is it particularly expressive. That's why triggers, procedural languages, and all sorts of proprietary extensions had to be developed in the first place. C.J. Date and a few of his associates have been campaigning for a better relational language for years (based on TutorialD, or Alpha, or whatever it might be called next -- see www.thethirdmanifesto.com)
-
ALGOL anyone???
2003-05-14 14:23:05 anonymous2 [Reply | View]
This was the first language that I learned after ASM and is still one of the best. I don't think it exists in the bill gates world - ????
bobh
-
Ideal language: Delphi w/ Clarion influence
2003-05-14 12:56:38 anonymous2 [Reply | View]
I'd love to see a delphi language/environment with Clarion's syntax for blocks, ifs, loops, and lack of the semi-colon terminator in favor of new-line. Clarion's syntax is the cleanest I've seen for these basic elements.
Check out this Clarion code:
if x = y
! number of statements doesn't matter
SomeProc('sdf', a)
loop i = 1 to 5
p = x * i
Message('p is ' & p)
end
elsif x > 3
! all loops start with 'loop'
loop while x = 3 and SomeFunc(x)
a = b * c + sin(b+c)
Message('a is ' & a)
end
elsif y = 4 and blah
! anumericvar is converted to string
Message(anumericvar)
else
halt('aarrgh!', -1)
end
No semi-colons and you don't need begin..end in some cases and not in others. Clarion dynamically converts between strings and numbers, and, as a 'general purpose' business language, returns 0 when dividing by zero instead of throwing an error. It supports file structure and window structure declarations (in the language itself) and is a natively event-driven language, with window event loops as just another type of loop in the language syntax. Unfortunately, all these neat features are much less flexible in the long term than the library based ways of Delphi.
-
It has never let me down... FOXPRO (VFP)
2003-05-14 10:47:16 anonymous2 [Reply | View]
Fast Development – Easy to use – Robust – Dynamic use of Databases – It keeps up with the times – Simple application deployment – Good Reference tools on the web – Strong user base – 3rd Party Add-ons – Owned by Microsoft – Can make Apps for the WEB – Low Cost – And the Fox is Cute too! ************ FoxPro VFP8 – What are you waiting for!
-
C rules, everything else vacuums lint
2003-05-14 10:41:47 anonymous2 [Reply | View]
OOP is for programmers who aren't smart enough to know how computers really work -- or who know how computers work, but are too lazy to care how much they abuse the cache, memory usage, etc.
C
-
U suX0r!
2003-05-14 10:37:40 anonymous2 [Reply | View]
Ph33r m3 c0z u sUx0r! 411 14N6u463$ ru13 n00b!
-
And what of C#?
2003-05-14 09:40:39 anonymous2 [Reply | View]
C# is a inconsistent mixture of C++, VisualBasic, Java, IDL, and Smalltalk. Blech!
-
Criticisms of Java were really criticisms of class libraries
2003-05-14 09:35:55 anonymous2 [Reply | View]
-
but i love and hate assembler.
2003-05-14 07:29:48 anonymous2 [Reply | View]
i don't need compiler, they are all gcc family with complexity. no matter what language name it, after all, it's son of C.
why don't you make it easy?
-
php is also missing function overloading
2003-05-14 07:27:13 anonymous2 [Reply | View]
last time I checked, I couldn't do function overloading by param signature, which sucks major browneye. There was some wack way of naming the same function differently for each param permutation and using the main function as a traffic cop.
Granted, in Perl I just lazily shift off and do sanity testing in module, but when writing OO code I prefer to overload functions, particularly constructors.
-
You need to look at REXX
2003-05-14 07:25:47 anonymous2 [Reply | View]
Some great points on languages, but REXX beats them all in so many of the points you raise.
bob hamilton
-
Programming in C
2003-05-14 07:23:31 anonymous2 [Reply | View]
I hate the huge vocabulary of C. I have a poor memory between my ears. I use PASCAL because I can do whatever I want and I do not need to use MAN to do it.
-
You *CAN* ignore checked exceptions in Java
2003-05-14 06:58:07 anonymous2 [Reply | View]
Don't program much in Java, do you? To "ignore" an exception thrown at you, just declare your method thusly:
public void myMethod () throws Exception {
}
With whatever return type, access control, name, and parameter list you need. Saying "throws Exception" ignores the entire group of checked exceptions. You can percolate this all the way up to the main method, which if it throws an exception, causes the default handler (dump the stack to stderr and terminate the thread) to spring into action.
-
C, C++, Java, maybe others - zeroth element arrays
2003-05-14 06:51:27 anonymous2 [Reply | View]
I hate zero-based array indexing. There is an IMMEDIATE disconnect when you declare an array to have 10 elements, then can only address up to element 9. Couldn't the COMPILER handle this transition so I can think about the array elements naturally?!?
What the heck is the ZEROth day of the week?
-
Aspect s to resolve some Java complaints
2003-05-14 06:28:03 anonymous2 [Reply | View]
A nice way to get around some of the complaints about Java lack of multiple inheritance and checked exceptions is to use Aspect oriented programming.
Using AspectJ (http://www.aspectj.org/) one can easily silence checked exception by wrapping them in Runtime exceptions. It also quite easy to provide common behaviour without multi-inheritance by writing an aspect that will be applied on a implemented interface.
There is a lot of other nice thing you can do with apsects such as adding authentication/authorization to existing code without any change to the existing code, providing consisten logging throughout the application, etc. It really worth checking out.
-
Great Article
2003-05-14 06:21:59 anonymous2 [Reply | View]
Kudos to Chromatic! His writing skills are now coming to par with his coding. Definately becoming one of my favorite article/opinion writers. Even when I disagree I can respect his point of view.
-
Using C for CGI programming is easy...
2003-05-14 06:10:46 anonymous2 [Reply | View]
The author said: I'd hate to write a CGI application in straight vanilla C; I'd go crazy trying to manipulate strings.
Response: Several free C tools are available that do the string manipulation for you. I've tried several but the one that blew me away is called "uncgi". If you work in Unix you really should take a look at uncgi. Uncgi takes all incoming information from an HTML form, places it into Unix environment variables, and then runs your program. All your program needs to do is use function getenv() to read everything on the form. Uncgi opens up html forms processing to a C programmer almost immediately. Note that uncgi is actually language neutral. Any language that can read environment variables will work. Here's where to get uncgi:
http://www.midwinter.com/~koreth/uncgi.html
-
Fredrick Brooks
2003-05-14 05:44:12 anonymous2 [Reply | View]
We were just talking about a related topic yesterday and I think it is appropriate to note that for all their differences today's present crop of 3rd and 4th GLs function at about the same level. Fred Brooks pointed this out many years ago in "No Silver Bullet", IEEE Computer. I said it once (IEEE Computer May 1999, Letters to the Editor) and I'll say it again: every programmer needs to read the Brooks article.
-
Perl and CGI . . .
2003-05-14 05:35:20 dausha [Reply | View]
Overall, I enjoy programming in Perl. However, I hate the many different flavors of Perl CGI programming. Too many of them don't quite do it well enough and the 'discussions' that happen when looking for the right one can be irritating. So, when it comes to CGI, I use PHP.
-
What is wrong about Ada ?
2003-05-14 04:46:19 anonymous2 [Reply | View]
Ada has saved me for a lot of work hours
giving me time to think about the actual
problem to solve...
-
All languages are not equal!
2003-05-14 04:30:58 anonymous2 [Reply | View]
see http://www.paulgraham.com/icad.html
-
Familiarity with and fluency in a language is very important.
2003-05-14 04:02:08 anonymous2 [Reply | View]
They certainly is.
-
Java problems...
2003-05-14 03:57:48 anonymous2 [Reply | View]
"If operator overloading is so bad, why does the String class do it?"
What String does isn't really operator overloading. It is a defined part of the language that exists for simplicity.
Also, what is done with String cannot actually be achieved with operator overloading mechanisms as they exist in other languages; it is a construct which is compiled into code that uses an entirely different class ('StringBuffer') to provide an efficient implementation that wouldn't be possible using String, which is immutable.
"I'd like to be able to reuse common code in ways besides inheritance. Mixins that don't require inheritance would be a nice touch."
Have you considered working with a pattern where a private member contains a reference to an object of the type you want to reuse code from, and then this is used within your class? I find this pattern very powerful, and useful in a lot of cases where people naturally turn to multiple inheritance in C++. In many cases, it is a lot easier to understand when reading the code, too.
"The libraries and the interpreter aren't cleanly separated. There are ways (involving decompilers), for example, to get regex support in 1.3, but I'd prefer to upgrade the standard library and the interpreter separately sometimes, rather than in one big chunk."
Is there any real reason they should be? I tend to think of a Java installation as a virtual operating system that runs on top of your own. Would you expect to be able to back-port Windows XP features so they were available on Windows 2000?
"I like the idea of checked exceptions in some situations, but forcing every method to catch all exceptions that its child calls or may call can be tedious. I'd rather be able to ignore an exception and let it propagate upwards. Sometimes, I'd rather not worry about exceptions at all."
Simple solution: add 'throws Exception' to the end of all your method declarations. It'll annoy anyone who isn't lazy and has to interface with your code, but it works just fine as a way of declaring to the compiler that you're not interested in the exceptions at this time.
-
What I really like about JCL
2003-05-14 03:41:30 anonymous2 [Reply | View]
IS THAT IT IS ALL UPPERCASE AND 80 COLUMNS AND STARTS WITH //.
However, the most important reason I don't use perl it it's 'cuteness' - I feel annoyed shitless by all this 'wow, ai'nt I just soooo cool' style, like using 'bless' as a command. Good grief.
-
Operator overloading in Java
2003-05-14 03:16:09 anonymous2 [Reply | View]
You wrote:
The inconsistencies between what the language allows and what the standard library actually does bother me. If operator overloading is so bad, why does the String class do it?
------------------------------------------
The philosophy behind that may be that overloading is not necessarily intrinsically "bad", but has the potential to generate unintuitive code.
The one supported instance of String concatenation is a natural and intuitive use of overloading.
Also, to eliminate it just in principle for consistency would deprive Java programmers of an extremely useful timesaver.
-
Why C sucks...
2003-05-14 02:35:00 anonymous2 [Reply | View]
I recently wrote another article here, before this one:
http://projectz.org/?id=182
-
Java
2003-05-14 02:05:43 anonymous2 [Reply | View]
Java does not support operator overloading so neither does the String class. What happens is that the compiler automatically creates a StringBuffer class for you and appends() various stuff together. It was designed to make life easier for the programmer. Do everythign by hand if you want - it won't make a difference.
It's exception handling tediousness is necessary to ensure the security of the language. Take it or leave it.
I agree about the library issues. I have multiple versions lying around, from 1.1 to 1.4 and also the microedition version. It sucks to have to change the classpath each time i want to compile something.
-
What I hate about Tcl
2003-05-14 01:29:17 anonymous2 [Reply | View]
It never gets mentioned in articles like this.
-
What I hate..
2003-05-14 01:24:24 anonymous2 [Reply | View]
about Perl: "there's more than one way to do it" is best applied at a more abstract level (ie algorithm design) than coding -- maintainability is improved if the code is written the way the maintainer expects - "the naive way is the best way (tm)"
about Python: invisible syntactic elements
about PHP: silly inconsistencies
about Java: it's supposed to be universal, right? why no builtin types for decimal numbers and dates -- it's been estimated over half of programs have to deal with these (and many of the rest would be improved by using decimals instead of floats, IMO) PL/1 was better.
about visual basic: you've got to wonder about any language with "dim" as a reserved word. It probably has more inconsistencies than any three other languages put together.
-
url (wiki): "Why We Hate Perl"
2003-05-14 01:10:21 anonymous2 [Reply | View]
http://c2.com/cgi-bin/wiki?WhyWeHatePerl
-
And what do you think about ERLANG
2003-05-14 00:26:01 anonymous2 [Reply | View]
I agree and that's why I am now using Erlang ( www.erlang.org ;-)
-
What I hate about C++/C
2003-05-13 23:23:52 anonymous2 [Reply | View]
Garbage collection.
(Bill G. might add "buffer overflows")
-
OCaml for high level coding + good performance
2003-05-13 23:10:19 anonymous2 [Reply | View]
OCaml is one of the few languages I'd really like to get into - I already know quite a few languages ranging from C++ to Python and Perl. It is a very high level language that can run interpreted or compiled into machine code that rivals C for efficiency (and beats it on some benchmarks).
A modern Lisp has similar attributes and is probably better supported with tools and other infrastructure, but OCaml has a nicer syntax and seems to be evolving very fast.
-
Easier C extensions for Perl
2003-05-13 23:03:02 anonymous2 [Reply | View]
XS is the built-in way to extend Perl using C; however, the impressive Inline::* modules make it very easy to embed C, Java, Python and many other languages *within* a normal-looking Perl program. Inline::C is so easy to use that very few people should need to use XS.
-
Java: one thing I dislike about it
2003-05-13 22:55:30 anonymous2 [Reply | View]
Garbage collection. Not having to call free() is like not having to declare variables before they're used. It just promotes sloppy coding when a programming language encourages people to leave information out of the program (e.g. when an object is or should be freed).
-
Screw this! Why I love Prolog
2003-05-13 21:52:00 anonymous2 [Reply | View]
In Prolog you describe the problem instead of attempting to describe a (usually, accidentally, inevitably partial) solution.
This solves two problems at once: once the problem is understood, it is also (Zen-like) solved.
-
What I hate about RPG
2003-05-13 20:52:20 anonymous2 [Reply | View]
Having only 512 byte 'Session' area...
Having only 6 character Database Field references...
Having to chain several RPG programs together with CL/400...
-
What I Love About TCL
2003-05-13 20:06:53 anonymous2 [Reply | View]
It rules. Your perl/php sucks. Blah.
-
What I Hate About Wonks Who Ignore TCL
2003-05-13 20:05:28 anonymous2 [Reply | View]
Blah. Tcl rules for just about everything you wankers force perl or (ack!) php to do.
-
What do you hate about AspectJ?
2003-05-13 19:22:33 anonymous2 [Reply | View]
AspectJ might have been an interesting case. It supplies something like mixin's for Java by allowing inter-type member declarations on interfaces which are inherited by any class declared to implement the interface. Also, it surfaces the runtime model of interception (as Java might be said to have done with Threads/locks and the synchronized keyword). However, pointcuts can drag Java programmers back into regular expression land...
You use functionality as a rough equivalency test for programs, but they often differ most in the 'ilities, like robustness, portability, maintainability, integration, etc. (through the magic of re-use by libraries, frameworks, patterns, and so forth). So I guess an interesting question would have been what parts of the runtime model belong as API's or should get language-level support?
One answer is that a language should express the programmer's mental model, and automagically take care of things excluded from the programmer's model. The extreme example there, of course, is Visual Basic.
Finally, why do programmers like their languages? That could actually drive away from the principle of transparency towards the clubbiness and security of obscurity.
-
Dynamic Typing is good : Try Smalltalk
2003-05-13 19:21:29 anonymous2 [Reply | View]
Smalltalk was one of the first languages I encountered after BASIC and Pascal (yes, I encountered Smalltalk BEFORE I encountered C.) But I was a young programmer, and I let all the old C programmers talk me into accepting C for application development; after all, you really wanted a program that would run FAST!
What I like about Smalltalk is:
* relatively easy implementation. Like FORTH, you can create a core smalltalk VM and image in remarkably little code. Squeak (a free Smalltalk) was originally implemented in Smalltalk, automatically converted to C using Smalltalk code that converted Smalltalk to C, and then compiled for different platforms.
* integrated development environment. Yeah, I know, a lot of young punks will tell me I'm insane for liking Smalltalk's now antiquated looking IDE, but I really like the fact that I can modify the definition of a class while an application is running. I can debug it too!
* weak dynamic typing. Yes, some will say that this is evil. I think it is good. When programming in Smalltalk, I think about families of methods / messages, not types.
* complete source available. The development environment is integrated into the running image, so... you tend get the source for the complete environment (minus the C or assembly code for the primitives.) Some might say that this is bad as it allows "bad guys" to see your source code. Well.. you can actually ship an application without the source, but like Java, it will be difficult to hide your intent from a dedicated attacker.
What's not bad about Smalltalk
* speed. It's actually not that slow. Some tasks under Squeak are faster than Java. Java is faster for others. CinCom's commercial Smalltalk is faster than Java on just about everything.
* multi-person development in an IMAGE based environment. FORTH programmers will known what I'm talking about. Classic Smalltalk stores the complete state of all objects in object memory in an IMAGE. This is basically one big database of objects. For a long time, the big deal with IMAGE based systems was that it was difficult to separate the development environment from the running application. Proper use of changesets and Projects seem to have done a great deal towards fixing this.
* documentation. Depending on what you want to do, there may be enough documentation to get you started.
* online community. There's a Squeak Yahoo! Group that is quite active. Unlike Slashdot, most of the postings are not inane drivel.
What's bad about Smalltalk:
* Need delegation ala Objective-C. Smalltalk would be a lot cooler if if had delegation.
* need namespaces. There's primitive namespace support in some Smalltalks, but it should probably be a little bit better.
* polled I/O. The virtual machine running the Smalltalk image does polled I/O in classic Smalltalk (and in Squeak.) This is a bit of a disappointment, especially for embedded platforms.
* documentation. Sadly, there are some aspects to Smalltalk development that are less documented than they should be.
* mod_smalltalk is not ready for prime time. Yes, I should probably stop bitching and start helping, but I guess I'm currently content to watch from the sidelines. In the meantime, you can run Commanche in Squeak.
I'm not the only one to recommend fixing the top three problem areas with Smalltalk, but people in the community have pointed out that "it wouldn't be smalltalk" if we did this.
Still... Smalltalk is really, really cool. There are Smalltalk development environments available for multiple platforms ranging from Palms to Convexes, and everything in the middle.
If you're even the slightest bit interested, consider visiting the Squeak site at http://www.squeak.org/ or the Squeak SWIKI at http://minnow.cc.gatech.edu/squeak .
-
languages
2003-05-13 19:20:29 anonymous2 [Reply | View]
Eiffel is the best!!!
Static typing, dynamic binding, design by contract, multiple inheritance and genericity.
-
Why C Gets Used for Everything
2003-05-13 19:15:56 anonymous2 [Reply | View]
I don't know about C-style libraries being the lowest common denominator. C-style linkage is certainly easy enough to support in just about any language, but I've noticed a trend where newer technologies often don't have C libraries available for them. I attribute this to the difficulty of writing a complicated library in C. Sure, you can link it with just about anything, but writing the whole thing in C? You must be crazy.
Which brings me to my main point about C, and why I'm currently writing a network application in C :). C is the only really portable language (which is rather ironic, considering how easy it is to write non-portable C code). If you're writing the next Apache, you're probably going to write it in C, because such a fundamental bit of network infrastructure really has to be buildable everywhere, and you're only going to be able to get that capability with a C infrastructure.
Heck, just about every other scripting language has a C backend. The fact of the matter is, you can't write the interpreter for your next generation language in that language. It's a chicken-and-egg problem. Once you have the language up and running, it's convenient enough to build the libraries and such in that language, but the core is generally in C. That's actually the approach I'm taking with the application I'm writing. Right now, it's mainly an exercise in designing all the support infrastructure for a scripting language to run on top of.
-
Dynamic Typing is good : Try Smalltalk
2003-05-13 19:15:47 anonymous2 [Reply | View]
Smalltalk was one of the first languages I encountered after BASIC and Pascal (yes, I encountered Smalltalk BEFORE I encountered C.) But I was a young programmer, and I let all the old C programmers talk me into accepting C for application development; after all, you really wanted a program that would run FAST!
What I like about Smalltalk is:
* relatively easy implementation. Like FORTH, you can create a core smalltalk VM and image in remarkably little code. Squeak (a free Smalltalk) was originally implemented in Smalltalk, automatically converted to C using Smalltalk code that converted Smalltalk to C, and then compiled for different platforms.
* integrated development environment. Yeah, I know, a lot of young punks will tell me I'm insane for liking Smalltalk's now antiquated looking IDE, but I really like the fact that I can modify the definition of a class while an application is running. I can debug it too!
* weak dynamic typing. Yes, some will say that this is evil. I think it is good. When programming in Smalltalk, I think about families of methods / messages, not types.
* complete source available. The development environment is integrated into the running image, so... you tend get the source for the complete environment (minus the C or assembly code for the primitives.) Some might say that this is bad as it allows "bad guys" to see your source code. Well.. you can actually ship an application without the source, but like Java, it will be difficult to hide your intent from a dedicated attacker.
What's not bad about Smalltalk
* speed. It's actually not that slow. Some tasks under Squeak are faster than Java. Java is faster for others. CinCom's commercial Smalltalk is faster than Java on just about everything.
* multi-person development in an IMAGE based environment. FORTH programmers will known what I'm talking about. Classic Smalltalk stores the complete state of all objects in object memory in an IMAGE. This is basically one big database of objects. For a long time, the big deal with IMAGE based systems was that it was difficult to separate the development environment from the running application. Proper use of changesets and Projects seem to have done a great deal towards fixing this.
* documentation. Depending on what you want to do, there may be enough documentation to get you started.
* online community. There's a Squeak Yahoo! Group that is quite active. Unlike Slashdot, most of the postings are not inane drivel.
What's bad about Smalltalk:
* Need delegation ala Objective-C. Smalltalk would be a lot cooler if if had delegation.
* need namespaces. There's primitive namespace support in some Smalltalks, but it should probably be a little bit better.
* polled I/O. The virtual machine running the Smalltalk image does polled I/O in classic Smalltalk (and in Squeak.) This is a bit of a disappointment, especially for embedded platforms.
* documentation. Sadly, there are some aspects to Smalltalk development that are less documented than they should be.
* mod_smalltalk is not ready for prime time. Yes, I should probably stop bitching and start helping, but I guess I'm currently content to watch from the sidelines. In the meantime, you can run Commanche in Squeak.
I'm not the only one to recommend fixing the top three problem areas with Smalltalk, but people in the community have pointed out that "it wouldn't be smalltalk" if we did this.
Still... Smalltalk is really, really cool. There are Smalltalk development environments available for multiple platforms ranging from Palms to Convexes, and everything in the middle.
If you're even the slightest bit interested, consider visiting the Squeak site at http://www.squeak.org/ or the Squeak SWIKI at http://minnow.cc.gatech.edu/squeak .
-
Java + Exceptions
2003-05-13 17:44:49 anonymous2 [Reply | View]
Please illuminate me on when you would like to ignore an exception.
-
Dynamic typing is evil
2003-05-13 17:39:52 anonymous2 [Reply | View]
Once upon a time I tried the "rescue" option of my Red Hat install CD, only to have Anaconda installer script barf on me with a Python traceback saying that the object "_" didn't have a toString method (or something to that effect). That's when I decided dynamic typing was evil.
Later on I wrote a big app in Java, but every time I wanted to distribute it, I had to ask people to mess about with interpreters and libraries. Even then there were lots of platform/implementation dependant issues. That's when I decided interpreted languages were impractical.
So now I'm back to C. And I love it :)
-
Another C Nitpick
2003-05-13 17:00:40 anonymous2 [Reply | View]
<quote> Quick, what are the differences between execl, execlp, execle, execv, and execvp? If you're not using these every day, you'll be hitting man 3 exec often.</quote>
If you aren't using these every day, you won't be hitting man 3 exec that often!
-
C...
2003-05-13 16:26:25 anonymous2 [Reply | View]
Objective-C is nice, has dynamic binding, has additional ways of getting around not having multiple inheritance (if that's a feature you want) in addition to protocols (interfaces in Java). And the Openstep, GNUStep, and Apple frameworks are a fantastic base to build on.
http://www.geom.umn.edu/software/w3kit/overview/objective-c.html
http://www.swarm.org/resources-objc.html
-
Objective C
2003-05-13 16:22:04 anonymous2 [Reply | View]
Knowing C, Java, Scheme, Perl, and Objective C, I'd have to say that Objective C really is among my favorite languages, precisely because of its hybrid nature. Things I like:
* You can do strong typing, but you don't have to.
* You can extend the functionality of classes (with extra methods) without needing the original source of the methods (using Categories).
* Messaging nil has no ill side effects as long as you don't rely on the return value of your method.
The only major complaints I've ever heard are the lack of class variables (which you can work around by using static globals in your class implementation file), and the lack of private methods (which you can work around by not advertising your methods in your header file). A few people bitch about no automatic garbage-collecting, but I see this is a feature, not a bug.
Other than that, I think it's syntactically nice, promotes readable code by using infix notation for method calls, and is a true superset of C (unlike C++). Also, the small number of syntactic element s that are added makes it an even bigger plus, since it really only takes an afternoon to learn!
-
Haskell
2003-05-13 16:18:53 anonymous2 [Reply | View]
Definitely learn Haskell if you want to get a look at a very strongly-typed language. It's also a pure lazy functional language, which is great for broadening the horizons (not many functional languages are as obsessively pure as Haskell).
Sure, the typing system can get really irritating at times, but after a while I found it very useful for catching bugs at compile time instead of runtime - if the types don't match, often it means you're attempting to do something that you shouldn't be doing.
If you are going to learn Haskell though, make sure you learn about monads. They're absolutely invaluable.
-
variable contexts in perl
2003-05-13 16:04:17 anonymous2 [Reply | View]
why do I have to tell the language whether I want an integer or not? Being able to reference arrays in scalar context and references in hash context means that complex data structures with more than one level of reference are a nightmare to work out exactly which combinations of $ and -> and { you need to reference the data you want.
-
Graphical Programming
2003-05-13 15:57:50 anonymous2 [Reply | View]
The article doesn't mention the ease/difficulty of programming in a Graphical language ex. LabVIEW. I used to hate it till I started using it. Now I do almost everything in LabVIEW.
What I Hate about it?
+ It ain't free.
+ No recursion
+ No OOP
+ Expensive toolkit add-ons for special functionality (Signal processing, Real-time etc.)
+ No matrix data-type. Of course you can use arrays but I would like to see a Matrix primitive
What I love about?
+ Takes me a day to do a project which I would
normally take a week to do in C.
+ Elegant and self explanatory
+ Dataflow programming style.
+ Great debugging tools
-
What You Hate About C++
2003-05-13 15:25:18 anonymous2 [Reply | View]
/I find the template syntax ugly. I have no idea how to make it more beautiful, though./
For a general deuglification of C++ see:
http://www.csse.monash.edu.au/~damian/papers/PDF/ModestProposal.pdf
Of course, like all such proposals, this one was not well received. ;-)
Damian
-
A few miscellaneous comments
2003-05-13 15:21:44 anonymous2 [Reply | View]
Java does have the ability to do unchecked exceptions. It only checks exceptions derived from "Exception"; unfortunately this doesn't help when you want exceptions thrown by other people's code (like the standard library) to be unchecked.
I was impressed to find out that javascript has closures, whatever its shortcomings are.
I've noticed that while XSLT was designed to be programmed in a functional manner, very few implementations have tail call optimization.
-
Learn Common Lisp
2003-05-13 15:19:25 anonymous2 [Reply | View]
The ultimate dynamic language--superb object system with incredible introspection facilities through the MOP, good commercial compilers (www.franz.com, www.lispworks.com, www.scieneer.com), good free compilers (www.cons.org/cmucl), the speed benefits of a typed language (if you use type declarations and declare the appropriate optimization level), the ability to patch running programs, first-class closures, hash-tables, lists, arrays, strings, etc., numbers never over flow, and so much more... The only thing to hate is that relatively few people truly know it.
-
As always
2003-05-13 15:18:28 anonymous2 [Reply | View]
Your forget as always this beautiful language called Ada....But perhaps it is perfect ;-)
-
Java: Catch all exceptions?
2003-05-13 15:11:20 zipwow [Reply | View]
I wonder what the author means by: "... forcing every method to catch all exceptions that its child calls or may call can be tedious. I'd rather be able to ignore an exception and let it propagate upwards."
Isn't that the description of adding it to the throws clause of your own method?
-Zipwow
-
C Nitpick: exec* are not part of the language
2003-05-13 15:10:45 anonymous2 [Reply | View]
The exec* family of functions aren't part of the C standard library. They're part of the Unix system library (which is named differently on each platform...). Your beef in this case is with Unix, not the C language.








http://musiclessonz.com/rebol_tutorial.html