u/balazs8921

Why do Dart developers prefer this HORRIBLE style?

Why do Dart developers prefer this HORRIBLE style? See here: https://dart.dev/learn/tutorial/object-oriented#task-3-create-a-helpcommand

Why don’t they write the constructor like this?

HelpCommand() {
  addFlag('verbose', abbr: 'v', help: 'When true, this command will print each command and its options.');    
  addOption('command', abbr: 'c', help: "When a command is passed as an argument, prints only that command's verbose usage.");
}

This is MUCH more readable!

Why aren’t the properties placed at the top of the class (before the constructor)??? Why is there an empty line before the return statement inside the run method???

This is simply terrible and VERY difficult to read.

edit: I'm coming from Java, and the idiomatic Java code is much more readable.

reddit.com
u/balazs8921 — 2 days ago