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."
...analyzing why people hate each other's programming language. Joy.
What he hates about PHP doesn't sound so bad, and doesn't seem like anything that won't be corrected in PHP5.
I knew there was a reason I liked it.
...we should all use Scheme.
Real programmers can write assembly code in any language. -- Larry Wall
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
What I hate about your programming language is that it doesn't work like mine does.
The cake is a pie
What I love about php is how to do comments. // is a lot sexier than "#", or "/*"
I hate your Grammer/Punctuation.
0110100100100000011000010110110100100000011000100
That's why I use Whitespace, of course!
ASP isn't a language. You can use any number of scripting languages with it. Of course, most are done in VBScript, but many folks use JScript (javascript), because it is what they use for the client side script.
DO NOT DISTURB THE SE
I used to have a T-shirt that was designed to piss off everybody. It said "Nuke the Gay Unborn Baby Seals". That's what reading this article felt like. Tinder to start a flame war that everybody can join in on.
No boom today. Boom tomorrow. There's always a boom tomorrow. - Cmdr. Susan Ivanova
And emacs handles all of this...
The package said "Windows XP or better. Pentium Class Processor or better"... So I got a Mac with OS X
The programming language (or schoolbus :-D) of future..
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
Produce a language without some rules and you would end up with even messier code.
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.
He likes JavaScript, but hates something about all other languages? Most of his complaints are just plain nonsense. Want regex in Java, well upgrade then! Upgrade to the latest compilers/bug fixes. He doesn't like the way Perl syntax LOOKS like??? He's not all that good looking himself! Most of his complaints are overly simplistic, and full of fluff. There are much worse things to complain about languages, besides syntax, and inappropriate usage.
I suppose tastes are individual in all things, languages and editors alike...
"Stop whining!" - Arnold, as Mr. Kimble
If no one has heard of it they can't make fun of it. Until they realize that I haven't gotten around to loops in the released version yet :-)
.jar files can be executed from the console, J2dk for Linux/ppc version 1.4 is released, caffeine springs from trees, and C++ no longer requires the programmer to deal w/ pointers. Oh yeah, and all BASIC interpretters are dumped into Sol.
I think that varied languages are a necessity. It'll be better when
You can't judge a book by the way it wears its hair.
I looked at this article, and I was disappointed by what a limited set of languages chromatic had examined. Where was Prolog? ML? Common Lisp? SNOBOL? Smalltalk? Dylan? All the languages in the article are in the class of "imperative languages with varying amounts of object-oriented gravy." If you're talking about how languages embody a philosophy, why stick to languages that pretty much embody the same philosophy, with some minor tail-fins and chrome as their differences?
[I suppose that's some flame bait....]
Anyone else noticed how, in the middles of the "my language is better than your language" flame war this guy was starting, he managed to slip in an editor flamewar by linking to vim?
Truly brilliant!
Follow the adventures of the new wandering jews
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.
The lack of good line termination (sorry, but a caridge return doesn't cut it) is another problem.
The dogcow says "Moof!"
Liking LISP, I find it annoying that most other languages do not make a distinction between changing variable values (assigning) and binding variables. Nor do the seem to notice that there is a large semantic difference.
No mention whatsoever of BASIC or Logo. Yes! At least he spared my languages of choice.
No sig
I don't think it's always technical. A few years ago it seemed like most comments in regard to Java were positive, but when it became evident that it wasn't really "free" in the same sense as is perl or python... then lots of people started bashing it. Though like many languages has it's flaws, it still remains a solid language. The same with VB, virtually no-one in *this* audience considers VB a great language, which is reinforced by the fact that no-one's really putting much effort into creating a VB like tool for Linux (albeit there are several dead projects that have tried). It's a shame because VB actually works quite well for a particular niche- quickly developing business apps. In the case of VB, I can safely predict most people here will not give it credit because of it's links to Monopolysoft.
Blender And Linux Fan
This just brought to mind the .NET CLR.
I have done a little bit with this, coded a couple apps where a member on my team really really liked VB and myself a java guy liked J#.
We could work well together without having to worry about learning a syntax that we didn't feel comfortable with.
BASIC wasn't so bad, before some company or other (can't remember which right now) decided to make a compiled version for "Visual" UI development.
The cake is a pie
<%@ Language=VBScript %>
Is you see this, please call Crime Stoppers at (888)580-TIPS.
hmm........... nothing tacky was said about Pascal!!
Harpo Tunnel Syndrome--my wrist feels funny.
Yeah you heard me right
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
Oh man, his criticisms of Java, C & C++ (three languages I enjoy) are dead-on. The way he addresses the whitespace issue in Python isn't anything new, but it's stated more clearly and articulately than I've ever read.
:D
My only complaint about the article is that his condemnation of XSLT isn't rabid and acidic enough for my tastes.
Good stuff. None of the languages he addresses are glaringly bad and in fact most are actually quite good (well... XSLT is a bad joke), but these are great points to remember when someone starts spouting off about how language XYZ is the ultimate.
...I work at a company that uses an early 1970's mainframe (won't divulge any details). We use punchcards (yes punchcards) to program the beast in FORTRAN. As you may or may not know, FORTRAN was originally adapted to punch cards, hence the 80 column limit and the 6 column space prior to issuing commands. (These limitations have been relaxed in FORTRAN 90/95). Of course, I also program on other, more modern systems using other languages, mostly C++ and Perl. However, I still find myself writing programs that basically mimic FORTRAN's style. I prefer short lines no longer than 80 characters and capitalized command names, etc. Once I actually rewrote some of gcc's source code so that reserved words like for, while, switch, etc. were changed to FOR, WHILE, SWITCH, etc. I also capitalized the functions in the standard library (!). Since then, I've gotten over my capitalization fetish, but FORTRAN's code still looks better to me. I guess old habits never die.
The syntax for working with anonymous data structures and structures by reference is ugly:
unless somewhere else in the code you've got a:this code will do nothing. and if you've got a mapping of names to numbers (and HACKERS must be numeric, since it's an array indice), you should be using a hash instead.
but of course, since this is perl, doing it correctly is even uglier
--BlueLines "The cost of living hasn't affected it's popularity." -anonymous
I love Squeak. It's SmallTalk, OO, Realtime, runs on anything, and is easy to cope with.
Check it out, if you are older, like me, and getting into programming but have never programmed much before:
http://www.squeak.org/
ANSI C itself is at least stable. The procedural part of the language is generally accepted (it's basically the same in Java, C++, etc.) The declaration syntax has problems. It's broken for historical reasons. Originally, C was LALR(1), but then came "typedef", and it went downhill from there with "class", etc. Nobody has been able to fix this properly. This is why the parser gets lost in so many error situations.
C++ suffers from some early bad design decisions. Templates came late. Strostrup knew about templates, and decided not to put them in. This led to great pain and ugly code, templates went in, and it's taken a decade to clean up that mess.
Java was supposed to clean this all up, but now Java is getting generics, which it wasn't supposed to need. So it's going down the same path as C++, but with a new set of mistakes.
Other attempts to fix C include Objective C (which still has a following) "C+@" (a Bell Labs product that predates Java), "C#", a Microsoft variant, and several others with tiny market share such as "D". None are enormously better than C.
I'd like to see C++ cleaned up, but the ANSI committee is more interested in putting in obscure features for template writers.
Hence the for "visual" UI development clause.
The cake is a pie
If you dont know that ASP is NOT a language, then the above applies to you. ASP sucks and nobody at Microsoft would tell you any different. Lucky for many, ASP sucked so bad, that Microsoft came up with ASP.NET, which completely rocks. No more spaghetti code. Codebehind is great for keeping the idiot designers from fucking with your logic. Being able to use C# when I feel like it or VB.NET when I feel like it is great. Of course, you would not know that, until you learn what makes a language a language.
Yeah, too bad you'll be stuck running your code on a microsoft server, bwahahaha. What a waste of money, let alone pseudo-security.
I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.
you'll be stuck running your code on a microsoft server
http://www.apache-asp.org/
neurostarCurrently just supports perl scripting though.
Actually i enjoy programming in a lot of languages and, as problably most who programmed for a while, the problem is seldom the language (otherwise you chose the wrong for the job).
:(
But it always get's ugly when it comes to debugging. You're in a bad mood anyway (it's a bug - probably your bug - and it will cost you, very probably, even more time than programming the whole f**king function).
No matter which language, after a while you start hating your debugger. You're programming 3D and have a problem with vectors - all u see variables with some numbers. You're programming a database and the results don't fit.. all you see are variables with wrong result. Etc...
It's always like your car broke down and you get messages like iron content of bumper 100%, mass of bumper 1.4, foo.ineedtorenamethis 1.5...
And then you gotta dig through the dirt
you said
"Never learn to program with ASP. The worst programmers I know started with that abomination of a language. (emphasis added)
mmmhmm.
MY programming language can beat up YOUR programming language.
Not to pick nits but you do *not* have to catch every exception in Java, and if a method throws a checked exception there's probably a good reason for it. Last week I had to give a demonstration of our software engineering project and almost got an F because someone used unchecked exceptions somewhere that kept causing the entire thing to quit. The first thing I did when I got back was change all of those methods to throw checked exceptions and assigned someone to fix the twenty or so classes I broke. He wasn't happy but when we gave the presentation again we actually made it past the login screen. (What? I can't blame bad testing on RuntimeException? Our own fault? Naaah...)
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
Complaining about Java & Python?
Please, if you REALLY want something to hate you've got to go back to the 70s & 80s on the mainframe:
- COBOL
- JCL
- MARK IV
- RPG
and the grandaddy:
- Auto-Coder!!!
Ever heard of Mono?
.net
Open source, multi platform
Visual Basic programmers like masturbation.
~~~
yes that was a little bit flame like but really that is one of the most insightfull posts i have ever seen on /.
A programming language where I don't have to do any work. One where I can just decide, "hey, I have a great idea for a program" and then discover that my computer had already programmed it for me.
There's a growing sense that even if The Future comes,
most of us won't be able to afford it.
-- Lemmy
dude.. havent heard that one in 20 years..
There is no good way to say ted is a tool.
He thinks hes some leet haxor, but doesnt use ++ or --.
WTF.
Also, there should be a programing language specific to GRITS and NATALIE PORTMAN. Perhaps a way for PONCH to hack out of a paper bag as well.
PROPS TO MAUS.
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'd suggest, if you would like to do it in a batch file but cannot, that you do in VBScript instead. Just hack it up in a .vbs files and you're ready to go. No development environment needed but a good text editor and web browser to hit MSDN. A self-contained .exe that may need the VB runtime distributed with it is a bit overkill IMHO. Think of it as the Perl for Win32, when you dont' want to install Perl.
Just my two cents. I hate VBScript for most things, but for this, I'll glady use it.
Bjarne wanted to put generics in from the very beginning.
Java "cleans up" nothing, it simply strips out all the more powerful features of C and C++ which novices tend to stub their toes on. Oh, and it adds one important feature: inner classes. Unfortunately the result is a language whose omitions actually make it more verbose and harder to maintain than C++.
Neither ObjC nor C# is an attempt to "fix" C; Objective C is an attempt to embed a Smalltalk object system in C, and C# is an attempt to fix Java. Neither of them are applicable to the same problem domains as C.
Everything in C++ belongs there, and most of it was intended to go in from a very early stage. The only thing that needs to be "cleaned up" is the C preprocessor. Templates could use easier syntax but no one has come up with anything signifigantly better than the current syntax.
--
CPAN rules. - Guido van Rossum
jerk off.
It seems that complex math is always the example people pull out to support operator overloading
// etc. etc. etc.
I was just thinking the same thing as I read the parent comment. Everyone uses complex numbers as an example. But, when programming in Java, it's not being able to overload == and != (and even sometimes [] if we're talking about collections) that drives me up a wall!
Take for example a class which contains both native types and objects. In order to implement the equals(object obj) method, you have to do the following:
return this.intType == obj.intType && this.objectType.Equals(obj.objectType) && this.byteType == obj.byteType && this.objectType2.Equals(obj.objectType2);
Yes... it's functional. No, it's not pretty. And that's where operator overloading is most sorely missed in my book.
I can't stand machine language. I'll be typing along and accidently type a '0' when I meant to type a '1' and my program goes apeshit. They should fix that.
The JScript engine is (was? it's been a while since I paid attention) faster than the VBScript engine.
And for that matter, VBScript is a horrible abortion of a language. Imagine, VB - but less graceful and powerful. Ugh.
Monopolysoft?
Oh, you mean Microshaft!
There's a growing sense that even if The Future comes,
most of us won't be able to afford it.
-- Lemmy
I've programmed in a fair handful of different languages, my current favorite being Java rather than some esoteric near-English language, and obviously lower-level languages will forever persist for the same reasons they currently do. But for most tasks, I shouldn't have to deal with memory pointers as in C; I shouldn't necessarily have to deal with strict object typing as most languages require (although I am displeased with Perl's vaguely counter-intuitive method of dealing with illogical variable comparisons, etc); and, ideally, I should be able to express an iterative sequence or bit of logic in little more than strictly-written English, essentially what psuedocode is now.
I have to agree with prior posters that while some of chromatic's comments are completely valid, they quibble over issues of punctuation and style in a world where the necessity of these rules are the issue.
If I have to remember to use different syntax when I do Java or PHP, I can handle that; any decent programmer can. Hopefully, though, there will be a time when I can describe briefly to the computer a task I want to do and simply have it do it. English would be the ultimate in "whipupability." (Note that I value this for its "whipupability," the ease of dealing with minor tasks quickly and efficiently as many scripting languages are designed to do now, not for its value in larger long-term projects; as I noted, low-level languages will always have their place.)
Probably about as many as the number of "// TODO: Place code here" in Visual C++ projects.
The cake is a pie
Better would be languages which are self-documenting...
There is no language that will force perfect code. There is always room for a poor programmer to produce hard-to-understand code. Functions that do two unrelated things, confusing control flow, bad variable names, broken code that was repeatedly patched instead of being cleaned up... the possibilities are endless.
Nonetheless, some languages have been designed with self-documenting code in mind; sometimes it even works.
If you look at languages like COBOL, they have long descriptive keyword names designed to make the code easy to read. But you get tired of looking at those long keywords.
I haven't used ADA, but I understand that it is somewhat designed for self-documenting code, and that as a result you are hemmed in on all sides by language rules. (ADA fans please comment here.)
The best language I have seen for this is Python. As a rule there is exactly one way to do things, so you don't trip over obscure hackish tricks that you have to puzzle out. The language doesn't force self-documenting or comments, but it does force indentation; everyone indents their Python pretty much the same (compare with the mess that is C indentation). The language is high-level enough, with lots of libraries, so you don't need to write 10 lines of code just to do one simple thing.
Python was designed by a guy who is both a computer geek and a math geek. The math geek in him led to a very tidy language design, and I like it very much. I think schools ought to be using Python to teach introductory programming classes.
steveha
lf(1): it's like ls(1) but sorts filenames by extension, tersely
My favorite T-Shirts are 2 I saw at defcon, coupla years back, in white on black (a la 'got milk'):
"Your OS sucks"
and
"Your favorite language sucks"
"Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
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.
Most...flamable...story...ever...fighting...urge.. .
to...badmouth...php
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.
It's plain wrong in the example. The execs...semantics are pretty clear, every letter has a concise meaning:
- "l" (linear?) means all argvs to the program are passed in a variable number of arguments. That's to say, the arguments to the program are explicit in the paramaters of the funcion. The number is variable, the end marked by a NULL argument.
- "v" (virtual?) means almost the oppossite, that the arguments of the programa will be passed from a variable sized array of char pointers, the last one indicated by NULL.
- "e" (environment) You also pass the environment variables as argument.
- "p" (path) Search the executable in the directories especified in the environment variable PATH.
So, as a OS teacher, I see them quite clear, sistematic and consistent, at least much more clear than strncmp()/ strncasecmp(), just to mention a pair.sgis ddo ekil t'nod i
One fault I find with the author's assessment is that he is evaluating the language only from the standpoint of the one who is writing in it. I think a better language assessment would also evaluate a language from the viewpoint of the poor bastard who actually has to read someone else's code written in that langage. Does the language have the tendency to produce code that is readable and understandable by the person who didn't write it? Or does the language have the tendency to produce code that is readable/understandable by only its original author?
For example, Perl allows the programmer who writes a perl program try to make their code as terse and unreadable as possible, fitting everything on one line by exploiting some bizarre behavior of the perl interpreter. While this "expressiveness" might be wonderful to the person who's writing the code, it's really going to be a problem for a second person who might want to contribute to it or maintain the project after the original author threw in the towel or got hit by a bus.
Another example is operator overloading. Perhaps operator overloading is useful to the first person writing the code, as it provides a nice little shortcut where they can do foo + bar as opposed to something like foo.add(bar). But if there's another person who's decided to work on this project, and they're not very familiar with the code and they are trying to get the idea of how it works, how can they tell whether foo+bar is a mathematical operation or some sort of concatenation? Yes, if they look over the code enough, they can understand it. But perhaps that extra amount of fuss and the extra amount of time wasted trying to make sense of things will convince that person it would be easier to write their own stuff than try to reuse someone else's.
A final area I wish the author focused on is documentation. Does the language support some sort of embedded and standardized documentation that make it easier for the first programmer to provide information that would help a second programmer make sense of the code, or is documentation at the discretion and mercy of the first programmer and whatever bizarre and non-standard documentation system they might use?
I would suspect that projects using languages that make it harder on the person who has to read the code have higher incidences of duplication of effort and a great NIH (Not Invented Here) tendency.
But that's just my opinion.
Ergonomica Auctorita Illico!
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
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
I want one like the guy I saw use at a MS Product launch last week for W2k3 and VS 2k3. He copied a stub for calling a web service incompletely (missing a }) and pasted it onto the design - NOT code view.
He then "compiled" and showed us the end result - which was already open.
Now if that would work. Damn that'd be sweet.
/* Lobster Stick To Magnet!*/
The Inline module should erase complaints about the difficulties of extending Perl with C (or C++ or Python or Befunge or ...)
I don't write a lot of code that would benefit from static checking.
Ok, I quit there. I've heard that from too many undergrads, the usual learn better when they hit their first all night bug.
What we can conclude from this article is that Delphi roxors :)
What do you mean by "good"? How does that improve the readability of the program? Is there some kind of error I might make if I mistake a copyright comment for an instruction comment? Is it supposed to make it easier to ignore the copyright? Aren't copyright notices meant to be noticed? Is there some reason I need to distinguish between multi line comments and single line comments? Isn't the fact that the comment spans multiple lines enough? Why use a different commenting syntax for each case? What are the rules for nesting all different combinations of comments?
The designers of PHP and Perl didn't really understand the justifications or interactions of the features from other languges that they were aping -- they just copied them to make people feel comfortable. That's what I mean when I say that languages like PHP, Perl, Java and C++ are reactionary programming languages. The world doesn't need any more reactionary programming languages, designed with such a Cargo Cult Mentality.
"We don't know why they're successful, but we want to be like them! Maybe if we immitate the commenting syntax of all the other popular languages, our new language will catch on as much as all those other languages combined! It will make porting comments and copyright notices so easy!"
-Don
Take a look and feel free: http://www.PieMenu.com
Very lyrical and poet flame bait. Before I CEE what this is all about I think I will ASSEMBLE an answer,
mayde I will code it in TASM, or NASM or just catch shit from my compiler by using C. I CEE that I have waded into a war of religion not a usefull discussion!
OH THE SHAME I fell off the wagon and use sigs again!
Ok, follow the thread. ASP.NET was the implicit subject at the point you chimed in. The initial post introducing ASP.NET states explicitly that ASP != ASP.NET. Your post contains url for a ASP-clone product.
Pay attention. If you can be bothered to cut and paste a link into a page (without an anchor tag, though that could be considered a stylistic preference), but missing the point entirely is unacceptable.
Somebody should write a Whitespace macro front-end for Python, then it will be better than Lisp!
Take a look and feel free: http://www.PieMenu.com
Superficial? He says he hates C++ because he finds the template syntax ugly, and he offers no way to improve it. That's deeper than 99% of what gets typed into Slashdot.
taken! (by Davidleeroth) Thanks Bingo Foo!
Perl is very good, if you use it correctly!
/;
Start a Perl script with:
use strict;
use diagnostics;
use Safe;
use English;
use vars qw/ varname
and avoid punctuation, globals,
undeclared, implicit $_ and @_,
put some freaking comments,
use Java like variable name and function name.
Fire any perl programmer who is not!
Java is SOOOOOO simple...
When you are finished
with your XML 200 pages of code (~6000 LOC)
for your XML recursive DOM parser, let me know.
I prefer this:
use XML::Ximple;
my $xml = XMLin( "file.xml", forcearray => 0 );
much simpler!
I program people. Some I program in english, others in arabic, a few in hebrew. I switched to mac because when I used to program people on windows, I used to get all sorts of conflicts. My name is God - I'm a god.
1 + 1 in javascript will blissfully give you '11', unless you play some tricks to make sure 1 is known as a number (and of course, there is no type declaration in javascript).
Using the same character for string concatenation and addition was a very dumb move, if you have no way of specifying the data type you are operating on!!!
Of course there are others...
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
why the people use visual basic.
So this probably won't see the light of day, but...
I thought that this was one of the best essays I've read in some time, even given its lack of technical substance.
The message of this article ultimately is that our languages of choice are often as much a matter of subjective personal preference as anything else.
A major theme of this article, then, was not to bash languages, but to celebrate the variety. The author's really trying to encourage us to explore our personal tastes.
Did anyone else note the link to pragmatic programmers, following admonishments to learn a new programming language each year?
How many on Slashdot try something like this? Maybe not every year, but on a regular basis? What's your experience been? Is it worth it? Anyone switch their language of choice because of it? Expand their respect for other languages?
Er, the use of @foo to define an object attribute is great; it means there's no need to type self. all the time, makes attributes obvious, and means you don't need to use lame prefixes like m_ObjectAttribute.
A much better hate would have been the awful Perl/sh-era pseudo globals ($_ $@ $! $| $" $' $1 - what were you thinking matz!?); we all hate those
My first degree was in the visual arts (printmaking and drawing), so I tend to approach programming languages the way I approach art materials: as tools with different ends in mind, that are preferred or rejected largely on the basis of familiarity, taste, and circumstance. Thus, I've been very lucky to avoid any sort of language fanaticism.
However, I've found that, the more experience I get, the more I drift towards languages that are harder to learn, but more precise/delicate/dangerous in their syntax. I went from Javascript to Perl to Java to C++, just the same way that, in art school, I went from drawing with charcoal on newsprint to watercolor on expensive paper to stone lithography. The more intense and demanding the process, the more it interests me as I'm able to handle it reasonably well, and the more rewarding it seems to accomplish something.
I've never really understood the motivation for language/platform zealotry, so I thought the article was great to lay out all those criticisms as the perfectly subjective kneejerks of the author.
Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
All your language are belong to us. Feeble man use syntax bad for operate binary.
...that Objective-C isn't in there? I'm sure there are reasons to hate it, but it's the language of choice for Cocoa in Mac OS X (and is probably a better extension to C than C++ could ever be).
Conglom-O: We Own You (TM).
I've been a bad programmer and I haven't truly studied many of the newer languages. I've always felt its good for programmers to learn different languages.
C++ was my forth or fifth language and by far the hardest to learn. Not because of the OO-paradigm--I was already quite familiar with that--but because of the syntax klunkiness, size, broken tools, changing standards, libraries that defy good design, and linkage problems. I'm loathe to dive into a whole new can of worms now that I finally feel productive with this flawed by ubiquitous tool. If it takes such a huge investment to learn a new language well, how many languages can a programmer master?
Is it better to be really good at a handful or to be somewhat skilled in a broad base? For a given project, knowing the implementation language well is essential. Having broad experience might help with good design.
I took issue with some of his facts.
Lot's of people would argue that ANSI C is not strongly typed.
Huh? Types are still a level of abstraction. Except for certain language extensions, most types in C and its descendents do not define things down at the bit level.
Ironically, these are not standard library functions, not ANSI C standard library anyway (as the context implies). Aside from nit-picking, I think this is a good illustration of my point: it takes a long time to learn the details of your language and libraries. How much software is developed by programmers who are learning new tools? How does that impact productivity and the ability to construct reliable programs?
I'm probably becoming a luddite as I get older. I instinctively flinch when I'm told that newer ways are better. I always see trade-offs. As you move to higher-level languages (and libraries) you lose some control. Often that control is not necessary, but when your performance problem is due to thrashing because your STL container scattered bits of indexing and data all over the virtual address space--life sucks.
Thank God; I was beginning to worry.
There are reasons why democracy does not work nearly as well as capitalism.
-- David D. Friedman
>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.
public methodThatJustPropagatesException() throws SomeException {
doStuffThatMayCauseExceptions();
}
Why am I disappointed with Perl, and thrilled with Python and SWIG? I sent Larry Wall some fan mail in April of 89, enthusiastically asking about upcoming features, and describing what I wanted to do with it:
He replied:Python is extremely well designed to thoroughly solve the extension language problem -- on purpose, not as an afterthought! And SWIG makes it very easy to expose rich programming interfaces, structured data types and complex class libraries to extension languages.
Will someone who's intimately familar with how Perl has evolved over the past 14 years since I submitted that request, please describe how difficult it is using Perl as an embedded extension language, integrating Perl with pre-existing applications, extending Perl with libraries written in C and other languages, exposing complex data structures and class libraries to Perl?
-Don
Take a look and feel free: http://www.PieMenu.com
Forget to take your medication again?
There's a growing sense that even if The Future comes,
most of us won't be able to afford it.
-- Lemmy
Well, I liked C++ a lot, before Microsoft came and bastardized it with MFC. It really should be called Macro Foundation Classes. I liked Java a lot and Microsoft bastardized it with J# and C#. I never liked Visual Basic, but its also a bastardly language. I dont quite like JavaScript either, but Microsoft again came out with a bastardly language called VBScript. any language it touches, it makes a bastardly language out of it... I think its best to stay out of a language that Microsoft is pursuing actively.
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.
main() {
int a[10];
int b=3;
a[b] = 10;
printf("%d \n", b[a]);
}
What happens?(Doesn't compile? Doesn't run? etc)
try to answer it before you tryr to compile.
I am not a great C programmer but I was quite surprised.
Yeah I've seen that before and it was in the back of my mind as I wrote my comment. But truth be told you'd have to be hard pressed to run a business on something like that.
I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.
You've heard it before, but it stands restatement - "When you've seen one Forth, you've seen one Forth."
I've been thinking lately about languages, what if I could write code in a pseudo language, with extremely flexible syntax the ideals of what i'm trying to program. e.g. I want to add a bunch of integers together. Sometimes when I write papers, I do it by hand on paper, cause, believe it or not, my thoughts get lost sometimes because I'm trying to process the typing in my memory (lol, no, I'm not retarded) Usually my papers flow better that way, that's not to say that I couldn't go straight to typing and produce something great. But the idea behind this thought is that I don't want to aggravate myself about the details of any particular language. I just want to put my thoughts on paper or something and then worry about what language, what environment i want to run this through later, after the main details are put forth.
I then want to take that pseudo code, which has strict syntax, pass it to a parser that then generates code in any language whatever it is that i want done. So I could say, convert to VB or C or Java or perl and out comes some generalized code that you can then compile with your favorite interpreter or compiler. I know it would be strange to convert object-oriented code into non-object-oriented code, but wouldn't that be a neat tool? And wouldn't that be a beast to code?
Anyone interested in a project? Sorry, this is loose and somewhat stream of consciousness, but I think it has merits, open discussion?
As a perl programmer I just read that as "What!?"
As if you could ever understand perl code without reading the #'s that explain it...
You appear to have misspelt "warnings" as "Safe". There's no point using Safe unless you're doing stuff that needs it.
These days, you should be using 'our' rather than 'use vars'. Plus, you say to avoid globals, but you 'use vars'?
You should learn Perl rather than rely on English.
You should not use Java like variable and function names, except where it matches with perlstyle.
As with most languages, the best way to understand code written in the language is to learn the language. Make use of its features and its strengths. Get involved in the community. Read books, read articles and more articles. Contribute to code repositories. etc.
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.
After all, the code should be self-explanatory :-)
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!
From the article:
"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."
-jacob
..."And you will never, never, never, succeed in creating a programming language in which it is impossible to do stupid things."
Well, maybe true. Actually if assembly is counted as a language then I don't think you -can- do anything stupid there.
Remmember, if you can't do it in assembly, then you probably shouldn't be having sex.
What's important to comment is why: the big picture of what's being done and how it fits into the rest of the system. Once you know that, then you can work out the rest, readable code or not, and work effectively. And that's what no amount of self-documenting code can do.
Ceterum censeo subscriptionem esse delendam.
C++ is a bunch of obsolete slow crap. Very confusing. The entire point of it is to confer the benefits of object-orientedness. Well, Obj-C gives you that with only a few additional stuff, and isn't confusing.
social sciences can never use experience to verify their statemen
This was a very interesting article. I natively speak Perl, C, and C++, know enough about PHP to get by, and still remember some Commodore 64 BASIC (10 ? CHR$(147)). I am also, as I believe I've said before, not afraid to learn things like Java, Python, Ruby, maybe even Visual Basic again (God forbid) should they prove exceedingly relevant to my case - in fact, I quite look forward to knowing (hopefully) all of them and then some. But never Pascal. (Just kidding.)
I've really found that the thing I hate most about programming in general is that no single language is the right one to use for any of my programs! I am very interested in any effort I ever come across to do functional merging of disparate environments. In addition to a couple of workarounds I've invented in the past for shoehorning Perl into PHP, I like reading about things like SWIG, the open CLR, and even COM (the concept more than the implementation), and a smile always comes to my face when I think about the Inline library written for Perl.
Now, the thing I really pine for is all of this interlanguage binding stuff being easy, fairly portable, more synactically simple, and less hacky. I know that these exist, but not quite completely together. If I write a program in Perl with use Inline C, I can never be sure that anyone else has all the development tools necessary to compile all the C on the fly. Writing a program in Visual Basic with a nice mouse-drawn GUI and an external component is really easy - but it's Visual Basic. Writing a component wrapper for Perl is fairly straightforward with SWIG, but some well-thought-out language features would make it easier. And COM... I'm going to have to try wrapping my head around that book again someday... I'm sure the ATL makes it all very simple, but can I use ATL from MinGW? From C? From Perl? And don't try to tell me that I need to learn yet another flavor of XML to make all of this work.
That's mis tus centavos.
(Note: I disclaim perfection. Don't hit me too hard; I admit I haven't done enough of my homework to claim this post isn't full of holes. Once I've looked this whole matter through, if ever, and if I still haven't come up with anything good, I may just have to take a deep breath, lay down a syntax, figure out how to use a lexer generator and a compiler compiler, and throw together some ghastly but very easy-to-use homogeneous aggregator system. Either that, or I wait for Parrot to interoperate with Mono...)
hilarious
both to the parent and you, for making my day.
Moo. Java. Moo.
No we didn't. It's an old idea.
I don't recall what the 1.x series did, but the 2.x series (first release early 1992) never compiled to intermediate languages.
The 3.x series certainly doesn't. Everything goes straight from the front-end language (C++, Java, whatever) to assembly. Many compilers build to an intermediate language, e.g., C, and then simply compile that -- in fact, the very first C++ compilers from Bell Labs did this -- but GCC is not one of them.
Now, if you're talking about an intermediate in-memory representation, sure, every compiler does that, starting with the simple "syntax tree" that we all learned in CS 101. But don't call them files, since they're never written out and (often) don't even have a convenient text representation.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
What i HATE about your programming language... is YOU!
bleh~!
To try to meet you in the middle, I learned AppleBasic, some assembly, [nothing for a long time], sh*, awk*, csh, sql*, C*, Perl*, Tcl, Vb, PHP, Java*, Lisp*. (asterisks indicate that I'm still using them, and still learning. When do you stop learning?)
Sorry, but Perl rocks. I'm building tools for people. Lately, that's sometimes is Java, sometimes in C, usually in Perl. Fast, bug-free development is the goal, and we do suprisingly well.
I'll never argue that Perl looks pretty by nature[1]. If people want a pretty language, please, that bin is other there.
For an example of my problems with PHP, look no farther than PHPGroupWare. It tries really hard to solve a really big problem, and honestly, comes somewhat close. But it blows, and is so impossible to read that nobody can fix it. We stared at it for months, and then gave up and built what we needed from it in perl, in 4 days. (We're filling things out, fixing dumb mistakes, and thinking about future moves before the code is released.) I won't even get in to these horrible messes of interlocked HTML, PHP, SQL (usually MySQL specific,) and poached Javascript that are the rule for this sort of crap...
When you need another ounce of performance, use C. When you need a large engineering team working together, use C++ or Java. When you need a team of monkeys pounding out "dynamic" html (or doing a personal website where it doesn't matter), use PHP. If you're playing with compsci, use Lisp. Otherwise, use Perl.
Flame off.
There, have I done enough for the pageview count for the /. cabel yet? Will you call the goons off? I like my last son really a bunch...
[1] It _can_ look pretty, if you actually have a plan. Many people use perl to build messes, and that is something they should have the right to do. Not my business. My code rarely gets messy, and when it does, I either comment it for fixing, or explain why I'm doing something weird. Contrast with the last 10K lines of C you've seen.
I forget what 8 was for.
However, I've encountered more than a few people who learned to program in VB and who should be kept away from any programmer who values his/her sanity, and from any programming project that might eventually aspire to affordable maintenance.
Maybe it was just coincidence that a batch of poor programmers with icky(TM) programming habits all happened to have used VB early in their programming experience. But they shared the same kinds of problems : complete misunderstanding of why local variables are a Good Thing, poor selection of variable/procedure names, a serious love of long runs of spaghetti code, inability to pick the right control structure.
Are these poor habits encouraged by VB? (Enquiring minds want to know...)
In practice I quite like the way Python (Haskell too) works and use Python quite a bit and only rarely have trouble with whitespace.
"So I contradict myself? Very well then, I contradict myself." (Thanks to Mr. Whitman for the quote.)
-austin
Ni bhionn an rath achx mar a mbionn an smacht (There is no Luck without Discipline)
but MOO is a great language!
09
and similar odd constructs like 3[a], is that the compiler translates it into something like *(a + b) and it doesn't really matter which order the addends are in. Or at least, that's how it was explained to me.
* And remember, it's spelled N-e-t-s-c-a-p-e, but it's pronounced "Mozilla."
FORTRAN, tcl or S (R). Am I dating myself?
Programming languages hate you.
"Visual" & "Basic" ...and I have to use the *&!#&@$ thing every bloody working day.
Go permanent? In your dreams and my worst nightmares.
I don't think self-documenting languages will ever replace comment type 1. On the other hand, I believe that comment type 2 needs to be used very sparingly. You probably should rewrite/refactor your program if you have a lot of comment type 2 because you are trying to explain some kind of hack. Also, comment type 2 can get out of synch with code changes.
Comment removed based on user account deletion
I've been looking at Ruby, and its definitly a very nice language... it might be my favourite, although I havn't done any real projects in it yet, so it's hard to tell. I'm glad to see that the article doesn't find anything wrong with the language itself (the lack of English docs is annoying) other than that it occasionally doesn't look great visually.
And it's self-documenting! No kidding! Check out the method call syntax: [self dataWithPDFInsideRect:copyRect] and you can mix and match your C and ObjC syntax: fabs([lastAbortDate timeIntervalSinceNow])
Those are simple examples, though, this one shows the power of the language better:What does it do? You have one second. OK, time's up.
I think the main thing people hate about ObjC is that they don't get to use it.
simon
home page
okay, i've read a lot of comments here and it seems i can summarize by saying that there are no good programming languages -- they all have major problems. nearly everyone is offering reasons not to use certain languages, but few alternatives are being offered. so, here's your chance to make a suggestion and back it up:
my background: started with basic, quickly moved to turbo pascal, which i liked and used heavily for several years. then i looked at c++ and then got tied up in school and didn't come back to anything for several years. eventually i found some spare time again and ended up messing with php, which is what i've been using lately. as should be evident, i am _not_ a professional programmer, i just tend to hack a little on my own.
as i mentioned, i liked pascal -- it was strongly typed, compiled fast, and worked for me then. c++ left a poor taste in my mouth; probably because it'd compile way too much and bomb out at runtime -- i'd much rather a compiler error than a runtime error. php is okay, but the project i'm working on presently is getting bigger and i can see the day when it's going to get out of hand. and, it's oop support is definitely a bit below average.
so, what should i consider? i use oop a bit, i prefer typed languages, but will deal with untyped langs if it's useful otherwise. mostly i'm developing web-based stuff today. probably the most important thing is i don't like the language getting in my way - my goal is to come up with functional software, _not_ waste time figuring out how to work around various bugs or idiosyncracies in a language or a compiler.
so, here it is for karma-whores and meaningful contributors alike: what are your recommendations and why?
geek friendly VPS's and free API enabled DNS : zerigo.com
Uh...I was the guy who wrote the original comment. I had "compiled" in there because it was mentioned in the post I was replying to.
The cake is a pie
Compare some of the big languages around: Perl, Java, C++, Visual Basic. Each has its own community, and each community has its own set of goals and priorities. Each community is wont to criticize the technical shortcomings of the others' languages. These criticisms often have some technical validity, but are usually beside the point -- each language "just works" for its own community.
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
If it's a Microsoft programming language, it's got to be bad. Ah but who can fault a visionless man for creating a software empire on visual basic, DOS, and bullying?
"You'll get nothing, and you'll like it!"
English, on the other hand, has great idiomatic versatility, little inflection, and a vast vocabulary. It is not without its problems, though. Here's what I hate about English:
The most direct functions of the class AuxilliaryVerb cannot be inherited in the infinitive case.
This deficiency forces awkward work-arounds: I hate to have to say to have to say rather than to must say. I want to be able to say I want to can say!
Pointless rules of syntax have, over the years, been added to the language. Many of these false rules lingered in all the major compilers, rendering the language less usable.
Examples include the injunctions against splitting infinitives and putting prepositions at the end of sentences, which force such constructions as the awkward Boldly to go where no man has gone before and the verbose This is the sort of nonsense up with which I will not put! These nonstandard rules are now nearly phased out, thankfully, but their scars linger.
There are too many exceptions to standard verb-call syntax.
Calls for most verbs is uncomplicated, but there are more than 280 verbs with syntactical exceptions, making a morass of inconsistent vocabulary that is hopelessly confusing to beginning coders. In this respect English should behave more like the obscure Esperanto, with its scrupulously consistent conjugation.
But despite these deficiencies, English is undoubtedly the king of of languages. I vote for English!
It's more like comparitive religion--from the point of view that these religions hate each other.
It's good to use your head, but not as a battering ram.
The notion of "coding in C is a premature optimization" is completely rediculous. While I'll admit that for different tasks, different languages are more appropriate, if you know C best, then you should probably do it in C.
Plus the notion that coding in C is an automatic optimization over other languages is absurd. It is true that do to the lower level nature of C, it can be used to make very efficient code. But in many cases I know I can write equally efficient code in C++ (or other languages) because of the nature of the problem.
Heh, starting to sound a bit hypocritical here aren't I? I guess what i am trying to say is. If you can do it best in a given language, do it in that language. I am however an advocate of learning as many languages as you can, so that you can make a better choice regarding this issue..on your own.
so don't go out of your way to do it in another language just because someone said you can do it slightly better if you took the time to learn about "language x."
General purpose languages are just that "general purpose", it is silly to force yourself to program in an "uncomfortable" language just because it may fit the problem better...you'll probably end up making worse code anyway.
proxy
ocaml and let this=be.that
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.
Damn. Straight.
...nor does it matter that VB.NET has fixed just about everything wrong with VB...
Despite the marketing line, VB.NET is more a CLR cousin of VB than a fix/upgrade.
It seems like Apple's "Objective C" is so irrelevant, it's not even on the list.
Best Buy can have you arrested
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.
use Inline;
problem solved.
Too many VB "programmers" out there think "I click, therefore I program." (I wish I could take credit for that quote, but I found it on the C/C++ Users Journal website in an editorial comment.) I have seen too many VB programmers who were basically clueless about abstraction, encapsulation, memory-managment, Big-O efficiency, or anything else except making GUI's quickly. This is not meant as flame-bait, because I have seen a small number of VB "programmers" actually become skilled software engineers.
From his comments, Chromatic would like Nickle. But I'm the co-designer---I have to say that :-).
I agree with some of your comments about VB prior to .NET, however, many of these statements are not correct. This also reflects the main reason that most developers dislike VB - since nobody takes it seriously, nobody knows the little details which annoy many people. Please don't get me wrong - I hate many things about VB too (ERROR HANDLING!!!), but I want to correct some facts here.
...). It's just some people don't know that you can skip the "Call" statement.
* Short circuit evaluation - point taken. However, putting these conditions into a simple function will often produce better self-documenting code AND allow you to do this.
* You can call functions the same way you call Subs - your statement is simply not true. To call either you can use FunctionName(argument1,
* VB cleans up local unused objects just fine. The practice of setting things to Nothing is a total urban legend. They get set to Nothing when they go out of scope every time. If you need clean up - use functions. Macros aren't great idea in a serious App anyways.
* You don't NEED the variant type. You can marshall any type across a COM boundary except for a User-Defined type (and you can use a Class instead)
Yes it is.
That has clearcly been written by someone who is a vi fanatic!
Emacs rules.
... or rather Reading poof, that was Oscar Wilde when he was in gaol.
Java 1.5 finally fixes the casting issues. I agree that the need to cast everything has made code less readable.
String stringvar = (String) vector.nextElement();
Since all variables are strongly typed, the Object returned by nextElement() should be automatically casted by the compiler. The Java 1.5 workarounds should greatly improve readability, but they still require unnecessary work from the programmers.
---
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?
He picked the one case where not having the overloaded operator would have killed interest. Almost every language allows Strings to be concatenated with a '+'. Personally, I'd prefer they did not since this can cause problems with casting numbers.
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.
I use static functions to get around this. For a current project, the main servlet has a
public static void respond(HttpServletResponse response, String htmlString) throws IOException
function to set the length and create the ServletOutputStream. The function is used by all our other servlets. The only difference between this algorithm and having a parent servlet class is the need to pass response as a parameter.
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.
Good idea. I am forced to use 1.3 for a project, and would love to be able to steal classes from later versions. We moved to 1.3 to get HTTP 1.1 support, but our production environment would have been greatly simplified if we had stayed with 1.2.
Also, why does the HttpURLConnection provide a method to set the user-client when it has no effect? (It always sends "Java1.3", which receives errors from MS IIS 4 servers that parse based on the semi-colons in the user-client.)
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.
You can pass Exceptions to the parent function using the throws option in the function declaration. How did he manage to use the language without encountering this? I learned it on day one when I first learned the syntax for writing a function. I usually handle Exceptions as they occur, but the ability to pass them up the function stack has been critical a few times. (Otherwise we would need to catch the Exception and throw our own, which seems wasteful of our programming time.)
--
Slashcode: Why does Submit come before Preview?
I spend my life entertaining my brain.
Nuke the gay baby whales for Jesus, is how I remember it. Obviously I mean the phrase not your Tshirt
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.
I find it odd that there are a jillion programming languages for procedural and OOP, and several for functional. However, I do not see a lot of competition for relational query languages. Why does everybody seem satisfied with SQL?
SQL sucks IMO (as far as relational languages go). It is the COBOL of relational languages. I would like to see more competition there. I kinda like the BS-12 approach pioneered by IBM in the early days of relational but dropped. Some like "Tutorial-D" by Chris Date, but I don't like the infix syntax.
Relational languages are virgin terrority for those who like making Yet Another Language. Why trod where everybody else has? Lets move beyond SQL.
Table-ized A.I.
Mis dos centavos. Olvidaba mucho de mi español. Sumimasendeshita.
As a particular example, take PHP's error handling. The language has no real exceptions, which is forgivable--but it insists of making up for it by faking them.
It has something akin to sigaction(), but much less powerful. It allows you to provide one function to handle all errors, except for some that PHP insists on handling itself. At least that function can switch on the error, right? Nope! There are only 5 different error codes which your code can catch, only 3 of which you can actually throw (again, with a function instead of a language construct).
And if you thought this was bad, try the error handling in the library. Each set of functions seems to have its own function to check for errors, and you have to repeatedly check the manual to find out how a function indicates failure. I've seen the following different methods of indicating failure:
function returns FALSE
function returns TRUE
function prints a message to the browser
function returns 0
function returns 1
function returns nonzero
function returns negative
call another function to find out
functions returns something that can be fed into another function to find out
function raises an error condition you can catch (through fake exceptions described above)
function raises an error condition you can't catch
pass in a variable by reference and the result will be there
check if the returned array is empty, and if it is use a different function to find out whether that indicates an error or just a (legitimate in context) empty array
Don't even get me started on the naming conventions of functions, or the ordering of their arguments. (Check out the array functions if you want some good examples.)
PHP is a language that was designed for small, simple CGI scripts, and it does this well. It does not scale. PHP was never meant to be used from the command line, but how else can you write a cron job to do some nightly maintenance? (Write in another language? Sure, and give up all the libraries you've written for the project.) Sure, you can use lynx -dump http://example.com/nightly.php >/dev/null, but then you have to make sure no one but you can use that script, and it's just generally an ugly thing to do.
For all of its faults (and it has many), one of the thigs Perl does well is provide actual language features for things like merging arrays, sorting arrays with a user-provided comparison function, or declaring a variable with loop scope. PHP's libraries keep growing, which is nice, but the language itself is too small and too limited. I don't want to use library functions for everything, nor do I honestly care whether the language is even context-free. I just want a lanugage that doesn't suck.
</rant>
Gates' Law: Every 18 months, the speed of software halves.
which reminds me, whatever happened to the definition of RAMBOTRAN, the guide fro real men who use FORTRAN? I used to have a copy, but even google can't find it now.
FACT somebody on your development team is stupid.
FACT he writes stupid code.
FACT it is a *good* idea, not a bad idea, to create a language that makes it more difficult to write stupid code.
as much as I love all the lil tricks to make a semi-complicated line of code into a tidy nugget of bang wack dot at plus plus.. I hate like hell when mr. stupid does it.
now, for my own projects.. that is code that me and only me will be writing (and if someone else contributes I will probably interpret their code and write my own version) then I dont really care.. but when I need to share a codebase with mr. stupid, reading other people's code, DEBUGGING other people's code.. well you get the point.
FACT there is a difference in professional code and hobby code
FACT 1 in 10 "professional" software developers is a fucking idiot
FACT most "professional" code sucks
Its not the car, its the driver....
Size doesnt matter, its how you use it...
Well, you get the idea.
is the senses of paranoia it engenderz
Then, I also hate the PPL - Paranoid Programming Languageo gramming-language.html
http://paul.merton.ox.ac.uk/computing/paranoid-pr
for much the same reason.
Intercal
http://catb.org/~esr/intercal/
is perhaps the easiest of the three to use, and is one I recommend heartily as the be-all-and-end-all of all possible programming languages
Because it's True!!!
"I his bow, and spun and wove, likes you." Vere de Vere out of my mould's mouth dragged me of the voluntary apes.
Turbo Pascal has another choices too.
/* this one looks hostile, like an army with spears */
// Terse, unbalanced and lazy way of commenting,
// but informative enough.
/* comments */.
(* beautiful comment *)
{ terse comment }
My comments about the other commenting styles:
# This comment works best on beginning of
# a line. It looks clearly different than
# anything else, and works well as a comment.
And there's quickbasic that has this:
PRINT "moi" 'Obligatory greeting
Qb-style comments are very easy to make and not the less readable than
Is the lack of all that bug-inducing syntax...
Execution maybe slower than compiled c or assembler but the time required to develop ANY application is definitely worth the time! No searching for a misplaced comma! Code is totally self-explanatory (it's in english!) Even dynamically compiled scripts (build by your program during runtime) are easy to debug!
put "I hate punctuation in program" into myhead
repeat forever
answer myhead
end repeat
go to www.metacard.com for relief!
Yes, what happened to it indeed. Infact, it seems the only reference google has to RAMBOTRAN is in a previous comment made on slashdot by YOU :-)
Just use the keyboard for real programmers.
If you search deep enough you also find this: http://mirror.lcs.mit.edu/telecom-archives/archive s/book.reviews/navigating.internet-gibbs
I find Python syntax just looks crazy.. it's like a book with no punctuation. You can see the meaning if you look hard enough, but without any seperators it's much more difficult to read. In any good language you'll spend more time reading it than writing it (solving problems vs. implementing the solutions), so the time gained by only having to tab is lost by constantly having to work out what the fuck is happening.
so i guess he considers it to be the perfect language.
Comments down the page praising Prolog!
I have to use it every day and it makes me want to gouge my eyes out. It's too damn freaky and recursive. For example, finding a member of a list:
member(X,[X|T]).
member(X,[_|T]):-
member(X,T).
Actually, although I'm a fan of C++ generally, I think they got this one wrong. Using << and >> in this way encourages you to put the format of a composite string in code and not in data. That immediately creates problems with maintenance, flexibility and portability.
This is particularly damaging in the area of i18n. For example, you can give the string
to a translation agency, and get back the translation into the language of your choice, with the order of $1 and $2 swapped around if the new language requires it. You can't do that if your string is all broken up in code.
I don't like printf much in terms of clarity -- it's very "old skool hackery" in that you have to know how it works before it makes any sense, and you still forget details -- but at least it put the logically whole unit, the string template, in one place. You can systematically construct a printf format string using any other string tools, you can send it off for translation as a unit, it's hard to introduce inadvertent changes during later edits, etc.
The ability to extend the IOStreams system to allow I/O of new types and to allow I/O of existing types to new streams is great, but we could certainly do better now building on that experience, by keeping the extensibility without giving up the rest.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
The first time I saw a perl listing I had to check the printer cables. I was sure there were some bad wires or a flakey connector.
Sure there are people who claim to be able to read the stuff, but why would you want to spend your life staring a an ugly wad of nonsense. Real programming languages are designed for people to read. Sure perl is dense but I have a $120-80 gig drive; lines of code are cheap, my time is not. Spend lines of code and make time for yourself.
Some languages have niche applications where nothing else does quite as well. Perl is not one of them. Anything written in perl from a complete web site to one line utility would run faster and be easier to read and maintain if it was written in something else.
It took a real world war to end the airplane's patent wars. - Fâché Rouge -
...well, that is if you have written a 10 line program (but the point is still valid)! Had the poster meant "vector" I am sure he would have typed "vector".
BTW, gcc allows this, but shouldn't:
int myArray[someScalarValue];
Visual C++ 7.x chokes (as it properly should). I haven't tried any other compilers.
I am very small, utmostly microscopic.
Programming languages hate YOU!
#include
What would the above list of languages use for an equivalent?
Perl: use Clue; /etc/clue
bash: .
Pascal: uses Clue
Java: public class main extends clue
What else?
Mail? Put "slashdot" in the subject to pass the spam filters.
#include <clue.h>
Mail? Put "slashdot" in the subject to pass the spam filters.
I think that we learned from COBOL that making the starting column of a statement significant is a really bad idea.
...in which you shoot yourself in a reference to your foot, and pass a message back to your foot informing it to behave as though it has been shot.
philcrissman.com.
Once you get used to the long-winded syntax, it's actually kind of fun to use. And it suits the creation of html very well... I guess I also sometimes like to use languages that require a bit of hacking, ie clever workarounds to get things done. Same reason why I like SQL, although I wouldn't want to use XSLT and SQL all the time - just now and then for a change.
From what I know - no threading - and not planned in 5 either.
No it shouldnt. It has been part of the C standard since '99.
Visual C++ usually doesnt get anything right. Atleast gcc has a feature to support the same bugs.
$self->{groups}[HACKERS] is saying dereference that element as an array reference and give me the element numbered by the constant I've called HACKERS.
But that constant is really a subroutine, either explicitly defined in the code or covered up by the use of Constant.pm.
bp
I hate using = for assignment. It causes no end of confusion for teaching analysis. Please, let = just mean equality. I also hate being forced to have 0 as the 1st index. It causes no end of off-by-1 errors. When I learned to count, I started at 1, not 0!
Damn, not my brightest day. I los my clipboard in the process and I'm not in the mood to correct it.
I'm just happy I'm not posting from my account.
virtual void foo() = 0;
It would have been much more elegant to add another keyword like pure instead of having this weird syntax.
I am an OS athiest: I have no allegance to either Windows or Unix - I write code that compiles and runs on both.
.NET (ok, ok 7.x) is actually a better compiler then gcc (3.2.1). VC++ 6.0 - well that was a bit of a dog. With fleas.
I find that VC++
The VC++DN code is smaller, and faster, and I find that in most cases it has better compilance (still has some template problems admittedly).
I am porting a fairly large class library from gcc to VCC right now - and I find that the same code runs about 20% faster under Windows XP using VC++ 7.1 than it does under Linux (RH 8.0) using gcc 3.2.1 - on the same machine.
In a month I port to the Intel compiler on both Linux and Windows - it will be intersting to see which combo produces the best performance. I am suspecting Intel on Windows... but we'll see.
I am very small, utmostly microscopic.
Every source I find states that dynamically sized stack arrays are not allowed under ANSI C++.
C++... not C.
The last time I coded in C, K&R was still popular.
I am very small, utmostly microscopic.
How about an array who's size you don't know until runtime?
If 'vector' is not enough for you, you can always typedef it(parentheses are used for illustration purposes only):
#include "vector";
typedef std::vector(int) IntArray;
IntArray intArray1;
but alot of things just don't have really elegant solutions
And what are those things ? you don't say. STL provides THE elegant solution. Remember, 'typedef' is your friend.
and the standard libraries are too sparse for what modern apps do with modern languages
I too wished that C++ had standards for gui, multitasking, databases, networking and other useful tasks. But... C++ is a language standard, it is not a run-time environment. If you want all this functionality, you can always use Qt(for example). C#, the specification is portable to other OSes, since it is an ECMA (?) standard, but the run-time isn't. So don't hold your breath taking your C# source code and compile it on Linux...on the contrary, any STL-based app will compile the same with almost every C++ compiler, and Qt is 100% source code compatible on every OS it supports.
Forth was my first language after Basic. It was so much more expressive! A maze-generating algorithm that I couldn't wrap my head around when programming in BASIC suddenly became obvious when programming in Forth. Having recursion really helped.
Plus, few people end up with jobs or projects that force them into Forth against their will, so there isn't much hatred out there.
Of course, brainfuck is the answer.
In Perl? Please, pass that pipe over here!
"Times have not become more violent. They have just become more televised."
-Marilyn Manson
Back in the good old days of C, there was pretty much the one point of contention: "Don't use goto." C++ takes the never-ever-use-goto-no-sometimes-its-okay argument to a whole new level.
Of course, code reviews can get very personal. Everyone tries to be all object-orienteder-than-thou. Or maybe it's: "I use more C++ features than you." So then you find yourself wanting to use advanced C++ features so that you can impress your co-workers and be in that elite club, but your conscience tells you that if you do use all those advanced features, you will sacrifice portability, and you will produce code that requires a very advanced C++ programmer to maintain.
Then there are the compiler problems. As the parent post mentions, all compilers suck. And one of the biggest compiler problems is that the error messages are often inscrutable -- nobody knows what they mean! So, those error messages mean nothing except to tell you that your program won't compile. I mean, finding a bug in program code is one thing. Sometimes you can find the bug by stepping through code in the debugger. But when you can't even get the code to compile, that's frustrating in a different sort of way.
A co-worker of mine wrote a couple thousand lines of C++ code using GCC on Solaris. Later, we tried to compile the code using the Sun C++ compiler on the same machine. After a week of trying, we pretty much gave up. Such is the life of a C++ programmer.
"The result is a langauge that is so syntactically impoverished that it is actually less readable than C++"
.NET, and you have a recipe for a tremendously higher level of productivity over C++.
Ok, so MORE shorthand syntax makes a language easier to read? Somehow I don't follow -- isn't that the whole reason why many find Perl the equivalent to line-noise?
C++ requires a lot of headspace for humans to parse it. You have to keep in mind the rules for references vs. pointers, heap vs. stack allocation, the two syntaxes for dereferencing, notoriously ambiguous compiler messages, instance vs. static operator overloading, etc. You also can only get bitwise copying, no built-in shallow cloning. You have to manage header files and module dependencies like a hawk -- circular references in a large system shoot your compile times to hell, reducing your productivity. RTTI is a poor-mans approach to reflection. Binary interoperability breaks whenever the vtables in your abstract base classes change, so you have to introduce ugly placeholder hacks to keep them aligned.
C++ allows tremendous freedom in style, it *can* be as readable as Java, maybe in some cases more so. Unfortunately:
a) writing readable C++ code usually requires a level of discipline not found in 90% of programmers.
b) it doesn't have the level of turn-around time and feedback of languages like Java and C# that reduce binary interoperability to the class level, and provide a runtime linking model.
c) it certainly doesn't have the level of feedback of purely interpreted scripting languages.
Scripting languages, or modern OO languages like C# or Java, coupled with a reflective development environment like Eclipse or Visual Studio
-Stu
What I really want to do is this: Reverse part of the sort later.
That's right. I need to sort an array, do a bunch of stuff with the sorted array, and then be able to unsort some of the array values later. So far the only way I can think of doing that is tracking the original index value of each element during the sort, and then afterwards for the ones I want look that up so I can put it back where it was.
I have no idea how map would work for this. Any examples?
Oh and this is very memory sensitive. One byte per element is a huge memory bloat for this app. I have to free the original arrays after I cast them to a 2 int struct (1 value 1 index) or it uses too much ram. If I could do it without having to make the structs, i.e. just making the index arrays, I wouldn't need to free hundreds of megs and only to allocate it again after this process ends.
Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!
Well first off, I've never heard of STL until it was mentioned here and I started looking it up. It wasn't covered or even mentioned in my education at all. I have no idea what typedef is, I'll look a that up later.
I did however look up vector, and tried using it. I ran into problems.
How do you do a 2D double dynamic array?
vectorarray = new (std::vector )[count]; obviously does not work.
vectorarray = new *(std::vector)[count]; doesn't work either so I can't get pointers to vectors so I can have a bunch of vectors later.
vectorvector = std::vector ; also no go.
Also, any idea if it works with memcopy? If not I don't know if I wanna throw a couple hundred megs into them and try copying it around.
Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!
C is a great language for writing operating systems, device drivers, any program that has to be lean and fast. If the code is going to be excuted billions of times a day all over the world C is the obvious choice. It is so close to the target machine that I think of it as a portable macro assembler.
It is such a great language that people began to worship it and came to belive it was the best language for every program that they needed to write. But better languages for application programming were developed. They had object orientation, could use design patterns, and could actually reuse code that had been written for other applications.
The C worshipers could not be satisifed if C was only best for low level programming so they piled on a ton of crap and called it C++.
It's like the hot chick that went to work in a dognut shop. A few years go by and not so hot anymore. C++ can still be used but the thrill is not there anymore. Bloated, messy, and covered with powdered sugar C++ just doesn't do for me.
It took a real world war to end the airplane's patent wars. - Fâché Rouge -
By this logic, assembly language should be be the easiest language of all to read, since it's such a simple, regular syntax. Syntax is added to languages in order to make them more expressive and readable, not less. Sometimes this can be done wrong, like in Perl's case, where a very expressive array of syntax is hobbled by a commitment to maximum terseness. Removing syntax for "simplicity's" sake often has the opposite effect, though.
Examples of this in Java include:
The only thing that makes coding in Java productive at all is a really clever refactoring IDE which automates a lot of those chores, along with a really enourmous set of standard libraries. Nearly everything I can express in Java I can express more quickly in C++ without any loss in readability, and often with in a way that better expresses my intent to the reader.
It's really comparing apples and oranges though. In general, Java and C++ are applicable to two mostly orthoganal domains; but most of Java's domain is better served by less wordy dynamic languages like Smalltalk, Ruby, Python, or Scheme.
--
CPAN rules. - Guido van Rossum
There's a cure for that, by the way: Effective C++ by Scott Meyers. It really is exactly the thing to fix up one's C++ knowledge to what's current (I learned C++ back in 1995, using books that were already over a year old then, and compiler versions that were at least three years old).
This reminds me that I should go ask the co-worker who's been borrowing it for six months now to return it...
New _Apple_ code is C++? Yikes!
Still, aside from Apple, _someone_ is buying all those new Obj-C and Cocoa books. I know when I get my Mac (waiting for the PPC970 train), I sure as hell won't be using C++. Blech. Obj-C99 seems about the nicest solution anyone's come up with yet, short of Python. I love the syntax of Rebol, but I wish it was lower level, compiled, & open source. Oh well.
I'm still surprised by the # of people who complain about things lacking in C, without realizing that C99 addressed many of those issues. *shrug*
> Someone please explain: why does this feature make you so upset?
I assume because it looks like Fortran 77 to them -- the same reason some dumbasses are upset about the Unix command line because it looks like DOS to them.
Trust me on that one: just ignore the dumbasses, and do whatever -you- like.
-- B.
This sig does in fact not have the property it claims not to have.
hmmm, search on google groups finds 2 references. I work in a fortran shop -- if you find this rambotran stuff pls post it somewhere!
AC (posting as AC so no one knows I code in fortran)
unless you language is something like....
....there ain't no way you code will be self commenting.
"
mr smith from jones &co asked me on 11/09 to take the orders from freds clients and transfer then to my.db;
ignore the next line because kate reported bug 1234
then he want's to totals of the clients in my.db to be printed in a report as per the format specified by billy on 10/09;
instead
take the totals of the transfered clients in my.db and print them using the format specified by billy on 10/09.
"
thank God the internet isn't a human right.
You are quite right.
But that's not some gratuitous dislike of things commercial, it has concrete technical reasons. As long as Sun was going to go through a public standardization process, its many design flaws were fixable, its bloat could have been limited, and other people could have created better implementatiosn than Sun. As soon as Sun made Java proprietary-with-community-input, all that went out the window.
As for VB, you are confusing the language and its environment. VB-the-language is pretty awful--some of Microsoft's main VB hackers have left the company over that. What has made VB succeed is the programming environment and the copious documentation, training, and marketing. VB-the-language succeeded because a big company kept spending on making it succeed despite the pretty awful nature of the language itself.
So, "free" matters, because something that is "free" usually involves much more community input in its creation, and something that is "free" usually has to make it on its own merits. Java and VB are, and will remain, deeply flawed languages precisely because they are not free: as long as Microsoft and Sun can spend money to paper over the technical problems with those languages, and as long as the community itself doesn't have the final say in what happens to those languages independent of the corporate interests of their owners, those languages will remain sub-par.
(As for VB-like environments for Linux, Python, Glade, and your favorite Python IDE give you equivalent functionality and a better language. What they don't give you is the documentation, standardization, and name recognition of VB.)
If you want to learn ruby slowly by example, check out osnippets.org's ruby section.
You can't judge a book by the way it wears its hair.
"Lieutenant, bomb that indent line back about a hundred lines. Give me some room to breathe."
I think I once described Python as a crammed language I can't breathe in. The whole code seems claustrophobic and somewhat... monolithic. It seems like it just sits there. It forms a structure. It sits in the file. Like a mountain built of small rocks and concrete. Once built, it won't move anywhere without a large effort. It just stands there.
And I feel it's tricky that the code relies ONLY on the indent to store structure. Once you take away even a little bit of that structure, it all collapses. If you take a block of Python and paste it elsewhere, it may just not work. If you lose the indent, it won't work either. Losing indents is very possible and very real - one example was already given: quoting, printing long code on paper, or some such.
Oberon-2 is a great language (though I'm not a fan of the Oberon OS) - it's low-level like C, but with safety, objects, and GC. It is, in my opinion, much better than Pascal or Modula (and I used to be a Pascal fan).
Anyway, quick links:
POW! - Oberon-2 IDE/Compiler for Windows.
OOC command-line compiler for Unix.
Oberon home page at ETH
Can't speak for Cobol, though. What school do you go to? I'm interested to know where they teach Oberon
-rob
Thank you.
Our product is almost gold, so there is no chance of changing the platform in the near future. We hope to move to a much newer Java release for the next version. We integrate with Domino, so the options are limited unless we want to include a WebSphere license. But there should be better options when we move the product to Domino 6.
We will test the library to see if we can set the HTTP USER CLIENT header. The Sun and IBM libraries from their JREs insist that it reverts to "Java 1.3". Since our servlet can act as a proxy, we want to pass the real clients' header, but we did not want to write our own HTTP classes for just this one feature.
Our development team is too small. We knew adding this feature would not be difficult, but we cannot delay the release for any reason. Most servers return valid HTML regardless of the client used, but MS IIS 4 is awful. So it will be on the bug list unless we find a better library. We stopped looking for one about a year ago. May this one will work. Again, thank you.
I spend my life entertaining my brain.
Note to moderators: what I quoted was (at the time I posted) the parents .sig. As such, my post was on topic. Please mod accordingly.
There are reasons why democracy does not work nearly as well as capitalism.
-- David D. Friedman
But then wouldn't you risk alienating gay male programmers?
I don't remember that name, but "real men use fortran" brings up a bunch of hits of likely no relevants. Only direct result is http://developers.slashdot.org/developers/02/05/19 /2216233.shtml
Typo'd it as robotran and found there IS such a program!
~REZ~ #43301. Who'd fake being me anyway?
Roman times: Gladiator Fights
/Sean/
Medieval Times: Jousting
Western Times: Dog Pit Fights
Modern Times: Flamewars on Slashdot about bad programming languages!!
The best way to make readable code is to leave out the comments altogether :-)
:-)
...And even in python you should use comments in moderation, (read: "when you are using some fancy voodoo")
After all, the code should be self-explanatory
In Python maybe, but certainly not in Perl
No sig for the moment.
You could try metacard. Start counting at 1 and assign variables with the pure prose of put "hello world" into x put x into field 1 People just dont get it! (MetaTalk pun intended)
It's a darn shame that you can't send someone slashdot messages, but I have to ask - what are you trying to do that's failing? I couldn't remember java 1.3 being broken in this fashion, so I wrote a little test program, and it seems to work just fine:
import java.net.*;
public class printURL
{
static void main(String argv[])
throws Exception
{
URL u = new URL(argv[0]);
URLConnection urlc = u.openConnection();
urlc.setRequestProperty("X-Whatever", "WhichEver");
if (argv.length > 1)
urlc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1; MultiZilla v1.4.0.3J) Gecko/20030425");
java.io.InputStream is = urlc.getInputStream();
java.io.Reader rdr = new java.io.InputStreamReader(is);
int ch;
for (ch = rdr.read(); ch != -1; ch = rdr.read() )
{
System.out.print((char)ch);
}
}
}
When I run this against a cgi script that just prints out what you send it (printenv.pl from a recent apache distribution), it clearly shows that the user agent is Java1.3.1 without that "setRequestProperty" line, and is what I say (I just copied what my browser says) with it.
What are you doing?
I'd take this off slashdot, but you give no way of contacting you in your slashdot profile.
-Don
PHP References Explained
Take a look and feel free: http://www.PieMenu.com
"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?"
Yo! who cares, yeah, sooon you be decompiling string, yo! you neeeeeed work to do boooooy.
"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."
Dat is why we have AspectJ my brother. Shit, if you need it, use it, ain't no one judging you. But you know, you be bringing that to my house and I'll put a cap in your ass. Straight.
"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."
Ok, you have a point here. This badness can do some harm.
"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."
My man, you know shit.
public Shit someMfkinMeth (Shit shitbooooy) throws throwable {
}
--------------------------------------------- "In the end, we're all just water and old stars."
But now that I no longer work for Borland, I have to admit to myself that this is just not true. Yeah, you can point to a lot of IDE features that are similar in the two products. But there are differences as well, And, more importantly, Object Pascal is a completely different language from any Basic dialect. There's the way variables are declared. There's language semantics (VB has one kind of string data type; OP has a lot more). There's a lot of other things.
Which is not to say that Kylix isn't a reasonable migration path for VB programmers. Indeed, a lot of Delphi/Kylix enthusiasts seem to consider themselves "reformed" VBers. But that's simply because Delphi and Kylix are better designed than VB. If you want to abandon VB for something more powerful, you'll probably find that Delphi and/or Kylix is worth the effort it takes to re-educate yourself. But that effort is not minimal.
Actually, no, I was thinking more along the lines of Lisp or Smalltalk. Both are small languages with minimal use of symbolic shorthands, and make use of a large vocabulary.
Lack of enums: Granted, in limited cases, such as parsing textual tokens, enums are useful. Pre 1.5 Java, type-safe enums are usually implemented using Josh Bloch's pattern from his book Effective Java. However, the typical use of enums is "type-coding" operations through a switch statement. This is a holdover from C and would be better written as polymorphic objects.
Lack of default arguments: Granted, though a minor problem.
Operator overloading. While I have seen examples where it's useful, they're primarily in terms of equality comparison, as is your example. I'm not in favour of general operator overloading, but I think the C# approach of allowing overloading of "==" but providing another (non-overloadable I believe) identity comparison operator is a good one. Having said that, the Java solution of marking a hard distinction between the semantics of "==" and ".equals" is a workable solution.
The above chores you've listed have little to do with refactoring IDE's, and you have omitted the observation that most of the maintenance challenges that are simplified by refactoring tools are challenges that exist in C++ as much as they do in Java: renaming methods, re-ordering parameters, moving methods, pulling methods up or down a hierarchy, inlining or extracting methods.
Not to mention the importance of managing dependencies through an IDE that can track them, which is arguably much more important in C++ because they can affect your compile times in horrible ways.
So you would prefer to write most standard features yourself? Or use one of several third-party libraries, some of which might be OS-dependent?
I'm really happy that you write clean code, but most C++ programs are not written that way. Furthermore, not everything to do with a language's productivity has to do with its syntax.
In practise, this isn't exactly what happened. Many businesses in the mid-90's tried developing business appliccations with C++, with very mixed results. It requires a level of discipline that isn't characteristic of most developers. This is what led to Java's widespread adoption in the enterprise.
.NET.
Furthermore, there are non-syntactical benefits to VM-based languages like Java or C#. The "safety net" of Java was a tremendous benefit -- the fact that it generally can't crash (save NullPointerException) with a segmentation fault due to programmer error in memory management.
Let's also not forget that Java's reflective language model, where every component of the language can be inspected, where interoperability and linking occurs at runtime, all of this has conferred tremendous productivity benefits to the deployment and version management of applications. No more worrying about the brittleness of the C++ ABI.
This brittleness led to the creation of standards like COM, which we all know put the COM in COMPLEX. So much so that Microsoft clued into the power of reflective languages and released
-Stu
.. is the way i seem to always bends screws when I hit them.."
Moan Moan Moan.
Come on, this is rediculous. Different programming languages, different applicable circumstances. One thing in one language is hard, in another its easy. Use the right tools, and bingo.
"So there he is, risen from the dead. Like that fella, E. T." - Father Ted Crilly
-
-
I do regularly use another whitespace-sensitive language that does not have these problems: Haskell. So when I program Python, I feel acutely that Python got it wrong.Continuation lines suck. They're visually ugly and a pain when editing. Why can't Python assume a line is a continuation when it starts to the right of the previous line? NB: don't give me any "good programmers don't need long lines" clap-trap.
Whitespace sensitivity is not optional. There is no "long-hand" to resort to when you want it "your way"--or want to protect your code against mangling in transit.
The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.