Other Added
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Development > Wrtiting Less PHP Code With More Results

Tags

  • customers
  • bored
  • everything
  • learnother group
  • these questions
  • normal dropdowns

  • Links

  • How To End Shynesss Forever
  • Monitoring the Sun Using Energy Balls to Collect Data
  • Do You Want A Larger Income Stream With Lower Risk Investments?
  • Other Added - Wrtiting Less PHP Code With More Results

    How to Create and Sustain Optimal Performance Throughout Your Organization
    There are two sides to optimal performance. One side deals with structures, processes and procedures, tools and measurement. This side deals with management of "hard" objective data: facts, figures, charts, etc. that can be examined and "seen."The other side of optimal performance has to do with attitude, creativity, commitment, buy-in and self-discipline. This "softer," intangible side deals with leadership: when leadership is present, the right things get done in an efficient, enthusiastic way. When leadership is absent, things get done but often without achieving the intended results.There are twenty steps that,
    ry often, especially in admin panels you just have a form with fields corresponding to the table ones and values in them. Just iterate thru the database fields (hint: "SHOW FIELDS FROM table_name") and insert/update

    - HTML code snippets - aren't you tired of creating or copy-pasting date dropdowns, checkboxes, normal dropdowns or radio groups? Create functions for each of these - it could accept parametters as name, values, selected name...

    - Formatting specifics such as date, money, phone numbers etc. Yes, the PHP functions like date() allow you to format in any way. But what happens if you have dates on hundred places and the customers decide that instead of mm/dd/yy they want format "dd Month,

    Building A Business: Smartest Risk You Could Ever Make Financially?
    It has been said that taking business risks is dangerous. Worst, that if you let yourself risk money, it is not just dangerous, but dumb according to many. But the reality is that when starting any new project or even a simple task, risk always exists. You could go on a date and your luxury car might not start while leaving the restaurant. You could plant a beautiful tree, watch it grow, and then have it fall on your house in a windstorm. You might partner with a long time successful businessman who then develops a gambling addiction problem and embezzles all the funds later on. You just never know.We take risks every day
    Most web development companies use their own or third party frameworks to improve their development process. If you want to work as a PHP developer in a company you will most probably need to agree to write your code using their framework. This article is for these developers and companies who want to build their own framework and improve their coding speed, the quality of their code and get paid more for less time. I will share with you the ideas we discovered in PIM Team Bulgaria while working on our PHP framework, but not the framework itself - you need to develope your own one which to suit the most your coding style. Our advises are valid for almost any other programming language.

    What is a framework and why I need it?

    Don't you get bored when you need to write same or similar types of code again and again? Do you hate when customer wants to change "some unsignificant thing" but you need to change it in 10 different files? Are your scripts too long? Do you write "spagetti" code? If you answer "yes" on some of these questions, then you need a set of functions and classes which will automate most of the tasks, reduce your code size and avoid copy-paste practices. That is framework. It is a set of classes and functions which you just include in your scripts and make your life of a web developer easier.

    What to "put" in a framework?

    Some people and companies tend to believe that everything should be generated by functions and classes and you should never have a "free flying" PHP code. As a result of that they put everything in objects and extremly complicated functions which try to handle everything for everyone. As a result the code gets hard to read, buggy, hard to change and slow to write and learn.

    Other group prefers to write everything for the current situation, again and again for every project and file. They often copy-paste hundreds of rows to save development time and effort, but when they have to modify the code it turns into a pain. And all of this is because they are too lazy to create a framework.

    The solution as usually is somewhere in the middle. You should be looking to optimize tasks which are repeated often in the project or in different projetcs. Here are the best propositions:

    - Mail functions - it's terrible to see most developers putting all the headers in each place where they need to send a mail. Just wrap the mail() function and use the wrapper.

    - Database wrappers - you MUST have one. Stop using the built in mysql (or other DB) functions directly into your projects. What will happen if the database must be changed?

    - Database functions - do you really need to type manually all the 50 field names of that table and then to manually fill the values from $_POST? Sure, it is often needed when the values come in a different way. But very often, especially in admin panels you just have a form with fields corresponding to the table ones and values in them. Just iterate thru the database fields (hint: "SHOW FIELDS FROM table_name") and insert/update

    - HTML code snippets - aren't you tired of creating or copy-pasting date dropdowns, checkboxes, normal dropdowns or radio groups? Create functions for each of these - it could accept parametters as name, values, selected name...

    - Formatting specifics such as date, money, phone numbers etc. Yes, the PHP functions like date() allow you to format in any way. But what happens if you have dates on hundred places and the customers decide that instead of mm/dd/yy they want format "dd Month, Y

    Demise of the Lone Ranger Manager: A Lesson in Management Communication Style
    When executives see themselves as solely responsible for the overall success of their enterprise, subordinates can hardly be blamed for acting according to predictions.Let's look at a familiar scene in classical American - if I may use the word - mythology.Panic and terror have brought all normal activity to a standstill in some pioneering settlement in the Wild West. A bunch of bad guys have been scaring the pants off the innocent, helpless and disorganized townsfolk.Then an imposing masked figure rides up on a white horse. He arrives just in the nick of time.With the right blend of
    ework and why I need it?

    Don't you get bored when you need to write same or similar types of code again and again? Do you hate when customer wants to change "some unsignificant thing" but you need to change it in 10 different files? Are your scripts too long? Do you write "spagetti" code? If you answer "yes" on some of these questions, then you need a set of functions and classes which will automate most of the tasks, reduce your code size and avoid copy-paste practices. That is framework. It is a set of classes and functions which you just include in your scripts and make your life of a web developer easier.

    What to "put" in a framework?

    Some people and companies tend to believe that everything should be generated by functions and classes and you should never have a "free flying" PHP code. As a result of that they put everything in objects and extremly complicated functions which try to handle everything for everyone. As a result the code gets hard to read, buggy, hard to change and slow to write and learn.

    Other group prefers to write everything for the current situation, again and again for every project and file. They often copy-paste hundreds of rows to save development time and effort, but when they have to modify the code it turns into a pain. And all of this is because they are too lazy to create a framework.

    The solution as usually is somewhere in the middle. You should be looking to optimize tasks which are repeated often in the project or in different projetcs. Here are the best propositions:

    - Mail functions - it's terrible to see most developers putting all the headers in each place where they need to send a mail. Just wrap the mail() function and use the wrapper.

    - Database wrappers - you MUST have one. Stop using the built in mysql (or other DB) functions directly into your projects. What will happen if the database must be changed?

    - Database functions - do you really need to type manually all the 50 field names of that table and then to manually fill the values from $_POST? Sure, it is often needed when the values come in a different way. But very often, especially in admin panels you just have a form with fields corresponding to the table ones and values in them. Just iterate thru the database fields (hint: "SHOW FIELDS FROM table_name") and insert/update

    - HTML code snippets - aren't you tired of creating or copy-pasting date dropdowns, checkboxes, normal dropdowns or radio groups? Create functions for each of these - it could accept parametters as name, values, selected name...

    - Formatting specifics such as date, money, phone numbers etc. Yes, the PHP functions like date() allow you to format in any way. But what happens if you have dates on hundred places and the customers decide that instead of mm/dd/yy they want format "dd Month,

    Executive Business Gifts As Sales Incentives
    Even the best sales representatives need a little motivation at times, right? Most companies do not consider executive business gifts for sales incentives—but they should be! In most sales situations, companies offer commission as the driving force, but in some cases, have small prizes for the best sellers can lead to even more inspiration to sell, sell, sell. The executive business gifts at YesGifts.co.uk are perfect for that extra boost in revenue.How much does that new leather carrying case really cost? Not that much (in fact, they start at only 9.49 at YesGifts), but once someone begins to desire something, they’re wi
    hat everything should be generated by functions and classes and you should never have a "free flying" PHP code. As a result of that they put everything in objects and extremly complicated functions which try to handle everything for everyone. As a result the code gets hard to read, buggy, hard to change and slow to write and learn.

    Other group prefers to write everything for the current situation, again and again for every project and file. They often copy-paste hundreds of rows to save development time and effort, but when they have to modify the code it turns into a pain. And all of this is because they are too lazy to create a framework.

    The solution as usually is somewhere in the middle. You should be looking to optimize tasks which are repeated often in the project or in different projetcs. Here are the best propositions:

    - Mail functions - it's terrible to see most developers putting all the headers in each place where they need to send a mail. Just wrap the mail() function and use the wrapper.

    - Database wrappers - you MUST have one. Stop using the built in mysql (or other DB) functions directly into your projects. What will happen if the database must be changed?

    - Database functions - do you really need to type manually all the 50 field names of that table and then to manually fill the values from $_POST? Sure, it is often needed when the values come in a different way. But very often, especially in admin panels you just have a form with fields corresponding to the table ones and values in them. Just iterate thru the database fields (hint: "SHOW FIELDS FROM table_name") and insert/update

    - HTML code snippets - aren't you tired of creating or copy-pasting date dropdowns, checkboxes, normal dropdowns or radio groups? Create functions for each of these - it could accept parametters as name, values, selected name...

    - Formatting specifics such as date, money, phone numbers etc. Yes, the PHP functions like date() allow you to format in any way. But what happens if you have dates on hundred places and the customers decide that instead of mm/dd/yy they want format "dd Month,

    Selling The Right Product Will Make You A Top Producing Salesperson - No Gimmicks Or Sales Tricks
    There are a lot of sales experts and sales trainers that teach sales skills, tips, and tricks – how to cold call, how to generate leads, how to close sales, where to find prospects, how to upsell, how to ask for referrals, and the like.You can do a search on Google and find thousands of results from people teaching you how to sell. Most, if not all of these, are just tricks or gimmicks. If there's a problem with your sales results, they'll normally tell you that your techniques are wrong. But not many will tell you that perhaps there might be something wrong with the product that you’re selling. Perhaps it’s not you – the
    ould be looking to optimize tasks which are repeated often in the project or in different projetcs. Here are the best propositions:

    - Mail functions - it's terrible to see most developers putting all the headers in each place where they need to send a mail. Just wrap the mail() function and use the wrapper.

    - Database wrappers - you MUST have one. Stop using the built in mysql (or other DB) functions directly into your projects. What will happen if the database must be changed?

    - Database functions - do you really need to type manually all the 50 field names of that table and then to manually fill the values from $_POST? Sure, it is often needed when the values come in a different way. But very often, especially in admin panels you just have a form with fields corresponding to the table ones and values in them. Just iterate thru the database fields (hint: "SHOW FIELDS FROM table_name") and insert/update

    - HTML code snippets - aren't you tired of creating or copy-pasting date dropdowns, checkboxes, normal dropdowns or radio groups? Create functions for each of these - it could accept parametters as name, values, selected name...

    - Formatting specifics such as date, money, phone numbers etc. Yes, the PHP functions like date() allow you to format in any way. But what happens if you have dates on hundred places and the customers decide that instead of mm/dd/yy they want format "dd Month,

    Your Image Makes a Difference
    The other day I watched a very compelling movie produced and directed by Clint Eastwood called "Flags of Our Fathers." It was the story of the WWII battle of Iwo Jima and the resulting media coverage in the US promoting the famous picture that resulted from that event. The message that came from that movie was interesting and one that we as business leaders should understand if we want to be successful.The message was that image is more important than reality. According to the movie, the infamous picture of the six Marines raising the flag atop the pinnacle of Iwo Jima was not taken when the flag was first raised, but
    ry often, especially in admin panels you just have a form with fields corresponding to the table ones and values in them. Just iterate thru the database fields (hint: "SHOW FIELDS FROM table_name") and insert/update

    - HTML code snippets - aren't you tired of creating or copy-pasting date dropdowns, checkboxes, normal dropdowns or radio groups? Create functions for each of these - it could accept parametters as name, values, selected name...

    - Formatting specifics such as date, money, phone numbers etc. Yes, the PHP functions like date() allow you to format in any way. But what happens if you have dates on hundred places and the customers decide that instead of mm/dd/yy they want format "dd Month, YYYY"? Don't change it everywhere, don't use the MySQL data formatting. Create your own wrapper and use it.

    - Admin panels - each and every admin panel includes screens for add/edit/delete various table contents. Why to do it each time? In PIM Team we created a class called table_editor which simply receives several massives and arguments and handles all the operations on any complex DB table, including the HTML code for the editing webform in less than 20 lines! The admin pages don't need to look nice, but yet our table_editor allows your tables to look perfect with CSS

    - File and picture uploading, resizing, thumbnails. You don't really write every time all the codes in your scripts I hope. It would be crazy. You need functions or class for these

    - Project sopecific functions. Many websites have specific features like displaying category trees, specific dropdowns, small tables with user's profiles etc etc. You can and must put these in objects or functions and use across your porjects.

    Don't overdo your framework

    You can't handle everything for every case. Maybe you can but this will make your framework heavy, slow to process and hard to use. The goal of the framework is to make your life easier, not some idealistic idea for pure OOP coding. You need to export functions and objects of things which you do often within different projects or several times in one project. You will only loose time if you try to handle some individual cases.

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.otheradded.com/article/87088/otheradded-Wrtiting-Less-PHP-Code-With-More-Results.html">Wrtiting Less PHP Code With More Results</a>

    BB link (for phorums):
    [url=http://www.otheradded.com/article/87088/otheradded-Wrtiting-Less-PHP-Code-With-More-Results.html]Wrtiting Less PHP Code With More Results[/url]

    Related Articles:

    A New Reason to Read

    The Queen of Fruits!

    How Do I Start Designing A Website?

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com