JREF Homepage Swift Blog Events Calendar $1 Million Paranormal Challenge The Amaz!ng Meeting Useful Links Support Us
James Randi Educational Foundation JREF Forum
Forum Index Register Members List Events Mark Forums Read Help

Go Back   JREF Forum » General Topics » Computers and the Internet
Click Here To Donate

Notices


Welcome to the JREF Forum, where we discuss skepticism, critical thinking, the paranormal and science in a friendly but lively way. You are currently viewing the forum as a guest, which means you are missing out on discussing matters that are of interest to you. Please consider registering so you can gain full use of the forum features and interact with other Members. Registration is simple, fast and free! Click here to register today.

Tags languages , programming

Reply
Old 30th November 2003, 11:35 AM   #1
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
Programming languages

My favorite part of computing is discussing programming languages (well, and machine architectures). So I thought I start a thread on random programming language features and related chit-chat. Toss in whatever you feel like.

A couple of items to start things off:

Perl is totally ridiculous. What are the $, @, % symbols, and what are they called?

Why does every language have 13 different kinds of strings for different purposes? Do the designers forget about escape sequences when they want a new feature? If you want a block text string for text messages, you don't need to invent a new kind of triple-quoted string!

It is absurd to use whitespace for structuring programs. Python go home!

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 12:45 PM   #2
volant
Muse
 
Join Date: Jun 2002
Location: The sea
Posts: 978
I'm glad I don't have to program in C++ no more, yay for DarkBASIC!
__________________
I may not agree with what you say, but I will defend to the death your right to say it. Your death, that is.
volant is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 01:38 PM   #3
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
I found my year with C++ to be an unpleasant experience. How many meanings can you assign to the keyword virtual?

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 01:51 PM   #4
El Greco
Summer worshipper
 
El Greco's Avatar
 
Join Date: Nov 2003
Location: Παρά θιν'αλός
Posts: 14,426
Code:
mov      ax, word ptr [16bit_Asm]
movsx    eax, ax
mov      dword ptr [El_Greco], eax
__________________
"Robbing a bank is no crime compared to owning one" - Bertolt Brecht
"Let it go and come to bed already, El Greco" - MoeFaux

El Greco is online now   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 02:33 PM   #5
Zep
Banned
 
Join Date: Sep 2002
Posts: 26,985
You know as well as I do, Paul, that DCL is the only programming language...
Zep is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 03:55 PM   #6
Stimpson J. Cat
Graduate Poster
 
Stimpson J. Cat's Avatar
 
Join Date: Sep 2001
Location: Oxford, UK
Posts: 1,833
I think C++ is pretty cool. Once you get used to classes, and understand the language well enough to understand what is, and is not, efficient, it is a wonderful language for numerical programming.

Right now I am working on a set of classes for integrating networks of oscillators. The object oriented capabilities of C++ allow me to write my code in a general way, that will allow any sort of oscillator I want to be added to the network, along with any topology and coupling scheme I might need. At the same time, then control C++ gives over things like memory management, and mathematical operations, allows me to achieve a level of performance that would simply be impossible with any other object oriented programming language.

In fact, I think the reason C++ takes so much flak, is because people don't realize its strengths. Sure, it is not designed from the ground up as an object oriented language, so hard-core object oriented types are going to prefer languages that are. Likewise, C gurus often complain about things like overhead in C++, when the fact is that usually such overhead is the result of sloppy programming, rather than any flaw in the language. When used properly, C++ can be used to write generic algorithms which are just as fast as specialized algorithms in C.

Basically, if you need the kind of power and speed that a language like C gives you, and also want the advantages of an object oriented language, then I think that C++ is the way to go.


Dr. Stupid
__________________
A poke in the eye makes Baby Jesus cry.
Stimpson J. Cat is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 05:31 PM   #7
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
Well Zep, DCL is one fine language. All I ask from a "decent" programming language is real strings, hash tables, and syntax that isn't too atrocious. So much for C.

Stimpy, my objections to C++ are mostly concerned with the informality of the language and the sloppiness of the implementation of the concepts. I'm just a crotchety language formalist at heart, I guess. Comes from learning software engineering in the '70s. I agree that it's efficient when you understand what you're doing. I was trying to write a precompiler for C++ to make writing lots of classes easier (for a bioinformatics system), but the butchered semantics of virtual classes, automatically generated methods, and the inheritance mechanism made it nearly impossible. I prefer languages like SmallTalk, Common Lisp, and Ruby that have better-integrated and more formal object systems.

Of course, I grew up without objects, so often I wonder why I need them at all.

http://www.geocities.com/tablizer/oopbad.htm

But never let it be said that I don't put my programming time where my big mouth is. Come January, my new language, Gossip, should be ready for prime time coding. Who says everyone can't have their own personal language? Shall I foist it on the world?

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 05:55 PM   #8
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
Two atrocious bits of syntax from C that have found their way into other perfectly good languages:

The equal sign (=) for assignment. Come on! The world uses the equal sign for equality. Of course, this one isn't C's fault.

A leading zero for an octal number (0123). Excuse me for wanting leading zeroes on some decimal numbers. Lazy bastages.

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 06:04 PM   #9
mindless
Scholar
 
Join Date: Apr 2002
Posts: 114
im interested to hear what your views are on Java.
__________________
Gir: I need tacos! I need them or I will explode... that happens some times.

Belief is not proof, your God does not exist.
mindless is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 06:48 PM   #10
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
I don't know Java. Amazing in this day and age, I know.

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 07:35 PM   #11
69dodge
Illuminator
 
Join Date: Nov 2002
Posts: 3,607
Quote:
Originally posted by Paul C. Anagnostopoulos
Come January, my new language, Gossip, should be ready for prime time coding. Who says everyone can't have their own personal language? Shall I foist it on the world?
Sure.

What's it like?
69dodge is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 07:51 PM   #12
Zep
Banned
 
Join Date: Sep 2002
Posts: 26,985
Quote:
Originally posted by Paul C. Anagnostopoulos
Well Zep, DCL is one fine language. All I ask from a "decent" programming language is real strings, hash tables, and syntax that isn't too atrocious. So much for C.

Of course, I grew up without objects, so often I wonder why I need them at all.

http://www.geocities.com/tablizer/oopbad.htm

But never let it be said that I don't put my programming time where my big mouth is. Come January, my new language, Gossip, should be ready for prime time coding. Who says everyone can't have their own personal language? Shall I foist it on the world?

~~ Paul
Heh heh! I grew up on Pascal, etc, as well. And COBOL, Fortran, Algol, PL/1, Snobol, Simula, etc, etc.

My own experience is that I believe that the vast majority of programming tasks even today do not require objects and their associated messiness. Most programming tasks are still mind-numbingly boring and simple and can be done in a few lines of plain code in a simple programming language that is written in a few minutes, tested in under an hour, and gets compiled into a tiny executable. Using objects and classes and all that is like using a Ferarri racing car to pull a plow - a fine tool but the WRONG tool for those common jobs.
{end-sermon}

Hey, send me a sample of Gossip! It might be very interesting!
Zep is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 09:02 PM   #13
Neutron Jack
New Blood
 
Join Date: Feb 2002
Posts: 21
Quote:
Perl is totally ridiculous. What are the $, @, % symbols, and what are they called?
Translation: I haven't bothered to spend ten minutes learning Perl, but I've decided that it's ridiculous.
Neutron Jack is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th November 2003, 10:56 PM   #14
Cecil
Muse
 
Cecil's Avatar
 
Join Date: Oct 2002
Location: Vancouver
Posts: 991
I'm fond of esoteric programming languages, especially Brainf*ck.

Code:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<
This code displays "Hello World".

Brain**** is essentially an 8-instruction Turing-complete language. You have an array of bytes, and a pointer, initialized to the first byte of the array.

> increments the pointer.
< decrements the pointer.
+ increments the byte at the pointer.
- decrements the byte at the pointer.
. outputs the byte at the pointer
, inputs a byte and stores it at the pointer.
[ jumps past the matching ] if the byte at the pointer is 0.
] jumps to the matching [.

It's tons of fun to play around with.

http://en2.wikipedia.org/wiki/Hello_...eric_languages has a great list of hello world programs in various esoteric languages; googling the name of the language along with "esoteric" will usually turn up a description of it.

Malbolge is worth a look; it's designed to be inhumanly difficult to use, and in fact no human has ever written a program unaided. The only program in existence is
Code:
 (=<`$9]7<5YXz7wT.3,+O/o'K%$H"'~D|#z@b=`{^Lx8%$Xmrkpohm-kNi;
 gsedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543s+O<oLm
It displays "HEllO WORld" and was generated by a beam search algorithm. See http://www.acooke.org/andrew/writing/malbolge.html for details

Piet is also pretty interesting. Code is in the form of a square GIF image, and the colour values of each pixel or bounded area form instructions.
__________________
"Great spirits have always encountered violent opposition from mediocre minds." --Albert Einstein
"The common man marvels at the uncommon; the wise man marvels at the commonplace." --Confucious
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." --Bertrand Russell
Cecil is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 12:13 AM   #15
69dodge
Illuminator
 
Join Date: Nov 2002
Posts: 3,607
Quote:
Originally posted by Cecil
I'm fond of esoteric programming languages, especially Brainf*ck.

Code:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<
This code displays "Hello World".
No, just "Hello ".

(It has only six periods, none within a bracket loop, so how can it print more than that number of characters?)
69dodge is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 12:21 AM   #16
El Greco
Summer worshipper
 
El Greco's Avatar
 
Join Date: Nov 2003
Location: Παρά θιν'αλός
Posts: 14,426
What I find amazing with users of HLLs, is that they often don't know what an 'object' is. Only a small percentage of HLL programmers understand what's exactly going on in memory when you create an object. And the concept of class is also vaguely understood.
__________________
"Robbing a bank is no crime compared to owning one" - Bertolt Brecht
"Let it go and come to bed already, El Greco" - MoeFaux

El Greco is online now   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 12:35 AM   #17
Zep
Banned
 
Join Date: Sep 2002
Posts: 26,985
Quote:
Originally posted by El Greco
What I find amazing with users of HLLs, is that they often don't know what an 'object' is. Only a small percentage of HLL programmers understand what's exactly going on in memory when you create an object. And the concept of class is also vaguely understood.
It doesn't matter to them - all that hype about the advantages of classes, etc, goes right over their heads. They just want to know how to make the next killer app or killer game more HOOO-AH!! Never mind that it's way bloatier than the current version... BUY MORE MEMORY & BUY MORE GRUNT will fix any problems!
Zep is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 04:27 AM   #18
Wudang
BOFH
 
Wudang's Avatar
 
Join Date: Jun 2003
Location: Sheffield
Posts: 8,318
REXX Fantastic language. When Mike developed it, he wrote the user guide first then forced the language to work the way it was described. It's so quick to knock out really good stuff. The parse instruction alone makes it worth while. You can get a free implementation for DOS/windows boxes.
For comparison, I've worked with COBOL, assembler, PL/AS, PL/I, korn shell, C++, pascal and others. They are the moon, Rexx is the sun.
Wudang is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 05:21 AM   #19
arcticpenguin
woo ban clan
 
Join Date: Sep 2002
Posts: 5,717
Quote:
Originally posted by Neutron Jack
Translation: I haven't bothered to spend ten minutes learning Perl, but I've decided that it's ridiculous.
I've spent quite a bit more than 10 minutes on it, and it is ridiculous. The language is inconsistent. The scientific programming community is turning to python.
__________________
The power of accurate observation is frequently called cynicism by those who don't have it. - George Bernard Shaw
arcticpenguin is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 07:01 AM   #20
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
Neutron Jack said:
Quote:
Translation: I haven't bothered to spend ten minutes learning Perl, but I've decided that it's ridiculous.
You have no idea how much time I have or have not spent learning Perl. Now I ask you again: What are the $, @, % symbols, and what are they called? When I ask what they are, I'm not asking what they do; I know that. I'm asking what kind of entity they are.

El Greco said:
Quote:
What I find amazing with users of HLLs, is that they often don't know what an 'object' is. Only a small percentage of HLL programmers understand what's exactly going on in memory when you create an object. And the concept of class is also vaguely understood.
I don't think programmers are taught how machine works any more, are they?

Penguin said:
Quote:
I've spent quite a bit more than 10 minutes on it, and it is ridiculous. The language is inconsistent. The scientific programming community is turning to python.
Oh Lord. The next Mars probe will fail because a space gets dropped and changes the entire meaning of the program.

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 07:11 AM   #21
Cecil
Muse
 
Cecil's Avatar
 
Join Date: Oct 2002
Location: Vancouver
Posts: 991
Quote:
Originally posted by 69dodge
No, just "Hello ".

(It has only six periods, none within a bracket loop, so how can it print more than that number of characters?)
Oops. I accidentally dropped the second line. It should be:

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<
+++++++++++++++.>.+++.------.--------.>+.>.

__________________
"Great spirits have always encountered violent opposition from mediocre minds." --Albert Einstein
"The common man marvels at the uncommon; the wise man marvels at the commonplace." --Confucious
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." --Bertrand Russell
Cecil is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 07:13 AM   #22
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
69dodge asked:
Quote:
What's it [Gossip] like?
Well, it's pretty idiosyncratic. I haven't done much commercial programming for about five years. Everything I've done is for my work or friends, and it's all written in TAWK. TAWK is an enhanced AWK produced by Thompson Automation, which is defunct now, I think. It has a lot of features from other languages, including Perl. It's claim to fame is that it's compiled, not interpreted, and is vaguely efficient for a "scripting language."

I've extended TAWK with lots of additional library functions, but always fooled around with the idea of writing my own language on top of it. So I did. Gossip's syntax is sort of a blend of Pascal and C. It has flexible strings, enhanced patterns in which whitespace is ignored, all my favorite operators and looping constructs. arrays indexed by strings, multiple-value returns, and other goodies. And, of course, a neat library of functions, including a printf() replacement called format(), a la Common Lisp format.

It's missing lots of things because TAWK won't support them. For example, if I wrote a language from scratch, it would be an expression language: every construct is an expression that returns values. It also has no condition system, since TAWK has no captability for that. It has no objects, mostly because I'm not much of an object guy. However, if I did write a language from scratch, I'd probably make it pure object-oriented. Go figure.

Hey, if Jules can write Jovial, I can write Gossip!

Edited to add: I forgot to mention that Gossip has a full macro facility a la IBM Assembler H. There are two types of programmers: Those who write hairy macros and those who don't.

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 08:30 AM   #23
Mike
New Blood
 
Join Date: Aug 2003
Posts: 1
Quote:
Originally posted by Paul C. Anagnostopoulos
You have no idea how much time I have or have not spent learning Perl. Now I ask you again: What are the $, @, % symbols, and what are they called? When I ask what they are, I'm not asking what they do; I know that. I'm asking what kind of entity they are.

~~ Paul
In perl, they are called sigils.

http://dictionary.reference.com/search?q=sigil

So I guess they are a magicial entity.
Mike is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 10:14 AM   #24
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
Yes, magical character is a good term. To quote Programming Perl, by Wall et al:
Quote:
... these types of variables are also preceded by funny characters.
~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 12:52 PM   #25
jnelso99
Critical Thinker
 
Join Date: Jun 2003
Posts: 444
The best computer language that I know of is one with which I can get a job.

I've used C, C++, VB, TCL, and Java in a professional context, and C# on my own. Each one has its place, but I like C++ best, even though it has those nasty pointers in it (which still throw me for a loop every now and then). TCL is/was evil.

My view on OO is that if the app needs it, use it. If it doesn't need it, don't use it. I find that the use of classes tend to make the app easier for me to understand as a developer, especially if the app is a large-scale distributed app or complex 3d app.
jnelso99 is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 04:22 PM   #26
a_unique_person
Director of Hatcheries and Conditioning
 
a_unique_person's Avatar
 
Join Date: Jul 2002
Location: Mt Disappointment
Posts: 33,466
I have been programming for many years, also. Turbo-pascal, Delphi, Cobol, Rexx, Assembler (IBM), CLIST, ABAP, C, Basic, Shell Script, AWK.

One thing that annoys me no end is the loop. I cannot see any need for it, and it is often the cause of bugs. While reading up on functional languages, I was introduced to the concept of applying a function to an array of data. Makes much more sense to me. Iterating over an array is just monkey work.

OO is a good idea that has been badly thought out. Like I asked in the Database debunking thread, why hierarchical? The relational database still rules, the OO DB has died the inevitable death. This is because the OO abstraction of the hierarchy has been proven to be a dead one for any ongoing, developing information system. You get a hierarchy set in concrete, then you cannot change it. (Not without having to go through a lot of pain. I now know what they mean by "refactoring".

Relational, with it's denormalised data, can cope with any new addition to the scope of it's data, without having to junk the whole thing and rebuild everything, or have to depend on more and more pointers in alternate trees having to be built.

I have to go with the idea behind the dbdebunk web site, that the data should be dealt with first, after that comes the programming.

SQL was a good first attempt at a data programming language, but it is flawed. I look forward to seeing what they can do with the next generation data language, D, which is described in The Third Manifesto, http://www.thethirdmanifesto.com The product Dataphor is supposed to be based on that. http://www.dataphor.com. I have just downloaded the public beta, so I have not had a chance to see if it is worth it or not.
__________________
Continually pushing the boundaries of mediocrity.
Everything is possible, but not everything is probable.
For if a man pretend to me that God hath spoken to him supernaturally, and immediately, and I make doubt of it, I cannot easily perceive what argument he can produce to oblige me to believe it. Hobbes
a_unique_person is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 04:39 PM   #27
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
AUP said:
Quote:
One thing that annoys me no end is the loop. I cannot see any need for it, and it is often the cause of bugs. While reading up on functional languages, I was introduced to the concept of applying a function to an array of data. Makes much more sense to me. Iterating over an array is just monkey work.
It would be interesting to see some sort of study comparing loop programming with functional programming. Functional programming may sometimes win with fewer bugs, but how often will it win with efficiency?

Also, check out a large, complex loop, perhaps nested, and then code it functionally. Not necessarily easier.

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 04:51 PM   #28
roger
Penultimate Amazing
 
roger's Avatar
 
Join Date: May 2002
Location: Mountain View, CA
Posts: 11,062
hmm, speaking only from my own experience, I can't remember many bugs that I've written due to mismanaging loops. I do use the STL functional calls when appropriate and when I think of it (for_each), but I've never found loops to be a great stumbling block (compared to things like pointers, which I now try to eschew as much as possible).
roger is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 05:08 PM   #29
a_unique_person
Director of Hatcheries and Conditioning
 
a_unique_person's Avatar
 
Join Date: Jul 2002
Location: Mt Disappointment
Posts: 33,466
I think that pointers are just another case of a loop, really.

As for complex loops, I think it is better to select the data up front that you wish to work on, using, say, SQL, then just apply the function to the resulting set.
__________________
Continually pushing the boundaries of mediocrity.
Everything is possible, but not everything is probable.
For if a man pretend to me that God hath spoken to him supernaturally, and immediately, and I make doubt of it, I cannot easily perceive what argument he can produce to oblige me to believe it. Hobbes
a_unique_person is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 05:13 PM   #30
a_unique_person
Director of Hatcheries and Conditioning
 
a_unique_person's Avatar
 
Join Date: Jul 2002
Location: Mt Disappointment
Posts: 33,466
That is, what we really need is the concept of the table at a programming level.
__________________
Continually pushing the boundaries of mediocrity.
Everything is possible, but not everything is probable.
For if a man pretend to me that God hath spoken to him supernaturally, and immediately, and I make doubt of it, I cannot easily perceive what argument he can produce to oblige me to believe it. Hobbes
a_unique_person is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 07:09 PM   #31
epepke
Philosopher
 
epepke's Avatar
 
Join Date: Oct 2003
Posts: 7,953
Quote:
Originally posted by arcticpenguin

I've spent quite a bit more than 10 minutes on it, and it is ridiculous. The language is inconsistent. The scientific programming community is turning to python.
Perl is a hacking language. I find it hard to imagine it being used in scientific computing, but there are things it excels at.
epepke is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 07:16 PM   #32
epepke
Philosopher
 
epepke's Avatar
 
Join Date: Oct 2003
Posts: 7,953
Quote:
Originally posted by Paul C. Anagnostopoulos
AUP said:
It would be interesting to see some sort of study comparing loop programming with functional programming. Functional programming may sometimes win with fewer bugs, but how often will it win with efficiency?
Quite a lot of the time, actually. The Scheme standard requires tail recursion to work without using any extra memory, and many other functional languages have also adopted this idea.

Properly compiled functional code, using continuations rather than the stack, actually looks a lot more like tight assembly language than does C.

Of course, nobody cares, but still.
epepke is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 1st December 2003, 08:07 PM   #33
a_unique_person
Director of Hatcheries and Conditioning
 
a_unique_person's Avatar
 
Join Date: Jul 2002
Location: Mt Disappointment
Posts: 33,466
Quote:
Originally posted by epepke



Of course, nobody cares, but still.
I care. I just want to learn a new programming language I can stick to. One that removes a lot of the inconsistencies of procedural programming. And has a built in abstraction for the relational database model.
__________________
Continually pushing the boundaries of mediocrity.
Everything is possible, but not everything is probable.
For if a man pretend to me that God hath spoken to him supernaturally, and immediately, and I make doubt of it, I cannot easily perceive what argument he can produce to oblige me to believe it. Hobbes
a_unique_person is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 2nd December 2003, 05:30 AM   #34
Samus
space hunter
 
Join Date: Dec 2002
Posts: 1,003
Quote:
mindless: im interested to hear what your views are on Java.
I don't know if this was directed at Paul, or everyone, so I'll respond.

I program in Java for a living. I happen to like it. In addition to being fairly simple to pick up (especially coming off of C++), they have published their API in a very simple, easy-to-browse format on the web. And, by formatting your class and method comments correctly, you too can generate HTML API documentation in one step. That is such a big deal to me, especially working on a project with a bunch of other programmers, because I don't have to wade through code to find the method name I'm looking for and its parameters.

I do wish Java had multiple inheritance, though. I've also heard about performance concerns about Java because you're not compiling your code into machine language. However, for any of the programming I've done, the non-GUI stuff runs seemingly just as fast as it would if I wrote it in C/C++. The GUI has a bit of lag time, depending on your computer's horsepower.

I have also done a bit of work in REXX, and I really liked it. Very easy to learn, quick, and the parsing capabilities are excellent.
Samus is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 2nd December 2003, 07:07 AM   #35
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
Quote:
Epepke said:
Of course, nobody cares, but still.
Sure we care, man! Scheme is great. I don't think the problem is lots of function calls, but rather the way large data sets are handled.

Quote:
AUP said:
I care. I just want to learn a new programming language I can stick to. One that removes a lot of the inconsistencies of procedural programming. And has a built in abstraction for the relational database model.
Try Scheme and/or Common Lisp.

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 2nd December 2003, 08:35 AM   #36
ceptimus
puzzler
 
Join Date: May 2003
Posts: 3,316
Whatever happened to Modular 2?

I wrote some quite big programs in FORTH at one time. Surprisingly easy once I got into it, but it configured my mind to work in reverse polish logic - which was bad for everyday life.

I like C now - I suppose I'm just used to it. I use the additional features of C++ sometimes, but I could happily live without them.
__________________

ceptimus is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 2nd December 2003, 09:12 AM   #37
epepke
Philosopher
 
epepke's Avatar
 
Join Date: Oct 2003
Posts: 7,953
Quote:
Originally posted by Paul C. Anagnostopoulos

Sure we care, man! Scheme is great. I don't think the problem is lots of function calls, but rather the way large data sets are handled.
I find a lot of people hate Scheme. I like it, but part of the reason for that is that I wrote an embedded Scheme for cinematic adventure game logic.

My "nobody cares" comment refers to the substantial prejudice against LISP-like languages back from the days when they really were poorly written and slow.
epepke is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 2nd December 2003, 09:30 AM   #38
epepke
Philosopher
 
epepke's Avatar
 
Join Date: Oct 2003
Posts: 7,953
Quote:
Originally posted by Stimpson J. Cat
Basically, if you need the kind of power and speed that a language like C gives you, and also want the advantages of an object oriented language, then I think that C++ is the way to go.
Objective C, on the other hand, is much more of a real O-O language along the lines of Smalltalk and still has C in it. It also has lightweight syntax and doesn't try to find fifteen thousand uses for the &.

But of course, in the industry, Objective C is mostly Mac and UN*X.
epepke is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 2nd December 2003, 02:15 PM   #39
Peskanov
Critical Thinker
 
Join Date: Dec 2002
Posts: 497
AUP,

Quote:
I have to go with the idea behind the dbdebunk web site, that the data should be dealt with first, after that comes the programming.

SQL was a good first attempt at a data programming language, but it is flawed. I look forward to seeing what they can do with the next generation data language, D, which is described in The Third Manifesto, http://www.thethirdmanifesto.com The product Dataphor is supposed to be based on that. http://www.dataphor.com. I have just downloaded the public beta, so I have not had a chance to see if it is worth it or not.
I found your views very interesting. I have been arguing with most friends about how much I dislike OO programming, and how SQL, which is the total oposite, seems so clean, understable and powerful instead.
It's interesting to see that from the so-called 4th an 5th generation languages, only SQL seems to have an important impact in todays's computing world.

As a games programmer I see how OO forces the programmers to repeat tons of code everywhere. Usually OO defenders says this is bad design. I can't believe it anymore, OO programs always grows terribly fast, transforming in spaguetty in very few time.
In the other hand, looking games code, many times I think:
"How good would be to have all this data normalized and just say:
SELECT Targets FROM Agents, Terrain WHERE Agents.Type=ORC AND Agents.Sector=Terrain.Sector AND Terrain.SelectedByUser=TRUE
,instead of the horrible mess we have there."

Certainly I have to take a look at D.
I was looking prolog and mercury a bit, but while they provide the functionality of SQL (and are of general purpose) they lack that clear sintax.
__________________
int i, j = 0xdeadbeef;
for (i=0;i<4000; i++)
((j = (j ^ ((j << 13) | ( j >> (32-13))))) & 1) ? printf ("\\") : printf ("/");
Peskanov is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 2nd December 2003, 05:55 PM   #40
Paul C. Anagnostopoulos
Nap, interrupted.
 
Paul C. Anagnostopoulos's Avatar
 
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
Quote:
Ceptimus asked:
Whatever happened to Modular 2?
Modula 2. Too formal. Turns people off.

Quote:
Epepke said:
My "nobody cares" comment refers to the substantial prejudice against LISP-like languages back from the days when they really were poorly written and slow.
Ah, right. It wasn't just the slowness, but also the lack of syntax. People love syntax. "Oh my, how am I ever going to balance all those parens?" Uh, get a pprogram editor.

If I was forced to eliminate all programming languages but one, Lisp would stay.

~~ Paul
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz

RIP Mr. Skinny
Paul C. Anagnostopoulos is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Reply

JREF Forum » General Topics » Computers and the Internet

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 11:53 AM.
Powered by vBulletin. Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
© 2001-2012, James Randi Educational Foundation. All Rights Reserved.

Disclaimer: Messages posted in the Forum are solely the opinion of their authors.