▲ 8 ▼ Wren: A classy little scripting language (wren.io) submitted 1 year ago by rssbot@lemmy.bestiver.se [B] to c/hackernews@lemmy.bestiver.se 9 comments fedilink hide all child comments Comments
[–] xxce2AAb@feddit.dk 1 point 1 year ago (7 children) That seems like a very nice alternative to Lua. permalink fedilink source hideshow 7 child comments replies: [–] whiwake@sh.itjust.works 2 points 1 year ago (6 children) This might confuse a lot of people class Unicorn { prance() { System.print("The unicorn prances in a fancy manner!") } prance(where) { System.print("The unicorn prances in %(where).") } prance(where, when) { System.print("The unicorn prances in %(where) at %(when).") } } permalink fedilink source parent hideshow 6 child comments replies: [–] xxce2AAb@feddit.dk 3 points 1 year ago (5 children) It's not obvious to me what you mean, exactly. What do you find confusing about it? permalink fedilink source parent hideshow 5 child comments replies: [–] whiwake@sh.itjust.works 2 points 1 year ago (4 children) I’m saying that when the project gets big, and each of those methods get long, A developer who is new to the project might have some confusion as to why there are methods with the same exact name inside of a class. permalink fedilink source parent hideshow 4 child comments replies: [–] xxce2AAb@feddit.dk 3 points 1 year ago Ah. Since they're targeting host applications written in C or C++, I doubt their target demographic would be unfamiliar with function overloading though. It's not like one has to use a feature just because it exists, so if it's really an issue just... don't? permalink fedilink source parent [–] Cochise@lemmy.eco.br 1 point 1 year ago (2 children) This is common on OOP. https://en.wikipedia.org/wiki/Function_overloading permalink fedilink source parent hideshow 2 child comments replies: [–] whiwake@sh.itjust.works 1 point 1 year ago (1 child) Yes. Which frequently leads to complications. #include <iostream> using namespace std; void log(int level) { cout << "Logging numeric level: " << level << endl; } void log(string message) { cout << "Logging message: " << message << endl; } int main() { log('A'); // Uh oh — which one is this? } permalink fedilink source parent hideshow 1 child comment replies: [–] ChairmanMeow@programming.dev 3 points 1 year ago The level one. But that's more due to implicit casting rather than function overloading imo. permalink fedilink source parent
[–] whiwake@sh.itjust.works 2 points 1 year ago (6 children) This might confuse a lot of people class Unicorn { prance() { System.print("The unicorn prances in a fancy manner!") } prance(where) { System.print("The unicorn prances in %(where).") } prance(where, when) { System.print("The unicorn prances in %(where) at %(when).") } } permalink fedilink source parent hideshow 6 child comments replies: [–] xxce2AAb@feddit.dk 3 points 1 year ago (5 children) It's not obvious to me what you mean, exactly. What do you find confusing about it? permalink fedilink source parent hideshow 5 child comments replies: [–] whiwake@sh.itjust.works 2 points 1 year ago (4 children) I’m saying that when the project gets big, and each of those methods get long, A developer who is new to the project might have some confusion as to why there are methods with the same exact name inside of a class. permalink fedilink source parent hideshow 4 child comments replies: [–] xxce2AAb@feddit.dk 3 points 1 year ago Ah. Since they're targeting host applications written in C or C++, I doubt their target demographic would be unfamiliar with function overloading though. It's not like one has to use a feature just because it exists, so if it's really an issue just... don't? permalink fedilink source parent [–] Cochise@lemmy.eco.br 1 point 1 year ago (2 children) This is common on OOP. https://en.wikipedia.org/wiki/Function_overloading permalink fedilink source parent hideshow 2 child comments replies: [–] whiwake@sh.itjust.works 1 point 1 year ago (1 child) Yes. Which frequently leads to complications. #include <iostream> using namespace std; void log(int level) { cout << "Logging numeric level: " << level << endl; } void log(string message) { cout << "Logging message: " << message << endl; } int main() { log('A'); // Uh oh — which one is this? } permalink fedilink source parent hideshow 1 child comment replies: [–] ChairmanMeow@programming.dev 3 points 1 year ago The level one. But that's more due to implicit casting rather than function overloading imo. permalink fedilink source parent
[–] xxce2AAb@feddit.dk 3 points 1 year ago (5 children) It's not obvious to me what you mean, exactly. What do you find confusing about it? permalink fedilink source parent hideshow 5 child comments replies: [–] whiwake@sh.itjust.works 2 points 1 year ago (4 children) I’m saying that when the project gets big, and each of those methods get long, A developer who is new to the project might have some confusion as to why there are methods with the same exact name inside of a class. permalink fedilink source parent hideshow 4 child comments replies: [–] xxce2AAb@feddit.dk 3 points 1 year ago Ah. Since they're targeting host applications written in C or C++, I doubt their target demographic would be unfamiliar with function overloading though. It's not like one has to use a feature just because it exists, so if it's really an issue just... don't? permalink fedilink source parent [–] Cochise@lemmy.eco.br 1 point 1 year ago (2 children) This is common on OOP. https://en.wikipedia.org/wiki/Function_overloading permalink fedilink source parent hideshow 2 child comments replies: [–] whiwake@sh.itjust.works 1 point 1 year ago (1 child) Yes. Which frequently leads to complications. #include <iostream> using namespace std; void log(int level) { cout << "Logging numeric level: " << level << endl; } void log(string message) { cout << "Logging message: " << message << endl; } int main() { log('A'); // Uh oh — which one is this? } permalink fedilink source parent hideshow 1 child comment replies: [–] ChairmanMeow@programming.dev 3 points 1 year ago The level one. But that's more due to implicit casting rather than function overloading imo. permalink fedilink source parent
[–] whiwake@sh.itjust.works 2 points 1 year ago (4 children) I’m saying that when the project gets big, and each of those methods get long, A developer who is new to the project might have some confusion as to why there are methods with the same exact name inside of a class. permalink fedilink source parent hideshow 4 child comments replies: [–] xxce2AAb@feddit.dk 3 points 1 year ago Ah. Since they're targeting host applications written in C or C++, I doubt their target demographic would be unfamiliar with function overloading though. It's not like one has to use a feature just because it exists, so if it's really an issue just... don't? permalink fedilink source parent [–] Cochise@lemmy.eco.br 1 point 1 year ago (2 children) This is common on OOP. https://en.wikipedia.org/wiki/Function_overloading permalink fedilink source parent hideshow 2 child comments replies: [–] whiwake@sh.itjust.works 1 point 1 year ago (1 child) Yes. Which frequently leads to complications. #include <iostream> using namespace std; void log(int level) { cout << "Logging numeric level: " << level << endl; } void log(string message) { cout << "Logging message: " << message << endl; } int main() { log('A'); // Uh oh — which one is this? } permalink fedilink source parent hideshow 1 child comment replies: [–] ChairmanMeow@programming.dev 3 points 1 year ago The level one. But that's more due to implicit casting rather than function overloading imo. permalink fedilink source parent
[–] xxce2AAb@feddit.dk 3 points 1 year ago Ah. Since they're targeting host applications written in C or C++, I doubt their target demographic would be unfamiliar with function overloading though. It's not like one has to use a feature just because it exists, so if it's really an issue just... don't? permalink fedilink source parent
[–] Cochise@lemmy.eco.br 1 point 1 year ago (2 children) This is common on OOP. https://en.wikipedia.org/wiki/Function_overloading permalink fedilink source parent hideshow 2 child comments replies: [–] whiwake@sh.itjust.works 1 point 1 year ago (1 child) Yes. Which frequently leads to complications. #include <iostream> using namespace std; void log(int level) { cout << "Logging numeric level: " << level << endl; } void log(string message) { cout << "Logging message: " << message << endl; } int main() { log('A'); // Uh oh — which one is this? } permalink fedilink source parent hideshow 1 child comment replies: [–] ChairmanMeow@programming.dev 3 points 1 year ago The level one. But that's more due to implicit casting rather than function overloading imo. permalink fedilink source parent
[–] whiwake@sh.itjust.works 1 point 1 year ago (1 child) Yes. Which frequently leads to complications. #include <iostream> using namespace std; void log(int level) { cout << "Logging numeric level: " << level << endl; } void log(string message) { cout << "Logging message: " << message << endl; } int main() { log('A'); // Uh oh — which one is this? } permalink fedilink source parent hideshow 1 child comment replies: [–] ChairmanMeow@programming.dev 3 points 1 year ago The level one. But that's more due to implicit casting rather than function overloading imo. permalink fedilink source parent
[–] ChairmanMeow@programming.dev 3 points 1 year ago The level one. But that's more due to implicit casting rather than function overloading imo. permalink fedilink source parent