Jump to content
BrainDen.com - Brain Teasers
  • 0


Guest
 Share

Question

I first got interested in programming about 2 years ago, and ever since, I've been thinking about a perfect, all-encompassing programming language. Obviously this is not possible given the variety of paradigms and etc, but it gave me the thought: What programming language is the most elegant?

I've been leaning towards Lisp for many reasons:

  1. No difference between expressions and statements
  2. function notation for literally everything
  3. parenthetical syntax

I'd be interested to hear what others have to say.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

First of all, what exactly do you mean by elegant? Do you mean one that is like the nobles of programming languages? Or maybe the language that is best overall for the majority of projects?

Second, I haven't actually used any programming languages, but I am going to be learning Java this semester :D .

Link to comment
Share on other sites

  • 0

simple syntax: Lisp check, Whitespace check

high-level: Lisp check, Whitespace not-so-check

few built-ins: Lisp has corrupted itself over the years, but Whitespace check

object-oriented [i disagree with this category]

looks good: check, check

you can think in it: Can you think in any programming language? I think this is mostly a matter of experience, independent of the language. True for not just programming languages but linguistic languages too probably

Edited by unreality
Link to comment
Share on other sites

  • 0

simple syntax: Lisp check, Whitespace check

high-level: Lisp check, Whitespace not-so-check

few built-ins: Lisp has corrupted itself over the years, but Whitespace check

object-oriented [i disagree with this category]

looks good: check, check

you can think in it: Can you think in any programming language? I think this is mostly a matter of experience, independent of the language. True for not just programming languages but linguistic languages too probably

You don't think an elegant language should be object-oriented? :huh: The whole idea of object-oriented languages is to make them more in tune with how humans think and reason about the world. How more elegant can you get than that? :D

I admit I don't know Lisp and Whitespace, but I've heard from others that Lisp is a bit bracket crazy. (( :wacko: )) There are so many languages out there right now because they have been developed for different purposes. Many of the smaller languages have their own niches where they do their one specific thing very well and they don't really do much beyond that. As it stands, C++ is still the most general language in existence. It has the high-level, object-oriented stuff, while also still supporting much of its low-level C roots. It's also compiled so it runs faster than Java and other languages that branched off. Java is elegant in its own way in that it attempts to create a natural cross-platform language that can run everywhere.

The longer any language is around, the more modules and libraries it's going to accrue. C++ and Java are both somewhat bloated, largely because they both try to do everything. If you know them, then it makes them versatile, but trying to learn how to do something new in a high-level language like that can be cumbersome.

Elegance, like beauty, is in the eye of the beholder. I've always been drawn to C++ and Java largely because they are powerful and have capabilities not found in scripting languages (they also are the primary languages used in my job, so it helps to know them :P ). You can write a program to do almost anything in C++, even if there is a much simpler way to do it in another language. As a quick example off the top of my head:

Hello World:

C++


#include <iostream>


using namespace std;


int main() {

  cout << "Hello, World!" << endl;

  return(0);

}
Python

print "Hello, World!"

Python's much shorter (and Java's Hello World application is more cumbersome than C++ :lol: ), but like I said, each language has its own place where it does stuff better than other languages. If you need a general-purpose app with both high- and low-level capabilities, there's still no better language than C++ so far as I'm aware.

Link to comment
Share on other sites

  • 0

You don't think an elegant language should be object-oriented? :huh: The whole idea of object-oriented languages is to make them more in tune with how humans think and reason about the world. How more elegant can you get than that? :D

That's kind of the opposite of what the word "elegant" implies to me... elegant implies something more abstract and 'pure' rather than applied / simulating the real world as OOP is. Lisp is elegant IMO because of the way it's based on the lambda calculus and it's logically completely abstract. It's written in its own code

Python's much shorter (and Java's Hello World application is more cumbersome than C++ :lol: ), but like I said, each language has its own place where it does stuff better than other languages. If you need a general-purpose app with both high- and low-level capabilities, there's still no better language than C++ so far as I'm aware.

I agree that C++ is probably the most general/fastest/applicable language... but not elegant unless your definition of elegant is "utilitarian" which is fine. Have you done anything in Perl? that's the most utilitarian thing I've come across. It tries to accomodate practically anything haha. Which is both its strength and probably its downfall for being so "loose"

Link to comment
Share on other sites

  • 0

python and lua are my personal favorites, i never could quite get the feel of lisp.

while both scripting languages, i like them because,

a) easy to understand and work in.

b) block like struture with high funtionality.

c) python, while not quite so elegant, handles difficult problems in a breeze, lua is more elegant, but a bit more challenging to program in.

python explictly has like 10 types, integer, long integer, float, string, tuple, list, dictionary, and class.

lua only has 3 types, tables (dictionaries in python), float, string.

i like python slightly more as even though it's a bit bloated, you can easily do precicely what you want with little fuss.

lua, while more challanging to code in produces faster results.

Link to comment
Share on other sites

  • 0

Like UR said, I think of elegance as more of a conceptual pureness than an ability to accomplish a variety of tasks easily. This might seem like an impractical approach, but that's why I said I was daydreamingtongue.gif.

@phillip - the variety of types in python may result in increased functionality, but IMHO it detracts from its elegance. Lisp, for example, does not use types AFAIK.

@dawh - I agree that as time goes by, more libraries/modules are written for a language, but I'm not talking about that.What I mean by built-ins are types, functions, and other features that are automatically able to be used without an include or import statement, or compiler directive.

Link to comment
Share on other sites

  • 0

I saw a funny comic strip representing the different programming languages by report. Like for C++ it said "This is 400 pages of useless information" and for HTML it said "I am holding a flowerpot". I understand a bit of programming, so I laughed.

Link to comment
Share on other sites

  • 0

My 2 cents.

I started programming way back when, using languages such as PL/I, REXX, various SCRIPT shells, etc. Since I turned to PC programming, I've tried several languages with varying degrees of satisfaction.

I find JAVA messy, but have friends who love it. I've written a few macro's for EXCEL/OpenOffice spreadsheet and didn't much like it to start, but must admit that it grew on me.

I'm currently doing most of my new stuff using AutoHotKey. I wouldn't consider it 'elegant' (getting used to how-to-assign-variables is a PitA) , but have got to really like it - the further I dig, the more function it seems to have. (and it's FREE!)

I think what I'm saying is this. Programming language is a personal preference. Some languages you'll like immediately. Some might grow on you. Some you'll never like. But try as many as you can.

Edited by fabpig
Link to comment
Share on other sites

  • 0

Further to the above about AutoHotkey:

It starts up - and runs in the background - when you start your PC. This is to enable the Scripts to run (it's considered non-intrusive). Go to MSCONFIG to disable the startup.

It's portable: AutoHotkey provide a compiler which will convert your Scripts to an EXE file which will run on any PC, even if AutoHotkey isn't installed on it.

And, no, I'm not an AHK salesman! (if you can sell something that's free) I just like it.

Link to comment
Share on other sites

  • 0

I think the code that causes the least amount of power to be dissipated by the circuitry of the machine and/or takes the least amount of processing time are the real measures of elegance.

Regarding the notion of an all-encompassing programming language, I understand that there are different languages that loan themselves to different tasks, but I think that at some point a "family" of languages will come along that is syntactically similar, and hopefully won't end lines with semi-colons ;-(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...