Skip to main content
Ooh nice
Source Link
The Thonnu
  • 1.6k
  • 2
  • 7
  • 31

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise but only, and also allows one expressionexpressions or statements.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise but only allows one expression.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise, and also allows expressions or statements.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

Make headers a bit smaller
Source Link
The Thonnu
  • 1.6k
  • 2
  • 7
  • 31

JS style

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise but only allows one expression.

Perl style

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise but only allows one expression.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise but only allows one expression.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

Update
Source Link
The Thonnu
  • 1.6k
  • 2
  • 7
  • 31

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise but only allows one expression.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

JS style

(parameters) => body 

Very concise. You can also have multiple statements if you wrap it in braces.

Python style

lambda parameters: body 

A bit verbose with the keyword lambda, and also only allows one expression.

Ruby style

do |parameters| body end 

Allows expressions or statements, but still a bit verbose.

Alternatively:

{ |parameters| body } 

More concise but only allows one expression.

Perl style

sub {my ($parameters) = @_; body}; 

Once again, allows expressions or statements, but it's even longer than Ruby.

C++ style

[&](parameters) {body} 

Concise and allows multiple statements.

Update
Source Link
The Thonnu
  • 1.6k
  • 2
  • 7
  • 31
Loading
Add C++
Source Link
The Thonnu
  • 1.6k
  • 2
  • 7
  • 31
Loading
Add Ruby and Perl
Source Link
The Thonnu
  • 1.6k
  • 2
  • 7
  • 31
Loading
Source Link
The Thonnu
  • 1.6k
  • 2
  • 7
  • 31
Loading