PHPDN Codeoff!! [Finished]

Where we keep all the boring tidbits about the PHPDN site, the news, and what not.

Moderator: General Moderators

User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Too chicken?

Oh and your scoring on accessibility really inhibits what we can do. I mean I'm all for degrading gracefully when it comes to web sites but when you are building a web 2.0 application you really gotta rely on the presence of JavaScript. I think my entry will require JavaScript and IE7+ or standards compliant browsers.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

ole wrote:Too chicken?.
I'll make you eat those words! I'll make an awesome super-app that destroys everyone else's! Literally! I'll call it PHPVirus. :-p
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I'm quite unclear about the "PHP5" aspect of this project. Probably sounds redundant and should not be synonymous with "PHP5" but does that mean completely object oriented? Design patterns? What about procedural coding?

Or, does it simply mean that it has to be compatible with PHP5, meaning, it won't have any problems running?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

I think he means that you shouldn't find the var keyword or anything that PHP 5 has clearly improved upon. Backwards-compatibility is not an issue, and we should be promoting PHP 5 and all it stands for. :-D
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

You know what I think I'm going to bow out actually. I had begun to develop an idea for an application but I've dropped the idea because it's too ambitious. I have spent the last 5 hours solidly thinking about something small (maybe only taking a week) that I could write and drawn a blank. So I'm going to go back to learning Ruby.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

The initial post has been updated with a modification of the "pre-existing code" rule, as well as category scores.

PHP5 means that when tested, it won't cause any PHP5 specific errors - like using the 'var' keyword. Object-orientation is one of many programming styles & is not always best suited for every application. Feel free to use oject-orientation or procedural coding, or whatever you feel is best suited for the situation.

@~ole - whether you enter or not is up to you of course, but you do have over a month and teams are allowed. I believe ~superdezign has voluteered.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

@~ole - whether you enter or not is up to you of course, but you do have over a month and teams are allowed. I believe ~superdezign has voluteered.
Well I was going to enter on my own but perhaps I could go for a team and just act as a code reviewer or something. So here is one possible project idea:

PHD
PHPDoc has been around for some time. As far as I know the project has been going at a snails pace for some time. The two original authors are still the only ones involved in the project. If you have ever had the displeasure of using some of the more advanced features of PHPDoc such as writing tutorials or had a look at the mark-up it generates you'll know that is more than enough room for improvement. PHD would be an attempt to improve on some of these problems but be a complete rewrite obviously.

Possible improvements over PHPDoc:
  • Enhancements to PHPDoc syntax, improved consistency? Careful consideration will be needed. Some of my ideas follow:
    • Have a @pragma syntax for controlling what PHD does instead of configuration file
    • Introduce a @flag syntax for marking things. So like "@flag binarysafe". PHD can produce output of what was flagged and what wasn't.
  • Improved handling of errors in the subject code
  • Embrace DocBook much more. DocBook is an XML schema for writing documentation that can than be transformed into other things such as HTML or PDF. Our library should probably just generate pure DocBook and be entirely DocBook based I believe there are existing tools to do conversion from there otherwise we could write those as well. Point is it gives users much more flexibility. Formerly to generate documentation for distribution with your source and documentation suitable to embed into your website was an impossibility, for instance.
  • Intelligent notifications of misuse of PHPDoc syntax
  • Better PHP syntax highlighting.
Unlike PHPDoc we'll be able to use the reflection API to rip all the information we need. getDocComment() could be very useful. We would have to create a page where code could be entered documentation produced for the purposes of the competition.
User avatar
The Phoenix
Forum Contributor
Posts: 294
Joined: Fri Oct 06, 2006 8:12 pm

Post by The Phoenix »

pickle wrote:The initial post has been updated with a modification of the "pre-existing code" rule, as well as category scores.
Now I seriously want to enter. I just need to find the time.. rather hectic time for me. But boy, thats a really fun diversion.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Oh my, thank goodness!
Attempting to write a small templating engine is no small task.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

scottayy wrote:Oh my, thank goodness!
Attempting to write a small templating engine is no small task.
If you are ACTUALLY making it small, it should only take like an hour or two. If you mean small in comparison to big ones, that's a diff story. :-p
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

There you go, took me about 5 minutes

Code: Select all

<?php
/**
 * Template class.
 */
abstract class Template
{
    /**
     * @var array
     */
    private $_data = array();
    /**
     * Get data back escaped for HTML
     * 
     * @param string $name
     * @return mixed
     */
    public function __get($name)
    {
        return htmlspecialchars($this->getRaw($name));
    }
    /**
     * Get data back as it was entered
     * 
     * @param string $name
     * @return mixed
     */
    public function getRaw($name)
    {
        return $this->_data[$name];
    }
    /**
     * @param string $name
     * @params mixed $value
     * @return mixed
     */
    public function __set($name, $value)
    {
        $this->_data[$name] = $value;
    }
    /**
     * @param string $name
     * @return bool
     */
    public function __isset($name)
    {
        return isset($this->_data[$name]);
    }
    /**
     * @param string $name
     */
    public function __unset($name)
    {
        unset($this->_data[$name]);
    }
    /**
     * Set several values at once with an array
     *
     * @param array $pairs
     */
    public function assign(array $moreData)
    {
        $this->_data = array_merge($this->_data, $moreData);
    }
    abstract public function __tostring();
}
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Well, crapcicles.

Not that many (or any) of you care ;) But it looks like I may have to bow out of this codeoff.

With a project already underway, it's too much of a task to have my submission for this contest done by the deadline. Plus, money rules. I'm downgrading my submission to 'work-on-it-for-fun' status.

If I happen to have it done by the deadline, that'll be sweet! Whether or not I do though, I still thank this competition for giving me the motivation to start on a project I've had in my mind for quite a while.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

ole wrote:There you go, took me about 5 minutes
Now, for the other 55 minutes, you have to make a sexy test template. ;)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Anyone send anything in?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Wow - that month went quick.

No, we got no entries - so I guess this contest is closed without a winner.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply