Re: Re: PHP development practices from a Java Architects eye

By Angsuman Chakraborty, Gaea News Network
Tuesday, April 26, 2005

In response to my post PHP development practices from a Java Architects eye, Jeff Moore had some thoughts.

I posted my response (to his reponse to my post) in his post. Dizzy yet?
However after 12 hours it was still not approved! So I thought of posting it here in my blog. To get an idea what this is about, read my original post and his response.

Here’s my response to his (rather strange) response:

Jeff> The author doesn’t make this paradigm shift and erroneously implies that PHP is not scalable.

I am not assuming anything here. I am stating the facts as I see it :)

Opening and writing to multiple files in the course of serving a single request doesn’t improve scalability. Specially when you are trying to scale across multiple machines. No amount of imaginary paradigm shift isn’t going to change that. Such practices also makes php a low throughput system.

Jeff> There is a name for this. It is called premature optimization.

You have mis-named it. It is called *architecture and design*.
I was talking about thinking, not optimizing then.

Jeff> PHP pitches a large tent. There are many amateur and professional programmers using PHP.

You bet. Unfortunately most of the much-talked open source php projects have a significant share of these amateur developers.

Jeff> The interesting thing is that some of the most popular PHP applications are not the ones that I would point to and tell people “this is a good example of programming in PHP.” I won’t name names, but I would hate for people to form their opinions about PHP solely on the design of these applications.

I agree. Please do point me to some succesful php projects of exmplary code.

Jeff> That realization was that project success has far more to do with how closely your software meets requirements than how technically advanced it is.

It also has to do with how manageable and maintainable a project is over the long run. I have seen too many projects with “amateur” coding became so unmaintainable so fast that they had to be abandoned and had to go for total rewrite.

Jeff> “high architecture” projects that never finished

I don’t know what “high architecture” means. However you are probably referring to over-architected projects. A good projects stands on optimal architecture, nothing more nothing less.

Jeff> That is why software built by their users, such as many visible PHP projects are, can be very successful.

The arguments don’t stand up. You are trying to prove a point that isn’t there. Programming is about programmers. Some language make it easy to write bad code like php or perl, some language make it harder like Java or C#. However bad code can be written anywhere.

Having none or minimal architecture in a project doesn’t make it a candidate for success or make it more suitable to meet customer requirements.

If you are looking for minimal architecture approach then you may be interested in extreme programming. XP projects are very successful in meeting customer requirements as the projects revolves around the customer all the time.
Interestingly there are more XP programmers in Java then in all other languages combined.

I think you need to delve deeply into Java, which will dispel lot of myth you have regarding Java.

Discussion
April 28, 2005: 3:21 am

> But that is not the only group that develops software.

Well sure. And that is why we have so much poorly made software which are horror to maintain.
If you ever have to maintain millions of line of poorly written code, you will know the immense pain associated with it. If you ever have such experience you will understand why we talk about good code and maintainability. Just yesterday I was viewing code of a scientist who have written a cool application in Java. However no coding standard was maintained. It was very hotch-potch code. Did you say that Java doesn’t allow writing bad code? Well, it does. However I wouldn’t encourage it with my professional integrity. Anyway I ended up in rejecting him for employment.

> Realistically Java is not an option for the millions of people who want to develop a website.

Do you want to develop websites in java for under 10$. I can suggest you several web hosts which provides that.

People are free to write anything in any language. The core issue is if they develop poor code, then they should be the only one maintaining it. They have no business in releasing that code for mass consumption. It is brutality to human race :)

> If a village needs a hospital they can use 100 shovels or an excavator. According to you, if they don’t have an excavator they shouldn’t build the hospital.

I never said that! I never said you shouldn’t use php! You misunderstood me completely. I am curious to know how you made that conclusion from my article above.

> If you reduce you argument fully, you are actually against invention. You belive that only self approved professionals should be allowed to build things and only with tools they bless as “good”. But that’s not where invention usually occurs.

Please see above. I have no idea how you came to that illogical conclusion. I am not against php or any language. What made you make that assumption.

I think this whole argument is centered on your mistaken belief that I am somehow prohibiting people from using php. Far from it. I personally use it on this website. My post was intended to highlight the differences and pros and cons.

Hope that clarifies the situation.

If you want you can communicate with me offline also.


Christopher Thompson
April 27, 2005: 6:07 am

“You may love php as much as you want. You cannot prevent any honest criticism of the shortcomings of the language and it has some. I also praised it where it deserved.”

I like Java as well as I like PHP. If you want criticism of PHP listen to the PHP community. They say very little bad about Java but have a lot to say about PHP. Vice versa is not as true.

“So in scripting languages bad programming means good programming? WOW!”

Exactly. And you still don’t get it. You like many programmers think programming is to only point. Programs are the important thing. Certainly quality programming methodologies are a positive, especially for groups of professional developers. But that is not the only group that develops software.

“This is plain BS. You can use any language, Java included, to produce really crappy code.”

That is is BS is still only your opinion. Realistically Java is not an option for the millions of people who want to develop a website. Learning curve, tool chain, availablity are all against it. Scripting languages are generally easier to learn, require simpler tools and are much more widely available. It is their nature.

“You need to get more exposure with other languages ”

I know a dozen and am currently learning Ruby.

“Are you saying such “bad”, unmaintainable programs are good? ”

I’m saying they are neither “bad” or “unmaintainable”, the were just developed in a different way than you develop. By a different type of developer with different requirements.

I liked your articles and thought you made some good points. Better than most of the “PHP from a Java POV” articles. I understand that your intention “was just to highlight the differences between the languages” but you unknowingly made some erroneous statements in the process.

If a village needs a hospital they can use 100 shovels or an excavator. According to you, if they don’t have an excavator they shouldn’t build the hospital. But from their point of view they don’t care how (the important thing to you), they just need a hospital. Maybe they don’t have an engineer either, so they use new prefab parts and limit it to one level. And maybe it is not as easy to maintain or could have been better. But they have a hospital.

If you reduce you argument fully, you are actually against invention. You belive that only self approved professionals should be allowed to build things and only with tools they bless as “good”. But that’s not where invention usually occurs.

April 27, 2005: 5:03 am

@Christopher
Now you are making less and less sense :)
Let me illustrate…

> The revolution of scripting languages is in part due to the fact that it changed the meaning of what “programming” and “bad” mean.

So in scripting languages bad programming means good programming? WOW!

> The thing you do not understand about languages like PHP is that while they allow your definition of “programmer” to produce your definition of “good” programs, they also allow people people who do not fit your definition of “programmer” to produce programs that you define as “bad”. Languages like Java really do not allow this.

This is plain BS. You can use any language, Java included, to produce really crappy code. Language cannot prevent you in that. You need to get more exposure with other languages :)
I have seen tons of bad Java code in my career, legacy projects which we re-factored and moved forward.

BTW: Are you saying such “bad”, unmaintainable programs are good? And they should be encouraged? AFAIU Jeff also wouldn’t agree with you on that, whose post you are defending.

> The fact that there are many widely used and very useful PHP scripts is a fact.

Sure. Who is arguing with that?
It seems you missed the crux of my arguments.

> But because something is beyond your understanding does not make it “bad”.

I haven’t seen anything in PHP beyond my understanding or the understanding of any 12th grader (It is a simple language and a simple paradigm). You keep saying that. You need to justify it better :)

And just to clarify. I have never said php is “bad”. I have a distinct feeling you have completely misunderstood my articles.

You may love php as much as you want. You cannot prevent any honest criticism of the shortcomings of the language and it has some. I also praised it where it deserved.

The intention of the post was just to highlight the differences between the languages and put forth some observations as a architect.


Christopher Thompson
April 27, 2005: 4:11 am

Not a strange conclusion. Your opinion about what “programming”, “bad”, “good” and “common sense” mean is just that — your opinion. What you seem to be blind to is that there are meanings beyond your limited ones. Jeff makes a very central point in your misunderstanding:

“That is why software built by their users, such as many visible PHP projects are, can be very successful.”

The revolution of scripting languages is in part due to the fact that it changed the meaning of what “programming” and “bad” mean. The thing you do not understand about languages like PHP is that while they allow your definition of “programmer” to produce your definition of “good” programs, they also allow people people who do not fit your definition of “programmer” to produce programs that you define as “bad”. Languages like Java really do not allow this.

The fact that there are many widely used and very useful PHP scripts is a fact. Whether your definitions apply to them really does not matter. The fact that they could be written (and rewritten) outside your definitions is the revolution. That they can also be used to develop programs that are completely within you definition is a separate point.

But because something is beyond your understanding does not make it “bad”.

April 26, 2005: 8:54 pm

@Jeff
Thanks. It was getting late and I got tired :)

April 26, 2005: 8:52 pm

@Christopher
> Since you mind is closed it is not a conversation, just a soapbox.

I try to keep it open at all times. Would love to know the reasoning behind your rather strange conclusion :)

Have you have read the original article? That portion I quoted didn’t really make sense. It is better to be upfront when something is illogical rather then sweet talk it. It is better for everyone in the long run.

> Who determines what “programming is” and what “bad” means?

Common sense. Unfortunately as Eistein said… :)


Christopher Thompson
April 26, 2005: 7:48 pm

“The arguments don’t stand up. You are trying to prove a point that isn’t there. Programming is about programmers. Some language make it easy to write bad code like php or perl, some language make it harder like Java or C#. However bad code can be written anywhere.”

Since you mind is closed it is not a conversation, just a soapbox. Who determines what “programming is” and what “bad” means? Surely not you.

April 26, 2005: 8:16 am

I usually check the queue a few times a day. Once I’ve approved one message from your email, the rest should auto approve. Sorry that you got on the “spam slow track.”

I posted a reply on my blog.

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :