Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Everything Is References

Name: Anonymous 2010-08-20 16:29

Is there a language in which variables, function arguments, etc, are always references by default?

For example:

int x = 5;
int y = x;
y++;  // x and y are both 6


If you really did want a copy of something, you'd have to use a keyword:

int x = 5;
int y = copy(x);


And pass-by-value would also have to be done explicitly:

void func(int z)
{
   int w = copy(z); // now w is effectively "local"
}


It would force programmers to at least be aware of the fact that they're making a copy.

Name: Anonymous 2010-08-24 14:03

>>77
The only part of an MP3 player that needs to be efficient is the MP3 decoding?  Not even you know what point you're trying to make any more.
Winamp provides a fully skinnable UI, a rich plugin architecture, an archive management system, etc.

The reason you think everything should be built in C++ is because you're unable to conceptually separate the computationally intense subsystems of the application from the whole application itself. Think about all of the features in Winamp; what percentage of Winamp code do you think is specifically for MP3 decoding? 2%? 1%? So why should you write the entire program in a comparatively low-level language just for that small percentage?

While the main function of Winamp is playing music, there is no reason this needs to even be part of the application code. Any modern OS provides decoding MP3s as a system service; for those formats it doesn't, you can use (foss or licensed) third-party libraries. If you do need to write something like this yourself, you can write it in a low-level language and link it in, and keep the other 99% of the program in a better language.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List