170 Comments
- Danltn, on 11/30/2008, -8/+147Finally, a well-written programming article...
- Alexio, on 11/30/2008, -4/+117Well damn, number 7 makes me feel stupid. All those hours of my life wasted and I could have floated the container of those floated elements? Dugg.
- WebWorker, on 11/30/2008, -2/+106"If you’re anything like me you probably work in cycles of going balls-to-the-walls with inspiration writing the best code of your life, to unproductive downtime of feeling unmotivated and looking at lolcat pics whilst saying “heh” periodically."
Yes! I'm not the only one :p - flashcat7777, on 11/30/2008, -3/+67Dugg for the first item: SVN checkout as the production site. FTP served me well... back in 5th grade.
- yongfook, on 11/30/2008, -0/+53unfortunately for me it's my actual name.
- NoNamesLeft, on 11/30/2008, -2/+38CSS reset != 'Dirty Little Trick'.
- tgc1, on 11/30/2008, -0/+26To Yong Fook - Dude you're awesome! Great Work!
- yongfook, on 11/30/2008, -1/+26actually the middle reason is pretty important.
if you have whitespace at the end of your php file after the closing ?> then the file can throw errors or warnings at execution time. by leaving off the last ?> you completely avoid this risk.
trust me, this is pretty useful if you've ever spent half an hour poring over code trying to figure out why it's borking, when the only problem is simply a carriage return at the end of the file... - seantubridy, on 11/30/2008, -0/+23Dude, don't be ashamed. Embrace it. It's a good name.
- DteK, on 11/30/2008, -3/+25all of my dirty tricks usually involve doing some work around for IE
- thelastcivilian, on 11/30/2008, -0/+18Now if it only made sense as to WHY this behaviour occurs then my head wouldn't hurt quite so much.
- phrstbrn, on 11/30/2008, -2/+18They created this nifty little command called "export".
SVN checkout on a production site is bad advice at best. - PRlME, on 11/30/2008, -0/+15i still FTP. never had a problem.
- haentz, on 11/30/2008, -11/+221 is already *****. Do never CHECKOUT to a production servier. Do an EXPORT...
- phrstbrn, on 11/30/2008, -0/+10No, haentz is reading it right. And he is right.
Doing a checkout on a production server is DUMB. - chipxsd, on 11/30/2008, -0/+10but you can use them to make a porn site
- moresheth, on 11/30/2008, -0/+9Another way to do it is to give the container div an overflow: hidden; style. This does the same thing, except it doesn't cause you to have to clear your floated container div. The only downside is that if you have something position absolutely outside of that container, it will be hidden. It's a tradeoff, but overflow:hidden works the best, in my opinion.
- steviesteveo, on 11/30/2008, -0/+9This is perfectly true - some of the best work is done with hours to go before a critical deadline, adrenaline helps creative programming but if you don't have that spark you're left sitting looking at the wall.
Although, if you're really programming seriously, you'll still be chewing the problem over in the back of your mind and that time waiting for the spark to strike is very useful time.
If you try billling for it though, whoa, do your clients not agree. - haentz, on 11/30/2008, -1/+9No. He says to do a checkout on the production server. That's crap. You should export the SVN repository to your production server. And of course you wouldn't do this with a cron job, like this guy suggests, but with post-commit hooks...
- PhrosTT, on 11/30/2008, -4/+12OMG finally a good top 10 tips article....
- conkeso, on 11/30/2008, -5/+13Are you related to Fook Yu and Fook Mi?
- tomarocco, on 11/30/2008, -0/+8I wish I was so blessed.
- championchap, on 11/30/2008, -1/+8The best.
- inactive, on 11/30/2008, -1/+8Johan Marcus Guy! You're back!
- danielsamuels, on 11/30/2008, -0/+7My personal preference is CodeIgniter, it is very easy to pick up and use.
- SuperJason, on 11/30/2008, -0/+7I understand the reasons against doing a checkout, but if you DO use a checkout instead of an export, don't you get incremental updates? The advantage of incremental updates is that it's way faster.
Am I wrong? I don't do many exports.
(Personally, I use rsync. Updating production takes 3 seconds to sync with the pristine copy on the build server) - HigherLogic, on 11/30/2008, -0/+6Another vote for CodeIgniter, simply because of how lightweight it is and much easier it is to pick up (especially for others). I've found other PHP MVC frameworks are too much like learning a second language. With CI, it's really easy to pick up and master if you already know PHP. Performance-wise, it's always beating other frameworks out too.
Another good reason to learn CI is ExpressionEngine, which is partially built on CI right now. When 2.0 comes out, it will be fully based on this. It's develoepd by the same group of people too.
And if you're strictly a PHP5 kinda person, take a look at Kohana, which is a fork of CI. Still, CI is preferred because it has a larger following.
EDIT: I missed the part about how you're just learning PHP. I don't recommend a framework for you then. You need to learn the basics of PHP and OOP before jumping into a framework. It's like trying to learn CSS without understanding HTML first. - Rickard, on 11/30/2008, -0/+6The middle one is. It's a simple way of preventing accidental "headers already sent" errors. What good does the ?> do you anyway?
- monzee, on 11/30/2008, -0/+6It is a good idea. The Zend guys themselves recommend this.
- inactive, on 11/30/2008, -13/+19Digg,
I'm really enjoying these web development tricks, they make me feel so naughty and alive.
Here's one for the masses, when you're ssh'ing into a server what I like to do is log in, and then put in a password. If I do this successfully, I rub my man-nipples a little bit and say "access granted". mmmmm.
Here's another one: Sometimes I'll take w3c compliant code, and i'll take off a ">", so it's not compliant anymore, but nobody can tell, it's like my naughty little secret.
When this mission is complete I reassure myself with a "you've been a low-quality web developer, maybe you need some honey applied to your sexy abs to make you more w3c compliant."
That's just a sample, I don't want to give away all my secrets!
-Johan Marcus Guy - Daniel0, on 11/30/2008, -1/+7legendxx, I think you misunderstand. Omitting the closing PHP tag is for preventing ACCIDENTAL whitespace from being outputted. How is that in any way "retarded"? I think you're the only person here who is retarded because you attack the person instead of the argument and because you are drawing conclusions and generalizing like that.
- tomarocco, on 11/30/2008, -0/+6RoR is a niche fad that will be dust in a few years. Not that RoR is bad, it's just that Ruby is the limiting factor and it ain't gonna carry Rails where you would like to see it go. MVC has been around a helluva lot longer than RoR. You Gen Y'ers worship it like David invented the wheel or something, while the real truth is that it is nothing but an incarnation of best practices that have been around since you were sucking on your mother's teat (or before).
I'd stay up late tuned for Python 3 before I'd give Ruby my effort. In the meantime, you can make six figure coding PHP and you don't have to be a pretentious twit while you're doing it. - McReynolds, on 11/30/2008, -0/+6I second codeignitor. It has excellent documentation and does not get in your way. It doesn't try to be so smart as to leave you clueless of what is happening, CAKEPHP is guilty of this. Symphony is hell unless you are ready to spend months getting up to speed with its build process.
- Crath, on 12/01/2008, -1/+7I heard you like to float, so I put a float in your float so you can float while you float...
referring to #7 - zip000, on 11/30/2008, -0/+5I was banging my head about this exact thing a few months back. I came across the floated container solution then and was quite excited about it.
- eraevion, on 11/30/2008, -0/+5Woo! Thanks for number seven!
- boojoy, on 11/30/2008, -0/+5For what its worth, I third CodeIgniter. I find it the perfect balance of letting you work the way you want to and speeding up your work.
- ell0bo, on 11/30/2008, -0/+5Some of my best code usually get written with a beer or two in me, I don't think so much and the logic just flows out. Of course commenting is usually a requirement at that point.
- bradleyland, on 11/30/2008, -0/+5Is it bad that I've been stuck on the lolcat pics part for the last six weeks? :(
- Telos06, on 11/30/2008, -1/+6Yes an export would prevent the .svn folders in every subdirectory, but since he has a solution to effectively hide those, a checkout makes sense. With his method you can run svn update instead of deleting everything and then doing a new export to pick up the latest changes.
- zakharm, on 11/30/2008, -0/+4It seems like he is looking for something easy to learn, RoR is not.
- bradleyland, on 11/30/2008, -0/+4You should check out Capistrano. Most people associate Capistrano with Rails projects, but it works just as well for PHP.
Think of Capistrano as a framework for deployment. It has a set of built in tasks that correlate to the common steps taken when deploying an application. You fill in the actions you want taken at each step, and Capistrano handles the rest. Capistrano's only requirement is that you have SSH access to the server, and a working Ruby 1.8 (or newer) install on your client machine. Ruby, nor Rails, is required on the server. - flashcat7777, on 11/30/2008, -0/+4If you develop correctly and separate your presentation from your logic, there is no reason to have echo's in your PHP-only files and the ?> can only add confusion.
- tgc1, on 11/30/2008, -0/+4Same here. I hate that. I also hate burnout. That's scary. Knowing that your lively hood depends on your mind being fresh and one day waking up and not being able to do anything creative to save your life. I've experienced burnout only a few times in my life. But every time it was hard hitting and took a while to get past.
- kreatr, on 11/30/2008, -0/+4nice find ... nice web dev article after a long time
- Narfmaster, on 11/30/2008, -1/+5Heart Yong Fook
- tomarocco, on 11/30/2008, -0/+4Listen to him. He speaks the Truth.
- bradleyland, on 11/30/2008, -0/+4What do you mean by "along with" Dreamweaver? When you move in to a framework like CodeIgniter, you move in to an entirely different type of web development. When you design static sites, each HTML file represents a page in your site. CodeIgniter, as well as many other frameworks, use an application architecture (called a design pattern) referred to as MVC (model, view, controller). This means that your "pages" are no longer contained in a single file. You're designing an application now, not a website.
If the question is, "Can I still use Dreamweaver as my code editor and file manager", then the answer is yes. If the question is, "Will Dreamweaver continue to work the same as it did for my static sites", then the answer is no. - PhrosTT, on 11/30/2008, -0/+3yeah.... please note he's referencing php-only files.
all Zend Framework tutorials recommend this. -
Show 51 - 100 of 171 discussions




What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official