-
Website
http://www.phpfour.com/blog -
Original page
http://www.phpfour.com/blog/2008/10/02/become-kick-ass-php-ninja-from-newbie-guide-tips/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
robskils
1 comment · 1 points
-
joshsharp
1 comment · 1 points
-
nirjhar
1 comment · 1 points
-
Nhm Tanveer Hossain Khan
1 comment · 1 points
-
cubanhenry5
1 comment · 1 points
-
-
Popular Threads
thanks for this informative post.
1.Version control: All programming languages should use it even I use it for my excel docs.
2.OOP: Java it drives you to do proper OOP.
3.Coding Standards and Patterns: Java have it too in a higher degree.
4.Document your code: Java have thousands of good tools for it.
5,6,7. Java have gazillions of neat frameworks to choose, use JUnit for testing, Java is a proper OOP you can reuse your objects and components check Spring, Guice, OpenEJB those can help you to do it much better.
8,9,10.Same in Java as PHP.
11. Good IDE: Java have awesome IDEs with awesome refactoring tools and much more, Eclipse, Netbeans, IntelliJ, Borland JBuilder, MyEclipse.
12.Java same as PHP.
I suggest you keep an eye on the latest trend in PHP, you'll see that it's quite a mature language right now. I've seen people using both PHP and Java, which they use for specific need.
Thanks for your comment though :)
@Frank, Im not interested in the template that is the easy part, Im interested in the model or controller code or the code behind.
The templates you could use Freemarker for a MVC framework or Facelets for JSF, it is similar as PHP templates. Take a look at Freemarker or Facelets are just xhtml templates. JSF it is a spec for web component based frameworks, It is not a template language, JSP it is the template but is not the best practice to use with JSF and I'm agree JSP sucks, thats why there are other alternatives and much better.
But also I'm agree with Emran Hasan that PHP can be helpful in some situations and Java in others, I'm just suggesting that if you care a lot about OOP or best practice and patterns Java it is better option IMHO.
http://www.ezcomponents.org/contributing/coding...
Bit disappointed to not see VIM in the list of good IDEs.
OpenSSH + GNU Screen + VIM + VIM aliases & scripts === the win
Thanks for your comments!
Think that phpDocumentor will be first on the list, as I already pretty much follow the coding standards.
Now we can just forward the link of this post to the newbies instead of giving them a long lecture :D. Good job.
and liked...
thnaks, good tips ;]
Mello.
im just a php beginner but you should talk about this point...
I am a micro-manager with code and I understand by building, that's why I like to re-invent the wheel, make sure when I do I take a good look at the wheel from security, flexibility.
I love the thought process of event driven :) It just feels to intuitive and the web really is 100% event driven, it's a disconnected system and you can only rely on one event at a time.
I just don't have that magical OOP feeling for the web.
When I develop outside the web I do C and C++, and it's a different world the communication is different. And While I develop AJAX JSON stuff in web, I always start with the assumption that the user and session is completely disconnected and never treat it like a real app.
I spent the time to write a very extensive and well rounded class for mysql. Then in everyday use, it just didn't feel right, I can't help but thinking hmm I miss my normal functions :) I miss my quick n dirty mysql_add_my_row($table,$fields,$vars). What am I missing out with on OOP? When I program OOP half of developers whine saying what is this, then the other half whine hey we use cake, you use zend.
I follow the rest of the practices to the point, svn, inline documentation, code format, etc. I am just not an OOP guy, can someone help sell me on the religion of OOP?
Thanks for the help! :)
- read(1);
- findAll ( "status = 'published'" );
- update ($post, $id);
to speed up my development time. Back in my head i know the generated queries are safe, structured and does their work pretty good. Just my thoughts :)
http://szeged2008.drupalcon.org/program/session...
This is different from writing using software patterns. Writing in software patterns can help.
Also, being agile as you describe it is different from Agile Development, which is a very specific form of development methodology. Agile Development suits some projects and not others whereas your definition of having a dynamic personality is useful always.
Also, OOP is a huge overhead for many of the simple functions you need to perform with scripting. Chances are, if you need to make something huge, scalable and quick then you're going to write the guts in your favourite compiled language such as Java/.NET/C/C++ etc. PHP is not designed for that and so falls down on fast backend processes.
In my personal opinion, some frameworks just try too hard to bloat everything and loses the main focus. For me, the objective of a good framework has to be providing structure to projects and provide a number of useful functionality like db abstraction, security, caching, profiling, url mapping, helpers, etc etc.
Regarding PHP's speed compared to other compiled language, it's a plain truth. A scripting language can not be as fast as the compiled ones. However, it can more or less handle the pressure of web - at least upto a few millions - if the app is developed properly and optimized for large traffic.
Thanks for your comment :)
PHP is a scripting language - don't forget that. Using objects and classes is important, but not vital to proper coding in PHP. Writing all your code within classes like many frameworks out there do creates a lot of overhead that isn't necessary when developing a website, and causes developers a lot of headaches just trying to get a simple website setup with a few dynamic sections.
OOP is a practice, and in PHP its just an option. Unlike other languages such as Java which are completely object based languages. Utilizing PHP's variable and object scope is much more important in my opinion.
Things to use objects for: modular information (such as a user entry, or a database wrapper)
Things NOT to use objects for: normal page procedure (Zend framework does this, and although this is a robust framework it is silly to waste time programming this way when PHP programming is meant to be a faster alternative than other languages - you might as well just use Java to program if you want to do it that way, it will be faster)
I tend to prefer Scite. Though, with this editor, you can only have 10 documents open which is a pain. And it is missing two very good features of Dreamweaver: Entire site search / replace, and suggestions (which are very handy, specifically with CSS).
Someone said to me that it keeps the form separate from the PHP code. If you use an MVC framework, you can still put the html code for the form in the view.
I have used my own type of framework, and my applications have been very quick and snappy. They definitely don't use separate functions and commands listed in arrays to create an input box!?!?!? Why, it's not necessary! I will admit that I may use a function that starts the form an ends the form, but not to populate the contents of a form.
comfortable writing the html myself.
Points well covered, and the "further reading material" in each point makes this post very valuable.
Thanks for sharing this.
not free, but really good: i've used it since 5 years, and its still the best _ lots of plugins to complement it.
I think that good freeware IDE for PHP programmers is also Eclipse for LAMP.
Looks like top point is to Write code in OOP.
OOP is not a way of coding. It's intended to match real world modeling in programming. When you think of OOP then you have to take every entity as object. I think you still really have some shortage of some software engineering knowledge. Though this article could be helpful but finally realized that you are not a true IT Professional. May be diverted form other field to this field. Still lots to learn buddy.
And don't know what the word "diverted" means here, but I've been programming since college. And if you think I'm not a "True IT Professional" that's fine with me as I don't mind about people saying things that they don't know about - its their discredit, not mine :)
Oh btw, what is your blog address where I can find good posts on software engineering?
Write code in OOP way,
Use a good IDE,
Test your code the right way,
Re-use code/libraries
Learning how to re-use code is probably one of the biggest thing a programmer can do for himself/herself.
Angain great article!
Meh