Post #287,422
6/20/07 2:58:56 PM
|
![New](/static/images/lrpd.gif)
I have always considered C to be . . .
. . "Pascal by hackers for hackers". Deliberately dangerous and self obfuscating. I've never looked at C++ but I'm sure it just expands on the underlying problems.
In the next to last issue of Computer Languages magazine the "Advanced C" columnist admitted he teaches C because that's where the demand is, but for all the contract programming he does he uses Pascal. That way when a client asks for a modification a year later he can figure out how the program works in 10 minutes instead of a week.
My personal opinion is that much of the buggyness of PC software is due to the insistence of programmers that it will be written in C.
Another commentator in Computer Languages lamented it was really hard to promote Modula II because none of the houses doing successful work in that language would admit in public to using it - they considered their use of Modula an important trade secret.
[link|http://www.aaxnet.com|AAx]
|
Post #287,425
6/20/07 3:16:51 PM
|
![New](/static/images/lrpd.gif)
I disagree.
C++ doesn't just expand on the underlying problems of C.
It creates whole new categories of problems as well.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #287,464
6/21/07 12:28:09 AM
|
![New](/static/images/lrpd.gif)
ICLPRD (new thread)
Created as new thread #287463 titled [link|/forums/render/content/show?contentid=287463|ICLPRD]
Is it enough to love Is it enough to breathe Somebody rip my heart out And leave me here to bleed
| | Is it enough to die Somebody save my life I'd rather be Anything but Ordinary Please
|
-- "Anything but Ordinary" by Avril Lavigne. | · my · · [link|http://staticsan.livejournal.com/|blog] · · [link|http://yceran.org/|website] · |
|
Post #287,446
6/20/07 5:54:38 PM
|
![New](/static/images/lrpd.gif)
Nah, Pascal was a teaching language
C was warmed over stylized PDP assembler. It was ported to 8 and 16 bit processors and provided a faster time to proof of concept (although a lot of the initial embedded stuff went to production with C code.)
Later, it just got popular. Go figure... C and C++ are ok languages, but they are still just languages. Do it right and it works well. Do it sloppy and it will savage you. Same as human languages...
I, personally, never understood the evangelism of certain languages. Some are good for specific things, but generally you can get most languages to do most general tasks. Interpreted languages are not going to work well in drivers, and assembler isn't going to work well in web design (I don't know, maybe it could, but there are better languages available.) Whatever... horses for courses...
|
Post #287,452
6/20/07 7:38:43 PM
|
![New](/static/images/lrpd.gif)
According to Nicholas Wirth he did not . . .
. . write Pascal as just a teaching language.
Of course for efficient PC programming it needed some "extensions", which were pretty much finalized in Borland's Turbo Pascal. Personally I've done a lot of passing complex structured variables as pointers, type casting and other behavior considered improper - but not GOTO, no never!
Actually, even type casting was included in formal Pascal, but by a means so awkward and obscure as to assure nobody used it.
[link|http://www.aaxnet.com|AAx]
|
Post #287,483
6/21/07 7:26:29 AM
|
![New](/static/images/lrpd.gif)
So who are you going to believe?
Nicholas Wirth or 20 year old Usenet gossip? I mean really...
Turbo Pascal was a fun language/package. I seem to recall that it came on a single floppy with room to spare. It could do fun things with VGA colors and curses style windows. It was specified as the required language for a program I had to write for a customer who had to convert the output of some kind of 20 bit processor (probably an in-house bit slice design). TP only had 16 bit signed integers so I ended up converting values by bit shifting 16 bits and multiplying by a real to get a final result. It was interesting but I was hardly impressed with the language. Outside of playing though, that was all I really did with it, so I don't have a real informed opinion.
In that time frame, I used mostly PLM and assembler. When I moved into unix systems, C was sort of a natural progression. When I went into OS/2 and Windows world, C/C++ compilers were readily available and I knew the language so I used them. I still like C and C++ for driver work and low level services and such. I don't do much high level web or data base stuff any more.
I still maintain that most languages are useful if used properly. I will probably never be able to use english to win this arguement though...
|
Post #287,492
6/21/07 9:53:50 AM
|
![New](/static/images/lrpd.gif)
Nah, you probably won't: "Argument". HTH! :-)
|
Post #287,505
6/21/07 10:59:41 AM
|
![New](/static/images/lrpd.gif)
Early versions had only 16-bit integers . . .
. . and that was a bit of a problem. Later versions added the 32-bit LONGINT data type which made usability much better.
[link|http://www.aaxnet.com|AAx]
|
Post #287,581
6/21/07 11:31:38 PM
6/21/07 11:32:50 PM
|
![New](/static/images/lrpd.gif)
Maybe not originally, but when he wrote Modula II
...he wrote it because Pascal wasn't flexible enough as a general purpose language; it was best used as a teaching aid (much like Java is today).
jb4 "It's hard for me, you know, living in this beautiful White House, to give you a firsthand assessment." — George W. Bush, when asked if he believed Iraq was in a state of civil war (Newsweek, 26 Feb 07)
![Expand](/static/images/plus.png)
Edited by jb4
June 21, 2007, 11:32:50 PM EDT
|
Post #287,580
6/21/07 11:28:47 PM
|
![New](/static/images/lrpd.gif)
I gotta say that...
...anyone who says that Pascal is more readable than C would also believe that COBOL is more readable than FORTRAN.
So what? They both impinge heavily on the braincells of the reader.
jb4 "It's hard for me, you know, living in this beautiful White House, to give you a firsthand assessment." — George W. Bush, when asked if he believed Iraq was in a state of civil war (Newsweek, 26 Feb 07)
|
Post #287,583
6/21/07 11:35:13 PM
|
![New](/static/images/lrpd.gif)
It's that stupid single exit point from a function
I always though PASCAL what very much like C, except braces were words.
Except for the single exit rule.
It claims to save the confusion of figuring out what bit of code did the return, but it adds lots of complexity / if/then/elses / gotos (gasp) to every friggen function to get around it.
|
Post #287,765
6/24/07 10:21:48 PM
|
![New](/static/images/lrpd.gif)
I've got NO PROBLEM with that
In fact, every coding standards/guidelines that I have anything to do with routinely prescribe "every block should have one way in, and one way out" Not a big fan of trap door exits, you see....
jb4 "It's hard for me, you know, living in this beautiful White House, to give you a firsthand assessment." — George W. Bush, when asked if he believed Iraq was in a state of civil war (Newsweek, 26 Feb 07)
|
Post #287,769
6/24/07 11:34:38 PM
|
![New](/static/images/lrpd.gif)
You ever have nested while and for loops?
With a decision or 2 inside it?
Single point of exit either requires numerous flag variables that have nothing to do with the program logic - they are there as an artifact of the language itself. Additional tests at each loop level to determine whether you broke out of the loop via a decision in the loop or a loop fall out.
Or, shudder - goto - that bounces you to the bottom.
Or, my favorite solution, named loops and a "last NAME;" statement, which allows a clean breaking out of nested loops.
Whether or not you have a problem with this is not the issue. I've seen a far better way and now know better. Far less code, much cleaner and easier to code and maintain.
|
Post #287,981
6/27/07 9:21:29 PM
|
![New](/static/images/lrpd.gif)
"Numereous flags"
mah-noor. Except in some very unusual circumstances, the exit can be controlled by exactly 1 flag. And by namingthe flag correctly (e.g. something like failure or done ) it might even self-document.
The answer to your question is yes. Now I got one for you: Ever debugged/refactored a 16-greenbar-page function cock-full of trapdoor exits, and where you get to page 14 or so and have absolutely no idea what the conditions are that have gotten you to this place in the code, because the berk who wrote it was overly enamored with taking his/her ball and bat and going home at the slightest provocation?
Didn't think so...
jb4 "It's hard for me, you know, living in this beautiful White House, to give you a firsthand assessment." — George W. Bush, when asked if he believed Iraq was in a state of civil war (Newsweek, 26 Feb 07)
|
Post #287,982
6/27/07 9:46:24 PM
|
![New](/static/images/lrpd.gif)
Didn't think so?
Hah.
Wimp.
[link|http://z.iwethey.org/forums/render/content/show?contentid=266834|http://z.iwethey.org...?contentid=266834]
Just because some idiot uses certain features unwisely does not mean the language should be designed for the idiot.
Because if you really want to split hairs on this one, I've got some stories of longjmp usage.
Or in MS-DOS days, poking a few values in a certain register and jumping to zero. hhhheeeeeeheheheheehe. Warm boot from my program as a last ditch effort.
Sometimes when you setup public workstations that's all you can do.
|
Post #288,104
6/29/07 6:00:12 PM
|
![New](/static/images/lrpd.gif)
That's a good way out.
Although it sometimes feels a little clunky. However, sometimes that's all the language has available.
I like Icon's approach. It's a bit tricky to describe but the idea is that you can pass breaks up several layers all at once. And you can make the last one do a next, instead. It's really elegant. However, due to other qualities of the language, it doesn't get used all that much. This is because things like goal-directed evaluation and expression back-tracking and generators are usally used to implement the kind of logic and loops that people need to put in trap-door exits for. :-/
Wade.
Is it enough to love Is it enough to breathe Somebody rip my heart out And leave me here to bleed
| | Is it enough to die Somebody save my life I'd rather be Anything but Ordinary Please
|
-- "Anything but Ordinary" by Avril Lavigne. | · my · · [link|http://staticsan.livejournal.com/|blog] · · [link|http://yceran.org/|website] · |
|