I keep hearing that opting for a framework is a big decision and that you should only use a framework when the project is "big enough”. How do you decide if your project needs a frontend framework?
You don't use a framework only when the project is big. You use it when the project could be inherited by someone else. A framework makes it much easier for different people to understand projects quickly.
Depends on your project timeline, scope and your client.
If you have a lot of time, a fat budget and a patient client you may not want or need a framework of any kind. In an ideal world you can scaffold your own projects, or provide build systems and base operablilty custom to the client. however you will find most of the time that you never have all three of these gifts, rather you have two, and need to make up for the lack of the other... be it time, scope, or client.
Often frameworks are chosen when you realise the budget is low or the timescale minimal - or that the scope is much larger than you prevously thought.... at this time a framework can come and shed some this load for you, providing you with a set of predifiened guidelines/patterns than can help you shortcut parts of the project dramatically - people get used to these shortcuts very fast and find they have a favourite framework for certain tasks - often you will find this leads the decision of what framework to use (the developers familiarity with it) more expereienced developers have tried more framework and therefore often have a greater forsight as to which is better to help us get to particular goals. Despite perhaps not needing a framework for a project at least one is often chosen to help get the ball rolling so people involved in the project can see results quickly.
Getting used ot certain build patterns can help you pump out applications very quickly, some may argue why not use a framework if it gives you this kind of head start. for personal projects I nearly always use somekind of framework because in a personal project you are oftena one man band so the time saved by using becomes invaluable - comparatively there is lots of cool stuff to learn if you can relaese yourself from some framework shackles, and code some of those parts yourself (Routing, Templating etc)
Just like @apertureless, I'll assume you mean a full-fledged JavaScript front-end framework, and not one that will mostly only give you a head start with respect to styling and layout (like Bootstrap).
I guess the “big enough” point is a symbolic one where the cost of learning, setting up, and adhering to the chosen framework becomes less than implementing and maintaining the necessary features yourself. However, I think it's often easy to underestimate how much it will actually cost to do all the small details yourself. For example, most of these frameworks, in contrast to your own solution, will already have been tested and fixed by “thousands” of users and developers. It is really naïve to belive that you won't need to fix at least a fraction of all those small wrinkles and bugs that they had to fix; and that cost can become huge. And, given that the majority of the cost of developing a software system is maintenance (see for example The Mythical Man Month, by Fred Brooks Jr.), using a well-maintained, open source, front-end framework can save you years of effort, in the long run.
On the other hand, the initial cost of learning, setting up, and adhering to the models and methods of the chosen framework can seem very high before you've made the walk. But, once you've made the investment, the cost for those activities will be much lower for your next project, because you've already gained so much experience from the first project you used it.
Based on these considerations, I would suggest that if the spec for the front-end features is very small and is not expected to change much, then you could consider developing the front-end without the use of third-party frameworks. However, if you chose not to use a framework, you obviously don't get any of the pros of using one, and you surely won't gain any of the experience that would have made it much cheaper to use one in the next project where you'll need to decide whether or not to use one.
I guess you mean javascript frontend frameworks like angular, ember etc. right? And not stuff like bootstrap or foundation?
Well it depends on two things. Do you have a solid API? And do you have enougth interactions where a Frontend Framework would simplify things.
The project size however is not that important. You can use frontend frameworks on small projects, too. If the user benefits from it.
The cool thing with for example React or VueJs is that you can build small components and there is no need to build the whole frontend as a SPA with that framework.
So, there are times when you find yourself in this position, in this dilemma: which framework should I choose? The answer to this question is not really that simple.
Frameworks help you develop faster, while still adhering to some design pattern. Say Angular: splitting the Model, the View, and the Controller, you have specific roles for everything. This makes maintainability a breeze. The point I am trying to make here is that if you have a well defined RESTful (basically, any type of API), using a framework can simplify many things.
Say, you are not using a frontend framework, and are manually printing tables and what not. That's probably the time when you use a framework. Almost immediately you'll realise how simple things can be with it.
Using a framework is never a bad practice, but if you have to write the backend and the frontend, it'll be too much work. The crux of this "speech" is that if you have a well defined backend, you can use a framework very easily and you won't regret it. A project is never "big enough" to be using a framework, it's all about how you have designed the services. You can finish a small project with ease when you're using a framework; you can write maintainable code for a large project and so forth.
If you have any doubts, feel free to throw them at me! :)
Shreyansh Pandey
node, coffee and everything in between
Hemamalini
Software Developer
It is all about experience.
When you first upload your project in live server, it will be too slow than your local development environment. So, obviously we want to reduce the loading time. How? Simplify, Minify, Compress your code, using front end framework.
When you have frequent updates in your live server or if it is a long term project, you need to maintain your code in an -easy to understand, easy to modify anything- structure for developers, using framework.
At the time of competition, you need to change, trendy designs in your website suitable to the market. You can do it hassle-free with frameworks.