2 ms·
Interesting view. What makes it feel like java in your opinion? I think I see your point about dart being what JS should have been but I would add that it is al
by fngjdflmdflg 3y ago
Interesting view. What makes it feel like java in your opinion? I think I see your point about dart being what JS should have been but I would add that it is also like what Java should have been. And really the only reason to compare it to Java is because it is the language that spawned most other comparable languages (C#, Swift, Dart, Kotlin, JS (kind of)). But syntactically Dart is nothing like java:
- no `new`
- no single class files only restriction
- named parameters
- no java.util.arraylist nonsense.
semantically it is also very different (unlike eg. Kotlin)
- first class support for passing functions as parameters (this is the worst issue with Java by far and can't be understated)
- sound type system (String cannot be null)
- async/await
- no bytecode
lots of other QOL features as well. If you're really thinking of trying out Flutter don't let Dart stop you from doing so. You may even find you like it!
- neonsunset 3y agoWith all those you could just use C# with much better outcome…
- fngjdflmdflg 3y agoI'm not too familiar with C# but I know it does not have a sound type system and it appears to require the "new" keyword for instantiating new objects. You need to import System.Collections for dynamiaclly sized arrays. Also appears to not have python-like print() (requires Console.WriteLine()). It also doesn't have flutter obviously. But in any case my point was more that Dart isn't really like Java. Why do you think C# will give you a better outcome?
- neonsunset 3y agoWe’re reaching the levels of hello world optimization even the staunchest proponents of top-level statements (write Program.cs python script style) considered impossible.
- fngjdflmdflg 3y agoWhat about sound types? And I think having dynamically sized arrays in the language rather than standard library is an improvement in general because it removes extra cognitive load. Same for "print()." It just makes the language easier to write. The same way we never really need to pass functions as arguments because we can always pass an object that is guaranteed to have that function defined for it via interfaces. This is what is generally done in Java and it is awful.
- neonsunset 3y agoWhat? None of this makes any sense. C# is not Java. It has different syntax and feature set. The print thing is just hilarious however. I have probably heard it only ever from someone who started programming a couple of months ago.