4 ms·
Which Dart has. (lack of wrapper classes, wrapper functions, lots of brackets)
by robmcm 13y ago
Which Dart has. (lack of wrapper classes, wrapper functions, lots of brackets)
- nailer 13y ago>> Type safety doesn't require semicolons, wrapper classes, wrapper functions, explicitly defining whether everything is public or private because there's no default, or lots of brackets. > lack of wrapper classes, wrapper functions, lots of brackets That's 3 items of 5. Of those 3: - All the demos use wrapper classes and wrapper functions and I'm getting conflicted reports on whether Dart requires them or not (see munificent's post for example). If none of this junk is required, ditch it in the public docs. - Not sure why you think Dart doesn't need brackets, it clearly uses them for blocks.
- robmcm 13y agoNot sure of your angle here, are you comparing to coffee script or something? I thought you were referring to wrapping functions to return modules in JS. Or over use of anonymous functions that leads to confusing brackets and pyramids of curly brackets.
- nailer 13y agoComparing to most common web dev languages: - Python, Ruby, Coffee don't require wrapper functions and classes for small examples, eg hello world or the Fibonacci example on dartlang.org. That said, another commenter mentioned the examples for Dart include these wrappers needlessly so this may be a documentation problem. - JS, Python, Coffee, Ruby and Scala drop semicolons to terminate statements (which users already mark with line terminators) - Python and Coffee ditch the marking blocks with braces (which users already mark with indentation) - Python, Scala, Ruby, and Coffeescript set either 'public' or 'private' as a default for new methods, so users don't have to specify unless they want the non-default behaviour. (I have very little knowledge of PHP but from what I've seen it's generally not as chatty as Java either)
- spankalee 13y ago* Dart doesn't require "wrappers" or classes for anything, including hello world or Fibonacci. This has been pointed out in almost every comment where you've brought it up. Yes, the examples might be confusing here, and so for pointing that out thanks and I will bring it up with the team, but repeating the claim that Dart requires wrapper classes for functions is completely unnecessary at this point. * Most of the popular languages use braces for blocks. I sort of like significant whitespace, but it brings a lot of other problems. In the end braces are a pragmatic choice and have very little bearing on the utility or usability of a language. * Dart also has a default visibility: public. You change it to private by adding a leading underscore.
- nailer 13y agoYes, I've been quite happy to acknowledge the it may just be poor docs, as you'll have noticed. As the target audience for dart (I'm a web developer, who makes large apps, and doesn't already know dart) all I have to go on is the actual dart website, so you'll forgive me if I expect it's demonstrations would be showing the language as it's best. Fix the docs, ditch the semicolons, and Dart may get more popular. I think marking up blocks twice is a waste of time, and leads to the possibility of inconsistencies between indentation and parenthesis, but appreciate using indentation for blocks is too different for some existing programmers.