Categories php solar

About Solar's documentation

en_US 2 May 2008 @ 18:43:50 5 comments

I've heard people complain about the lack of documentation for Solar. While I generally agree, there's something I have to say to defend Solar. There's also a few things about framework documentation in general that I feel the need to talk about.

The thing is: to really understand a framework you are using, you need to actually dig into the code and read it. That's the only way you'll ever be able to take full advantage of a framework. The framework you are using is a major part of your code, probably more important than your own code, so why wouldn't you try and learn every aspect of it? For example, I don't want to be calling methods and have no clue what they actually do performance-wise behind the scenes. At the end of the day I really want to know what the code does.

There's no denying the developers that read code are the ones that first make bug reports.

So, while Solar's manual is kinda lacky for first-comers, it's inline docs and comments certainly are not. Not only does Solar have comprehensive PHPDoc-blocks in every class and method, it also has inline comments explaining almost every line of the code. Comments aside, even the code itself is written in a manner that is the easiest to understand and learn from.

From Solar's goals:

Because reading code from other developers is a learning experience, all Solar classes are written as a teaching experience. This means that Solar classes are written as simply and clearly as possible without any tricky or obtuse techniques.

I don't see these kinds of words anywhere, at least not often enough. Programming is constant learning, even more so when you have to work with other people's code. To really learn someone's code and see how it works, you need to read the code, not read end-user documentation.

It bothers me that many companies, and projects in general, choose a framework based on how good the end-user documentation is without taking much look at the code. They look at the website and see it looks pretty and there's a long list of manual topics. At first this manual helps. It helps to understand some of the consepts and gives some hints about the API. On the long run, you will end up looking at the actual code to understand how it really works.

I've noticed many times how the manuals of many known frameworks are really vague and only touch the surface. Once you actually want to know what a method you call does, you're lost with a manual.

If Paul had put the time it took to write the inline docs to write a manual, there would be a more comprehensive manual. But there isn't. The time has been spent to write the most awesome PHP code you've ever seen, full of inline docs and comments. To me this is much more important than a manual.

You could actually pick up Solar and learn it from inside-out much more easily than any other framework. I will bet on that.

Comments

avatar.php?gravatar_id=b4ff47c5d32d09e060b987e11d7b8931&rating=G&size=80&default=http%3A%2F%2Fanttih.com%2Fpublic%2FAnttih%2Fimages%2Fanon.png
Comment by Raymond Kolbe 3 May 2008 @ 06:18:08

Solar 1, Zend 0

I 100% agree with you Anttih! When I started playing with Solar I was also playing with Zend and almost went with Zend because they had a large manual to go with their framework. This made me feel "safe" that I had something to fall back on if I ever got stuck coding. Truth be told that their manual really tells you nothing about the framework (well, sort of).

Even though Solar does not have an official published manual (read: a full "how-to") I find that I am better off from reading the code and inline docs not only because I understand the code better but because I can use it to its full advantage by overriding classes, extending classes, or utilizing certain data members that an official manual may not tell me about. This also gets me in the mood of the Solar framework and allows me to write code that sings as well as Solar itself ;-) (a good idea if other people will be reading your code).

avatar.php?gravatar_id=88f204ab93ac93f80e103fc0e44a744f&rating=G&size=80&default=http%3A%2F%2Fanttih.com%2Fpublic%2FAnttih%2Fimages%2Fanon.png
Comment by Edwin Lopez 18 Jun 2008 @ 07:54:54

Completely agree with you on this, I learned better from the code that I could posibly do with an end-user manual. However, I don't know if that much documentation comments on the Solar code can diminish its performance.... What do U think?.

I got convinced that it has a penalty when using PRADO and PRADOLITE (All prado classes with comments stripped in a single file). Prado Ppl do this comments and documentation stripping automatically and I was wondering if there is any previous work in Solar to benchmark performance with and without comments and loading a single file....

I guess I will do that test someday and check by my self.

Regards from sunny Colombia..

_____________________________

EdwinF.

avatar.php?gravatar_id=5647fa9077c057cb2028d32747c886a9&rating=G&size=80&default=http%3A%2F%2Fanttih.com%2Fpublic%2FAnttih%2Fimages%2Fanon.png
Comment by Antti Holvikari 19 Jun 2008 @ 21:16:00

Hi Edwin!

However, I don't know if that much documentation comments on the Solar code can diminish its performance.... What do U think?

No, I don't think the amount of comments in PHP code has any noticeable effect on performance.

I got convinced that it has a penalty when using PRADO and PRADOLITE (All prado classes with comments stripped in a single file).

Compiling all class files into a single file certainly has a big impact on performance, although I would not recommend doing that. You get almost identical performance boost by using an opcode cache -- with zero effort compared to creating a "bundle".

Prado Ppl do this comments and documentation stripping automatically and I was wondering if there is any previous work in Solar to benchmark performance with and without comments and loading a single file....

No I don't think there is such a benchmark. But be sure to check out Paul's framework benchmarks.

avatar.php?gravatar_id=88f204ab93ac93f80e103fc0e44a744f&rating=G&size=80&default=http%3A%2F%2Fanttih.com%2Fpublic%2FAnttih%2Fimages%2Fanon.png
Comment by Edwin Lopez 19 Jun 2008 @ 22:43:32

Thanks for the answer.

Yes, I checked the benchmarks, but they're meaningless for me since I haven't worked with those other frameworks (shame on me!) :-( ...

Anyways, thanks for your work in Solar, I really love this framework for its code quality and best practices...

one question... I've checked the mailing lists and Paul's blog, but I didn't find any reference for any aprox. date for the first "stable" release.... any idea?..

I ask this because following the trac changes, I see many improvements over the current alpha-release I'm working with, hence the curiosity :-).

Best Regards. EdwinF.

avatar.php?gravatar_id=5647fa9077c057cb2028d32747c886a9&rating=G&size=80&default=http%3A%2F%2Fanttih.com%2Fpublic%2FAnttih%2Fimages%2Fanon.png
Comment by Antti Holvikari 20 Jun 2008 @ 00:04:18

Yes, I checked the benchmarks, but they're meaningless for me since I haven't worked with those other frameworks (shame on me!) :-( ...

I understand. If nothing else, they give you some hints about how fast Solar is out of the box compared to others.

Anyways, thanks for your work in Solar, I really love this framework for its code quality and best practices...

Thank you sir, I hope to see you at solar-talk mailing list or on IRC #solarphp@Freenode.

one question... I've checked the mailing lists and Paul's blog, but I didn't find any reference for any aprox. date for the first "stable" release.... any idea?..

That's a good question. The thing is, Paul and other Solar users are too busy running Solar on production sites that a "stable" will take a little more time to be out ;-).

I consider Solar pretty stable already and won't hasitate to run it in production.

Add your comment

Will not be published. Finds your Gravatar.
Style guide
Your comment will be added immediately. Please be nice.
Don't fill this if you think you're human