Moderator: General Moderators
onion2k wrote:phu wrote:How about something practical?
I don't really think that's a good idea. The point of coding challenges is to find interesting and inventive solutions to arbitrary problems - it's very likely those solutions won't necessarily be the best ones from a readability, efficiency or practical point of view.
phu wrote:Seriously? If you're not going to go for readability, efficiency or practicality, what is the value? Solving "arbitrary problems" in PHP is very nearly worthless;
phu wrote:if it's not a web-based scenario, using PHP just provides a massive handicap.
phu wrote:Yeah, you can do all the fun string manipulation you want, reimplement A*, or tackle any other academic programming problem you can find on Wikipedia, but if you aren't learning anything with a practical web application, something more efficient than you might otherwise do, something more readable than the typical PHP way of doing it, you're not helping yourself or anyone else.
phu wrote:I guess if it's just an exercise in wasting time, that's your call, but it seems pretty inane to actively avoid doing anything useful.
phu wrote:And if you're afraid of people using your security-hole-ridden code...
phu wrote:well, you can post a disclaimer and make it their problem. You could also make part of the exercise using good input sanitization practices. Besides, if you intend for people to post unreadable, inefficient and impractical code, you're already doing plenty of damage to anyone who might read it without understanding that the methods being used are just plain poor.
Benjamin wrote:Generally, the simplest solution is the correct one. I don't think it's a stretch to say that the simplest solution would also be the most readable, efficient or practical. Or at least close to it.
Benjamin wrote:PHP is only one level above C, which is only one level above ASM. So I wouldn't consider that a massive handicap.
Benjamin wrote:This is simply not true. Finding unique solutions to solving problems, without any constraints allows for very creative use of the language. Various different and creative methods for solving similar problems can be very educational for programmers who may not realize that X can even be done.
Benjamin wrote:I don't believe we are "actively avoiding doing anything useful". You are welcome to post your own challenge meeting your criteria. We certainly won't stop you.
Benjamin wrote:phu wrote:And if you're afraid of people using your security-hole-ridden code...
That is cynical.
Benjamin wrote:I don't remember seeing any unreadable, inefficient or impractical code being posted as a result of any challenges. I would argue that code which solves the intended problem is not impractical.
Benjamin wrote:I think you are viewing this from the perspective that the challenges need to be "taken more seriously". If this was the case, I would doubt anyone would participate, so good luck with that.
phu wrote:Implement regex-based URL routing: Given a URL, passed by the web server to your front controller, find the most efficient way to match said arbitrary URL against an arbitrarily large list of URL regex's, with an emphasis on avoiding the overhead of repeated preg_match (or similar) calls.
Benjamin wrote:Create a post outlining the requirements and then post a link to it here. I think URL segments would be much more efficient than pattern matching, because arrays could be used in combination with isset, which is extremely fast.
Users browsing this forum: No registered users and 2 guests