What I [think to] know is that simple word permutations don't help for general cases of localization, so printf would just work for some
primitive application special cases.
Java, as a language, was rather well designed.
On Sat, 27 Jan 2024 11:09:56 +0100, Janis Papanagnou wrote:
What I [think to] know is that simple word permutations don't help for
general cases of localization, so printf would just work for some
primitive application special cases.
In a project I worked on some years ago, I devised a custom string- templating scheme for localization purposes, using keywords to represent
the variable bits. We got as far as handling Japanese and Chinese, plus a
few European languages. [...]
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
As someone who as programmed daily in C++ since 1989, usually
in performance sensitive code, I've never found the C++ input
and output operators useful.
The run-time cost both in space
and time is far more than the *printf formatting functions,
and they're less flexible when the formatting changes based,
e.g., on locale.
Java (as a newer language) has also some advantages, but was in many
respects far behind C++ (IMO).
Wow, that's a strong statement. What led you to hold that opinion?
Java, as a language, was rather well designed.
The run-time costs,
however, precluded the use of Java in most of the projects that I've
worked on since Java was introduced.
[...]
In Java, as in Python, all class instances are allocated on the heap. Therefore the word “new” becomes superfluous. And so Python gets rid of it, reducing class instantiation to what looks like a function call on the class name.
Yet Java keeps the requirement to say “new”. Why?
On 27.01.2024 22:04, Lawrence D'Oliveiro wrote:
In Java, as in Python, all class instances are allocated on the heap.
Therefore the word “new” becomes superfluous. And so Python gets rid of >> it, reducing class instantiation to what looks like a function call on
the class name.
Yet Java keeps the requirement to say “new”. Why?
If the "Why?" refers to the word "keeps" then the answer seems obvious; compatibility, to not break existing code.
If you're asking why "in the first place" they introduced it; I suppose
to differentiate it from simple types, and to indicate that such objects
are subject to the garbage collector (when getting unused).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 161:55:31 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,500 |