Jump to content
Larry Ullman's Book Forums

Question For Hartley San!


Edward
 Share

Recommended Posts

This question is for Hartley San but if anyone else wishes to get involved that would be fine.

 

Hartley San, you stated the other day that Frameworks should be avoided, i myself have been wondering whether or not i should use one for my project. I tried to pull YiiFramework further apart the other day and it seems to be working in almost the same way as my own MVC oop framework which i built. So now i think probably the best option for me is to build a practice site with both methods to see how each turns out and decide whether to use Yii or not because once i go ahead there will be no turning back.

 

But i wanted to ask you about your own experience with your own projects. It doesn't matter what your website does but i am wondering about what underlying structure you used to create your website and what experience you have gained from such coding? Did you use a standard procedural approach or did you build a modular MVC object orientated system? Please tell me about your experience so it can help me decide on which route to take?

Link to comment
Share on other sites

Edward, I don't recall ever saying that frameworks "should be avoided". If you can quote me on that, by all means, stuff it in my face, but what I *think* I said was that I personally don't like using frameworks as they're typically bloated, add another layer of abstraction that has to be learned (in addition to the base language), and in most cases, I can write more specific code that better handles the particular tasks I'm faced with for a site, etc.

 

To me, that's just the nature of frameworks. It does not make frameworks inherently bad, but if you have the time and knowledge, using just the base language to code something will (almost) always make for a slimmer and more efficient code base. I really don't think that's debatable. (Although, if you can prove me wrong, please do it.)

 

With all that said, frameworks have some obvious perks, which I won't bother explaining here. In the end, I can't tell you whether to use a framework or not, but I would recommend trying to estimate how much more (or potentially less) time it will take you to do something without a framework vs. with a framework, and then decide if that time difference is warranted given, for example, how much you're being paid for said job, the deadline (if any), etc.

 

Probably the best argument I can give for using frameworks is that Larry uses them all the time, and he's a million times more knowledgeable about PHP, etc. than I am. Ultimately, though, the decision is yours, and without more details, neither I nor anyone else can help you make that decision.

  • Upvote 2
Link to comment
Share on other sites

"While I don't want to put words into Antonio's mouth, he seems to more or less agree with me, and my opinion is that frameworks, when possible, should be avoided." It was in the database tips and tricks page 2nd page.

 

Anyway there is no harm in saying that, its just got me thinking over the weekend and had me taking a close look at things again. Well i don't know what Larry has to say here but from what you are saying if you have a personal project you will always be working on, it seems then that frameworks are not suited, a custom model would be better. I understand what you are saying about the abstract classes and extra layers, Ive seen that, and to be honest there is no point in them, other than trying to be fancy.

 

Well may be Larry likes to use one as once you learn it you can just make a new project with the same framework quickly without having to build up all the base. So for projects to projects it is okay. May be the person who recommended me to use frameworks has underestimated the knowledge and ability we have after learning from Larry's books.

Link to comment
Share on other sites

Oh, thanks for digging that quote up. I suppose I could have worded it better; what I really meant to say is that I personally don't like frameworks, but it suits certain people in certain situations.

 

Although, call it what you want, but the truth is, we all use frameworks in a way. I mean, I have my own blocks of code that I always use to complete tasks. They're not as robust as a framework, but then again, that's the point; more flexibility.

 

I guess in the end, I prefer to work with lots of smaller bits of code, because to me, it's actually easier, but nevertheless, I'm not reinventing the wheel every time I code something.

  • Upvote 1
Link to comment
Share on other sites

If you check the framework code closely you will see its pretty much identical to the stuff we do there are no magic methods as i can see? Even with the JS book we have, its just so good that we wouldn't really need jquery anymore, but for our own safety we could use it if we wanted.

 

Well i am going to still give Yii and try when it comes out, possibly just learn it to use ideas from the framework to implement into my own. But from what i can gather here it seems to be best to make it your own way, since it will be the only web site i will work on.

 

I appreciate your time in answering this question well Hartley. Thanks for you Help.

Link to comment
Share on other sites

I agree that there is no magic behind frameworks, and from what I can tell, they are well coded, but even so, they have their own sets of bugs.

 

The two things I think frameworks are good for are cross-browser solutions and tricky regexes. Many a time, I have studied the jQuery code, ripping out the parts/concepts I needed, and then recoded things on my end to better fit my particular situation.

Link to comment
Share on other sites

Well after what Larry's says in his other comment and knowing his experience i will just go with the YiiFramework, i have the kind of site that is going to never finish being built so i might as well have a strong base without the repercussions. I am like you though in when i do have time i do like to experiment to know how things work. But when you do think about building a whole framework alone, yeah there is definitely room for margin of error in that, I will leave the problems for the Chinese guy to sort out.

Link to comment
Share on other sites

  • 2 weeks later...

Yes, I will probably get the Yii book, and yes, I agree that it's important to be familiar with frameworks. I know pretty much all of the major JS libraries (although I don't use them much myself), and I am familiar with Zend and WordPress.

 

To be honest though, if your basic computer language skills are solid, picking up a framework is about as easy as installing the files on the server and calling the right methods (not to play down the usefulness of Larry's Yii book).

Link to comment
Share on other sites

Yes, I will probably get the Yii book, and yes, I agree that it's important to be familiar with frameworks. I know pretty much all of the major JS libraries (although I don't use them much myself), and I am familiar with Zend and WordPress.

 

To be honest though, if your basic computer language skills are solid, picking up a framework is about as easy as installing the files on the server and calling the right methods (not to play down the usefulness of Larry's Yii book).

 

Good to hear you are getting it if I am stuck I'll ask you. But easy as you say is what I need I think I've got enough challenging parts of code to deal with in js already as well as PHP. Anyway Yii will be fine if my site works well I can rechange code later on if need be, I just want to keep things simple at the moment.

Link to comment
Share on other sites

It's probably a bit presumptuous of me to say that frameworks are easy. A majority of my experience has to do with JS libraries, and in almost all cases, if you have decent vanilla JS knowledge and read the documentation, it's all pretty much done for you.

 

My problem is that I often don't like the generic results (and bloated code) that comes along with frameworks.

Nevertheless, I have heard a lot about Yii, so I'm going to give it a chance and try to be as unbiased as possible.

Link to comment
Share on other sites

I also don't like that kind of code bloat my self, there is an interesting statement Larry made in the Yii Book:

 

"And second, you should give in to the framework. All frameworks have their own conventions: how

things are to be done. Attempting to fight those conventions will be a frustrating, losing battle. Do

your best to accept the way that the framework does things and it’ll be a smoother, less buggy, and

faster experience."

 

Tell me HartleySan are you a developer for your day job there in Japan or is this just sideline stuff for you?

Link to comment
Share on other sites

I work as a translator for the software division of a major electronics maker in Japan.

I'm planning on moving back to America in spring of next year, at which point, I'll be trying to start a career in web development.

I'll be sure to share my experiences with trying to find a job when I get to the point where I'm actually looking for one.

 

Also, I do agree with Larry; you really just have to give in to the framework (like it or not). I suppose for a site that I need to whip together real quick for a client, it makes sense to use a framework, but for any of my own personal projects (my babies), I don't see myself using frameworks (yet). Things certainly change over time though, so I don't want to say never, but I enjoy the challenge and customization of "doing it all myself."

Link to comment
Share on other sites

Do you mind me asking what nationality are you?

 

I tried already to build the MVC the OOP way, it worked but the point is there could be errors so its just makes more sense and after what Larry said just to go with something good like Yii that is readily available. If we did do it ourselves it will also be somewhat similar especially with the OOP coding style. These decisions could be made depending on the size of your projects.

Link to comment
Share on other sites

 Share

×
×
  • Create New...