which apps or software to learn from

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

which apps or software to learn from

Post by matthijs »

Often an advice to people learning php (or programming in general) is to look at existing software and see how things are done.

However, it's also mentioned quite often that a lot of php software is not a good example of good design. I have seen many (experienced) forum members on this forum and elsewere mention how bad the code and design is of for example lots of forums software or cms systems. Even though these apps are very popular and useful.

So, I know of the apps which supposedly aren't a good example of "good" design.

But what are good examples then? I would be interested in examples of good designed, solid and safe scripts and apps. Any suggestions?
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

Gallery2 is the best designed script (I think) but, it is difficult to understand it. (http://gallery.menalto.com)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: which apps or software to learn from

Post by RobertGonzalez »

matthijs wrote:Often an advice to people learning php (or programming in general) is to look at existing software and see how things are done.
I agree with this and have offered this advice repeatedly on these forums.
matthijs wrote:However, it's also mentioned quite often that a lot of php software is not a good example of good design. I have seen many (experienced) forum members on this forum and elsewere mention how bad the code and design is of for example lots of forums software or cms systems. Even though these apps are very popular and useful.
This, I think, it a matter of preference of the developer that is mentioning the app (mostly). There are varying views on coding standards, practices, uses of thrid-party plugins and apps, and a host of other things in the debate over what are good coding examples and what are not. I would recommend that you look into the apps that you think might offer the best learnable environment for you.

As an example, I learned a great deal from the phpBB codebase. I like it tremendously and still reference it quite often. Some people argue that it is poorly written. Others swear by it as a potential standard for project development. What would you say about it?

Wordpress is another app that is often refered to. I have had a difficult time trying to figure what the developers are doing in that application. Does that mean it is poorly written? No. It is a little hard to follow at times (for me anyway), but I think it is cleanly written and it is a nice example of how a project application might look when being worked on.
matthijs wrote:So, I know of the apps which supposedly aren't a good example of "good" design.
Which ones are these?
matthijs wrote:But what are good examples then? I would be interested in examples of good designed, solid and safe scripts and apps. Any suggestions?
Again, this is very speculative and subjective. But I would be interested to see the responses given here.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

ok wrote:Gallery2 is the best designed script (I think) but, it is difficult to understand it. (http://gallery.menalto.com)
Having never looked at Gallery, going from your comment only...I can say...it's not a well designed application then is it??? :P

Programmers who write code with a "It was hard to write so it should be equally hard to understand" mentality, don't write good code :)

Cheers :)
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Measuring apps in PHP is dangerous. Many of the most popular PHP apps may not even be OOP, relying instead on procedural code. Others are OOP, work really well, but are nightmarish entities. Others are fully OOP, keep things separated, and are easy to dig around in.

I'd actually suggest something as simple as a library - check the Code Snippets section for Swift Mailer as a start. After that try something a bit bigger, like a blog. (not recommending one since I haven't read much blog apps source code). It might also be worth just picking a small area of functionality, and talking through it on the forums. Seems to get the best reception every time...

If you want an example of OOP, in a not so good way - try reading the source code for ADOdb. It works, it's popular, it's OOP, and it's a bloated illegible pig of a library...;). If nothing else it will demonstrate why even code which works without many problems can still have its problems.

I think the best examples are still individual classes and patterns. Most of us around OOP for a while have picked up a collection of classes we've written ourselves, or stole from other people.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

As far as applications? None immediately spring to mind...

PRADO was easy to read and follow along...Nice use of PHP 5, the developer was clearly educated and uses correct terminology in comments, etc...

As Everah has said, this is mostly personal perspective...

I have learned or been introduced to many interesting concepts through software programs that I would personally classify as garbage - but again, still walked away the wiser as I did get something from it.

The most difficult task is that of "completing" an application or software library, etc

So IMHO anyone that actually does so, gets my respect right off the bat...regardless of how poor the design might be from my perspective...

Cheers :)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Something else I wanted to add...

To often a project is rated on it's quality of code or design...when in reality what *really* matters is the quality of docs...

It doesn't matter how well or poorly written (according to my own standards) an application or library is written if it's poorly documented/commented it's difficult to use and/or modify...

Cheers :)
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Thanks for the replies.
Which ones are these?
Well, coincidently two of them are phpBB and wordpress. The first one gets also a lot of attention related to security problems, which - for me - is a sign that something is not good (can be a whole different discussion of course whether this is a good argumentation). The second is a very popular app, I use it myself as well, but I've heard people say the code is difficult/messy. Also, a recent sitepoint thread about "badly" coded forum software got quite some response.
Measuring apps in PHP is dangerous. Many of the most popular PHP apps may not even be OOP, relying instead on procedural code. Others are OOP, work really well, but are nightmarish entities. Others are fully OOP, keep things separated, and are easy to dig around in.
Yes, I understand that. I'm not specifically looking for something in OOP. A good designed procedural script, whether it's a one-page guestbook or a complete CMS doesn't matter. But something in OOP is also good to learn from. The framework from Arborint and others for example is very interesting to study for me.
I think the best examples are still individual classes and patterns. Most of us around OOP for a while have picked up a collection of classes we've written ourselves, or stole from other people
Indeed, good advice. I do try to look at the classes and libraries written by the gurus here and try to learn from those.

I'll have a look at PRADO, thanks for the tip Hockey.

So, I know it is a very subjective and difficult question. But my quess is that there should be scripts, classes and software of which - most - experienced programmers will say that it's in general well-designed or well-written.
- is the code solid or fragile?
- is the code "secure"?
- is the code flexible?
etc etc

Looking at badly written code can teach a lot, but looking at good code as well.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Patterns and Anti-Patterns are something you could look into - they're not predetermined implementations, but more general design concepts. Reading an application's source code is fine, reading it and being able to recognise the patterns (and the naughty anti-patterns) it uses is even better. If you go that route don't fall into the trap of requiring PHP examples - Java examples are just as informative, and if you know PHP5 than following a Java snippet is not a huge task (it's actually pretty simple once you get over Java being a typed language).
alvinphp
Forum Contributor
Posts: 380
Joined: Wed Sep 21, 2005 11:47 am

Post by alvinphp »

I think you don't really look at one single site and use that as the definitive example of perfect PHP. What I would do is look at lots of examples and learn how they work and from that you take the best ideas from those sites. After time you will recognize those sites which are not coded the best.
Post Reply