-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please consider for a version 3.0 #33104
Comments
I'll try summarizing the requests here:
|
If you approach what I am requesting, as it has helped me to better understand how the language works internally I can define the requests in the following way:
class Person {
private String firstName;
private String lastName;
private Int age;
public String getFirstName() {
return this.firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/*.....*/
}
final Person x = new Person();
x.setFirstName("Brian"); //Correct
x.firstName = "Dilan"; //Error. property is private By this I mean the visibility of the properties of a class only not of the class with what exists at the library level with the reserved words Export, Import, As and Show is sufficient.
print(String.of(540,000).toLowerCase().trim());
Math.pow(Dynamic.of("20").toInt());
List.of(['a','b','c','d','e']).map(/*....*/).reduce(/*.....*/); this syntax is beautiful does not require further explanation what else is to include more operators see the case of javascript with.
class Person {
private String firstName; //It is assumed ""
private String lastName; //It is assumed ""
private Int age; //It is assumed 0
private bol state //It is assumed false
}
final Person x = new Person(); this is what I always ago, there could be a way to make this syntax mandatory, this would avoid values null what I am not sure if it applies to all cases. Immutability is being used a lot in these times.
These improvements in the language if they are brought to reality will convert the language dart into the best language that I could use, it will be better than java, javascript and php and as I said before, Dart should be the star language of google as it is C# for Microsoft and Java for Oracle Dart must be there with that vision and Google must let it give support to things thrown with Java with TypeScript and even with JavaScript so that Dart can replace all that and take the role that deserves. To have this, there is a lot of work but this is the future without saying anything else, I say goodbye. |
For the examples here, Dart is a different language than, say Java, and it has chosen different designs for some things. Dart does have privacy, and it has getter and setter members as well, so there is never any reason to write code like:
In Dart, you should just write: class Person {
String firstName;
String lastName;
int age;
} There is no functional difference between this and the code you wrote, you can still change the first name. Whether you do class Person {
String _firstName;
String _lastName;
int _age;
Person(String firstName, String lastName, int age)
: _firstName = firstName, _lastName = lastName, _age = age;
String get firstName => _firstName;
String get lastName => _lastName;
int get age => _age;
} This gives you (library) private mutable fields and public getters only, so any code from a different library can only read the values, but your own library can change the fields. In other words, in Dart you don't need "getter methods", you use actual getters, and you can make fields private (but, alas, not "protected", that is still missing). You ask for methods on all types that can convert from one type to another. The examples are somewhat curious, though.
These would just be written as: print(540000.toString().toLowerCase().trim());
Math.pow(("20 as dynamic).toInt());
['a','b','c','d','e'].map(/*....*/).reduce(/*.....*/); I'm not absolutely sure what the Dart does not have overloading, so we can't have multiple functions with the same name and different argument types. Instead you need to choose a meaningful name for each function. That's why functions that take and interpret a As for allowing users to add more functions, that is something we are considering (perhaps something like traits or scoped extension methods). Having default values for variables that is different from I'm very dubious about the claim that "while" loops are obsolete. They are a tool, like any other, and they have advantages and disadvantages. The Dart is single-threaded, and I seriously doubt that is going to change any time soon (it's possible, but definitely not easy, to change at this point, too much code assumes that there is no real concurrency). That makes arguments that Adding |
@Ing-Brayan-Martinez - closing this as it's difficult to manage / triage such a broad request. Please feel free to file more specific requests (along the lines of the 2nd / 3rd comment breakdown) and reference the discussion here. You may also find existing bugs on some of those. Thanks! |
Good morning to all, I have been analyzing the answers and I will summarize it in a single proposal, which I consider a necessity and the most important one, as the translation is not exact I will explain it with a couple of examples: |
Greetings to the development team of the language dart, I am someone from Latin America, I do not speak English, but I apollo in Google translator and been helping in the promotion of this language to Latin America through this group of Facebook, the reason for this is to find a way to contribute to the improvement of the language through three proposals which seek to help readability and security of the code.
The first is to consider including the words reserved Public Private and Proteted this parese something much needed for a more readable code and to relizar a better encasulation of the data or properties, this will be actrativo approvers coming from the world of .NET Java PHP and TypeScript this to increase the popularity of the language of that estoi sure.
The second proposal is to have a better abstraction of the data types already in Dart 2.0, we have been working on that, what I propose is the following if we have the primitive types int, double, char, bol, dynamic, among others. I think we should have its complex version like Integer, Double, String, Bol, Dynamic to perform things like Integer.of ("1,500"); Dynamic.of ("2,000"). ToInteger (); that I look great, and hasi can be static or dynamic when we want.
The tersera proposal following the same order of ideas is borrowed from the golang language that deals with when we create a variable that comes preloaded with a value avoiding null variables and the classic example nullpointerexcections if we show a varible tipada bol x; its default value is false, the other to consider only have cycles for forget the while and do while the end result is a more concurrent language.
To finish I wanted to tell you a reflection, that google should bet more on this language as well as microsoft bet on c # o oracle by java google should bet on dart, google should stop supporting typescript and java or similar and switch to using dart as a language Principal this to grow your popularity, these are my proposals are easy but I know there is a lot of work behind you I hope you like them and I would like to be able to collaborate more actively especially with people who speak Spanish greetings to all
The text was updated successfully, but these errors were encountered: