Earlier quoted context omitted.
Your desktop monitor should already be in landscape mode, shouldn't it?
Not if you code a lot. It is not rare for developer to use vertical screen. https://img.devrant.com/devrant/rant/r_200135_Q9Fh4.jpg
25 Years of PHP
101–110 of 426 posts
Re: 25 Years of PHP
#102Earlier quoted context omitted.
some of the function names make me want to stab people What would be an example? My only real gripe with PHP is the annotation syntax What do you mean? Afaik there is no "annotation syntax" in PHP. Could it be that you confuse what certain frameworks and IDEs do with PHP, the language?
Function names are rather inconsistent. get: gettype get_class str: str_ireplace str_pad str_repeat str_replace str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn encode: base64_encode quoted_printable_encode session_encode rawurlencode urlencode gzencode php: php_uname php_sapi_name php_logo_guid phpinfo phpcredits phpversion htmlentites: htmlentities html_entity_decode to: stream_copy_to_…
Of course it would've been nice if, at any time in the past 20 years, they'd gone back and standardized those function names (possibly also adding some kind of backwards-compatibility shim for people who absolutely cannot update their ancient codebase with global search-and-replace), regardless of whether the story is true.
Re: 25 Years of PHP
#103Earlier quoted context omitted.
The biggest advantages of PHP over Java are build and deploy times, so coding a php app is much more rapid. You can test your app right away, even after a single line change and get immediate feedback on the screen, which I think is important in web dev because a lot of it is visual. The other advantage is the run-time. Java has a slow startup time and when you redeploy then you need to stop/start your entire app. Wi…
> Another advantage is that php runs each request with a clean state PHP apps are almost guaranteed to be "stateless", thus scaling up and down is quasi-painless also.
Re: 25 Years of PHP
#104PHP is damn fast now, no joke. And with all of the modern features it's actually not so bad to work in. I'm becoming increasingly puzzled every time I see PHP hate now, especially when I read tired comments like "just use rails". Laravel is arguably as good or even better than rails at this point, and PHP 7+ is definitely light years faster and lighter. One thing that still sucks is package management / composer.
What are the "modern" features of php? It looks like it's trying to shed it's dynamic nature and add types (with annotations etc). Also frameworks like Symfony / Laravel look more and more like java web frameworks to me. I'm not saying this is necessarily bad but there's nothing modern about types. Also, might make more sense to choose java if you need types.
Java is not a replacement for "PHP with types". There is currently nothing you can deploy as easily as a PHP web app. The operational overhead is very low because cheap, robust hosting providers have decades of experience with the most typical LAMP style stack.
I would also disagree in terms of language features. Gradual typing through type hints (and other 'on demand'-style consistency features) is a very ergonomic way to introduce consistency during development (plus implied performance optimizations). You write in 'free-dynamic-mode' initially and then add type hints where they make sense bit by bit, typically in function signatures. There are many examples of this in the (semi?) dynamic world.
Re: 25 Years of PHP
#105Earlier quoted context omitted.
The point of calling a "fractal" and talking about the "design" is that while you can only look at the surface in an article of reasonable length, it points toward strutural and systemic failings within the language itself. The problem is that PHP is built on bad foundations and while many of the superficial problems can be mitigated, the underlying foundations can't be fixed without breaking changes. (Or, as Python…
yet you don't see articles about how bad python is, it still receive lot of praises and much love. This is telling a lot about how fair are some comments about PHP.
This is the same reason I think Java gets a lot of respect: they had a few core language design ideas and built the language around them. People will say COBOL's syntax is horribly verbose, but you can see what they were trying to do.
So you might dislike those choices, but your critique becomes about the consequences of the choice, which implicitly is something the person making it can't know at the time.
With PHP, people are complaining that users have to live with a whole host of accidents or poorly thought out ideas that are now baked in.
Other languages get criticized for that, too. Python was hammered over their poorly thought out support for unicode in Py3K[4], which blocked many distros from supporting it until around 3.4. (And, generally, most people agreed Python3 was a mess until ~3.6 and the whole transition is widely seen as a case study in what not to do.)
Java gets dislike for similar bad choices. Java's Date class is pretty notorious[2] as a how-not-to. Java arrays are covariant, and it was staring them in the face as they coded the ArrayStoreException[5] to deal with otherwise perfectly valid assignments. But the .NET one-upped them by knowingly making their arrays covariant, despite knowing it was a problem in Java. (Probably to make it possible to run Java on the CLR.)
To pick on Javascript, critiques of promises[3] center around the fact that people proposed using monads, and the designers brushed it aside as theoretical. The famous 'wat' presentation[1] talks about behavior in Javascript (and others) that is magical and bizarre, and it's principally because Netscape has some neat ideas they didn't think through.
[1]: https://www.destroyallsoftware.com/talks/wat
[2]: https://codeblog.jonskeet.uk/2017/04/23/all-about-java-util-...
[3]: https://github.com/promises-aplus/promises-spec/issues/94
[4]: https://click.palletsprojects.com/en/7.x/python3/
[5]: https://docs.oracle.com/javase/7/docs/api/java/lang/ArraySto...
Re: 25 Years of PHP
#106I wrote a lot of PHP from 1999-2008. First as a hobby, then professionally. From 20 LOC guestbooks to payment gateways used to process millions in payments. It wasn't until recently that I was sure I'd written more code in any other language than PHP. These days I'll occasionally poke around with it or patch a bug, but that's about it. Is it a perfect language? No. But which language is? (I can hear the Lisp crowd gr…
That's the error.
Re: 25 Years of PHP
#107Earlier quoted context omitted.
you mean your favorite language prevents you to copy paste code, have variables shorter then 4 letters and also fixes the bugs for you, let me know this cool language so I can try it. I am also sure that in your first years of coding your code had no issues similar with the ones you described.
> your favorite language prevents you to copy paste code, have variables shorter then 4 letters "here's one place that PHP doesn't prevent poor quality code that is the same as other languages, and so all languages are the same" No languages prevent these things (that I am aware of), but not all languages have the same number of edge cases that PHP has. > and also fixes the bugs for you, let me know this cool languag…
> but not all languages have the same number of edge cases that PHP has.
I agree , some have more some have less
The things is that from your comment it shows you have no idea what you are talking about, I suggest you let people with experience in PHP to explain hat are the issues and how to work around them. I have a few experience in PHP, experience with 5.4 and older PHP not the 1990 version. What I could complain about PHP are small things I do not feel that I need some feature from Java or C#, my time is spent reproducing bugs reported by our users, debugging and fixing them or spent on adding new features, creating solutions etc.
I admit when I was younger I would complain about why do we have to use AS3, or PHP or X for this, there are better languages but this days I know that the language is a small part of the entire project, the hard part is creating solutions, a new dev will start by typing code and offering you a fast solution that someone else needs to fix it later, an experienced dev will think at 2,3 or more solutions, consider all the advantages and disadvantages, test then and finally start writing the code - so IMO the fact that soem language has a bit more sugar coding or and IDE starts 2 times as fast is irelevant, what is important is the person that generates the solutions and the person that when a bug is raised can dig deeper and find the cause and fix it.
Re: 25 Years of PHP
#108Re: 25 Years of PHP
#109I wrote a lot of PHP from 1999-2008. First as a hobby, then professionally. From 20 LOC guestbooks to payment gateways used to process millions in payments. It wasn't until recently that I was sure I'd written more code in any other language than PHP. These days I'll occasionally poke around with it or patch a bug, but that's about it. Is it a perfect language? No. But which language is? (I can hear the Lisp crowd gr…
Communities should be kept responsible for setting quality standards or failing to do so.
Re: 25 Years of PHP
#110Earlier quoted context omitted.
> It is possible to make something great with substandard tools. Is PHP substandard though? While it's no longer my cup of tea, I do remember it being fairly stable and performant. Some of the enterprise software I work with, that was written in Java is ridiculously bad, but I don't consider Java substandard. Real world example: the "Configuration" app I use takes a minute to start up on modern hardware, and it's mai…
In my experience, and of course opinion, yes. Java might also be "bad", I don't know. I programmed it for a bit but didn't like it so moved on. The main problem with PHP, the real killer, is not that it's complex, or the needle/haystack parameters to functions changed, or the iffy string escaping/unescaping or all that stuff, it's that it's hard to know all the edge cases in the language that could cause you to write…
I definitely get where you're coming from. But everyone is different, and thinks differently.
I did a lot of Rails after PHP, so I like using Coffeescript, even though that admission would get me mocked on any JS forum, since I've seen many people be called an idiot for not preferring Typescript.
As for frameworks, I like Svelte, because it works the way I think. I've seen a lot of negative comments from React and Vue users on people using less popular frameworks like Svelte.
My general attitude about these things is "if it works for you, that's great". I'm no longer a PHP user, but I don't think the reasons why I liked it 15 years ago have changed, even though my preferences have.