Ask HN: Best features of your favourite language?

12 points by neilellis ↗ HN
I've been hacking away at a scripting language for a while and I'm interested to see what language features from your day-today programming you like most?

I'll kick it off with:

Java 8 - Streams, collection processing.

TypeScript - progressive typing.

23 comments

[ 5.6 ms ] story [ 766 ms ] thread
Python - Introspection, metaprogramming
C++ - All the power of C, but with better data structures
Red: amazingly easy gui creation and cross compilation. There's a lot to like about that language and its toolset.

Following somewhere after that, are JS's prototypes, my first introduction to inheritance.

But then again, I don't know that many Languages and barely touched red. I'm only waiting for their gui backend on linux and then I'll dive right into the language.

PHP - make changes, just refresh browser. No compiling, node/pm2 restarts, anything.
The write / refresh cycle in PHP is really underrated. The same goes for it's "no state between requests" model. Both of these would be interesting to see in combination with a better language.
In my experience the "deploy via SVN/Git" model is especially well suited to PHP.
Also amazing for creating MVPs. If you are a solopreneur with no shame (as in you don't give two shits about bugs, best practices, continuous delivery, etc) then I believe that a week is more than enough time to launch even the most ambitious of projects with PHP.
Elixir - Pattern matching for function signatures. So many conditional statements just nuked from orbit.
That's a good one. Once I started making use of that my functions are a lot smaller and cleaner.

To add to Elixir, I would say the ease of interoping with Erlang. It allows me to easily take advantage of the massive Erlang libraries that are built in (such as crypto) without having to do anything extra.

Best feature also most confusing aspect of Vietnamese: the "pronoun" system. The way you uses a pronoun in a sentence reveals your relationship toward that person, your social standing to that person, and your emotion toward that person (not necessary all at once but certainly more nuanced than "you")
Can you elaborate a bit, possibly add examples? Sounds very interesting.
In Vietnamese, there are some noun used as pronoun. Therefore the number of pronoun in usage is much more diverse than say English pronoun. For example, the word pronoun "you" in English is used for both addressing the second person both singular and plural. However, there is no one translation for "you" in Vietnamese.

How you would address the person you speaks to depend on the circumstance:

- If you are a child and you are speaking to your parent, "you" would be "ba/cha/bố" (father) or "mẹ/má" (mother).

- If you are speaking to your sibling, then "you" would be "anh/chị/em" (older brother/older sister/younger sibling).

- If you are on the street and speaks to a person around your age "anh/chị" (even if they are the same age or younger than you a little bit, it's show polite to refer to them as if they are your older sibling). This show that you can express politeness through the usage of pronoun.

- On the flip side, if you are really casual, you can use "mày", which usually mean "you" but very impolite. Some people can take offense if you use this to refer to them.

- Also the word "you" translate to different word for each person in your family tree (same thing with Mandarin if I remember correctly) as you refer to people in your family by their relationship to you, and there isn't just a direct translation for the English pronoun "you" for conversation around the family.

One of the thing I appreciate from English is that you just need to say the word "you" when refer to the person you are speaking to. You never have to worry about the context of the conversation that you are having and adjust your pronoun usage accordingly. When I speak Vietnamese, I often just estimate their age and use "anh/chị/bạn" (older brother/older sister/friend" accordingly. Also I try to use their name in place of the pronoun, which can sound weird sometime.

On the other hand, you can get away by not saying any pronoun in some case, mostly very casual case.

Non exhaustive list can be found here (along with an in-depth explanation of how this mess works): https://en.wikipedia.org/wiki/Vietnamese_pronouns

As I learned modern JavaScript this year, coming from Clojure most recently, I'm really digging JS's destructuring, extended object literals, spread arguments, and lambda syntax. It's a pretty dang sweet language to write in today.
C# - LINQ - Reflection
Once you go LINQ you never go back! Also, easiness of async/await.
I've been learning Ada as a hobby and I really like the language. Type system is powerful and flexible, compiler is really user friendly, OOP implementation is refreshingly DIY, support for concurrency via Tasks, C binding not too difficult.

Still learning, and there's not much out there in terms of libraries to interface with other tech, but its been enjoyable.

Are you using GNAT? What kind of programs are you writing to learn? Why Ada?
Yes, I'm using GNAT. Right now I'm working on a text based adventure game with procedural generated content. I was initially interested in the language because of how it allows for nested functions, so I bought a book and started working through it, and like a lot of the other features it offers.
Common Lisp: The tooling; outside of smalltalk there is no language with implementations containing the combination of dynamicism and performance. I can profile a function (all the way down to assembly), make a change, recompile and re profile in seconds.

Seriously after using lisp, the amount of time C++ takes to link (much less compile) feels like an eternity.

The other usual suspects are nice, but a non-lisp with tooling that competes with slime I could still be happy with.

(other usual suspects):

The condition system: seriously every language with lexical closures should scrap their system for what common lisp has.

Macros: a bit like seatbelts or airbags; you can go for years without ever needing one, but when you do, you're really glad you had it.

I once considered this web server "LightTPD" as an alternative to Apache2, and I read some officially published and comparatively astonishing benchmarks for performance written in a language called Lua. Can anyone else speak to Lua's alleged superiority in the web service regard? Or, is this a consequence implicit to LightTPD?

(Sorry--not an response to question, explicitly, and thanks!)

LuaJIT is one of the faster JIT VMs in existence.

Lighttpd and nginx both started to get mind-share in the english speaking world at about the same time (nginx was written by native russian speakers IIRC).

Lighttpd was faster than apache for the same reason that nginx was, a more modern, non-blocking design.

I don't think that lighttpd is written in lua though. It probably supports lua scripting, though I haven't used that feature of it.

Python - a tie between metaprogramming features and comprehensions.