What Happened to PHP?

lamp.jpg

There is a new tribe in town titled Learn2Code. This tribe will reward posts with the venerable BYTE token. The tribe also has a new Discord Server.

The tribe invites posts about coding; So, I decided to write a series of posts about coding.

A decade ago I wrote a series of articles about using PHP and MySQL to create dynamic web pages. My target audience was small businesses looking to add server side features to their web pages.

At the time, it was common for webhosts to offer a collection of programs called the LAMP Stack. The Acronym LAMP referred to "Linux, Apache, MySQL and PHP."

LAMP was the defacto standard for web development. NOTE: I asked Nightcafe to create a stack of antique lamps for this post.

Everything seemed good.

Sun Microsystems acquired MySQL in 2008. Everyone applauded.

ORACLE acquired Sun Microsystems in 2010. ORACLE Corporation is noted for draconian licensing agreements for its database products and the Linux world panicked.

Oracle began adding proprietary extensions to MySQL ... which is scary.

Opensource aficionados created a fork of MySQL called MariaDB.

I switched from using MySQL to SQLlite.

Changes at PHP

I advocated a functional design backed by a traditional relational database using the LAMP stack. This is the easiest way to create a dynamic web sites.

PHP 3.0 had some obvious security holes. Free form PHP was prone to SQL injection and other hacks, etc.

The functional approach reduces these vulnerability.

Anyway, the programming world blew up in my face with the release of PHP 7.0. PHP had problems with the programs they published for accessing databases. PHP deprecated the functions and instructed the world to use the new PDO object to access the database.

This is what happened to me:

I copied an example of code using the PDO object.

I ran it on my web server. I want to emphasize that the example that came from training material published in official PHP documentation.

The example was something like:

/******
* Imagine table with three transactions 1, 2, and 3.
* Three is the most recent transaction
******/

$stmt = $pdo->query("SELECT trans_id, price FROM Transactions ORDER BY trans_id DESC");
while ($row = $stmt->fetch()) {
  echo $row['name']."<br />\n";
}

There are three rows in the table. Row 3 has the most recent price. IMHO: It is the most important row.

The PDO object only returned rows 1 and 2. It skipped the most important row!

I admit. I am a traditionalist. I consider a function that returns the wrong value to be an abject failure.

The whole point of a function is that a function returns a predictable value!

Imagine that you were wanting to buy some BYTE on HIVE-Engine. Would you want to see price of the last transaction or would you want to see the price of the second to last transaction?

The fact that the PDO object returned the wrong value was a category killer for me.

I spent 6 months trying to figure out why PDO sometimes returned the wrong value.

ZEND Berates PHP Developers

What happened next was even worse.

I filed a bug report and contacted Zend (the company that developed the program).

I provided an example from their published materials. The example returned the wrong result.

The programmers at ZEND immediately did what every second rate computer hack does.

They launched into an attack and berated me.

They attacked me for using an functional approach to web design. They attacked me for the naming convention I used for variables ... again, I was using variable names from official documentation.

I was perplexed by the mistreatment. I then found out that the second rate hacks at Zend were berating anyone who had problems with their bug ridden code.

It is a very simple case of projection. One blames others for their core faults.

I can tolerate people mistreating me. I cannot tolerate systematic mistreatment of others.

The Zend customer base was small businesses that were hanging on by a thread. Zend killed thousands of mom and pop web design businesses.

The Cause of the Problem

BTW: The problem that I faced was the result of the way that the PDO object extended the Countable Object.

I have no clue as to why the PDO object would be extending the countable object.

The Zend Framework

As I understand, PHP was released under a slightly modified open source license. They disagreed with the "copyleft" principle that any code developed with PHP must also be open sourced.

Businesses have to have a way of making money. I have no problem with taht.

As I recall, Zend's approach was to extend PHP with a proprietary framework that included an IDE.

They licensed the proprietary framework for a fee.

I had no problems with that.

The problem I had was that they berated people who did not use their stinking framework.

At the time I advocated a functional framework as opposed to an object framework.

Unfortunately, I felt that I could no longer support the platform.

This was the second leg of the LAMP stack to falter.

From Zend to Laminas

People in the Linux Community balked against the proprietary extensions in the Zend Framework.

In 2019, Zend transferred control of Zend Framework to the Linux Foundation. They changed the name to Laminas.

Should I Return to PHP?

I still love the core PHP. Small businesses can easily role out PHP web sites using the functional paradigm.

I was burned out by Zend.

I do not have an irrational hatred of frameworks or object-oriented programming. I simply believe in using the right framework for the right job.

The Problem With Frameworks

I've been going through PHP related web sites and YouTube Channels. Much of the thought about PHP is revolving around frameworks.

The idea seems to be that one should chose a framework for their code, then code to that framework.

The problem with this is that when one programs for a framework, one builds a dangerous dependency on the framework.

PHP and HIVE

I've followed programming posts on HIVE. Although PHP continues to be the best programming language for small business. There does not appear to be much interest in PHP on HIVE.

HIVE developers tend to use node.js and python. I use Python for managing files. I am scared to use Python because I've seen people destroy files by mistakes in their Python code. While Javascript is great for integrating with the HTML DOM, I don't like using it for generating pages.

People here prefer Node.JS or Python. Sadly, everything that I dislike about PHP is true of both of these frameworks.

What Should I Write About For BYTE?

I decided to write some articles for the new @learn2code tribe and I am having a bear of a time figuring out what to write.

I am actually considering doing something extremely odd.

I am considering creating a web site from the ground up in C.

The articles will actually concentrate on core web technologies like the TCP/IP stack, network interface cards and the things that people discussed back in the 1990s.

I really don't know if the articles will have any value. To be truthful, I cannot think of a single subject I can write about that would not be berated by someone.

I notice that a whale has taken to downvoting the articles in the Learn2Code tribe. When did programming become such a toxic subject?



0
0
0.000
28 comments
avatar

Thanks
I enjoyed the read and I am looking forward to learning something new. !LOLZ

I do have an interest in learning how I can use php and PDO to access Hive data that I can integrate with my existing web2 membership site.

0
0
0.000
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000
avatar

I simply believe in using the right framework for the right job.

It is a very reasonable position. Although it is surprising that many times humans are very unreasonable creatures. So you may find, with surprise, that some fan of a particular language or system attacks you for your choice of work on one or another platform or programming language.

I notice that a whale has taken to downvoting the articles in the Learn2Code tribe. When did programming become such a toxic subject?

In subjective matters, there may be no reasonable cause. It may even be personal and visceral antipathy against the topic, without there being any mentally valid reason to give a downvote.

Any way at all. I'm not a programmer, I just like to review the history of things a little, and I liked how you explained the situations and contexts in your post.


!GIF Good post!
Stay !ALIVE
!PGM !LUV !BBH

0
0
0.000
avatar

@yintercept! You Are Alive so I just staked 0.1 $ALIVE to your account on behalf of @ pedrobrito2004. (2/10)

The tip has been paid for by the We Are Alive Tribe through the earnings on @alive.chat, feel free to swing by our daily chat any time you want, plus you can win Hive Power (2x 50 HP) and Alive Power (2x 500 AP) delegations (4 weeks), and Ecency Points (4x 50 EP), in our chat every day.

0
0
0.000
avatar
(Edited)

I'm not a programmer, I just like to review the history of things

The development of computer programming is one of the most fascinating subjects in history.

The systems created by programmers have had a tremendous impact on society.

One interesting aspect of programming is that accessible languages like BASIC, PHP and even JavaScript are routinely berated by the academic community.

It is an interesting question: Why does the academic community favor convoluted programming structures over easily accessible ones?

The LAMP stack was extremely popular in the early 2000s. The demise of the LAMP stack is an interesting area of study.

People keep using the LAMP stack despite the bad press given to it.

I can pound out extremely robust and secure web sites using PHP plus a relational database, but for some odd reason, people avoid the tech.

!PIZZA

0
0
0.000
avatar

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

0
0
0.000
avatar

I've just started scatching the surface of programing and I'm trying to learn python in my free time: it would be really interesting to read your articles, even if they are going to be about other languages! I've heard that most of them share a lot of similiraties, so I'm sure I'm going to have a lot of stuff to learn from your posts :) also, python (and many others) are evolutions of C, aren't they?

Curated with @arc7icwolf.byte for the #LearnToCode Community

!PIZZA

0
0
0.000
avatar

Internet is full of programming courses, so the best is to teach what you love. Listen to your heart!

0
0
0.000
avatar

I guess one could write a huge book about how NOT to develop a programming language based on the history of PHP. Has anybody tried to estimate the cost of replacing old PHP based software due to incompatibilities of different versions? My advice is that if you want to learn programming better stay away from PHP, if You can. There are plenty of other options around. Of course many companies still use PHP so it's possible you will have to learn it anyway.

0
0
0.000
avatar
(Edited)

Great article! I am learning Python. I'll probably be destroying some files as I learn from my mistakes. Backup, backup, backup, right?😁

The stuff I will develop for Hive that isn't messed up will be open source. That's doing something right. Somebody can always improve on what works and make it even better.

Posted using STEMGeeks

0
0
0.000
avatar

You should write a Python script for you backups.

The key for security is to keep the code used for file maintenance separate from the code used for web development.

It isn't an impossible task.

Unfortunately, it is common for people to confuse such code.

0
0
0.000
avatar

I notice that a whale has taken to downvoting the articles in the Learn2Code tribe. When did programming become such a toxic subject?

I think you are referring to the only one who downvoted the "Hello, World" post. It's just someone with a grudge against my @holovision account. The user isn't a whale of BYTE and isn't making harassing replies. We can ignore the user's downvoting.

Posted using STEMGeeks

0
0
0.000
avatar

Congratulations @yintercept! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You got more than 3500 replies.
Your next target is to reach 3750 replies.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Feedback from the April Hive Power Up Day
Hive Power Up Month Challenge - March 2024 Winners List
Be ready for the May edition of the Hive Power Up Month!
0
0
0.000
avatar

Yeah I kind of wish we could go back to the good ole days of just opening an editor and writing some PHP to make a functional dynamic website.

And not messing with Git , composer , laravel. But hey I'm not a programmer anymore. lol.

0
0
0.000
avatar

While researching the article, I realized that the groups pushing PHP Frameworks may have capitulated.

The PHP world has a huge problem. A large number of small businesses simply stopped using PHP after the release of PHP 7.

The core PHP user does not want to be forced into using a framework.

We might return to the days when PHP is accepted as an odd scripting langage that can be used to generate web pages.

!WINE

0
0
0.000
avatar

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

0
0
0.000
avatar

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

0
0
0.000
avatar

Currently, all my businesses are built on PHP, not only a website, but robots, automation, services in the background, what I use the least is databases and when I need something similar I simply use text files and work with my own tables in csv format, or text files with lines in JSON.

I currently program for HIVE and I do everything in PHP. I have Tradding Robots, Voting Robot, Notification Robot and other things with which I directly interact with the blockchain, always using PHP.

I'm writing all this to you to think that PHP is not only for web pages, it really is a very versatile, fast language that solves things in a simple way...

I recently started programming in the HAXE language, I research a lot about WREN and the V language and everything is becoming simpler, but having programmed for more than 20 years in PHP, it is the language that I write most fluently..

Thank You for the Post .!!

0
0
0.000
avatar
(Edited)

I think that PHP is the most versatile programming language that I have ever encountered.

The language lets people use whatever coding style they desire.

I used PHP primarily for creating data driven web sites.

I had written a number of tutorials to help small businesses develop sites using a functional paradigm on PHP.

For that matter, I still believe that the functional paradigm is best paradigm for small businesses.

Anyway, I reported a bug in their software. Instead of looking at the bug, the engineers started berating me and the people who used my code.

The engineers at Zend were telling the people I worked for that my code was crap. The completely destroyed me and my credibility.

I noticed that Zend wasn't just attacking me. In their effort to sell their framework, they were berating all of the people who were developing free form sites.

I was completely devastated when they did this.

When I was researching this article, I discovered that Zend finally stopped pushing their Zend Framework on everyone. It appears that they have returned to supporting different frameworks and home grown code.

!WINE

0
0
0.000