| JREF Homepage | Swift Blog | Events Calendar | $1 Million Paranormal Challenge | The Amaz!ng Meeting | Useful Links | Support Us |
![]() |
|
|
|
|||||||
| 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. |
|
|
#1 |
|
Nap, interrupted.
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 |
|
|
|
|
|
#2 |
|
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. |
|
|
|
|
|
#3 |
|
Nap, interrupted.
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 |
|
|
|
|
|
#4 |
|
Summer worshipper
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
|
|
|
|
|
|
#5 |
|
Banned
Join Date: Sep 2002
Posts: 26,985
|
You know as well as I do, Paul, that DCL is the only programming language...
|
|
|
|
|
#6 |
|
Graduate Poster
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. |
|
|
|
|
|
#7 |
|
Nap, interrupted.
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 |
|
|
|
|
|
#8 |
|
Nap, interrupted.
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 |
|
|
|
|
|
#9 |
|
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. |
|
|
|
|
|
#10 |
|
Nap, interrupted.
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 |
|
|
|
|
|
#11 |
|
Illuminator
Join Date: Nov 2002
Posts: 3,607
|
Quote:
What's it like? |
|
|
|
|
#12 |
|
Banned
Join Date: Sep 2002
Posts: 26,985
|
Quote:
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! |
|
|
|
|
#13 |
|
New Blood
Join Date: Feb 2002
Posts: 21
|
Quote:
|
|
|
|
|
#14 |
|
Muse
Join Date: Oct 2002
Location: Vancouver
Posts: 991
|
I'm fond of esoteric programming languages, especially Brainf*ck.
Code:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<< 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
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 |
|
|
|
|
|
#15 |
|
Illuminator
Join Date: Nov 2002
Posts: 3,607
|
Quote:
(It has only six periods, none within a bracket loop, so how can it print more than that number of characters?) |
|
|
|
|
#16 |
|
Summer worshipper
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
|
|
|
|
|
|
#17 |
|
Banned
Join Date: Sep 2002
Posts: 26,985
|
Quote:
|
|
|
|
|
#18 |
|
BOFH
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. |
|
|
|
|
#19 |
|
woo ban clan
Join Date: Sep 2002
Posts: 5,717
|
Quote:
|
|
__________________
The power of accurate observation is frequently called cynicism by those who don't have it. - George Bernard Shaw |
|
|
|
|
|
#20 |
|
Nap, interrupted.
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
|
Neutron Jack said:
Quote:
El Greco said:
Quote:
Penguin said:
Quote:
~~ Paul |
|
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz RIP Mr. Skinny |
|
|
|
|
|
#21 |
|
Muse
Join Date: Oct 2002
Location: Vancouver
Posts: 991
|
Quote:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<< +++++++++++++++.>.+++.------.--------.>+.>.
|
|
__________________
"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 |
|
|
|
|
|
#22 |
|
Nap, interrupted.
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
|
69dodge asked:
Quote:
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 |
|
|
|
|
|
#23 |
|
New Blood
Join Date: Aug 2003
Posts: 1
|
Quote:
http://dictionary.reference.com/search?q=sigil So I guess they are a magicial entity. |
|
|
|
|
#24 |
|
Nap, interrupted.
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:
|
|
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz RIP Mr. Skinny |
|
|
|
|
|
#25 |
|
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. |
|
|
|
|
#26 |
|
Director of Hatcheries and Conditioning
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 |
|
|
|
|
|
#27 |
|
Nap, interrupted.
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
|
AUP said:
Quote:
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 |
|
|
|
|
|
#28 |
|
Penultimate Amazing
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).
|
|
|
|
|
#29 |
|
Director of Hatcheries and Conditioning
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 |
|
|
|
|
|
#30 |
|
Director of Hatcheries and Conditioning
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 |
|
|
|
|
|
#31 |
|
Philosopher
Join Date: Oct 2003
Posts: 7,953
|
Quote:
Perl is a hacking language. I find it hard to imagine it being used in scientific computing, but there are things it excels at.
|
|
|
|
|
#32 |
|
Philosopher
Join Date: Oct 2003
Posts: 7,953
|
Quote:
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. |
|
|
|
|
#33 |
|
Director of Hatcheries and Conditioning
Join Date: Jul 2002
Location: Mt Disappointment
Posts: 33,466
|
Quote:
|
|
__________________
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 |
|
|
|
|
|
#34 |
|
space hunter
Join Date: Dec 2002
Posts: 1,003
|
Quote:
![]() 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. |
|
|
|
|
#35 |
|
Nap, interrupted.
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
|
Quote:
Quote:
~~ Paul |
|
__________________
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. ---Susan Ertz RIP Mr. Skinny |
|
|
|
|
|
#36 |
|
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. |
|
__________________
|
|
|
|
|
|
#37 |
|
Philosopher
Join Date: Oct 2003
Posts: 7,953
|
Quote:
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. |
|
|
|
|
#38 |
|
Philosopher
Join Date: Oct 2003
Posts: 7,953
|
Quote:
But of course, in the industry, Objective C is mostly Mac and UN*X. |
|
|
|
|
#39 |
|
Critical Thinker
Join Date: Dec 2002
Posts: 497
|
AUP,
Quote:
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 ("/"); |
|
|
|
|
|
#40 |
|
Nap, interrupted.
Join Date: Aug 2001
Location: a little toolshed
Posts: 18,632
|
Quote:
Quote:
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|