"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
Tuesday, July 11, 2017
Should You Use a PHP Framework? Five Pros and Cons
From routing HTTP requests to accessing the database and rendering the user interface, most web applications have a lot in common with each other. Many of them allow their visitors to sign in, and it's hard to imagine a web application without email sending.
A software framework is a way to put this observation into use.
By extracting the common traits and the application's underlying architecture and bundling them into a reusable template and collection of libraries, a framework allows developers to focus on what makes their project stand out.
In fact, when you use your previous project as a boilerplate instead of starting from scratch, you are already using an ad-hoc framework. The popular PHP frameworks—such as Laravel, Yii, or Symfony—take this approach to its logical conclusion by placing a strong focus on designing the framework's architecture and tooling and then making it available for other developers to use in their projects.
But is using a framework always the best way to go, or does it sometimes make sense just to start from scratch using nothing but plain PHP?
To answer the question, in this tutorial, we will look at five pros and cons of using a PHP framework.
Five Pros of Using a PHP Framework
Let's start by looking at how using a PHP framework can help you in your application development.
1. Rapid Development
In today's startups based on experimentation, rapid prototyping, and getting your minimum viable product out in the world as fast as possible, development speed can be what makes or breaks your business.
Using a PHP framework is one way to answer this requirement.
A well-designed PHP framework selects the best implementations to common problems from the open-source community and, building on top of them, provides you with an application architecture (in most cases, based on the Model-View-Controller pattern) to guide your development.
This way, instead of spending time planning your application's architecture and evaluating the various libraries available, you get to start from a fully functional, if bare bones, template and get right to building the features specific to your application. Many PHP frameworks also come with a command-line tool that you can use to generate code and save more of your precious development time.
2. A Framework Makes Your Application More Secure
While speeding up your development, a framework can also make you more secure: You are working fast, but that doesn't happen by hacking your way using quick and dirty solutions but �by using proven best practices and ready-made components.
The solutions included in a modern PHP framework are continuously tested and peer reviewed and validated by multiple developers using the framework. As the frameworks are open source, security issues and other �problems that you might overlook in your proprietary code get quickly noticed and fixed.
That said, it's important to remember that using a framework doesn't mean you can forget all about security and good development practices. Make sure you use the framework as it is meant to be used, keep it updated, and do your part in things such as parameter validation—using the frameworks' tools, it isn't all that difficult.
3. Easier Maintenance
By providing a sound structure for your application and nudging you towards software development best practices and patterns, a PHP framework guides you towards writing code that is loosely coupled and repeats itself as little as possible. In other words, it's easy to read, test, maintain, and develop further.
Virtually all popular PHP frameworks today are object oriented and developed with automated testing and even test-driven development in mind.
You will still have to do your part. But compared to starting from scratch, a framework and its documentation reminding you of the concepts and nudging you towards using them will surely help.
Another way in which using a framework makes maintaining your application easier is through its shared components. As the framework libraries and helpers are developed independently of your application, you get to offload a big part of your application's maintenance to the framework developers.
In a way, it's like having a team of developers working for you, for free!
4. Stronger Teamwork
As a developer, you know your classes and functions by heart and can use them easily. But as you bring in team members, the situation changes.
Without knowledge of your design decisions and complete documentation (let's face it: especially in the world of rapid development, documentation is often an afterthought), they will find it hard to wrap their heads around your application's code.
Using a PHP framework �will help make it easier for new developers to get started with working on the project. Chances are they are already familiar with the framework and can put all of their attention into understanding the specifics of the application. And even if the framework is new to them, the documentation, �online tutorials, and the familiar design patterns will help them get up to speed with minimal effort.
All this while you can keep working on the application rather than teaching the developers your ways of thinking.
5. The Community Is There for You
Finally, a significant benefit of using a PHP framework comes from the active communities of developers and users that gather around them.
All major frameworks attract open-source contributors who, in addition to working on the framework itself, develop additional widgets, libraries, and helper components for others to include in their applications. �Other contributors write tutorials and books or create videos to explain the ins and outs of how they use the frameworks in real-life projects.
As a part of such a developer community, you will grow as a developer, learning quickly and applying what you learn to your application development.
And if you are so inclined, you can give back and participate in the open-source projects in any way that feels natural and fulfilling to you.
Five Cons of Using a PHP Framework
Now that we have seen how using a PHP framework can help you in your development, let's take a look at the downsides and why going without one might sometimes be the better option.
1. Slower Execution
Compared to running a simple PHP script, a PHP framework always adds complexity and overhead in the form of classes and libraries loaded before your code even gets called. The difference can be significant in quick scripts and APIs with a limited set of functionality that needs to run fast.
In most web applications, however, the efficiency implications of a framework have more to do with how you use it than the framework itself. For example, while an Active Record implementation is a handy way of accessing the database, it doesn't make sense to use it in places where you have to work on multiple rows in the database at once.
So this comes down to knowing your application's needs, but also not allowing yourself to be attached to a specific way of using it. Sometimes, even when working with a framework, it makes sense to sidestep and write some of the code at a lower abstraction level.
2. General Solutions for Specific Problems
The idea of a PHP framework is to be a general solution for the recurring requirements most developers will face in developing a web application. But where should we draw the line in what to include in the framework and what to leave for the applications—or third-party add-ons—to implement?
According to some developers, this is where many frameworks go wrong.
PHP's creator, Rasmus Lerdorf, has said:
“Nobody has a general problem. Everyone has a very specific problem they’re trying to solve. And a general purpose framework, while it can solve it, usually solves it in a way that you get so many other things that you don’t need. That ends up being done on every request.”
Because of this, if you decide to use a framework, it's important to make sure you pick one that fits your application's needs.
While most frameworks are based on lazy loading and won't include the parts of the framework that your application doesn't use, the added complexity will still be there, leading to unnecessary tinkering in removing functionality that came with the framework but that you don't need.
3. A Framework Takes Time to Learn and Master
While a PHP framework nudges you towards good code, it is no guarantee for it. If you work with a framework without understanding it and the design patterns behind it, you will most likely end up with a big, structured mess.
For someone who is already familiar with these design principles, from other frameworks or projects, the learning curve will be relatively short. For a developer with less experience, learning will take longer. Not to mention mastering the framework.
So, if you are in a hurry—and your project is small—it may not be the time to start learning a new framework. Instead, consider using a micro-framework or even starting from scratch and using some libraries you are familiar with.
Then, take the time to learn a full-blown PHP framework when your schedule allows.
4. Limited Visibility and Control
Using a software framework moves your application development to a higher level of abstraction. This is by design, and usually a good thing. However, it's good to realize that it too can lead to problems.
While many parts of the framework's template are meant to be customized, the framework's core and its libraries are like a black box you use but don't have much control over. You may suggest improvements but ultimately, it's up to the framework's developers to decide whether they will include that change or not.
Also, if you start using a framework before fully understanding the PHP language itself, you may confuse the framework's features with language features—and will end up using the framework's functionality even when plain PHP would be a better choice.
5. A Framework Introduces an External Dependency
A framework is always an external dependency for your application—code controlled by someone other than you and your team. While this is usually not a problem, it's something worth considering if the software you are building is a core part of your business.
Ask yourself what you will do if the framework’s development is dropped or moves in a direction you don’t want to follow.
A good way to mitigate this risk is to use a reliable, popular framework with an active community of developers and users. But even then, it's something to give some thought to: are the benefits of using a framework big enough to make the risk worth taking?
Conclusion
A modern PHP framework is a powerful tool in a software developer's tool chest: it can save you a lot of time and effort and provide peace of mind as you develop your PHP application. Just remember that this shouldn’t replace learning core PHP first!
The key in the above conclusion, however, is selecting the right tool for the job. Every project is different, and even a framework that is perfect for one project might not be quite right for the next. Go for simplicity and ask yourself if a full-blown framework is right for the project, or if using a micro-framework such as Lumen could be a better solution.
Starting from scratch using vanilla PHP is rarely the best option, but that too is worth considering when developing a very simple application (such as a website without much interactivity)—and remember that you can always extend it by using Composer to pick libraries of your choosing.
When selecting a framework, make sure the framework you choose is actively developed and supported and follows sound software engineering practices. This way, you're future-proofing your application by making sure the underlying framework will not suffer a quiet death.
And finally, even if you decide not to use one, it's a good idea to get familiar with one or more of the modern PHP frameworks. Studying them is an excellent way to learn and improve your craft in software development and help you stay on top of the evolving world of PHP development.
Additional Round-Ups
- The Noob’s Guide to Choosing a JavaScript Framework
- 20 Useful PHP Frameworks Available on CodeCanyon
- A Quick Guide to Choosing the Best Framework for You
by Jarkko Laine via Envato Tuts+ Code
Why Communication is an Essential Skill for UX Professionals
I use my red Swingline stapler every day, though I can’t recall actually stapling anything in years.
The colour of the stapler is no coincidence, as my first encounter with a red Swingline was the cult classic Office Space. In the movie, Milton Waddams defends his prized piece of office equipment from theft and destruction at the hands of unscrupulous coworkers.
For Milton and millions of office workers worldwide, the red Swingline has become a symbol of those pieces of our work life for which we would, if ignored, set the world on fire.
My stapler’s daily use is as a reminder that everyone has red-stapler issues in their work life, and that a failure to communicate on those issues could have dire, unforeseen consequences.
It’s an important reminder, to be sure. Our placement in our company’s organisation and workflow means that communicating as a UX professional is both imperative and, at times, extremely difficult.
Here are a few important lessons to learn to help avoid those red-stapler situations.
Learn and translate new languages
My wife and I do not speak the same language.
My wife is an Archivist, and I’m a User Experience Engineer. Unsurprisingly, there is very little crossover between the world of antiquities and modern technology and design. Any dinner table conversation that begins with the inane question of “How was your day?” can lead to a whole meal spent translating different professional terms and concepts into language the other can understand.
This simply goes to illustrate this point: no one speaks the same language. Our individual collections of idioms, slang, and jargon is unique to each of us. What’s more, our own language changes and evolves depending on the group of people we’re interacting with at the moment.
Nowhere is the difference in languages used within an organisation more apparent than in the world of the user experience professional. We have exposure to nearly every element of our business, from C-Level management all the way on down to individual clients.
To be successful in what we do, it’s imperative that we learn to speak and communicate in the various languages of our business partners and clients.
Additionally, because of our involvement across the business, a large part of our job is facilitating communication of difficult concepts between different groups. We are professional translators, addressing a wide audience that speaks a relatively small common language.
To make matters more difficult, UX has its own unique vocabulary that many in the organisation simply won’t understand. This is especially true in organisations that are new to UX. The temptation to slide a word of our own native language into the conversation is overwhelming.
Whether it’s a presentation or an email, we must take a moment before we begin communicating to put ourselves in our audience’s shoes. Potentially confusing jargon, acronyms, and unfamiliar concepts all need to be addressed to effectively communicate to our chosen audience. Identifying these potential issues ahead of time will help you avoid any problems and keep the conversation moving forward smoothly.
Admit your knowledge gaps
Your words mean nothing without the trust of your audience. The quickest route to being known as the office weasel—and quite quickly “the weasel that used to work here”—is to… ahem… massage the truth.
The temptation is real, especially when put on the spot. Unlike developers or QA analysts, UX professionals are often teams of one in many organisations, which means that we often have no one else to call on for help. Additionally, our familiarity with a project from multiple perspectives often forces us to believe we should know more than we actually do.
When our expertise is called upon and the answer evades us, that answer at the bottom of the trash can begins to look really attractive.
It’s a tough lesson that many learn the hard way: audiences can spot a heap of cow caca a mile away. Give that truth a rub down in front of a group more than a couple of times in your career and you will be called out. It will be painful.
At the same time, most people understand that even experts don’t have all of the answers. Additionally, most people don’t care where an answer comes from, so long as it is accurate and timely.
If you’re put on the spot to answer a question outside of your knowledge, simply admitting that you don’t know the right answer holds a lot of power. It projects honesty, humility, and self-awareness, all rare and valued personality traits in designers.
Equally important to admitting “I don’t know” is following it up with the phrase “but I’ll find out.”
The ability to navigate multiple different teams and business partners is a huge part of what we do, and we’re well-placed to find answers or connect individuals across internal boundaries. Always follow up with the requested information or an introduction to the party who can actually help out.
Always take the high road
It’s a guarantee that, eventually conflict will creep into your professional world. Every office is full of conflict, taking a number of different forms. There are egos to manage. There’s office politics in play, at some level, in virtually every decision of importance. There are personality conflicts and disparate goals amongst different arms of the organisation.
Add to that the all-around pressure to perform well, and it means that you will, inevitably, receive some sort of communication that is less than pleasant.
Whether the slights are subtle or overt, in-person or written, when someone lobs a putdown our way, our blood boils and our brain clouds up. Responding in anger is a natural reaction, but it’s not one that will help you accomplish your goals or further your career.
In office environments, anger and resentment are often the result of poor communication. When confronted with an angry or mean communication, take a step back, breathe, and even take a few minutes to calm down before asking yourself “What is this person really mad about, and how can I help resolve their problem?”
The chances are this person is not angry just for the sake of being angry. There is an issue to be resolved, and you have been given an opportunity to help solve the problem.
With our exposure to different business partners and perspectives, UX professionals can often be the key to quick resolution. We have the ability and insight to identify issues and connect key individuals to work towards a clear consensus on difficult issues.
What’s your best communication tip? Leave a comment here, or chat with us in the forums.
The post Why Communication is an Essential Skill for UX Professionals appeared first on UX Mastery.
by Doug Collins via UX Mastery
Taxmaro Personal
by Rob Hope via One Page Love
How to Improve Your Facebook Videos With Facebook Video Insights
Want to increase engagement, longevity, and exposure of your Facebook videos? Have you explored the data in your Facebook Video Insights? Whether you’re streaming live or recording videos, Facebook provides insights that can help you refine your future videos. In this article, you’ll discover three ways to evaluate and improve your Facebook video performance. Access [...]
This post How to Improve Your Facebook Videos With Facebook Video Insights first appeared on .
- Your Guide to the Social Media Jungle
by Teresa Heath-Wareing via
Destroyer LA
by Rob Hope via One Page Love