The Good, the Bad, and the Ugly: What Happened to Unicode and PHP 6
slideshare.net/andreizm/the-good-the-bad-and-...Posted May 30, 2011, 5:31 AM UTC
Posted May 30, 2011, 5:31 AM UTC
Summary: "PHP 6 won't happen because PHP is about doing easy things poorly, and Unicode is too hard for anyone to be interested in doing at all."
What? That is not the summary. The summary is that they chose UTF-16 instead of UTF-8, which was a huge mistake and required a tremendous amount of code to be written and changed.
I thought that by now people would stop making that mistake. Always use UTF-8 and never any of the other encodings.
If they had chosen UTF-8 from the start I bet this project would have been completed. And one main reasons for that is you can do it incrementally.
Switching PHP to UTF-16 is all or nothing. But UTF-8 works with regular ASCII, so whichever parts you change work, and the rest don't break, they just don't handle unicode natively.
But UTF-8 works with regular ASCII, so whichever parts you change work, and the rest don't break, they just don't handle unicode natively.
Depends on whether your prior language assumed Latin1 or ASCII. If it assumed ASCII then you're fine. If it assumed Latin1 then you'll find you have many fun and subtle problems to be careful of.
I would expect PHP to have a configuration option to turn on UTF-8 mode.
PHP is popular because of the cheap hosting available anywhere and most PHP users don't control their configuration options.
Exactly. There is nothing stopping PHP developers from moving ahead with a UTF-8 implementation. Likewise, there's no particular reason to be discouraged that a UTF-16 implementation failed to gather steam (except to be discouraged that it happened at all).
Equating the failure of this misbegotten project with the death of PHP is complete arsery.
This is non-sense.
Yes, UTF-16 has fallen out of facor in recent years, and I too prefer UTF-8. But the storage format is one of the smallest problems when working on Unicode support.
"PHP 6 won't happen because PHP is about doing easy things poorly, and Unicode is too hard for anyone to be interested in doing at all."
This actually the most accurate description of anything PHP devs do.
Clearly you know nothing about UTF-16.
And UTF-8 and 16 are not storage formats.
It's a MASSIVE change going from ASCII to UTF-16, you have nulls to deal with (so all your C functions don't work), you need to deal with byte orders. You have that stupid byte order mark. UTF-16 can not be resynchronized midstream.
It's a massive project implementing UTF-16.
UTF-8 on the other hand is completely compatible with ASCII - in most cases you don't have to do a thing to support it. A couple of functions need to be modified but the vast majority of your code is unchanged.
And PHP bashing automatically causes you to loose credibility.
Perl is advancing the Unicode standard in practical use:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-05/msg00788.html
Well there is that, and the fact that Internal is just a huge mess, where a handful of people just throw feces at each other, and are not really going anywhere.
The death of php6 was the reason, why I stopped actively developing anything PHP-related. Inertia kept me attached to it for a year, but 2 months ago I quit.
I still support my projects, but new projects use Unicode-aware languages with better core development culture.
I made the same choice.
What do you now use to develop web applications?
current project is in python, but I use a lot of languages all the time (ruby, javascript, various kinds of c)
In so many ways, this makes me feel disgusted at PHP. I used to develop in it, but now...
Seeing that they're treating the language as their "fun" time and not the professional language it's often used as (>.>) I can't take it seriously any longer.
I know a lot of you hate PHP, but to web developers, it can be a good source of income.
I've used PHP mostly. What are realistic alternatives? ASP and Perl?
Edit: Also Ruby.
Edit: Don't know why I'm getting downvoted, I'm asking out of curiosity, not arguing.
Python, coldfusion and java are also common in the web space, borderline cases are lisp, and c++.
C++? That's very borderline.
Perhaps you mean C# and ASP.NET/MVC?
I never got what was wrong with using binary C++ for the web... Leave all the scripting to Python and compile everything down in C++.
I like Java for persistent servers, PHP for quick and dirty scripts/ sites, and I'm moving into Python for more important scripts. I am learning C, C++ and maybe C# at some point soon, maybe Go too. But I can't speak for them yet.
ASP I dislike, Perl I've never tried, and I didn't like Ruby either :3 Can't explain why, it was a fleeting moment.
I didn't like ASP much either, I tried Ruby but it seemed a bit mickey mouse - maybe I didn't go in the right direction with it. Perl is really cool but I think you have to work more for some things that come easy in PHP. That said, I've only dabbled. PHP is the one I've done most in, ASP second, and I hear PHP is bad and I'm not a fan of ASP so I've been trying to work out what I should learn to use for future web coding.
I'm lost when it comes to compiled languages on the server-side, so that'll be a new one. C# is be really cool for client-side applications, but would it be insanely difficult for web coding?
Abandoned PHP applications are a typical web developer's nightmare.
Indeed, I've seen some horrifying projects...
Unicode identifiers? Something tells me that's not a good idea.
We could finally have an error function named ಠ_ಠ
$ perl -Mutf8 -E 'sub ಠ_ಠ {"error"}; say ಠ_ಠ'
error
It's great for non-Latin1 people.
Only problem would be if Unicode changes the definition of what an identifier is, and they might.
Java has you covered.
What is this sorcery declaring variables inside the loop?
its bad enought with just a US keyboard and no unicode. Have you ever tried to read code that was written in ANY computer language say Ruby, Ada95 or C++ but by a Spanish or French speaker hehe.
class Elevadora extends Estructuro { String compartemento_numbero = ''; }
it's a nightmare ....... similarly HTML with unicode text (eg, Arabic text portions in paragraphs) ...... sigh.
Right. Unfortunately for some, programming languages were written for English speakers. English is the most widely spoken language in the world. If you want to program, you need to know English.
It's a well known fact that it takes a few minutes to switch gears from one language to another. Embedding one in another? Ugh.
It's a well known fact that it takes a few minutes to switch gears from one language to another. Embedding one in another? Ugh.
Not really, not spoken languages. I do so daily, multiple times in one sentence.
I doubt that, since I read about this in psych and experience the same problems myself.
Depends on what you're programming. Most math symbols are non-ascii so if you're doing something like translating a lot of math equations into code it would actually be a blessing to be able to use the same symbols.
That just makes it difficult to program. It's much easier to type mu or chi than to type μ or χ.
I had my Xcompose set up so it was as easy as COMPOSE-g-m (Greek, mu). Miss it a lot on Windows.
i'm heartened to see php finally getting called out for the ghetto it is, with its own foreclosed suburb of never-lived-in macmansions (php6)
but hey, facebook uses it, so it must be good
TIL that mojibake is a real word.
What languages DO have support for Unicode?
Perl since 5.6 (March 22, 2000) though refined greatly in 5.8. (July 18, 2002)
Python 3 is straight unicode.
On *NIX (or when specifically configured). Otherwise Python3 uses UCS-2 for internal representation.
Didn't know that. That's okay, though, I'm sure it makes very little difference for the programmer, and most of my Python is *NIX anyway.
Ummmm....what???
UCS-2 is Unicode.
I'd also like to see a citation that says that Python 3 is totally different in its Unicode handling on Unix and Windows. With the exception of OS-specific stuff like filenames, I'm EXTREMELY skeptical.
UCS-2 is not Unicode. It misses the upper planes. UCS-4 is Unicode.
Here is a place where someone suggests that the problem could be solved by simply making everything UCS-4. There is a survey of which implementations do UCS-4 and which implementations do UCS-2. At the point of time of the survey Windows did UCS-2 and the Linuxes mostly did UCS-4.
Here is a complaint about the use of UCS-2 in Python3 with associated comments.
Does it natively support all the features they were trying to implement?
[deleted]
Um... python3 supports unicode identifiers just fine.
So Python doesn't fully support unicode and localization?
Why do you believe they're stupid?
Go
perl, python, java and all jvm based languages, all .net based languages, go, some common lisp/scheme implementations, erlang.
Python 3, Ruby 1.9, a lot of JVM languages
I hate having to read a bunch of slides to get basic info. This post explained the problem a bit more for me.
http://www.teamlalala.com/blog/2010/03/30/whatever-happened-to-php6/
Does slide 13 not load for anyone else?
Check your encodings.
But seriously:
Unicode != I18N
- Unicode simplifies development
- Unicode does not fix all internationalization problems.
Long time PHP developer here, (been using it for 9 years), but I'm not professionally employed.
I'm struggling to understand this slideshow. What does it mean in layman's terms, and what are the practical advantages of Ruby/Perl/ASP (or whatever people would recommend to replace PHP) in a medium-sized website-building project.
It doesn't mean anything, except that one guy's poorly-conceived plan to retrofit Unicode into PHP never got off the ground.
Someone else's will, one day. Until then, it's easy enough to work with UTF-8 in PHP anyway.
I don't think so. PHP developers are not up to that task, it is just to hard for them.
Slide 25 may explain a lot.
Edit: Also: Unicode identifiers? What could possibly go wrong?
Lots of languages have unicode identifiers -- pretty soon you'll have a hard time finding a language that doesn't have them.
I'm sure they do, but I'm not looking forward to the day I find that the only FOSS project I can rely on for whatever purpose have variable names in thai. Programming is hard enough without having to worry about linguistics at the same time. I realize that I'm being myopic - I say that because I already find english variable names easy and convenient. I might not have had the same attitude if I'd been chinese, but I submit that a chinese programmer would not find code with, say, arabic variable names easy to use and / or maintain either.
A lot of programmers don't know English so they're incapable of giving variables English names. I've seen at least one project where all the variables, functions, etc were in French. You don't even need Unicode for that!
And as a French person I find it ridiculous unless it's a toy language or an excel macro. You can't be good at programming if you don't understand English.
They're useful for programmers with non-Latin1 keyboards.
It'd be no different than an ASCII identifier, other than Unicode deciding to change what should be included in an identifier on you, which they're thinking of doing soon.
Call me a weirdo but I think using CppCMS and C++ is a better option than PHP + web framework. At least with C++ I get great performance.
Spoken like a true C++ programmer.
Weirdo.
At least C++ has great Unicode support. Wait a minute ...
It does, via a library. Well, several libraries in fact. Not the standard ones of course. In fact, a lot of fun can be had building an application out of libraries that disagree on what a string is.
Yep, C++ - the 'general purpose programming language' (according to Stroustup's homepage) without support for strings, dates and decimals.
How long does compilation take for large projects? In PHP changes are instant.
but the scars are forever
About 6 years ago I jumped to Ruby.
I never regretted it.
PHP is a horrible language.
Ever since I jumped, I kept on ranting against PHP.
But since about 2 years I no longer really care about PHP in any way, not even ranting against it. I am so heavily detached from PHP that it makes no real difference whether it exists or not.
I don't even say that PHP should die much anymore. But I think people need to switch to ruby or python instead.
There are only two projects where PHP is really awesome, but not because as a language, instead because the projects are cool.
This is Mediawiki, and phpBB.
As soon as there are REAL competitors to these two, will PHP fade rapidly. (And they must be at least as good as them - sorry, most alternatives to these projects are INFERIOR, even though PHP as a language sucks. This shows that you can build great projects even with a crappy language.)
PHP happened to PHP6.