+ 2
What is your favourite language construct from all of programming?
What is your favourite? Do you have a thing for lambdas, map and filter or do you just love polymorphism? Is the trusty for loop all you need for happiness or are list comprehensions the real stuff for you? Share your favourites and see what others like.
3 Answers
+ 23
RegEx & AJAX
+ 2
I'll go first, but I can't really decide.
List Comprehensions, from Haskell or Python for example, are super amazing. For a mathematician like me, the notation is very intuitive and they make for concise and elegant code.
Generators are also a contender for my personal number one. Fast, memory efficient and semantically beautiful, they are defined like a function, but behave like a list.
+ 1
I think that Python's context managers are brilliant (they were my favorite construct before) but quite far from the power of generators, especially since 3.3