public static vs static public

Ever since starting with PHP 5 object oriented development, all documentation I read on the topic seemed to suggest that the only way to write the method keywords is "public static". I've been following along those lines, and for a while I really thought any other order would trigger errors. Only recently I found out the other way round is actually nicer.

Even in current literature on PHP 5 object oriented development, you'll mostly see mentions of the "public static" order. And it isn't strange, I can understand that some people prefer the PPP at the start to give clarity on the access rules for methods.

While looking around inside the symfony code, I first encountered the "static public" order of keywords. At first, I thought this strange, but the more I look at it, the more beautiful I think it is. It gives a great overview of which methods are static and which aren't. 

In the end it is of course a personal preference, however I've found my preference shifting towards the latter over the past months. I decided to check which was preferred most in my twitterverse, and here's the results:

 

As you can see, a big majority still prefers "public static". However, even more important I think is that the "static public" had more ground than I expected (or perhaps it's that a lot of people that follow me come from the symfony world). Having 2 votes for the option "I don't use static methods" was perhaps also a small surprise, but I guess it depends a lot on what you work on as well.

If you haven't voted yet, feel free to give your opinion in my poll. 


Add comment

Comments

gravatar mp3 players docking station: listening to your favourite music is simple with the sony rdpx200ip ipod, ipad & iphone wireless docking system. as the low guy on the totem pole in terms of prices for jvc cd receivers, this model still boasts good features and sound. omaura debuts wall-mountable htpc.
March 9, 2013
gravatar voice recorder kindle app: measuring 435 mm in width, 380 mm in depth, and 99.5 mm in height, and weighing 5.8 kilograms, the toshiba is considerably bulky and heavy. diasonic technology sets the standard for digital audio recording again with linear pcm voice/telephone recorder - the first and only recorder with "better than cd quality" voice and telephone recording! this is one of the tax planning strategies that most tax payers fail to give a second look.
March 10, 2013
gravatar Bass Guitar Lessons For Beginners: truss rod the best guitareffects pedals should ideally have pitch modulation such as phase shifters, flanges, chorus, ring modulators and talk modulators and resonance filters. being able to study on your individual rate will make playing a brand-new instrument way more pleasant experience for the large percentage of people. ideally, a new batch of guitar guitar players could be sharpening their proficiency at this moment in time. there has hardly ever been a more rewarding time to understand 4 string guitar as there are methods of training to guarantee everyone is able to acquire the optimal means to read and learn. it truly is suggested that you just decide on that strategy is correct to suit your needs and proceed with it. ok, so at this point we have a very good plan of what the truss rod and neck are accomplishing. so now if your neck is great you are accomplished. but if possibly one of the steps above resulted in a buzzing sound then it is time to get the instruments out and do some adjusting.ng. guitars for beginners cheap guitarsoloman777 guitars for beginners and beyond r taylor guitars
March 11, 2013
gravatar fertilizer broadcast spreader: jobe's 1260 organic tree fertilizer food spikes, 10-pack. bonding should start early for lgds. compost tea is made by soaking compost in water and straining off the liquid. if you live in the lower elevations of the southwest, your soil is a word of caution on buying fertilizer. farm fresh living is the online source for certified organic, green, and a rich organic fertilizer for herbaceous plants and perennials with beneficial bacteria and mycorrhizal fungi!
May 15, 2013

Php5_zce_logo

Tags

1337 2008 2010 2011 4developers access modifiers accessibility AdaLovelaceDay09 advent agavi agile alfred amsterdam amsterdamphp apache api apple article articles atk atkMetaNode audioscrobbler autoloading automation azure backwards compatibility barcelona barcodes bash bbc bbq beatstad belgium best practices bittorrent blogging blogs boards of canada book books bughuntday bundle caching cake cal evans calendar career cat cerf certificate cfp cilex clear cms cologne common sense communities community components composer conference conferences contest continuous integration contribute contribution crisis css curl custom d-day data migration datetime DbFinderPlugin decorator decorators deployment deps devdays development directoryindex directoryiterator docblox doctrine doctrine2 documentation download dpc dpc09 dpc10 dpc11 DPC2008 dreamhost drupal dv7 eclipse ed editors efficiency enterprise errors event events expertise ezcomponents facebook filter-branch filteriterator finland flickr fork framework frameworks free ticket freelance freeze frontend fun game games geoip germany getting real git github globiterator gnome-do google google calendar googletalk graceful degradation hack hackers hidden gem hiphop howto hp HR html http i386 ibuildings icann ide ideasofmarch idm imovie inclusivity indy ingewikkeld integration international php conference internet interview ipad IPC ipc ipc08 ipc10 ipc11se iterators iterm2 javascript jenkins jenkins-php job job openings jobeet john peel joomla joomladays kiva kubuntu launcher launchy left on the web libcurl libraries library lighttpd lime linktuesday linux live london loudblog m2ts mac magazines malware mambo manchester marjolein mediterra meeting meme meta methodology micro-financing microframework microsoft migration movie music mysql namespace namespaces netbeans netherlands newsfire nllgg northeastphp nos odmarco open source opinion ORM osx paradiso paris partnership pavilion pear pecl performance personal pfc10 pfc11 pfcongres pfcongrez pfz pfz.nl photo php PHP php5.3 phpabstract phpazure phpBB phpbb phpbelgium phpbenelux phpbnl10 phpday phpdoc phpdocumentor phpgg phpitalia phpnw phpnw08 phpnw11 phpnw12 phpstorm phptek phptek09 phpuk2009 phpUnderControl phpunit php|architect php|tek podcast politics portability postcrossing presentation presentations private projects protected prototype PSR-0 public python qa qr codes re2c recruiting refactoring review rewrite ruby on rails san francisco schedule scifi script security sensio seven things sexism sfdaycgn sflive2011 shell scripting silex simplexml slides smfony software sogeti solar sound speakers spl ssh standard standards star trek static steer strings stylesheets subversion symfony symfony live symfony2 Symfony2 symfonycamp symfonyday symfonylive symfonyUnderControlPlugin talk talks tech techademy technology techportal tek09 telecommuting terratec terrorism testfest testing textmate textpattern the right tool timeout tips tld todo tomas tools training twig uncon unet usability usergroup validation vhost video vim vinyl virus warp webinar weblogging webservices wiki windows winphp women wordpress work workshop world world of warcraft wpi writing wunderlist xml xpath xsd yara year youtube zc11 ZCE zemanta zend zend framework zend server zend studio zendcon Zend_Form zite
© 2004 - 2013 Stefan Koopmanschap + Powered by Symfony, photos powered by Flickr, links powered by Delicious, Shanghai smilies by Iconbuffet. Feeds: rss / atom. Left on the Web v4.4.0.1