this post was submitted on 26 Oct 2025
8 points (100.0% liked)

Hacker News

2904 readers
328 users here now

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

founded 1 year ago
MODERATORS
top 9 comments
sorted by: hot top controversial new old
[–] replicat@lemmy.world 3 points 5 days ago

Wren is a cool language. It's supported by tic-80 so if your want to check it out, that's a good place to start.

[–] xxce2AAb@feddit.dk 1 points 5 days ago (1 children)

That seems like a very nice alternative to Lua.

[–] whiwake@sh.itjust.works 2 points 5 days ago (1 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).")
  }
}
[–] xxce2AAb@feddit.dk 3 points 5 days ago (1 children)

It's not obvious to me what you mean, exactly. What do you find confusing about it?

[–] whiwake@sh.itjust.works 2 points 5 days ago* (last edited 5 days ago) (2 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.

[–] xxce2AAb@feddit.dk 3 points 5 days 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?

[–] Cochise@lemmy.eco.br 1 points 5 days ago (1 children)
[–] whiwake@sh.itjust.works 1 points 5 days ago (1 children)

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?
}
[–] ChairmanMeow@programming.dev 3 points 5 days ago

The level one. But that's more due to implicit casting rather than function overloading imo.