3 ms·
JS and Java can do that because they were designed reasonably well from the start. All they tend to add are more features on top of the solid core language. Pyt
by bobbylarrybobby 7y ago
JS and Java can do that because they were designed reasonably well from the start. All they tend to add are more features on top of the solid core language. Python's language was not solid (e.g., strings not unicode by default) so they needed a major overhaul.
- downerending 7y agoKind of an odd slam, given that Python (and most other widely used languages) predated Unicode. In any case, I think the jury is still out on whether Unicode in the primary string type is a good idea.
- colejohnson66 7y agoDidn’t C# come out after Unicode (1990s vs 2000)? And they still didn’t implement it properly. Instead, they went with the horrible UCS-2 because it made interfacing with the Windows API easier (it uses wchar_t (16-bit) and UCS-2).
- petre 7y agoI wouldn't call Js a reasonably well designed language but at least it supports Unicode strings.
- teh_klev 7y ago> JS and Java can do that because they were designed reasonably well from the start. Javascript was knocked up over a week or so. Sure it implements concepts from Scheme and other languages but it was certainly not "designed reasonably well from the start". Otherwise we wouldn't have needed books such as Crockford's "Javascript The Good Parts" to help us understand areas of the language to avoid/misuse. > Python's language was not solid (e.g., strings not unicode by default) From the article: "Python itself predates the first volume of the Unicode standard which came out in October 1991."
- int_19h 7y agoIt's funny that you should bring up Unicode strings as an example. Java strings aren't Unicode by modern standards - their char is fixed as 16 bits, because back in the day, UCS2 was "good enough for everybody". So the moment you have, say, an emoji, stuff like length() and indexing is no longer dealing in actual codepoints. And you can slice in the middle of a surrogate pair, and end up with an instance of String that's not even valid UTF-16. Python didn't get Unicode until later, so it had a chance to do it right - and it finally did, even on platforms like Windows where wchar_t is also 16-bit for historical reasons.