Author Topic: What's your favorite language feature?  (Read 2341 times)

0 Members and 1 Guest are viewing this topic.

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2018
  • Country: nl
What's your favorite language feature?
« on: March 05, 2020, 11:16:59 am »
Thought it would be fun to hear from other people what cool language features are out there. What feature in your programming language of choice do you like the most? Can be anything about any language.

My choice would have to be ... mmmhh, list comprehension in python. Maybe generators in general. Oh and itertools, and, and... But to keep it specific, yes, list comprehension.

So what's yours?
 

Offline jfiresto

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: de
Re: What's your favorite language feature?
« Reply #1 on: March 05, 2020, 11:27:52 am »
Associative arrays (dictionaries), named arguments and coroutines
« Last Edit: March 05, 2020, 03:15:44 pm by jfiresto »
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 11735
  • Country: gb
    • Having fun doing more, with less
Re: What's your favorite language feature?
« Reply #2 on: March 05, 2020, 11:37:09 am »
Hard realtime performance guaranteed by the IDE not measurement (combination of hardware and software), output to be executed at specified clock cycle, input received at a specified clock cycle. All found in xC running on xCORE processors

Built-in primitives (not libraries) for multiprocessor systems and inter-processor communication. Found in CSP, Occam, xC and to a lesser extent Rust and Go.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 9706
  • Country: my
  • reassessing directives...
Re: What's your favorite language feature?
« Reply #3 on: March 05, 2020, 11:51:12 am »
pointer, pointer to pointer, type casting, OOP, operator overloading. keen coder should already know what is this, only one language can provide this at humanly friendly language/syntax. the rest? list of <insert whatever here>, dictionary <insert your fav here> etc all can be made later on as a class or whatever (higher level function), but once the pointer feature is not available directly, it feels like sitting on a wheelchair losing both legs.
It's extremely difficult to start life.. one features of nature.. physical laws are mathematical theory of great beauty... You may wonder Why? our knowledge shows that nature is so constructed. We simply have to accept it. One could describe the situation by saying that... (Paul Dirac)
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 13652
  • Country: cn
  • Power Electronics Guy
Re: What's your favorite language feature?
« Reply #4 on: March 05, 2020, 11:53:07 am »
Venerable universal scanf family.

Sounds simple, but interesting enough MSFT didn't have them included in .NET.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3610
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: What's your favorite language feature?
« Reply #5 on: March 05, 2020, 01:27:27 pm »
Conditional execution, especially as applied to branch instructions.

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 5324
  • Country: fr
Re: What's your favorite language feature?
« Reply #6 on: March 05, 2020, 05:27:26 pm »
Swearing and cursing.  ::)
 
The following users thanked this post: Siwastaja

Offline jfiresto

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: de
Re: What's your favorite language feature?
« Reply #7 on: March 05, 2020, 05:40:32 pm »
Swearing and cursing.  ::)
Ah, but in what language?
 

Offline boffin

  • Supporter
  • ****
  • Posts: 953
  • Country: ca
Re: What's your favorite language feature?
« Reply #8 on: March 05, 2020, 05:56:40 pm »
  • Associative Arrays/Dictionaries (most modern languages)
  • Sets (Pascal).  Just wait until you use a set to represent an output register.  It's a thing of beauty....

 

Offline dferyance

  • Regular Contributor
  • *
  • Posts: 130
Re: What's your favorite language feature?
« Reply #9 on: March 05, 2020, 06:10:13 pm »
Separate compilation / linker.
So many "modern" programming languages don't bother with it (Java, .Net, Python, NodeJS). So you end up with Docker hell trying to manage all your dependencies.

A programming language ought to be able to produce a single executable without additional runtime libraries or installs. That isn't to say all applications should be a single executable, but they all ought to be able to use a linker to include dependencies (as well as exclude) at compile time.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 5324
  • Country: fr
Re: What's your favorite language feature?
« Reply #10 on: March 05, 2020, 06:37:47 pm »
Swearing and cursing.  ::)
Ah, but in what language?

Any that supports it. The OP said: "Can be anything about any language."

 

Offline ve7xen

  • Frequent Contributor
  • **
  • Posts: 732
  • Country: ca
    • VE7XEN Blog
Re: What's your favorite language feature?
« Reply #11 on: March 05, 2020, 08:01:04 pm »
I'm going to go with type inference as my favourite 'general' feature. It makes strongly typed languages so much nicer to use.

As for the 'coolest' feature, I'm going to go with Golang's goroutines and channels.
73 de VE7XEN
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 11735
  • Country: gb
    • Having fun doing more, with less
Re: What's your favorite language feature?
« Reply #12 on: March 05, 2020, 08:51:11 pm »
I'm going to go with type inference as my favourite 'general' feature. It makes strongly typed languages so much nicer to use.

As for the 'coolest' feature, I'm going to go with Golang's goroutines and channels.

Actually Communication Sequential Processes' channels and execution semantics. From 1976, from CAR Hoare. Look him up on wackypedia etc.

First implementation : Occam in the early 80s. Current variant: xC,  as per my previous post :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 1704
  • Country: fi
    • My home page and email address
Re: What's your favorite language feature?
« Reply #13 on: March 05, 2020, 10:03:55 pm »
Aggressive and words of power.

External language bindings in various programming languages, and extended inline assembly in GNU C and C++.
 

Offline bsudbrink

  • Frequent Contributor
  • **
  • Posts: 406
  • Country: us
Re: What's your favorite language feature?
« Reply #14 on: March 05, 2020, 11:26:43 pm »
I like languages that allow direct access to hardware, including the CPU and its registers.  And the operations are represented by simple numeric codes in consecutive memory locations.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 11183
  • Country: us
  • DavidH
Re: What's your favorite language feature?
« Reply #15 on: March 06, 2020, 12:59:09 am »
Sane casting of integer multiplies and divides would be my favorite language feature if it existed.

 

Offline I wanted a rude username

  • Frequent Contributor
  • **
  • Posts: 388
  • Country: au
  • ... but this username is also acceptable.
Re: What's your favorite language feature?
« Reply #16 on: March 06, 2020, 03:17:42 am »
 

Offline golden_labels

  • Regular Contributor
  • *
  • Posts: 180
  • Country: pl
Re: What's your favorite language feature?
« Reply #17 on: March 06, 2020, 04:02:01 am »
Prototype-based programming. Easy to abuse, but great for compatibility layers and modifying method behaviour. Unfortunately also quite inefficient. :(
Any type of sane multiline string literals, possibly coupled with indentation removal.
Template metaprogramming in C++. Too bad the error messages are unreadable.
Null coalescing and Elvis operators, in various shapes and forms.

Separate compilation / linker.
So many "modern" programming languages don't bother with it (Java, .Net, Python, NodeJS). So you end up with Docker hell trying to manage all your dependencies.

A programming language ought to be able to produce a single executable without additional runtime libraries or installs. That isn't to say all applications should be a single executable, but they all ought to be able to use a linker to include dependencies (as well as exclude) at compile time.
Java has a separate compiler (javac) and “linker” (java).

Since Java has no executables, it also means the second paragraph would not apply. However: the closest it has to executables, JARs, allow you to pack anything you want — including all the dependencies. This is a horribly bad practice that will bite you just like any other failure at using modularity, but there is nothing that prevents you from doing so.
« Last Edit: March 06, 2020, 04:08:20 am by golden_labels »
Worth watching: Calling Bullshit — protect your friends and yourself from bullshit!
 

Offline ivaylo

  • Frequent Contributor
  • **
  • Posts: 634
  • Country: us
Re: What's your favorite language feature?
« Reply #18 on: March 06, 2020, 05:56:14 am »
functions as first class citizens
in any language...
 

Offline emece67

  • Regular Contributor
  • *
  • Posts: 225
  • Country: es
Re: What's your favorite language feature?
« Reply #19 on: March 06, 2020, 08:37:24 am »
Dictionaries & regexps.
Information must flow.
 

Offline jfiresto

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: de
Re: What's your favorite language feature?
« Reply #20 on: March 06, 2020, 01:45:18 pm »
Closures
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 13652
  • Country: cn
  • Power Electronics Guy
Re: What's your favorite language feature?
« Reply #21 on: March 06, 2020, 01:55:27 pm »
This is a horribly bad practice that will bite you just like any other failure at using modularity, but there is nothing that prevents you from doing so.

Or you just go the complete opposite, using containers.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 5324
  • Country: fr
Re: What's your favorite language feature?
« Reply #22 on: March 06, 2020, 04:02:02 pm »
Template metaprogramming in C++. Too bad the error messages are unreadable.

I would cite metaprogramming in general as well. Unfortunately, this is so badly implemented in most languages I know of that I can't really associate this sanely with any.
C++ templates were a nice attempt at first, but they became horrible, and yes the diagnostic messages are usually unusable, so you better get it right first or you will cry.

Since Java has no executables, it also means the second paragraph would not apply. However: the closest it has to executables, JARs, allow you to pack anything you want — including all the dependencies. This is a horribly bad practice that will bite you just like any other failure at using modularity, but there is nothing that prevents you from doing so.

Java itself is a horribly bad practice. >:D
 

Offline dferyance

  • Regular Contributor
  • *
  • Posts: 130
Re: What's your favorite language feature?
« Reply #23 on: March 06, 2020, 07:46:55 pm »
Quote from: golden_labels link=topic=232434.msg2950470#msg2950470
Java has a separate compiler (javac) and “linker” (java).

I intended to mean static or compile-time linker. Most languages and operating systems have some sort of dynamic linker.

Yeah, JAR is essentially a work-around, similar to Docker. It still is dynamic linking, slows down program startup, can fail for things that ought to be caught at compile time, doesn't eliminate dead-code or do link-time optimizations. But it is better than having a ton of files all over the place.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1306
  • Country: 00
Re: What's your favorite language feature?
« Reply #24 on: March 06, 2020, 09:03:32 pm »
I would say that, in general, my favorite language feature is "being modern."  That is, a language that evolves to meet the demands of modern software engineering and doesn't rest on its laurels and live in the past.  A language that helps the developer apply best practices as they are understood here-and-now.  (I'm basically calling-out languages like 'C', here.)

Specifically, I'd say one of the most interesting language features to come (back) around recently is coroutines.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf