Best General Purpose Programming Language

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

What is the best general purpose programming language?

C
7
14%
C++
22
45%
Java
6
12%
Pascal
0
No votes
C# .NET
4
8%
J# .NET
0
No votes
VC++ .NET
0
No votes
VB .NET
0
No votes
ASM
1
2%
Other (Please Specify)
9
18%
 
Total votes : 49

Best General Purpose Programming Language

Postby Daem0hn » Wed Mar 14, 2007 11:38 am UTC

In your opinion what is the best general purpose programming language.
01 01 was a race horse, 10 10 was 01 10, 01 01 01 01 race, 10 10 01 01 10

-- Mike (19/Male)
User avatar
Daem0hn
 
Posts: 324
Joined: Wed Feb 14, 2007 2:28 pm UTC
Location: Perth, Western Australia (IATA: PER)

Postby Tractor » Wed Mar 14, 2007 1:41 pm UTC

Erm, what do you mean by 'general purpose'?
9 x 6 = 42

Note: Randall kicks ass.
User avatar
Tractor
 
Posts: 2467
Joined: Mon Jan 08, 2007 6:17 pm UTC
Location: no

Postby evilbeanfiend » Wed Mar 14, 2007 1:48 pm UTC

to be honest nowadays there is not much difference between a 'scripting' language and a 'real programming' language but i assume he means similar to the listed languages i.e. not a scripting language or a domain specific language e.g. perl is often considered a scripting language and SQL is a domain specific language
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby Tractor » Wed Mar 14, 2007 1:58 pm UTC

No, I mean what general purpose are we programming towards? Are we doing some Windows GUI development? Are we writing a quick number cruncher? Something completely different?

I know a few languages, and certain ones are best for certain tasks.
9 x 6 = 42

Note: Randall kicks ass.
User avatar
Tractor
 
Posts: 2467
Joined: Mon Jan 08, 2007 6:17 pm UTC
Location: no

Postby evilbeanfiend » Wed Mar 14, 2007 2:06 pm UTC

a general purpose language should be able to do either task (althoug hnot necessarily equally well) i.e. he doesnt want languages like SQL that can do DB queries but nothing else, he wants stuff like assembler which you can hack into anything, even if it ain't the language you'd chose for most stuff.
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby Daem0hn » Wed Mar 14, 2007 2:48 pm UTC

evilbeanfiend wrote:a general purpose language should be able to do either task (althoug hnot necessarily equally well) i.e. he doesnt want languages like SQL that can do DB queries but nothing else, he wants stuff like assembler which you can hack into anything, even if it ain't the language you'd chose for most stuff.


well put.

By general purpose i meant a language that you can write a number cruncher in, or a GUI app, or a networking app, so i guess:

"Which language is jack of all trades but master at none".

Personally i believe Java, C# and C++, i chose C# as it has the most extensive API library (although this is also due to the platform for which it was designed). Although i do find that i do most of my hobby programming projects in C++ as i mainly work on Linux (gentoo). Most of my paid programs are done in C# as it integrates well with windows.
01 01 was a race horse, 10 10 was 01 10, 01 01 01 01 race, 10 10 01 01 10

-- Mike (19/Male)
User avatar
Daem0hn
 
Posts: 324
Joined: Wed Feb 14, 2007 2:28 pm UTC
Location: Perth, Western Australia (IATA: PER)

Postby Stig Hemmer » Wed Mar 14, 2007 3:11 pm UTC

Common Lisp. Hands down.
This is not true.
Stig Hemmer
 
Posts: 29
Joined: Wed Feb 28, 2007 4:46 pm UTC
Location: Trondheim, Norway

Postby Andrew » Wed Mar 14, 2007 3:15 pm UTC

I always fire up C# for that kind of thing.

I like .NET's error handling and debug features, and C# is the only .NET language I've really used -- I'm given to understand they're all essentially the same anyway, but with different commands and syntaxes. If something goes wrong it's so much easier to locate. Also, writing a program with managed arrays and pre-defined String structures is so much easier and quicker than... well, than programming properly, so that's what I tend to do unless I really need some serious execution speed (which is never).
User avatar
Andrew
 
Posts: 619
Joined: Tue Jan 02, 2007 9:59 pm UTC
Location: Manchester, UK

Postby evilbeanfiend » Wed Mar 14, 2007 3:18 pm UTC

Stig Hemmer wrote:Common Lisp. Hands down.


which is on the scripting poll instead for some reason? possible emacs lisp was meant instead as a scripting language? though as i said before i don't believe there is a real distinction between scripting and real languages anymore anyway
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby Yakk » Wed Mar 14, 2007 3:56 pm UTC

Of the above languages, only one could be used viably when generating kernel-level code, and can (within the compler) generate non-linear amounts of output machine instructions from a linear amount of program code.

And that would be C++.

In another interpritation, if you banned all other programming languages except for 1, C++ would be the best choice from the above list for that 1 language.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby parsonsb » Wed Mar 14, 2007 3:58 pm UTC

brainfuck all the way babieeeee
User avatar
parsonsb
301st Spartan (Overslept)
 
Posts: 229
Joined: Tue Jan 23, 2007 10:17 pm UTC

Postby evilbeanfiend » Wed Mar 14, 2007 4:05 pm UTC

parsonsb wrote:brainfuck all the way babieeeee


whats the best esoteric programming language poll?

oh and i'd say INTERCAL
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby elminster » Wed Mar 14, 2007 6:02 pm UTC

When it comes to "best" it always depends on your intended usage and requirements, etc

Way i understand it:
C++:
Alot of prewritten code around, Alot of support available, Allows high level of control over actions, Popular language. Bad points, easily broken code, has alot more complexities, longer development times.

Java:
Alot of prewritten code around, Alot of support available, Easier code, multi-platform (code runs alot of os's), Popular language, c++ based so examples can be easily translated. Bad points, its run via a virtual machine making it awefully slow for any large amount of processing.

C# .NET - Some hail this as the new C++, it keeps alot of c++ similarities, but majorly redsigned to be easier to work with an more logical approach to things. Also the whole .NET support

J# .NET - Microsofts rippoff of java put in .NET

VB .NET - Alot of people refer to VB as a "learner" language, since its simple language, although hides alot of useful functionality, barely used for major development. Its more of a RAD (rapid application development), since you can whip up a program in minutes.

ASM - Highly complex, very long development times, as optimised as possible, complete control. Mainly used for very small programs, drivers, direct hardware interaction where needed (c++ allows direct input of asm).


Id say the "jack of all trades" would be C++,
Java goes out the window because its slow, ASM takes too long to develop, VB. NET doesnt give enough control, J# .NET doesnt provide that much benefit(Although viable if you already learnt java), C# is quite a high contender (2nd if you asked me).

p.s Most likely i forgot to mention alot of things, but the summary is all that was needed really.
Srry for the time waste :?
Image
elminster
 
Posts: 1382
Joined: Mon Feb 26, 2007 1:56 pm UTC
Location: London, UK, Dimensions 1 to 42.

Postby SpitValve » Wed Mar 14, 2007 6:35 pm UTC

Fortran rejected yet again... hmm...
User avatar
SpitValve
Not a mod.
 
Posts: 5105
Joined: Tue Sep 26, 2006 9:51 am UTC
Location: I got Seoul

Postby evilbeanfiend » Wed Mar 14, 2007 6:38 pm UTC

SpitValve wrote:Fortran rejected yet again... hmm...


its pretty awesome performance wise.
to memory bad memories for me to vote for it though. which column does the & go in again?
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby SpitValve » Wed Mar 14, 2007 6:40 pm UTC

evilbeanfiend wrote:
SpitValve wrote:Fortran rejected yet again... hmm...


its pretty awesome performance wise.
to memory bad memories for me to vote for it though. which column does the & go in again?


I use $. Column 5. I think emacs figures out that sort of thing for you nowadays... and ctrl-c-ctrl-r is so useful for giving you your 70-character ruler :)
User avatar
SpitValve
Not a mod.
 
Posts: 5105
Joined: Tue Sep 26, 2006 9:51 am UTC
Location: I got Seoul

Postby syntaxers » Wed Mar 14, 2007 7:18 pm UTC

If I need to do intense computer-science problems, java is the most straightforward (fewest subtle nuances), and when I just need something to print out quickly (number crunching) I go for PHP or VB.

But when I need an ad-hoc programming solution when a computer is unavailable or unallowed, I use TI-BASIC on my ti-83. (I finally got recursive algorithms to work using TI-BASIC!)
User avatar
syntaxers
 
Posts: 19
Joined: Wed Oct 25, 2006 10:36 pm UTC
Location: Ann Arbor, MI, USA

Postby elminster » Wed Mar 14, 2007 8:15 pm UTC

syntaxers wrote:If I need to do intense computer-science problems, java is the most straightforward (fewest subtle nuances), and when I just need something to print out quickly (number crunching) I go for PHP or VB.

But when I need an ad-hoc programming solution when a computer is unavailable or unallowed, I use TI-BASIC on my ti-83. (I finally got recursive algorithms to work using TI-BASIC!)

Java runs virtually, the syntax maybe simpler etc, but its certianlly not a performance based language.

Fortran does have very high performance, especially for mathmatical and scientific calculations, although theres a number of things to help c++ achieve relatively the same in a number of cases, and more in a few (google Blitz++).

Php is a C++ based language for pre-processing system for dynamic web pages, not for number crunching either, the php system has a default a shortish maximum processing time (30seconds) to stop things overusing it.

VB performance is relatively unoptimised solution (although quick to make), since it doesnt allow low level control over the data. Its suitable for small tasks, but not something like protein folding for example.
Image
elminster
 
Posts: 1382
Joined: Mon Feb 26, 2007 1:56 pm UTC
Location: London, UK, Dimensions 1 to 42.

Postby Torn Apart By Dingos » Wed Mar 14, 2007 10:10 pm UTC

This is an awful poll. Where the hell are Haskell, O'Caml and Lisp?
User avatar
Torn Apart By Dingos
 
Posts: 817
Joined: Thu Aug 03, 2006 2:27 am UTC

Postby simen » Wed Mar 14, 2007 10:33 pm UTC

Torn Apart By Dingos wrote:This is an awful poll. Where the hell are Haskell, O'Caml and Lisp?

Every poll I've seen on this subject has been horrible. There are simply too many programming languages for stuff like this. Either you include all the languages and have complete chaos, or you get flamed by the guy who still uses COBOL.
From the top of my head, I see two approaches to this: Either we discuss the subject, and then make a list of all relevant languages to be voted over, or we have a poll on which paradigm you prefer.
Random driveby fact: In my language (norwegian), J#, if interpreted as a note, would be pronounced jizz.
User avatar
simen
 
Posts: 165
Joined: Wed Feb 21, 2007 7:02 pm UTC

Postby Goplat » Wed Mar 14, 2007 11:45 pm UTC

Torn Apart By Dingos wrote:This is an awful poll. Where the hell are Haskell, O'Caml and Lisp?


I would not consider them to be general purpose. There's a lot of things that just can't be done practically in the languages you listed. For example, try writing a program to calculate an MD5-sum in one of them.
Goplat
 
Posts: 490
Joined: Sun Mar 04, 2007 11:41 pm UTC

Postby dan » Thu Mar 15, 2007 12:50 am UTC

Goplat wrote: For example, try writing a program to calculate an MD5-sum in one of them.
I think somebody already has: http://web.comlab.ox.ac.uk/oucl/work/ian.lynagh/md5/
User avatar
dan
 
Posts: 62
Joined: Wed Aug 09, 2006 12:55 am UTC

Postby Yakk » Thu Mar 15, 2007 1:26 am UTC

As a note, that haskall implementation has roughly the same line-count as the first MD5 C++ implementation I googled.

Note that Haskall is a very procedural functional language. The main difference, from talking to a Haskallite, is how Haskall is formally defined.

This is not a small advantage.

But I'm not a Haskall hacker. The only Haskall hacker I know personally is a very smart cookie. Of course, he also had some fun generating a rational economic justification to buy a lottery ticket.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby EvanED » Thu Mar 15, 2007 2:49 am UTC

Stig Hemmer wrote:Common Lisp. Hands down.


I wish I knew Lisp well enough to make a statement like that. I think that this summer I'm gonna work on a project in Lisp though.

I voted C++. Java bugs me because, coming from C++, I feel constrained. I constantly feel like I should be able to do something I can't. C# is better in this regard, and if it were cross-platform without Mono I might vote for it over C++.

The problem with C++ is that learning it is a pain. There are enough edge cases to make it horrendous. Once you know it, it's a great language (though still occasionally very obnoxious), but getting to that point is next to impossible.

But besides Lisp (which is in a class of its own in this regard) and C++, show me another language where you can almost create reasonably powerful new syntax. C++ doesn't have strong typedefs? You can make them, and create a macro, say, STRONG_TYPEDEF(int, myint) that will do it. C++ doesn't have Lambda functions? Go ahead; you can make them. (Show me another language that doesn't give you lambda functions as a language feature but gives you enough power to create even a very limited form of them.)
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby warriorness » Thu Mar 15, 2007 4:47 am UTC

elminster wrote:Java:
Alot of prewritten code around, Alot of support available, Easier code, multi-platform (code runs alot of os's), Popular language, c++ based so examples can be easily translated. Bad points, its run via a virtual machine making it awefully slow for any large amount of processing.


As a person whose only major CS experience is in Java, I have wondered about this. Would Java be more popular if it were a pure-compilation language (as opposed to a mix between compilation and interpretation)? What prevents it from being a fully-compilable language - it's essentially the same syntax-wise as C++.
Iluvatar wrote:Love: Gimme the frickin' API.
yy2bggggs, on Fischer Random chess wrote:Hmmm.... I wonder how how a hypermodern approach would work
User avatar
warriorness
Huge Fucking-Lazer
 
Posts: 1610
Joined: Thu Dec 28, 2006 10:33 am UTC
Location: CMU, Pittsburgh, PA, USA

Postby EvanED » Thu Mar 15, 2007 5:01 am UTC

warriorness wrote:
elminster wrote:Java:
Alot of prewritten code around, Alot of support available, Easier code, multi-platform (code runs alot of os's), Popular language, c++ based so examples can be easily translated. Bad points, its run via a virtual machine making it awefully slow for any large amount of processing.


As a person whose only major CS experience is in Java, I have wondered about this. Would Java be more popular if it were a pure-compilation language (as opposed to a mix between compilation and interpretation)? What prevents it from being a fully-compilable language - it's essentially the same syntax-wise as C++.


Nothing really. In fact, GCJ does it. With the recent open sourcing of Java, you can probably expect more compiled forms to pop up eventually.
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby bitwiseshiftleft » Thu Mar 15, 2007 6:32 am UTC

It's hard to define a general-purpose programming language. How general should the purpose be? I suppose if I could only have one language from this list for the rest of my life, it would have to be C or C++. They both run pretty much everywhere (whereas Java does not run on embedded systems or in performance-critical software libraries). C++ is higher-level, but kernels and such are written in C for cleanliness and speed.

As for the others, let's see. Four Windows-only languages. One special-purpose language, if you even call it that (ASM isn't a programming language, it's a family of programming languages, and nobody uses it for general-purpose anything). One defunct, escaped teach-me-to-program language (Pascal). One language that, for general purposes, is strictly superseded another on the list (C < C++ except for simple programs and hardcore systemsy stuff).

So that leaves, uh, C++ vs Java. And given that Java is based on C++, that's pretty narrow.

So, how about Python or Ruby? Or Perl? Or something functional? LISP, O'Caml and Haskell are all pretty general-purpose, unless we're requiring that it be easy to write Windows GUI apps, and then you can always use the foreign-function interface. People have written databases, webservers, business applications, command-line tools and so on in all these languages. They also all have graphical toolkits, so you can write GUI apps in them, albeit not as easily as in C#.net.

Also, none of the programs listed have interactive interpreters. If I want to puzzle some problem out, I don't usually want to recompile between changes; I'll fire up Python or O'Caml or Haskell (or Maple or Mathematica or Magma, but those aren't not general purpose) and mess with it.
User avatar
bitwiseshiftleft
 
Posts: 287
Joined: Tue Jan 09, 2007 9:07 am UTC
Location: Stanford

Postby Torn Apart By Dingos » Thu Mar 15, 2007 7:14 am UTC

Yakk wrote:Note that Haskall is a very procedural functional language. The main difference, from talking to a Haskallite, is how Haskall is formally defined.

What do you mean by that? It's purely functional; how could it be any less procedural? Give an example of a less procedural functional language.
User avatar
Torn Apart By Dingos
 
Posts: 817
Joined: Thu Aug 03, 2006 2:27 am UTC

Postby torne » Thu Mar 15, 2007 12:40 pm UTC

Python, fo' sure. It's my beloved Smalltalk all prettied up and able to use modern libraries. :)
User avatar
torne
 
Posts: 98
Joined: Wed Nov 01, 2006 11:58 am UTC
Location: London, UK

Postby EvanED » Thu Mar 15, 2007 1:09 pm UTC

bitwiseshiftleft wrote:C++ is higher-level, but kernels and such are written in C for cleanliness and speed.


I don't know about that. FWIW, it sometimes seems like kernels are written in C because That's How It's Done (TM). (And also for portability reasons. There are *still* a lot of sucky C++ compilers out there, so actually taking advantage of some of C++'s features can restrict where you can port your programs to. Part of this is the C++ standard's fault for having a lot of utter crap.) Some types of Windows drivers use C++, and I've often thought that it would be an interesting project if I had a spare year to port Linux to C++. (This is inspired by Linus saying that it's "bloody stupid" to write C++ kernel code, which I don't buy.)

Then again, as you can see above, I'm a big C++ fan. ;-)
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby evilbeanfiend » Thu Mar 15, 2007 1:21 pm UTC

http://www.unixlite.org/

there is very little valid c that isn't valid c++, typically the same construct in c and c++ will compile to the same instructions when using the same compiler (they typically a lot of the back end)
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby dr7 » Thu Mar 15, 2007 2:14 pm UTC

I am devastated by the lack of support for the love of my life, C.

You have all crushed this poor man's heart. I hope you're happy.
dr7: king of the wicker people
User avatar
dr7
 
Posts: 59
Joined: Mon Feb 12, 2007 3:17 am UTC
Location: Right here. You can't see me?

Postby WhiteRabbit » Thu Mar 15, 2007 2:40 pm UTC

I voted C, but I would have to say Obj-C is better than C++.
User avatar
WhiteRabbit
Railgun of Infinite Patience
 
Posts: 242
Joined: Fri Oct 20, 2006 2:30 pm UTC

Postby Yakk » Thu Mar 15, 2007 2:41 pm UTC

Torn Apart By Dingos wrote:
Yakk wrote:Note that Haskall is a very procedural functional language. The main difference, from talking to a Haskallite, is how Haskall is formally defined.

What do you mean by that? It's purely functional; how could it be any less procedural? Give an example of a less procedural functional language.


I am simply relaying what I understand from how the Haskalite explained it.

A functional language is determined by how we use it. Haskal has the concept of a monad(sp?), which carries with it an implicit state that can be as large as one wants. Making this monad as large as (say) the almost the entire state of your program is apparently easy. Once you have implicitly passed state between sequential statements, those statements can be viewed as a series of processes acting on the state rather than a series of functional filters that implicitly pass the state.

Note that C++ is, under certain views, a functional language. For example, it is admitted to at least one functional language competition, and quite often wins (once again, hearsay from the friend who programs in Haskall). Each statement in C++ is simply a function that takes the entire state of your machine and implicitly passes it to the next statement.

'course, I may have misunderstood how Haskall works. :)
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby evilbeanfiend » Thu Mar 15, 2007 2:55 pm UTC

c++ templates are a functional language. obviously you can also fake bits of functional languages without templates as well e.g. function pointers.
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby EvanED » Thu Mar 15, 2007 3:26 pm UTC

evilbeanfiend wrote:c++ templates are a functional language.


With the most horrendous syntax ever... ;-)
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby evilbeanfiend » Thu Mar 15, 2007 3:32 pm UTC

EvanED wrote:
evilbeanfiend wrote:c++ templates are a functional language.


With the most horrendous syntax ever... ;-)


to be honest its not that different from lisp with <> instead of (), but yes c++ syntax is pretty contorted in places as its had all these extra features added but still maintains backward compatibility
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby torne » Thu Mar 15, 2007 4:56 pm UTC

EvanED wrote:I don't know about that. FWIW, it sometimes seems like kernels are written in C because That's How It's Done (TM). (And also for portability reasons. There are *still* a lot of sucky C++ compilers out there, so actually taking advantage of some of C++'s features can restrict where you can port your programs to. Part of this is the C++ standard's fault for having a lot of utter crap.)

The Symbian mobile phone OS (previously known as EPOC32, the Psion PDA OS) has a kernel written in C++. It does indeed suffer from the problem of sucky C++ compilers, though mostly those are related to how much C++ compilers sucked many years ago when the original EPOC32 was being written, not how much they suck now. For example, until recently Symbian did not support C++ exceptions, instead using a different mechanism, because 'back in the day' C++ exceptions had not yet been standardised and compilers did not implement them consistently. :)

I'm a Symbian kernel developer, so I'm pretty acquainted with how a C++ kernel is done. In my personal opinion, it's not significantly better or worse than using C, the conventions are merely different. Object oriented development is possible in just about any language whether it provides objects as a primitive or not: many Linux kernel APIs are fairly clearly object oriented and make use of polymorphism (structs filled with function pointers).

I do hate both C and C++, however, despite using them professionally; I much prefer Python (or assembler, for when machine-level manipulation is really required). I learnt Smalltalk at a very early age and thus Python-love is almost inevitable.
User avatar
torne
 
Posts: 98
Joined: Wed Nov 01, 2006 11:58 am UTC
Location: London, UK

Postby EvanED » Thu Mar 15, 2007 5:27 pm UTC

torne wrote:I'm a Symbian kernel developer, so I'm pretty acquainted with how a C++ kernel is done. In my personal opinion, it's not significantly better or worse than using C, the conventions are merely different. Object oriented development is possible in just about any language whether it provides objects as a primitive or not: many Linux kernel APIs are fairly clearly object oriented and make use of polymorphism (structs filled with function pointers).


I realize that you can do OO programming in C, and that the kernel does it a lot; I've done some Linux kernel development myself. (However, the syntax is more unwieldy. (o.foo(o); instead of o.foo(); on calls if you're using function pointers, or classname_foo(o); if it's an equivalent to a non-virtual function. It also splits the syntax: in C++, o.foo() is the right way to do it whether it's virtual or not, but in C you have to do different things. Nevertheless, I think my objections are mostly based on what I'm used to.)

But it's not really the above that makes me want C++ in the kernel, it's the lack of other features. There are places where the Linux kernel loses typesafety because they don't have templates. I think it would be nice to be able to build a debug version of the kernel that does, say, array bounds checking. You can't do this without compiler support in C, but in C++, it's easy. If you could have exception support without coming up with a new and very non-standard feature to support it like NT's Structured Exception Handling. (I'm not 100% sure that exceptions are the way to go, but if you accept that they are good for application programming I see no reason that they wouldn't be good for kernel programming unless the performance overhead is too high.) But perhaps the single biggest thing that it would be nice to have is RAII. Even adding automatic destructors to C would be enough to placate me quite a bit.

(I realize that some of these things have overhead, like exceptions and template bloat, but I think that they could be kept to a barely-noticeable (if that) minimum. And if they weren't, then I think you could make restrictions on the expressiveness of C++ so that they could be.)
Last edited by EvanED on Thu Mar 15, 2007 5:37 pm UTC, edited 1 time in total.
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby EvanED » Thu Mar 15, 2007 5:34 pm UTC

evilbeanfiend wrote:
EvanED wrote:
evilbeanfiend wrote:c++ templates are a functional language.


With the most horrendous syntax ever... ;-)


to be honest its not that different from lisp with <> instead of (),


and by making you use classes with static members instead of functions, and only letting you operate on integers but not floating point numbers, and causing compilers to spew error messages longer than War and Peace when you get something wrong. ;-)

but yes c++ syntax is pretty contorted in places as its had all these extra features added but still maintains backward compatibility


I realize that it inherits a lot of uglyness from C that it needs to maintain, but it also introduced a lot of uglyness itself. For instance, ask me to rant about the typename keyword; the rules for its use are about 5 times more complicated than they need to be. I did a presentation last semester during which I talked about typename. IMO the rules should fit on about half a slide. It took me four.
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Next

Return to Coding

Who is online

Users browsing this forum: Farpappestals and 8 guests