Click here to Skip to main content
15,881,715 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Steve Naidamast18-May-20 2:50
professionalSteve Naidamast18-May-20 2:50 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Jalapeno Bob22-May-20 9:22
professionalJalapeno Bob22-May-20 9:22 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
johnywhy23-Oct-21 3:57
johnywhy23-Oct-21 3:57 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Fred283417-May-20 20:51
Fred283417-May-20 20:51 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
johnywhy8-Dec-22 20:29
johnywhy8-Dec-22 20:29 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
lopatir17-May-20 20:52
lopatir17-May-20 20:52 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
johnywhy22-Oct-21 7:57
johnywhy22-Oct-21 7:57 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Lorenzo Bertolino17-May-20 20:59
professionalLorenzo Bertolino17-May-20 20:59 
It won't be the most concise, human-understandable and practical language but Dart sure is very concise, for a statically typed language, dropping a lot of the oop cruft that languages such as c# or java have

abstract class Item {
  use();
}

class Chest<T> implements Item {
  List<T> contents;

  Chest(this.contents);

  use() => print("$this has ${contents.length} items.");
}

class Sword implements Item {
  int damage = 5;

  use() => print("$this dealt $damage damage.");
}

main(){
  var chest = Chest([Sword()]);

  chest.use();

  for (var item in chest.contents) {
    item.use();
  }
}

It drops public and private in favor of using "_" before private instance variables, doesn't require the new keyword, has a very concise (and imo clear) function definition style and a constructor definition that can't be made slimmer without impacting heavily on understandability.

Regarding
| Notice the lack of punctuation. Notice judicious use of whitespace as syntax.
(how do you quote text? Smile | :) )
Yeah, no, as you can see there is a lot of punctuation and whitespace is basically meaningless

For the practicality of this language... outside of Flutter, not much, honestly.
I find it to be very neat but it isn't going to replace js any time soon

Edit: the code is taken more or less literally from the examples on dart.dev

modified 18-May-20 3:09am.

AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 1:28
mveRichard Deeming18-May-20 1:28 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
KateAshman17-May-20 21:57
KateAshman17-May-20 21:57 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts17-May-20 22:48
kalberts17-May-20 22:48 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 1:33
mveRichard Deeming18-May-20 1:33 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts18-May-20 4:30
kalberts18-May-20 4:30 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 4:39
mveRichard Deeming18-May-20 4:39 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts18-May-20 20:59
kalberts18-May-20 20:59 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 23:40
mveRichard Deeming18-May-20 23:40 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts19-May-20 6:55
kalberts19-May-20 6:55 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming19-May-20 7:31
mveRichard Deeming19-May-20 7:31 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Stuart Dootson18-May-20 0:59
professionalStuart Dootson18-May-20 0:59 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
BryanFazekas18-May-20 2:21
BryanFazekas18-May-20 2:21 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
W Balboos, GHB18-May-20 2:35
W Balboos, GHB18-May-20 2:35 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Member 1181677618-May-20 3:47
Member 1181677618-May-20 3:47 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
sasadler18-May-20 8:51
sasadler18-May-20 8:51 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
nedzadarek18-May-20 10:25
nedzadarek18-May-20 10:25 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
B Alex Robinson18-May-20 13:45
B Alex Robinson18-May-20 13:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.