Jump to content

A PHP/MySQL Challange


Recommended Posts

Dear Forum members.

 

I've just had a disappointing experience on various freelancer/php commercial sites.  I've decided to blog it (indeed, I'll do this in general for my projects from now on) and would like some feedback on exactly how complicated my request was/is.

 

I'm perfectly able to code it myself.  I consider it (very) trivial, I'm just busy.  It is trivial?  am I wrong?

 

Please take a look: http://dumb-dumb-dumb.blogspot.com/

Link to comment
Share on other sites

I've decided to blog it (indeed, I'll do this in general for my projects from now on) and would like some feedback on exactly how complicated my request was/is.

I though it was pretty straightforward, the only part that was a bit hazy:

The structure "I_am", "one_of" "a_type" is a nested structure. Reverse the order and you get (shops > local shops > baker).

So are these categories & sub-categories ("I_am"=baker "one_of"=localshops "a_type"=shops)?  Why do you list them in reverse order?

Link to comment
Share on other sites

So the structure is clearer to 'ordinary folk'

 

"Shops > Local Shops > Bakery"

 

as opposed to

 

"Bakery > Local Shops > Shops" (the structure looks back to front to me).

 

And both stand in contrast to chains stores.

 

"Shops > Chain Stores >  Macy's"

 

That bit is hazy.  I admit.

 

I'm going to crank out the code this evening to see how complicated it actually is.  I still think it's less than 4 hours work.  And probably closer to 2 hours, tops.

Link to comment
Share on other sites

Thanks for the offer.  But I put the work up because I was overloaded for two weeks.  Now I've cleared the backlog, and had a couple of evenings out to boot.  So I am looking to do it myself this evening.

 

I'll bear it in mind for later, however.

 

My disappointment was/is this. 

 

I consider the job to be trivial, if a bit involved in a couple of places (curl, preg_*, mysql_*, some HTML analysis, some programmatically writable javascript functions, really nothing complex).    The responses I got put the work into the 'days to complete' categories, and no one seemed to have a clue about curl and preg_* functions.  The peeps seemed to know how to connect to a database and print out the results in nice HTML. 

 

That was the extent of the skills of the 'five star' candidates.

 

 

Link to comment
Share on other sites

Thanks for the offer.  But I put the work up because I was overloaded for two weeks.  Now I've cleared the backlog, and had a couple of evenings out to boot.  So I am looking to do it myself this evening.

Gotcha.

 

I consider the job to be trivial, if a bit involved in a couple of places (curl, preg_*, mysql_*, some HTML analysis, some programmatically writable javascript functions, really nothing complex).    The responses I got put the work into the 'days to complete' categories, and no one seemed to have a clue about curl and preg_* functions.  The peeps seemed to know how to connect to a database and print out the results in nice HTML.

 

That was the extent of the skills of the 'five star' candida

I surely see why you would be disappointed.  I've never really used public freelance sites so I can't really comment, but I've always been told they're hit or miss (mostly miss ;P).

Link to comment
Share on other sites

Hmm..."days to complete".  Let's just say for argument's sake that 2-4 hours is an accurate estimate of how long the project should physically take.  Are you sure you aren't misunderstanding others' statements of "days to complete"?  Perhaps they mean it like "I will have it ready for you in a couple of days".  Which is not the same as saying "I am going to bill you 48-72 hours" or whatever.

 

Because...just because something only takes a couple of hours to physically do (allegedly..again, for the sake of argument we're assuming 2-4 hours is accurate), doesn't mean people are just sitting on their ass with nothing better to do than jump on your project immediately and focus solely on that. 

 

At any given point in time, I have at least a dozen or so projects on my plate.  Just because something takes X time to do, doesn't mean you're gonna get it in X hours.  Same with you...you yourself say that you can bust it out in 2-4 hours...but how long have you been sittin' on it?

 

edit:

 

Also, dunno about you, but where I work, we charge for more than just how long it takes to physically code.  We  include in our SoWs time for communication and figuring out all the details of what you actually wanna do, working with the client devs to make it go from concept to reality (knowing how to interact with a db is not the same as knowing how you have your stuff setup, what established protocols/procedures/coding conventions and other hoops you have to jump through to interact with your setup, etc..), QA processes, etc... IOW there is a lot more work involved in getting something from your head to live on your site than the actual coding. 

 

 

edit:

 

And of course, none of this speaks at all towards their ability to perform the task in general.  I am merely pointing out a possible misunderstanding between "how long should this take (how many hours will I be billed)" vs. "when will I actually get it", and also the fact that projects involve more time and work than just coding - something many people tend to forget, when looking for someone to do work.

Link to comment
Share on other sites

I think possibly the problem with those type of sites is who votes them 5 star. They may earn that ranking from doing exactly as you say, querying a database and printing out some HTML, over and over again. Whether the code is of good quality is likely not known to the person hiring them. It works, looks good and they did it quick, so they're voted up and look like a professional. I don't really ever go on freelance sites either, so I may be wrong.

Link to comment
Share on other sites

I usually find the same problem with freelancing sites but have honestly been impressed with the way oDesk handles everything so you may want to look into that for future jobs as well (after looking here of course :P). For fixed rate jobs if the work isn't completed as agreed you don't pay (which could be potentially bad for coders if the employer decided to be a dick but is good for instances when you may have hired a bad choice) but while working on the hourly paid jobs the coders must keep the oDesk app open which takes screenshots every few minutes. If there is a block of time they aren't working you don't pay them for that block of time, the rest you do.

They also offer tests that people can do that cover a variety of subjects so you can look for coders that have passed these tests and have a general idea what to expect from them.

Just thought I'd point them out in case you hadn't seen them yet.

Link to comment
Share on other sites

@Maq

 

Sorry, I didn't answer your question properly.

 

The pages are in reverse order because the top level classes are made first, and then the second level then the third.  The way the various IDs are made are kind of programmatically consistent, but order could be cleaned up.  It's not a priority and elsewhere the order gets reversed again for other purposes.

 

So each solution had problems,  So we kept to the first one, and will fix it later (if at all).

Link to comment
Share on other sites

@Crayon. and others.

 

The coder offered a 1-2 day start, but google chatted 3 days later for clarifications (natural enough).  This was given and he promised me the pages by close of play next day. I waited three days ('waited' == 'sent update requests emails once a day').    Sent a final warning and then cancelled the contract.

 

Real time vs elapsed time.  I'm perfectly aware of the difference. 

 

I didn't want to use a company because  I was offering up to 150 GBP and wanted as much of this to go to the coder as possible.

 

This evening I wrote page 1.  Basically cut n paste plus google research.  I blogged it http://dumb-dumb-dumb.blogspot.com/2011/05/phpmysql-challenge-how-long-did-it-take.html and am now having a beer. 

 

Oh, there was a final reason for asking another person to write it.  I always find my own PHP coding to be ugly, especially with all the echo "html things" commands.  It hurts my eyes.  I'm intending to take some formal programming courses to tighten up the

Link to comment
Share on other sites

Those functions are pretty straight forward if you already know regex as you claim, or string manipulation techniques in general. And the php manual is widely recognized as one of the most well written manuals..ever.

 

I think you foolishly made a lot of assumptions about how easy something should be, and are now trying to use your lack of php knowledge as an excuse. And that may be a true statement on your part...but that same lack of knowlege applies to accurately judging time and difficulty.

 

It sounds to me like you need a helping of humble pie.

 

To be fair though, regex is not for the faint of heart. Very few people grasp it. Even fewer master it, even the devs who master practically everything else.

 

You are of course welcome to post questions on the forum...if you leave the "I'm awesome, this is easy, everybody sucks, its everybody else and the language and everything else that fails" attitude at the door.

Link to comment
Share on other sites

Well, thanks Crayon

 

No, it's the nesting of the results in an array in an array that got me, not the regular expressions (they worked once I realised my target strings were in nested arrays). 

 

Using curl, urlencode and preg_replace to convert addresses to lat long still returns an array in an array.  Expecting this behaviour means I can deal with it.  Extracting lat-log was a few minutes work.  Finding the correct geoencoding URL was harder because I don't undertsand PHP classes.

 

I would expect a proficient PHP programmer to know about this stuff.  For me, there's a learning curve, I have to google, read and understand the idioms of a new programming language  (because I'm a newbie to PHP---yes I am, whether you like it or not).  I am still on target for less than 4 hours.  But newbie PHP status is slowing me down.  And that isn't an excuse... there are newbies in the world.

 

Anyway.  My code looks horrible, filled with failed experiments, commented out and redundant statements.  I'm not sure I know why it some of it works in parts because it's cut n paste.  I know there must be better ways to do this.  But then I don't sell myself as a PHP coder.

Link to comment
Share on other sites

No, it's the nesting of the results in an array in an array that got me, not the regular expressions (they worked once I realised my target strings were in nested arrays). 

 

Using curl, urlencode and preg_replace to convert addresses to lat long still returns an array in an array.  Expecting this behaviour means I can deal with it.  Extracting lat-log was a few minutes work.  Finding the correct geoencoding URL was harder because I don't undertsand PHP classes.

 

I don't know the exact context but if you are trying to extract something then you shouldn't be using preg_replace().  You should be using either preg_match() or preg_match_all().  I mean sure, you can technically get what you do want by using preg_replace() to remove everything you don't want, but that's kind of an ass-backwards way of doing it.  And that's not preg_xxx specific nor is it php specific...that's a way of thinking in general, so you can't really blame your lack of php skills on that.

 

I would expect a proficient PHP programmer to know about this stuff.

 

And I have said, it's not very wise to make assumptions about something when you admit you don't know the language.  As mentioned, regex is pretty advanced even for people who are otherwise proficient at php - or any other language for that matter. 

 

For me, there's a learning curve, I have to google, read and understand the idioms of a new programming language  (because I'm a newbie to PHP---yes I am, whether you like it or not).  I am still on target for less than 4 hours.  But newbie PHP status is slowing me down.  And that isn't an excuse... there are newbies in the world.

 

Anyway.  My code looks horrible, filled with failed experiments, commented out and redundant statements.  I'm not sure I know why it some of it works in parts because it's cut n paste.  I know there must be better ways to do this.  But then I don't sell myself as a PHP coder.

 

To a degree, I understand this, but if you are already proficient in other programming language(s), then it's not so much of a learning curve to pick up a new language as it is to start programming in general.  99% of it is simply syntax differences and formats, which are trivial, not the same as learning programming concepts in general.  Especially when it comes to php, as it is actually one of the lowest learning-curve languages out there. 

 

What little you have mentioned, to me not only speaks of being a newbie in php, but of programming in general.  Seasoned coders (non-language specific) do not make assumptions about things.  They do not just cut and paste snippets of code they googled and use it, without understanding what is going on.  Are you seriously going to put code you don't understand onto your live site? 

 

I'm not trying to pick a fight or nothin', but seriously, you are giving off the impression that it should be easy, but then trying to excuse yourself from your own judgments.  Perhaps this is not what you are meaning to do, but it is what it is, and that's the impression you're giving people.

 

 

Link to comment
Share on other sites

To clarify.  preg_replace was being used to get rid of newlines and preg_match_all was used to extract <td=blah.* into an array with the required data at fixed indexes.  A br tag got through, as did a closing td tag.  I couldn't eliminate these.  But that's because the strings I was trying to affect where nested in arrays.  When I found that, it was easy.

 

There's no point arguing the regexps were wrong when they weren't.  And yes, you can criticise me for not spotting the nested arrays. 

 

I  agree PHP has a very low learning curve, but if you don't know something you still have to learn it (and it's not just syntax, it's about what data structures are returned.  And I'm lucky because I've heard of the functions I need in passing.

 

But the point about googling, cut n pate, the experimentation and learning curve is/was that I am not a professional PHP coder.  I'm not even a PHP coder by hobby.  I have done a few thousand lines each of Lisp, Perl and Ruby.  Several times that many in ksh and bash.

 

And that's where I'm coming from in this.

Link to comment
Share on other sites

Do you consider yourself to be a professional coder?  From your own mouth, obviously not php, but what about Lisp, Perl or Ruby?  Do you consider yourself to be a professional coder in one of those languages, or some other language?

 

Because you keep trying to blame it on your lack of knowledge of php but from reading your posts here, as well as your blog posts, just seems like it's not really because of lack of php experience specifically, but lack of experience in programming  in general.  And that is fine.  Everybody starts somewhere.  But what is not fine is you making judgments about how long things should take or what others should be able to do, when you don't have the experience to make such statements.

Link to comment
Share on other sites

I'm an on/off hobby coder (normally more off than on).

 

The point I am making, which seems to be lost here, is that I know from my level of skills this will take 2-4 hours of my time with my coding skills.  And I am talking as an on/off hobby coder.

 

I would expect someone I'm happy to pay 40/50/60 GBP/hour to,  who charges for their time as a PHP codee, to have a much deeper knowledge of the language, spend less time googling and reading the manual pages, and generally to be more productive than I am.

 

It's an interesting aside, however.  How much more productive/better should a 'professional' be than an amateur? The same level (2-4 hours), 100% more (1-2 hours)... etc.

 

Look, if you think I'm wrong about the time involved, try for yourself.  I assure you it's trivial.

Link to comment
Share on other sites

Are you really complaining about not finding really good developers on the freelancing sites?  That it's not packed with the caliber of developers who could easily land a high paying full time job or make a lucrative living with just a handful of steady clients? 

 

I suppose we could give that up and go for a career competing with $2/hr South Asia developers spending my day making bids with the hopes of being able to land that one gig that'll get us a whole couple hundred dollars/pounds.  And then spend way too much time on that gig with the client who thinks you have nothing else going on that week than to work on their schedule, and who also has "some programming background" and will continually tell you how to code something despite every time they open their mouth, they just expose further areas of ignorance.

 

 

If you're really that confident that this will only take someone 1-2 hours and you're willing to pay normal agency rates for those two hours, why not just hire a local development agency directly?  Or did you try that already and all the bids were coming back reflecting that you're way underestimating what it will take to write stable, secure, maintainable code for this project?

Link to comment
Share on other sites

> I suppose we could give that up and go for a career competing with $2/hr South Asia developers

 

I offered more than I make (150 GBP ).  No $2/hour in sight but actually just over $246 for a trivial task (and I still say 2 hours for a competent coder is sufficient).  In any case, current daily rates for PHP developers are 225 GBP ($370).  So the amount is still sufficient.

 

I'm not sure what you would call 'high paying', but if it does take 2 hours, then the coder is on the equivalent of nearly $1000/day.  If it takes 4 hours, it's just short of $500 /day.

 

Oh, and "stable, secure, maintainable code", I know people love their buzz words but again, compare the triviality of the task with your list.  The task is so trivial that stable and maintainable code will be auto-coded in by anyone competent.  "Secure"... well that is more interesting.

 

Link to comment
Share on other sites

To continue:

 

Remember to RTFM.

 

Chasing down the (for me) unexpected nested arrays produced by preg_match_all I reread the manual page.

 

Somehow my eyes skipped the following...

 

>Parameters

> >  matches

> > > Array of all matches in multi-dimensional array ordered according to flags.

 

So that's where the nested array came from.  Expected behaviour, as described in the manual.  My Bad.

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.