Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Bumblebee

Frameworks Discussion

Recommended Posts

I've just been reading the "Rise of the Frameworks" section of Chapter 1, and would like to take issue with you Larry (in the nicest possible way!) because I think your comment about Frameworks being very attractive because they are designed to be browser-agnostic, could be rather misleading to newbie developers.

 

I think I'm right in saying that browser-sniffing is very seldom used by competent JS developers now. It is in fact quite straight-forward to produce browser-agnostic code, if you apply object detection and have a test suite of browsers to check against on your computer. It does not add much to the development time and I do not think you need to fall back on frameworks for this.

 

All credit to you for pointing out  problems commonly associated with framework use, the need to become familiar with the framework language, the difficulty that might arise in finding a program that will suit your design, and the likely drop in performance associated with their use. I have seen this all to often in recent years on the internet. You find sites bloated with library functions that cater for far more functionality than the site requires.

 

I would add another negative to your list: I suspect heavy reliance on frameworks can stifle creativity. You can become lulled into relying on the framework to provide you with ideas for your design. If you create your own JS, then your designs are only limited by your imagination.

 

The bottom line is this: Do you want a hippo or a gazelle?

Share this post


Link to post
Share on other sites

I'm not speaking on Larry's behalf (as I don't fully know what he meant by "browser-agnostic"), but I just now re-read that section, and I did not get the feeling that his "browser-agnostic" comment implied browser sniffing.

For example, (while I don't know the underlying code off the top of my head) my guess is that the ajax method in jQuery uses a simple feature-detection technique to come up with the proper object to use for each browser, as opposed to using browser sniffing.

 

I do, however, agree (for the most part) with your comment that frameworks can stifle creativity. I'm a firm believer that to fully understand and take advantage of a framework like jQuery, you need to have a solid understanding of the core language. I think this creates an interesting catch-22 in that frameworks are designed to help individuals that are not skilled with the base language, but at the same time, those individuals cannot fully understand how to use the framework without better understanding the base language.

 

As an argument against that point though, while I personally came from the perspective of learning vanilla JS first and then jQuery and other JS frameworks after that, I do know people that started with jQuery, due to its low requirements for entry, and after getting some experience with that, going in reverse and learning the inner-workings of vanilla JS to better understand the jQuery code.

 

In the end, while I'm very much an anti-framework guy and like to avoid them whenever possible, I think it's foolish to deny their usefulness. I think it's very elitist to not acknowledge the fact that not everyone has the time nor the inclination to learn a language like JS inside and out before using it. At my company now, I've seen so many cases where an unenlightened boss will seemingly randomly walk up to a co-worker (whom has zero knowledge of Web design), and ask them to learn everything they can about Web design in two weeks and then quickly make a masterful website for the company. For people in this kind of precarious position, a framework can prove invaluable.

 

On the somewhat flip-side of the coin too, there are those developers that fully understand what they're getting into with a framework, and while they may not personally want to use one, the time constraints on a company project will all but force them to use a framework. And to be honest, I doubt that most developers care enough about their company websites to the point that they're going to waste hours of OT, etc. to make the site run a bit smoother without the use of a framework. So again, a framework can prove invaluable.

 

I guess my point is that for people like you and me, since we're willing to take the time and effort to properly learn JS, we rarely need a framework, but we have the acknowledge that there are many reasons that websites need to be made, and a majority of them are not created under the same relaxed circumstances that you or I might take for granted.

 

As a final point, I don't agree 100% with your comment that frameworks stifle creativity. (Please note that I said I "mostly" agree with your comment above.) Quite often the kinds of "developers" (and I use that term loosely) that flood their pages with a ton of JS scripts are actually using only one framework, on top of which they are then loading a bunch of extension scripts to help create things like date pickers, etc. As such, (while my point here is admittedly a bit overly pedantic) I don't know if it's so much the framework itself that is the problem as the over-reliance on using a lot of libraries written by other people to simplify the creation of mostly unnecessary components. For developers like that though, I think the root cause of the problem goes far beyond relying too much on frameworks, and is more a fault in their approach to Web design in general.

 

Please note that I more or less agree with your personal perspective on not wanting to use frameworks, but at the same time, your stated points seem to overgeneralize things a bit much and I felt like your perspective on the issue was a bit closed. Please do not get offended by any of my comments, as that was not my intention. Also, welcome to the forums! I hope I don't scare you away.

Share this post


Link to post
Share on other sites

Hartley San,

 

Many thanks for providing such a detailed response to my comments. Don't worry, you would not offend anyone with them! First things first, I think what Larry means by "browser-agnostic" is that the site will work whichever browser is being used, ie the JS works cross-browser. I didn't mean to imply that frameworks do a lot of browser-sniffing however. I was referring to Larry's 1st paragraph on p 16 which appears to suggest (to my mind that is) that creating cross-browser code can be very difficult, and I was trying to point out that actually you don't need to tailor your code for every single different browser version around (aka by browser-sniffing), but you can just do a simple process of object detection without having to rely on frameworks.

 

As for your points regarding the use of frameworks to help inexperienced users, save time in development, get design ideas, etc, all very valid points and I would agree with you. It would be foolish to suggest you should never use frameworks, of course there will be times when developers in all stages of experience might have to fall back on them, and they can be a big help in many circumstances. I am just trying to point out that it would be preferable if they are not the overriding solution, that if you can have the time and inclination to develop your own JS you will probably do a better job and maybe a more creative one, and maybe your visitors will enjoy your site more. To my mind there are far too many sites out there reliant on frameworks, sometimes to the detriment of users I think. But sadly it would be overly idealistic to expect every site to be custom-coded by the developer.

Share this post


Link to post
Share on other sites

Yes, you are absolutely right. Thank you for further developing your points.

 

I'm not sure how old you are or how much professional experience you have, but I'm 29 now and in my (meager) 7 years of working since graduating from college, I have noticed one overriding factor in the way 99.9% of people work: They always take (what they perceive as) the easiest way out.

 

You're 100% correct in that the reality of JS is that it's not hard to code cross-browser solutions yourself. In fact, in most cases, it's a simple if-else statement in a function, but the truth is, even doing that is quite often too much for most people to handle. I do sympathize with and support people trying to learn JS though. Like anything else in this world nowadays, there's so much junk, false truths and just down-right confusion surrounding JS (just do a quick Google search), that for a beginner, it takes a lot of time and a discerning eye to be able to quickly wade through it all and find a valid solution. And in my experience, most people are not willing to do that.

 

Using Ajax as an example again, for a beginner to JS trying to use Ajax for a project, what are the odds that they are going to be able to figure out how to code a cross-browser solution on their own? And that's somewhat assuming that they would even recognize the fact that a cross-browser solution is necessary in the first place. On the other hand, if that same beginner hears about jQuery and how easy it is to use Ajax with a single method call, then I think the choice they make for solving their Ajax woes becomes very clear.

 

Anyway, I can only bank on my limited experiences, but the trend I see more often than not when someone approaches something new is to take the most reasonable solution among the limited solutions that instantly present themselves[\i]. Quite often, if people spent even an extra 10-15 minutes researching something, a better solution would become evident, but my experiences have taught me that people (myself included) are not like that.

 

I do agree that it would be nice if people were more aware of the realities of JS, but I don't see that happening any time soon. I suppose the best thing we can do is try to help out people in need whenever possible and not continue to proliferate junk.

Share this post


Link to post
Share on other sites

Thanks for the post. Nope, definitely didn't mean "browser sniffing", which is why I said "browser agnostic", not "browser sniffing". In fact, I say several times over in the book that "browser sniffing" is bad. "Browser agnostic" just means it doesn't care what the browser is, it works. So really, "browser agnostic" is the opposite of "browser sniffing".

 

And while I see how you interpreted that paragraph, I certainly didn't state, or believe, that creating cross-browser code is difficult (thanks to object detection). All I'm saying is that frameworks work on all modern browsers really well. That's it.

Share this post


Link to post
Share on other sites

You make some very good points Hartley San. Yep I'm sure there are loads of people knocking out sites with little knowledge of what they're doing. And I suppose, as the internet is open to everyone, they have every right to. And I can well understand developers taking the easy way out, especially if they have a boss breathing down their neck!

 

I just think, in an ideal world the internet would be a leaner and more enjoyable experience if developers did have the time and inclination to do the programming themselves, and it would give them much more satisfaction than just slapping in some code they've copied somewhere.

 

And I think it is beneficial to explain that there are negatives associated with this sort of design (as Larry has said in his book), and that there is often a better and achievable alternative. My concern is that the wholesale adoption of Frameworks will be to the detriment of the internet of the future, and that we are already sliding rapidly towards this. Of course if there is such wholesale adoption, it will make it more difficult for those with more experience to spare the time to make a better effort.

  • Upvote 1

Share this post


Link to post
Share on other sites

I'm currently working on a quite large system with a friend. We have decided to base our code on Twitter Bootstrap. This is a modularized framework with both CSS and JS. The reason why we do this is to get a stable and reliable core. We pick out those components that we want, including base CSS (typography, grids, forms, buttons, icons, etc) and JS.

 

We have decided to do a strip down to the bare essentials. We will then build our own custom CSS on top of that because we need different styles.

 

The most important thing for us is "that is works". We already have JS modals as an example, but we've had some problems with some browsers. By using Bootstraps code instead, that problem is gone and we can focus on more important things. (for us that is) Because this is a fairly large CMS with football management, developing database structures, building classes and finishing this fast is more important than vanilla JS.

 

We have actually build our own MVC that is also very stripped down. The reason for this is both learning and having something to build everything on our sites on.

  • Upvote 1

Share this post


Link to post
Share on other sites

People are LOVING Bootstrap these days. I may have to write a book about it...

 

Thanks for sharing your experience!

  • Upvote 1

Share this post


Link to post
Share on other sites

Bumblebee and Antonio, I gave both of you guys +1 because I like how your comments seem to be on opposite sides of the discussion while both offering valid points.

 

Bumblebee, I agree with you that it would be nice if people would take more time to think about and care about Web development (or anything else for that matter). It is important to dream about and strive for a better Internet, but at the same time, I wouldn't lose any sleep over waiting for people to start caring enough about Web development to not blindly throw a bunch of frameworks at a seemingly difficult or annoying problem.

 

And that's not to imply that a framework is always bad. If they were, they wouldn't have the kind of presence they have now. I think Antonio's comments testified well to that fact. He has been around these forums for a while, and he's a better programmer and designer than me, and I have complete faith in his abilities, so when he says that using a framework is useful in some cases, then I totally trust him.

 

With that said, I will admit that I've personally never come across a project (including big projects) where I felt a framework was necessary, but that's just me, and I tend to be rather stubborn and a purist about such things and like to write my own functions for the necessary utility tasks on a project-by-project basis.

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi folks,

 

I'll just respond to some very good points made by Antonio and Hartley San here:

 

 

Bumblebee, I agree with you that it would be nice if people would take more time to think about and care about Web development (or anything else for that matter). It is important to dream about and strive for a better Internet, but at the same time, I wouldn't lose any sleep over waiting for people to start caring enough about Web development to not blindly throw a bunch of frameworks at a seemingly difficult or annoying problem.

 

Yep Hartley San, I (reluctantly!) guess you're right, I'll just have to dream on!

 

And that's not to imply that a framework is always bad. If they were, they wouldn't have the kind of presence they have now. I think Antonio's comments testified well to that fact. He has been around these forums for a while, and he's a better programmer and designer than me, and I have complete faith in his abilities, so when he says that using a framework is useful in some cases, then I totally trust him.

 

Sounds a really nice project Antonio, and like Hartley San says, hats off and you obviously have more experience than me.

 

With that said, I will admit that I've personally never come across a project (including big projects) where I felt a framework was necessary, but that's just me, and I tend to be rather stubborn and a purist about such things and like to write my own functions for the necessary utility tasks on a project-by-project basis.

 

My approach also, describes me down to a tee! In fact I find writing a library of my own abstracted modules during projects is a very useful way to go, although I can understand the need to fall back on Framework functions for complicated stuff. As Antonio said, another approach could be to strip down library functions to just the stuff you need, or maybe you could refer to them as a pointer for your own (perhaps more streamlined) solutions.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...