views:

5524

answers:

74

Each language I've used has had its pros and cons, but some features have really shone through as being indispensible, shining examples of how to design a programming language to make programmers happy.

I use PHP a lot at work, and the one thing I really miss when moving to other languages is PHP's foreach:

foreach($items as $item) //iterate through items by value
foreach($items as &$item) //iterate through items by reference
foreach($items as $i => $item) //by value, with indices
foreach($items as $i => &$item) //by reference, with indices

In C#, I'm kind of smitten with the built-in multicast delegate system, as well as the way it handles getters and setters.

So what's your favourite/favorite language, and what feature makes it awesome?

A: 

Whenever I use a language other than C++ (and obvious cousins), I keep finding myself saying, "If I had access to the pointers, I could do this way easier."

Ryan Fox
You are probably doing it wrong...
EricSchaefer
Whenever I am forced to program in C++ (and obvious cousins), I keep finding myself saying, "If I didn't have to use all these pointers, I could make the program much more readable."
Vegard Larsen
+7  A: 

In C++ I like that I can still use pointers directly and still have the higher level functionality of classes.

In Python, I really, really like tuples. They are really handy.

In statically typed languages I keep finding myself wanting dynamic typing, but in dynamically typed languages I wish there were a way to statically type some things (particularly function parameters). It's a no win situation.

Cristián Romo
Using pointers has no value in and of itself.
JesperE
It does on memory mapped IO devices.
Cristián Romo
Go with C# 4.0. C# is statically typed, but they are added dynamic types to 4.0.
Josh G
Javascript (ECMAscript) will (in the next version, IIRC) have the option of adding typing (or "verified" and "mapped" duck-typing rather) to functions, post facto. Fast prototyping ... and design-lockdown.. win-win! :)
Marcus Lindblom
+3  A: 

Clearly this depends on what you're doing. For web-based apps, I can't go passed the Javascript + PHP combination. Here's why:

Javascript: Built into the browser and gives you complete control over the UI. There is no client-side plug-in required and can use AJAX on-demand to talk to the server.

PHP: Easy creation and manipulation of trees and hashes, is fast, doesn't enforce a specific programming technique or style and has fantastic online documentation.

Steve M
<3 www.php.net
Matt Refghi
As Douglas Crockford says: "JavaScript has many bad parts and good parts" :)
Jacob Relkin
+46  A: 

C#. Lots of killer features, many of them sub-features of LINQ (e.g., query comprehensions, iterators, extension methods, lambdas, generics, expression trees, type inferencing, and anonymous types). Some of them existed before LINQ while others were introduced to support it.

Strongly typed ruby-style suffixed foreach with indicies can be done with extension methods:

//items.ForEach((i,item)=>dowhatever(item));
static void ForEach<T>(this IEnumerable<T> items, Action<int,T> action)
 { int i = 0;
   foreach(var item in items) action(i++, item);
 }

//By-reference: items.ForEach((int i, ref Foo item)=>item = new Foo())
static void ForEach<T>(this T[] items, RefAction<T> action)
 { for(int i = 0;i < items.Count(); ++i) action(i, ref items[i]);
 }

delegate void RefAction<T>(int i, ref T item);

LINQ already has a version that returns a collection of mapped values:

 static IEnumerable<TResult> 
         Select<TSource, TResult>( this IEnumerable<TSource>        source
                                  ,     Func<TSource, int, TResult> selector)
Mark Cidade
Note you can also create Smalltalk style if/else(true.IfTrue(() => System.Console.WriteLine (truestring), () => System.Console.WriteLine (falsestring)), It's probably not practical but still fairly cool.
Roman A. Taycher
+8  A: 

F-Script, a SmallTalk-like language that has serious array programming features, and can be used to script Cocoa applications.

Say that you have a list of person objects that have properties like name and date of birth:

persons := {person1, person2, person3}.

We can get their names like this:

persons name.

which would return:

{'Phil', 'Anna', 'Sam'}

and then we could find out who was the oldest by doing this:

(persons at: (persons dateOfBirth ! persons dateOfBirth \ #max:)) name.

which might return

{'Phil'}

F-Script has an amazingly powerful feature set for working with arrays of objects. The killer feature is that any message sent to an array are passed to the objects in the array, and the return value is an array of the return values of that message (the exception is messages that the array implements, such as at:). So persons name above passes the message name to each element in the persons array and returns an array with all the names.

The second example shows the level of terseness. Basically what it does is that it finds the largest date of birth by reducing the array returned by persons dateOfBirth with max:, yielding the largest date. Then it checks each element in a identical array if that element is not equal (!) to that date, yielding an array of boolean values. at: can take an index, an array of indices or an array of booleans (where true would include the element at that index), so passing it the return from the last expression will return only the element whose dateOfBirth was the largest. Finally the message name is passed to the retults, returning an array with the name of the only object left.

I don't program in F-Script very much, but I find it a very nice language. For working with large sets of objects that need to be searched, sorted, filtered or joined in different ways I find it extremely terse and powerful. It's like combining SQL with SmallTalk.

Theo
Love me some F-Script.
Gregory Higley
Very nice, dude.
Hai
+18  A: 

OCaml, its killer feature might be pattern matching. It makes your program very readable :

let rec fact = fun
 | 0 -> 1
 | n -> n*fact (n-1)
;;


let rec filter predicate = fun
 | [] -> []
 | h::q  when predicate h -> h::(filter predicate q)
 | h::q->(filter predicate q)
;;

Ok sorry for that :

So the first function describe the blockbuster factorial function. It's implemented recursively.

So the first function should be read :

*(l.1)* **let** **fact** be a **fun**ction defined **rec**ursively as :

*(l.2)* when given **0** as an argument, returns **1**

*(l.3)* when given **n** as an argument, returns **n-1**
poulejapon
For the sake of us who don't (yet) know OCaml, could you comment that a little? For example, what's the "h::q" about?
Just Some Guy
:: is the operator to add an item (h) to a list (q). 1::[2;3;4] would give you [1;2;3;4]. With pattern matching, it is the other way around. you tell OCaml "give me the first item in the list (h) and the rest of the list (q)".
Matthias Schippling
F# could apply here too, since it can compile OCaml code without changes
Mauricio Scheffer
Um. Shouldn't that be `n * fact (n - 1)`?
Svante
Is your filter function broken? It seems to return "h::(filter predicate q)" regardless of whether "filter h" is true or not?
Doug McClean
fixed, sorry I wrote that in a rush
poulejapon
I think haskell also has this
Roman A. Taycher
F# was *strongly* inspired by ML and OCaml. They share many strengths.
Greg D
+1  A: 

My experience is still kinda limited. I have done some VB (6 and .NET) and now work in C#..

I have to say I find the syntax of C# a hell of a lot cleaner than VB, I look at some VB now and it really offends my eyes.

As already stated, a lot of the "goodness" that is C# really comes from the .NET framework and the environment.. We quickly see a lot of the benefits of dynamic languages coming to the static language world due to some awesome compiler "magic" (e.g. the "var" keyword).

That said, once I am done with this lame MCAD and have more experience, I look forward to expanding my knowledge of languages and looking into more functional and dynamic languages :)

Rob Cooper
+11  A: 

I have recently begun playing with Haskell, and as Paul mentioned about OCaml, the pattern matching is really nice. Another thing I like about Haskell is the incredibly compact and beautiful list definitions, such as

[a | a<-[1..], a `mod` 3 == 0]

which creates an infinite list of all integers evenly divisible by three. The lazy evaluation (which allows the operations on infinite lists, and much more) takes a while to get used to though. I'm still quite confused about it.

Erik Öjebo
+52  A: 

Python

slices: Whenever you have a collection of items, you carve yourself just the slice of that collection you need.

a = ('a', 'b', 'c', 'd', 'e')
print a[2:]     # prints ('c', 'd', 'e')
print a[:2]     # prints ('a', 'b')
print a[-2:]    # prints ('d', 'e')
print a[:-2]    # prints ('a', 'b', 'c')
print a[0:-1:2] # prints ('a', 'c', 'e')

map, reduce, filter functions: Just enormously concise ways to perform operations on collections of items:

t = time.localtime() # today's date/time tuple,
#   e.g. (2008, 8, 19, 10, 18, 12, 1, 232, 1)

Filling the collection with default values:

d = map(lambda a, b: a or b, (2000, 10), t[:3])
# d -> [2000, 10, 19]

Filtering a collection:

f = filter(lambda a: a > 10, t)
# f -> [2008, 19, 25, 43, 232]

with statement: Cleaner, more readable code with all the ugliness of the mostly technical detail of file exception handling and resource cleanup modularized into the file object itself.

with open('file.txt') as file:
    for line in file:
        print line

Perl

The Father of regular expressions - need I say more?

CPAN - an exhaustive collection of libraries for just about anything...

What I hate about it though, is the amount of horribly, horribly unmaintainable code, it makes so easy to write, and the lack of proper error handling.

Java

open source community. If you need a somewhat general purpose library or framework, chances are there is an open source version for it in Java.

Roland Tepp
Upvote for slices. The single most important aspect of Python IMHO.
steffenj
Perl has slices as well. `say $a[2..5]' I think in Perl6 you will be able to do `say $a[2...]`.
Brad Gilbert
Perl also has `map`, and `filter` only they`re called `map`, and `grep`.
Brad Gilbert
Perl6 also has a `with` statement.
Brad Gilbert
I prefer Perl over Python. Python programs with similar functionality, will tend to look the same. Which is good for learning the language, but makes working outside the box difficult. I really really like working outside of the box.
Brad Gilbert
Perl5 RE: http://perldoc.perl.org/perlretut.htmlPerl6 RE: http://dev.perl.org/perl6/doc/design/syn/S05.html
Brad Gilbert
Thanks Brad for pointing those out, It's been a while ince my Perl years, so I bet there's been a lot changes in Perl land.
Roland Tepp
The cleanness of Python implementation and the way Python programs are just plain easier for my eyes that won me over. The ability to "work out of the box" should never be the goal onto itself though - and that is mainly why Perl programs are so often so hard read.
Roland Tepp
@Brad Gilbert: I don't understand why the fact that 'programs with similar functionality look the same' should be a deterrant, could you elaborate? I don't get what you mean by 'working outside the box' either...
sundar
I like list comprehensions in python, that combine the functionality of map and filter: [fn(a) for a in my_list if some_condition(c)]
SpoonMeiser
As far as I know, Perl is not the "father of regular expressions". Regular expressions existed for a long time (e.g. in grep, awk, sed...) before Perl came to be.
Svante
@Brad Gilbert: stop being such a curmudgeon for perl in all these comments... we get it, you think Perl is the best language ever. Don't worry, there's room for more than one language.
TM
I would say that ed(1) is where regular expressions emerged in their current form, back in the early '70s. That's a good fifteen years before the early versions of perl.
Curt Sampson
@Svante and @Curt - your correction is noted, but my point was rather to the ecffect that if today someone thinks about regular expressions as a language integrated feature, Perl clearly excels at that.
Roland Tepp
@Brad: if you're working on a team, "programs that work similarly look similarly" is a killer feature.
Jimmy
@Jimmy I didn't say it was a bad feature of Python, just that I like playing around with the language.
Brad Gilbert
@titaniumdecoy: Lambda has not been dropped.
+1  A: 

A programming language is a tool which suits good for a limited set of tasks and everyone probably has several favorite languages, like a favorite language per programming paradigm (LISP or scheme for functional programming, C for imperative, C++ for Object-oriented etc) and/or favorite language per task(C or C++ for embedded system developing PHP or C# for Web developing).

Speaking about handy features... I really like generators in Python, you write a generator once and then can use and reuse it hundreds of times. Once you've written your generator you can focus on what to do with each item it produces and never bother yourself again with how to get an item.

Templates in C++ are also great, using them your can also express general ideas once and for all. STL is a good example of templates usage.

Serge
+28  A: 

Right now, if I had to choose one language* to stick to for the rest of my life, I'd most likely go for Ruby.

Every time I use something like

5.times { |i| something_useful_that_uses i }

... I'm smitten again by the everything-really-is-an-object aspect. (Hmm, I'm a little concerned about how those underscores are going to render, looking at the preview below where I'm typing this)

And as for that PHP "foreach" thing, we have (for example)

for item in items

or

items.each do |item|                     # without index
items.each_with_index do |item, index|   # with

depending on your preference.

* I think the list of languages in which I've done some serious development is something like: COBOL, PL/1, C, C++, C#, MS Basic, VB/VBA, Pascal/Delphi, Python, Ruby. I've dabbled in others, but not enough to really have a proper appreciation. In the functional and LISP-derived language areas I am aware that I have, so far, missed something.

Mike Woodhouse
"items.each_with_index do |item, index|" - new Ruby thing I learned today. Thanks!
mmacaulay
And I the opposite, didn't know you could do 'for item in items'.
monkut
You can also use `for key,value in hash` in Ruby. Doesn't work with arrays (don't know why).
Jules
Mike, if `5.times {...}` blows your mind, I recommend you take a peek at Smalltalk. It isn't necessarily better, but since it is even "OOPier" than Ruby, you might find it interesting.
Oak
@Oak - Smalltalk has been on my radar for more than a decade! When I failed to "get" it first time round, I took up Ruby as a perceived stepping stone (message-based, everything an object, etc, but less whacky syntax to someone mostly familiar with Algol-derived langauges). Happy accident. That was 2003 and I'm still planning to learn Smalltalk. Maybe when the kids are older... ;-)
Mike Woodhouse
+18  A: 

Python

Closures

def adder(x):
    return lambda y: x+y
add5 = adder(5)
add5(1)
6

List Comprehensions

 numbers = [1,2,3,4,5]
 squared = [x **2 for x in numbers]

Functional Tools

squared  = map(lambda x: x**2, numbers)

Simple syntax that is easy to read and understand. Slicing.

mk
Interesting that all of these can also be done in Perl, although with very different syntax.
Brad Gilbert
Perl6 closure: sub adder($x){ return sub($y){ $x+$y } }
Brad Gilbert
Perl list Comprehension: @squared = map{ $_**2 } @numbers;
Brad Gilbert
+5  A: 

Right now

PHP

  • Dynamic typing goodness
  • The PHP Manual
  • No framework dogma (lets you learn things by repeatedly shooting yourself in the foot)
  • C Style syntax (#1 requirement of the NBL :D)
Imran
PHP is not my favourite language, but the one I use almost every day. I think PHP's killer feature is: super easy deployment.
FlorianH
+8  A: 

Ruby

I grew up writing PHP and Perl, and Ruby really strikes me as a purer, cleaner version of Perl. Its best feature is how it makes functional programming second nature while still maintaining the "everything is an object" mentality.

Jim Puls
Maybe you should take a look at Perl6.
Brad Gilbert
A: 

I don't have a favorite programming language, just a flavor-of-the-month, since I'm an admitted language junky.

Right now that flavor is REBOL. Its killer feature is easy creation of domain specific languages, also known as "dialects". REBOL doesn't have a feature? Easy: make a dialect to do it.

Dialects are created by passing a block (a chunk of REBOL delimited by square brackets) to the parse command, followed directly by another black containing the rules for parsing the block. Here's a silly example:

print-times: func [b [block!] /local rules r i] [
    rules: [
        'print
        set r any-type!
        set i integer!
        'times
    ]
    if not parse b rules [
        make error! "Dang it! Bad syntax!"
    ]
    repeat n i [ print r ]
]

print-times [print "StackOverflow" 20 times]

Alright, so no one's likely to create such a dialect, but they are amazingly useful. For example, REBOL has no list comprehensions, but you can use a REBOL dialect to remedy that fact. (I've done just that thing.)

Gregory Higley
+4  A: 

Good programmers write FORTRAN.

Really good programmers write FORTRAN in any language.

Cristi Diaconescu
+13  A: 
var favourite = languages.Where(lang => 
                   lang.Keywords.Contains("yield return")
                               ).FirstOrDefault();
Daniel Earwicker
Ruby! .
Jules
Actually C# has a yield return also...
Josh G
And so does Lua.
Cristián Romo
Okay, may as well mention CLU then, which was probably first.
Daniel Earwicker
yield return is pretty nifty
Brett Widmeier
@Brett - but in the hands of a lunatic... http://smellegantcode.wordpress.com/2010/02/04/linq-to-stupid/
Daniel Earwicker
@Earwicker: That's bizarre!
Brett Widmeier
+6  A: 

Who is master: You or the language? You or the compiler? Why continue to bow down to the needs, whims and quirks of an awkward syntax, a finnicky compiler, a static language core? Enough of that. Write Ruby, be happy.

Ruby was built from the ground up with the primary goal of making programmers happy. Ruby makes programming enjoyable, a delight. Ruby gets out of your way, so you can go straight from idea to functional demo as quickly as possible. Ruby is your ally, not your enemy. You do not wrestle with Ruby, Ruby judo throws your problems to the mat and makes them slap it while crying for submission. Ruby was designed for maximum intuitivess; least surprise. Ruby boasts a marvellous consistency and arms you to the teeth with enough standard-library, introspective, metaprogramming, ZOMG-I-Can't-Believe-How-Many-Ruby-Projects-Have-Been-Written-Already ordnance to outshoot Clint Eastwood, Rambo, and Chuck Norris combined. With one hand. On a foreign language keyboard.

I dance with Ruby every day:

My programming language is my dance partner. She is supple, flexible, versatile, graceful, elegant, powerful, agile, and a delight to the eyes. With only the slightest expression on my part, she knows what I intend, and, without question or resistance, moves with me in perfect harmony. When we dance, I know neither frustration nor surprise; every moment brings only joy.

Pistos
Ruby also has a tendency to be cryptic, I haven't found a whole bunch of tutorials for standard Ruby (RoR is somewhat different) except 1 out of date book. So trying to learn Ruby is like learning any language without a guidebook. Ruby may be what you say, if I could just find a decent free book.
The Wicked Flea
Try these:http://rubylearning.com/satishtalim/tutorial.html http://www.pine.fm/LearnToProgram/ http://tryruby.hobix.com/ http://www.ruby-lang.org/en/documentation/quickstart/ http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/
Pistos
I'm learning Ruby and man do I hope you're right.
Yar
"She is supple, flexible, ... and a delight to the eyes" -- creepy^max! ;)
Juliet
+1  A: 

Unification. I don't have a favorite language, but I do like Prolog's unification. It is a powerful tool and it is frustrating to not have it in the other languages I program in. As others have pointed out, pattern matching is nice. But unification is even better.

ejgottl
+5  A: 

Smalltalk: write code while your program is running, no compile cycle at all!

I really do not understand why no other language offers this!? Ruby and Python could both offer this feature, but alas no one has done that yet.

Adrian
Um, I'm not a pro at it, but Ruby does offer this. I don't know how you'd output what you put into the REPL of Ruby, but it does have a REPL loop.
The Wicked Flea
I am not referring to a REPL loop, but to an IDE and Debugger that allow you to edit source files while your program is running or debugging, and hot swaps the changes into the running program.
Adrian
Visual Basic did this for years.
Mike Hofer
C# offers edit and continue, but only for 32-bit programs. Typically the problem with it is part of the interpreted versus compiled argument. Interpreted allows this, but compiled is much faster. (In most cases, if you abstract the math well enough you can get decent interpreted numbers)
Guvante
What happens in C# to object instances if, at runtime, you add a field to their class?
Adrian
You can do this in LISP. FORTH too.
Ferruccio
+10  A: 

Ada

It has full rich and portable concurrency support.

T.E.D.
+6  A: 

My favorite language is Java, mostly because of the great community support and support for multithreading and synchronization.

Also, Java does have its own 'foreach'.

public void foo(String[] a) {
  for(String s : a) {
    //do stuff
  }
}

Weird syntax, I admit. But essentially does the same thing.

Ryan Thames
+10  A: 

At the risk of getting downvoted :), I'll say "Perl 6". Yes, I know it's not in alpha yet, but it's getting closer all of the time. My favorite features? Too many to count, but here are a few:

  • Subtypes:

    subtype PosInt of Int where { $_ > 0 }
    
  • Roles:

    Known to many as traits, they solve many class composition problems.

  • Junctions (they're automatically parallelizable, too):

    if ( $role eq 'manager' | 'consultant' ) { ... }
    
  • A complete meta-object protocol

  • A mutable grammar allowing for much more powerful macros than what one sees in other languages.

There's plenty more and I fully expect an alpha out by next year.

Ovid
You should mention the grammar/rule/regex syntax.
Brad Gilbert
+37  A: 

Haskell. Its killer features:

It's lazy. This makes many difficult algorithms easy to reason about, and makes your programs more concise.

Example 1: To create a regular polygon with n sides, simply generate an infinite list of points by rotating 2pi/n around the origin, and take the first n items from it.

regularPolygon n sideLength =
  take n $ iterate (rotateVertex angle) (r, 0.0)
     where
        angle = (2 * pi) / n
        r = (sideLength / 2) * (1 / sin (angle / 2))
        rotateVertex angle (x,y) =
          (x * (cos angle) - y * (sin angle),
           x * (sin angle) + y * (cos angle))

Example 2: Parallel evaluation. The par function evaluates the first argument in a separate thread and evaluates the second argument in the current thread. The pseq function evaluates the first argument and then the second. Here's a parallel Fibonacci sequence that takes advantage of lazy semantics.

fib 0 = 0
fib 1 = 1
fib n = r `par` (l `pseq` l+r)
    where
        l = fib (n-1)
        r = fib (n-2)

It's purely functional. This means that absolutely no undeclared side-effects are allowed. Functions can therefore be relied on to not have an effect on the rest of your program. Pure functions refer only to their arguments, and are therefore easy to understand.

square :: Integer -> Integer
square x = x * x

Effectful functions have a different type. Instead of returning an Integer, this function returns an IO action that gets an integer from the environment at a convenient time.

getInteger :: IO Integer
getInteger = do {
   x <- getLine
   return (read x);
}
Apocalisp
This is really beautiful
Camilo Díaz
Haskell is THE language for algorithmic stuff, although it's often annoying to have no mutable structures.
FUZxxl
+39  A: 

I use Delphi because it allows me write all types of applications. Web Development (ajax, Web Services the whole 9 yards), Desktop Development, Services, Dlls, .Net, Games, Graphics, you name it. And it comes with decades of well-established principles. And it's so easy to use. huge support base.

It's a language that's very easy to read so it's a breeze taking over legacy code and building on it.

Perhaps the biggest advantage, for me, is that it compiles to an exe or dll. No translation, so effectively runs twice as fast with 1/2 the resource footprint.

"so effectively runs twice as fast with 1/2 the resource footprint": Compared to what?
EricSchaefer
+14  A: 

C. For lack of "features". What you C is what you get.

n-alexander
+2  A: 

Java.

Killer features:

  1. JVM
  2. Static typing - enables easy refactoring, searching and navigation features in IDEs
  3. Libraries
  4. GWT and Android use Java syntax, while Jython, JRuby, Clojure, Scala and whatnot use JVM. I don't know how to call it, but it is awesome

What sucks:

  1. No lambdas
  2. J2EE

Edit: "Static typing" seems kinda weird as a killer feature. I guess I'm just opposing it to python, which is my 2nd favourite language

Yoni Roit
So true regarding static typing: in Eclipse I can write a method name that does not exist and it will suggest it. Same with classes and variables: Eclipse will say, "do you mean this or this or that?" With a dynamic language, you never get asked, but you're always responsbile.
Yar
A: 

I regulary come back to AWK. It's "killer feature" certainly is the "{...}" operator/environment/w.d.y.c.i.

Andreas Scherer
+1  A: 

PowerBuilder!

The datawindow is an absolute killer for UI development.

Though no serious development happens on this platform for various reasons, it was one of the first languages I worked with and I still find that it has some features which are unavailable in other major UI devlopment RAD tools.

Learning
A: 

Java

Its really cross platform when it comes to server-side.

I've developed applications in WinXP machine with 1 gb of ram and deployed on HP900 superdome with 16 gb or ram without chaning a single line of code.

Client side has been improved but still not cross platform.

OscarRyz
+5  A: 

I love C++, The pointers and other stuff like the templates etc, are just so powerful. And i am surprised not many people have put in C++. I accept there are languages which make programming easy, but then when you really want to program i guess C++ stands out.

Raghu
I frequently find myself fighting with C++ rather than embracing it. Faux features like header files to "make interfaces explicit" are rationalizations for vestigial cruft that exists to make life easier for compiler writers in the '70's and '80's, sadly resulting in massive amounts of time wasted repeating myself over and over again. What languages other than C++ have you really learned? Every person I've met in real life who loves C++ does so because they haven't learned a language that's been invented since 1980. (And they skipped lisp and smalltalk.)
Greg D
+31  A: 

I love LOLCode - its killer feature is that it makes me laugh out loud. (;

Kieron
Excellent choice!
fastcodejava
+6  A: 

C# Rules!!

  • LINQ
  • Generics
  • Lambas
  • Expression Trees
  • Anonymous types
Rulas
+11  A: 

As I've recently started to rank all the major programming languages according to their pulling power, my favourite would have to be an obviously female-attracting language like Delphi: elegant and friendly, using proper words instead of resorting to pointless grunty man-squiggles, yet instinctively practical and not at all like frilly, ditzy, slow-to-react Ruby - the only language actually to be coloured pink.

At the other end of the spectrum, there are old favourites like Fortran, which is hopelessly male but in a pleasant pipe-smoking, GWR steam engine, leather elbow patches sort of way that reminds me of my Dad.

On a more serious note, see my answer about the extraordinary language Q.

RoadWarrior
A: 

Python has some killer directory/file traversal techniques which I loved when I was developing in it the other week.

Kezzer
+1  A: 

C++

  • For deterministic object destruction.
Eclipse
Explain why this is important to you.
EricSchaefer
@Eric: It means that you can use RAII for resource management, and know that even in the case of exceptions, your resources will be release in a timely manner.
Eclipse
+1 - important for for some sets of problem domains where java and c# just can't handle it.
Tim
Java and C# can't handle it? `using (MyClass myObject = new MyClass()) { // do something }` is even easier that RAII.
EricSchaefer
So at least C# can handle it...
EricSchaefer
@Eric, `using` puts the cleanup responsibility on the user of the class, rather than the designer of the class. In C++, the default behaviour of allocating an `fstream`on the stack is the correct behaviour. In C#, if I don't remember put a `FileStream` in a `using` statement, it can keep that file locked for some indeterminate period of time.
Eclipse
That is because you might want to keep the FileStream around for a while.
EricSchaefer
Except, as soon as a FileStream exists without a using statement, it's no longer exception safe. In C++, I can create an fstream on the heap if I want to, and hang on to it with a smart pointer.
Eclipse
@EricSchaefer: Even if the file object isn't accessible anymore in C#, and all references to it are gone, it *might still exist* because I forgot that `using` statement and it didn't hasn't been garbage collected yet. C++ does away with many common cases of the manual release of resources through deterministic destruction.
Thanatos
+3  A: 

I'm happy with C and C++. The language that amazed at first impression was definitely Smalltalk. Coming from crude static languages such as C, or from the dark pits of x86 assembly, the dynamic and totally alive environment sensation that Smalltalk brings to the programmer is really outstanding.

C++ is a beast, is ugly, with non-orthogonal syntax, pitfalls everywhere, undefined behaviour here and there... but who can deny offers you (probably) a range of features and flexibility not available in most languages.

I like assembly very much, altough the x86 is a complicated beast to program compared to cleaner designs like MIPS.

Hernán
+1 for MIPS assembly
EricSchaefer
+2  A: 

Groovy because of GroovyMarkup. It's awesome to be able to represent code and documents using the exact same syntax. Also, because it adds great syntax sugar to Java.

Io because of the simple, clean syntax and that it has no keywords.

nicerobot
+2  A: 

C#, for a number of reasons.

Type safety, full support for objects, extension methods, terseness, and a very rigorous compiler that doesn't let me get away with sloppy habits that I got used to as a Visual Basic programmer.

In my mind, however, C# is like Java, C, and Visual Basic merged together into a beautiful language with incredible power and flexibility. And, as an open standard, it shows promise as a cross-platform language (though that's not been fully realized yet).

Mike Hofer
C# is not completely typesafe, at least at compile time: It will allow you to do something like: `Base[] barr = some_array_of_Derived; barr[0] = another_derived_type` - the compiler will miss this (and there's nothing it can really do), and you get a run time exception. Safe, but not quite as much as I'd like.
Thanatos
+2  A: 

ActionScript and FLEX. With 95% penetration, it gives me the opportunity to create consistent client-agnostic applications that can provide extremely rich and highly interactive content in most web browsers - which I would never be able to do using any other mechanism...

Scott Evernden
+4  A: 

C

Not only is it both flexible and elegant, it is the lingua franca of Computer Science.

Anthony Cuozzo
Lingua franca of computer *programming*, granted, but computer science? Very few of the computer science papers I've read in my life have used C. Most of the classics I've read were Lisp, Algol, or occasionally Fortran, depending on the field.
Ken
How about EBNF?
Potatoswatter
+1  A: 

C++ is my primary language. Its killer feature is that it lets you touch the low-level details, while still managing to be a portable high-level language. If you know what you're doing, this lets you write well-designed, maintainable applications that are portably efficient with minimal human suffering. (note that the "if" requirement applies to all of the above...)

Haskell is my new favorite language. It has lots of really nice features, but the genuine killer feature is the type system. Haskell's type inference removes the need for most type declarations, while providing the full debugging and performance benefit of strong, static typing. And, its type class system makes C++ templates look sick and pale by comparison. (you still have to know what you're doing, though...)

Haskell's well-known laziness is an interesting feature IMHO, useful and annoying by turns. But it is nowhere near as impressive as its type system.

comingstorm
+3  A: 

Common Lisp

Almost all new and shiny things in today's new languages are already there.

  • real macros that operate on the language (not the text) mean that you can eliminate all boilerplate
  • simple, consistent, and clear syntax through s-expressions
  • REPL
  • full support for functional programming and object orientation
Svante
I think "already there" almost misses the point. The *reason* they're already there is because of Lisp's true killer feature: it's programmable, in itself. If you wanted OO in Lisp, you write a small library. If you wanted OO in C, you find a genius like Bjarne to design a new language and write a compiler. CL is a quarter century old but it's not really going anywhere because it's hard (though not impossible) to find a feature that can't easily be added to that ball of mud.
Ken
A: 

Mine used to be C#, mainly because on Visual Studio's awesome graphical editor for making king Windows forms apps. But now that I'm using it at my day job, there is a lot I really dislike. It has lots of new-fangled "wow" features, like generics, linq, attributes, etc... but they all seem to be riddled with caveots, inconsistancies, and just odd design decisions... plus so many of the good add-on libraries are for-pay, not as much open-source stuff out there.

Now I'm back to really liking Java again, due primarily to:

  • Language stability. I don't have to learn some new stuff every 2 months.
  • Consistant design decisions. Intuitive syntax.
  • Supports AOP tooling (technically C# sort of does now too, but it takes tools that much your code at compile time)
  • Community support? Actually a double edged sword. Lots of open source projects and good libraries, but are usually terribly supported and horrible excuse for documentation. Hibernate is an example. I've spend litterally days step debugging through Hibernate source code to find the source of anomalies that were apparently well known but not documented. Like there would be a flag you could set to do something, but it would have no documentation past a simple "turns on blah" comment.
rally25rs
A: 

No one has made a stand for VB so I will! (well, .Net framework at least)

  • Background compilation, I can add to a Class, and have my new functionality appear in Intellisence immediately, without compilation, or even saving the file!
  • ForEach loops, puh-lease!

    ForEach item As String In ListOfStrings
      'stuff'
    Next
    

People bag out VB.Net (or just MS in general). But in my line of work, we get judged on time-per-feature, so the less time working on pointer arithmetic the better I say!

Mark Glorie
You don't need background compilation for intellisense. C# can do intellisense just fine by parsing the source files int he IDE. btw, It might be totally subjective, but since I *had* to deal with VB.Net today and yesterday (VS forces VB.Net as macro language), I have to say again, that it is the worst language I have ever dealt with. Plain horrible, everything... properties, "withevents", ... Whoever designed it must have been incredibly drunk...
Robert Giesecke
+1  A: 

Perl for its first class support of regular expressions, CPAN, and the fact that it doesn't force any specific programming style on you.

Jared
A: 

php

runs just about anywhere

in the wild!

+1  A: 

Perl.

Killer feature: Regular expression and a lot of library support at CPAN

kal
+2  A: 

C#

killer feature: type safety.

+1  A: 

Scheme:

I really love the simplicity.. and perhaps, the fact that we can use special characters in variables name..

(define (smaller? x y) (< x y))

(if (smaller? 3 4) (do that))

In python (and other languages):

I really like to be able to use a list on-the-fly whenever I want without losing time and space doing vector ...; I just use li = [1 2 3].

In C# and Java:

I really love the fact that whenever you need something quickly, there's a library that's already been tested somewhere. I remember when I needed to quickly find a way to encrypt password.. it took me what.. 10min? Google, download, paste, install, test.

In Bash:

I really like the historic part.. there're so many hacks everywhere.. anytime I see a new hack, I learn a little bit more about the history of unix :) I also really like the fact that my console is in itself a programming language.. To be more precise on that, I like to be able to code even if I'm not creating a script.. sometime I just want to move files, or search a pattern, or unzip lots of file.. but still, I'll use a for loop. (Instead of selecting, and right+click unzip, etc.)

Finally, C/C++:

I know that performance is not really important for many apps.. however, when you need to really have control of what your code is doing, those languages are awesome. Everything was written with performance.. there's not a push_front method for vectors.. guess why? because it would make the insertion slower. (Even if we can still insert in the begining with an inserter.. :-)

+1 for scheme and c++
Tim
A: 

REALbasic is my favorite language. It's killer feature is that it is by far the easiest way to create a cross-platform desktop application. I love being able to develop on Mac OS X, but deploy to Windows when necessary.

I'm not aware of any killer feature in the language right now, but it did have extension methods years before C# 3.0 did!

Paul Lefebvre
+105  A: 

Delphi

for the following features:

  • Class polymorphism. this means you can use virtual constructors and virtual class functions (as illustrated below). It's also possible to query whether a class supports an interface without having an actual object.
type
  TGraphicClass = class of TGraphic;
  TGraphic = class
    class function FindClass (FileExt: String): TGraphicClass;
    class procedure RegisterClass (AClass: TGraphicClass);

    class function SupportsFileFormat (FileExtension: String): Boolean; virtual; abstract;
    constructor CreateFromFile (FileName: String); virtual; abstract;
  end;

  TBitmap = class (TGraphic)
    class function SupportsFileFormat (FileExtension: String): Boolean; override;
    constructor CreateFromFile (FileName: String); override;
  end;

...

initialization
  TGraphic.RegisterClass (TBitmap);
  ...
  Result := TGraphic.FindClass (ExtractFileExt (FileName)).CreateFromFile (FileName);


  • The seamless COM integration, supported by the "implements" keyword, the "safecall" calling convention and the Variant type (of which you can write custom implementations, and even custom invokable variants for late binding!).

  • The clear separation of "interface" and "implementation". This is quite common in C++ as well (albeit not inforced), but it somehow got out of fashion in more recent mainstream languages such as Java and C#. If you want class declarations in C# or Java to be anywhere as concise as in Delphi, you'll need to mess with your IDE and with code folding - a feature which is, by design, totally unneccessary in Delphi.

  • Deterministic destruction.

  • The intrinsic enum and set types:

const
  CWhitespaceChars = [#9, ' '];
  CNumericChars = ['0'..'9'];
  CAlphaChars = ['A'..'Z', 'a'..'z'];
  CAlphaNumericChars = CAlphaChars + CNumericChars;
  CTokenChars = CAlphaNumericChars + ['_'];
  CNonWhitespaceChars = [#1..#255] - CWhitespaceChars;
  CNonPathChars = ['/', '\', ':', '*', '?', '"', '', '|'];

type
  TVegetable = (Aubergine, Zucchini, Tomato, Paprika, Onion);
  TRatatouille = set of TVegetable;
  TPeperonata = set of Tomato..Onion;
  • In Delphi Prism: Compile-time AOP! Doing AOP with no performance degradation, full support during coding (e.g. in IntelliSense) and without nasty bytecode juggling tricks, how cool is that?

  • Not Delphi-specific, but useful enough to be mentioned: Generics, anonymous methods aka closures and reflection.

  • Delphi is not case sensitive. This can be a huge plus.

  • Nested procedures and functions. You can emulate that with anonymous delegates, but it's a syntactical mess, it runs the risk of accidentally passing out a delegate, and it degrades performance notably.

Moritz Beutel
For the range checking!
gabr
I don't find built-in range checking that important; IMO it's better to use external tooling for that, such as CodeGuard in C++Builder.Whenever working in Delphi, I tend to miss CodeGuard's runtime checks which are way more extensive than simple bounds checking.
Moritz Beutel
For Visual Forms Inheritance in the IDE! Works like a charm much before .NET and Java have it (AFAIK no Java IDEs have it) .
Fabricio Araujo
Visual Form Inheritance, however, strikes me as not being a language feature :)
Moritz Beutel
Your example of CAlphaChars is horribly broken in Unicode world (at least outside of English speaking countries). You'd better call it CAsciiAlphaChars.
Dejan Stanič
@Dejan: feel free to correct it.FWIW, sets aren't really a viable approach to process Unicode characters. In reality you'll probably have one single Unicode flag table (~64 KB) which you then use for such lookups (or perhaps a more cache-friendly solution).
Moritz Beutel
Should I add as a 'feature' the community?
Not specific to Delphi. But feel free to add it under "not Delphi-specific" :)
Moritz Beutel
case InSensitive: human typing for humans.
PA
@Dejan: Doesn't look broken, if you use a unicode version of delphi?
Arafangion
+1  A: 

English why?-pick your own interpretation

Roman A. Taycher
+1  A: 

Java

  • Generics
  • Threads
  • Memory management
fastcodejava
+8  A: 

Delphi for .Net / Delphi Prism for unmanaged exports, which lets you consume managed assemblies from native code just like any .DLL without requiring .Net interop.

Bruce McGee
You can do that with almost any .Net language, though. It isn't even hard or less natural than in Oxygene, once you autom. the post compilation part into an msbuild task.
Robert Giesecke
It's supported in managed C++ and Delphi Prism, but you have to hack it to work with C# or VB.Net. Unless something's changed recently.
Bruce McGee
I wouldn't call it "hack". You can add VT fixups to any assembly, that is CPU-specific. The underlying system is built into the runtime (created for and heavily used by C++/CLI). I'd hardly call that "hack". ;-)
Robert Giesecke
Do you have a link?
Bruce McGee
Sure, http://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexportsI made convenient project template for C#, but that could be done for most other .Net languages as well. (I incidentally made it for Oxygene, before it got exports itself)
Robert Giesecke
Thanks. I'll take a look.
Bruce McGee
@Robert: still no source?
Wim Coenen
+29  A: 

Delphi

For its readability. I have often been thrown into 10,000 line applications to fix bugs and other problems. With Delphi I can almost read the code like a book. Makes it easy to find and fix the problems.

For its adaptability. Out of the box you can put together Desktop, Client/Server, N-Tier, Web servers, COM objects, etc., etc., etc. From anonymous methods and generics to inline assembly language. It hasn't failed me yet after 15 years of intensive use. And I can still compile and run applications that were implemented in Delphi 1 15 years ago!

For its sheer productivity! I personally believe that Delphi gives me almost a 2 to 1 advantage over other language platforms in developing almost any kind of application. That converts into dollars in my pocket pretty quickly. And for one company that I worked for, it was instrumental in moving them into the top tier of companies in their field in just a few years because of their ability to respond to changing market conditions.

Larry Drews TheSoftwareRonin

Larry Drews
+24  A: 

Delphi is my favorite for Windows RAD. Apps compile into a single file executable, no additional runtime files required.

RxRick
+1  A: 

C++.

Other languages, with modern compilers, can be almost as fast as C++. I make my living at being faster than "almost."

Crashworks
A: 

I would vouch for javascript, the reasons being easier learning curve than many other languages Not many changes to the core features apart from new tools and plugins being added

balalakshmi
+12  A: 

Delphi for Web Apps, Desktop Apps, Service Apps, DLLs, .Net libs, Game Development, Mobile Development and hopefully soon Mac & Linux development (again), FTW!

Hein du Plessis
+3  A: 

Delphi, for the reasons I mentioned here: Is Delphi a good language to learn?

Mihaela
A: 

Visual Basic 6

It has everything that a developer will ever want. It is very easy to learn and use. In fact it is so easy that one feels completely at home in just a few hours.

It IDE just the best. It is said to have standards for even driven programming in the times when procedure based programming ruled the programming world.

It is object oriented. One can develop a simple one window program without writing one single line of code.

It does have runtime but Microsoft even today ships the runtime for VB 5 and VB 6 in all windows versions.

It is the only true Host for ActiveX and COM objects. All other languages cannot host ActiveX and COM objects without first importing them and then wrapping them which according to me is a pain in the neck at all times. Even the latest version of .NET does not support all features of ActiveX/COM.

There is a very big industry which is still developing ActiveX. VB is the only language that has probably the worlds largest component/control writers in the world.

Even MS is still developing COM objects in Windows so that others can easily use Windows services.

VB is also suitable for prototyping and such tasks and it is very easy to convert a prototype to a production software very easily.

Finally if it were not for VB then Windows will not have been as popular as it is today. After all any OS is as good as the number of applications available for it. If Apple has released such a development tool for their Mac OS probably it would have had better acceptance then it has today.

Even after being discontinued by MS it is still the most widely used development language in the world.

Yogi Yang 007
+2  A: 

Delphi

Because of what has been said and it's the fastest and easiest way (and the only one I think) to build native win32 application - and then, in a future version win64 as they said...

Ronaldo Junior
+2  A: 

F#; it's a marvelously object-functional language like Lisp (which I love), but is also statically typed (which I also love). However the killer feature is auto-generics and insanely awesome type inference to go along with it.

Ben Collins
+4  A: 

F#

The combination of Object-Oriented and Functional paradigms without too much work to switch.

Guvante
A: 

Python

Killer Feature: Its source code is neat & clean and doesn't turn into bracket soup.

crgwbr
+2  A: 

All programming languages.

The killer feature is that they make your brain work.

cherouvim
+1  A: 

Delphi.

Class as a value. The great feature for all construction patterns (like Factory). You can have a variabe holding not a values of some type but a reference to type.

type
  TSomeContainer = class
    ElementType : TClass;
    function NewNode: TObject;
  end

function TSomeContainer.NewNode;
begin
  Result := ElementType.Create;
  // in C#/Java it would be like
  // Result = new ElementType()  
  // but ElementType is a variable that can reference any type
end;

var
  container : TSomeContainer;
  e : TObject;  

begin
  ...
  myContainer.ElementType := TButton;
  e := myContainer.NewNode;
  // now e containes a TButton object  
end

No need for separete class factory type or generic class.

Maxim
+1  A: 

Delphi!

  1. When proper used, the code looks clean.
  2. Class interfaces and implementations seperated => quick overview of the class API's
  3. The IDE itself is great
  4. Components rule
  5. Everything can be built in Delphi
  6. Property names for getters and setters, haven't seen that in other languages yet!
Nevel
+1  A: 

Serious answer: Q, a very powerful proprietary language aimed primarily at financial programming. It's a descendant of the K language, and is inextricably linked to the kdb+ database. There is an abridged language manual online.

Probably its main killer feature is extreme expressiveness. Because of this, a few lines of code can often solve complex analytic challenges with simplicity and elegance.

The following program fragment shows some elements of Q's expressiveness. It reads a CSV file of time-stamped symbols and prices, places the data into a database table and computes the maximum price for each day. It then opens a socket connection to a q process on another machine and retrieves a similar daily aggregate. Finally, it merges the two intermediate tables and appends the result to an existing file.

sample:{
 t:("DSF";enlist ",") 0: `:c:/q/data/px.csv;
 tmpx:select mpx:max Price by Date,Sym from t;
 h:hopen `:aerowing:5042;
 rtmpx:h "select mpx:max Price by Date,Sym from tpx";
 hclose h;
 .[`:c:/q/data/tpx.dat;();,;rtmpx,tmpx]}

One reason why expressiveness is a killer feature is because the (interpreted) code sits comfortably in L1 cache, which means that it executes really fast. I'll try and dig out a benchmark from Google - but I do mean extraordinarily fast.

Another reason why expressiveness is a killer feature is because it's much easier (at least for me) to understand and verify a small amount of code than some bloated OO hierarchy. A code review of the above fragment is much easier than the equivalent 50-100 lines in, for example, C#.

On a less serious note, see my answer here.

RoadWarrior
+1  A: 

R

I like R because it's a functional language:

adder <- function(x) { 
           function(y) { x + y }
         }
adder(5)(3)
8

So, adder is a function of x that returns a function.

Although I like Python too, in this case I prefer R's syntax. Because Python has this artificial distinction between def and lambda, although both just define a function:

def adder(x):
    return lambda y: x+y
adder(5)(3)
8
A: 

Delphi is the best. That is all.

Andrei K.
+1  A: 

JavaScript

The killer features here are first-class functions and function closures. Here are some interesting things you can do:

"Classes":

var createCounter = function () {
    var i = 0;
    return function () {
        return ++i;
    };
}
var c = createCounter();
c(); // 1
c(); // 2

var d = createCounter();
d(); // 1

.

var Car = function (name) {
    // Private
    var on = false;
    var speed = 0;
    var adjustSpeedometer = function (rpm) {
        speed = rpm * 60 * 20 / 12 * 5280;
    };

    return {
        // Public
        'turnOn': function () { on = true; },
        'getName': function () { return name; }
        'setName': function (n) { name = n; }
    }
};
var a = Car('A');
var b = Car('B');
a.turnOn();

Currying/Partial Application:

function greet(greeting, name) {
    alert(greeting + ' ' + name);
}

var createGreetForPerson = function (name) {
    return function (greeting) {
        greet(greeting, name);
    };
}
var createGreetWithGreeting = function (greeting) {
    return function (name) {
        greet(greeting, name);
    };
}

greet('Hello', 'world'); // Hello world

var greetWithHello = createGreetWithGreeting('Hello');
greetWithHello('Bob'); // Hello Bob
greetWithHello('world'); // Hello world

var greetWorld = createGreetForPerson('world');
greetWorld('Hello'); // Hello world
greetWorld('Good morning'); // Good morning world

Please do add more!

Casey Hope
A: 

Haskell, call-by-need evaluation.

Tony Morris