Skip to content

Instantly share code, notes, and snippets.

@JoeUX
Last active October 1, 2018 04:54
Show Gist options
  • Save JoeUX/70ef305ff8e64bca94dac2ebd4dd62fa to your computer and use it in GitHub Desktop.
Save JoeUX/70ef305ff8e64bca94dac2ebd4dd62fa to your computer and use it in GitHub Desktop.
A basic Dart program, taken from the Dart website
// Define a function.
printInteger(int aNumber) {
print('The number is $aNumber.'); // Print to console.
}
// This is where the app starts executing.
main() {
var number = 42; // Declare and initialize a variable.
printInteger(number); // Call a function.
}
// From https://www.dartlang.org/guides/language/language-tour
@JoeUX
Copy link
Author

JoeUX commented Oct 1, 2018

A better programming language would look like this:

var number = 42
display "The number is {{number}}."

Notes:

  1. Remove all punctuation noise like curly braces, semicolons, and empty parentheses.
  2. Use the word display instead of the 1960s relic print.
  3. Don't use two different variables for this (aNumber and number).
  4. Don't use a disjointed two part program (with two different variables).
  5. Don't require the invocation of two different functions.
  6. Forget about main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment