• Definitely (unregistered) in reply to omgitsfletch
    omgitsfletch:
    //PS: I'm majoring in Engineering at the moment, but seriously considering switching to computer science, going major/minor, etc.

    Uh, best advice is to get out of Computer Science and/or IT while you still can.

    (Captcha: himmelfreundpointer)

  • Michael Geary (unregistered) in reply to Mot
    Mot :
    >>What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now.

    Answer: Find a project you like, maybe sugarcrm.com or something, written in PHP. Join the community. Contribute to the community. Be able to answer newbie's questions, do it graciously. Help people debug their stuff, contribute stuff, extend other people's stuff. Never flame, denigrate, etc.

    Once you get a reputation as either 'helpful' or 'an expert' (hopefully both) you will have a group of people who work in the field ready to recommend you - to real jobs that pay real money.

    Outstanding advice, Mot! I second it.

  • (cs) in reply to omgitsfletch
    omgitsfletch:
    Guys, this kind of brings up a side question I have. What is the best way to get into a real PHP programmer job?

    Create a resume citing your past projects as references. Submit to dice.com. You'll get 20 calls in the next week.

  • some guy (unregistered) in reply to shadowman
    codemonkey:
    The real WTF is he uses many IF statements instead of an IF-ELSE IF chain.
    Hmmm... so, to use an analogy, it's like being on a sinking ship and complaining that the mate rang a bell to warn you instead of blowing a horn.

    shadowman was much more constructive by providing:

    shadowman:
    $education = array("High School","Some College"); // and so forth

    foreach ($education as $ed) { print "<input type='radio' name='EducationID' value='" . $ed . "' "; if ($_SESSION["EducationID"]==$ed) print "checked"; print " />" . $ed . "
    "; }

    This is nearly identical to the solution I would have offered and is much more suited to solving the original problem than noting that there is another less wrong, but still wrong, way to do something.

  • Plastriq (unregistered)

    People that write code like this should take a break for a few months. I'm 16, self-taught, and even I write better code than this.

  • (cs)

    I see a real design problem from the UI perspective as well. Why is this not in a <select> Tag? Considering that the options follow a pattern (increasing scale) and are closely related, having a dropdown makes more sense, and makes it easier to tell which is selected. You should never have more than a few radio buttons or the UI structure gets too tall.

  • (cs) in reply to akatherder
    akatherder:
    Create a resume citing your past projects as references. Submit to dice.com. You'll get 20 calls in the next week.

    Hmm, I had never heard of dice.com before, looks like a good site to know about. I had tried looking on Monster, but all it got me were spam emails that I was qualified for stuff like a job in New York requiring a B.S. degree, when I'm a current college student in Orlando :-p. I'll give it a try though!

  • Mr Steve (unregistered) in reply to omgitsfletch
    omgitsfletch:
    Guys, this kind of brings up a side question I have. What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now. I get outbid by programmers like this, and I know I'm not working for near the amount I should be.

    I don't profess to be a PHP guru, but I certainly write better code than this slop. Even if it was just an entry level programming job, anything beats the slave wage work you find on some of the sites out there. Any job I've applied at in the area, I don't hear anything back. Maybe it's because I'm a "freelancer", maybe it's because I don't have an official CS degree, maybe it's my age, maybe it's something else. Is there any way for someone who's self taught to earn a fair wage programming in a situation like mine?

    //PS: I'm majoring in Engineering at the moment, but seriously considering switching to computer science, going major/minor, etc.

    Find an existing open source project that you like and do some work on that (DO NOT START YOUR OWN PROJECT!!!). This will give you real world experience.

    I was in much the same situation, though i made the mistake of freelancing (did crap) then getting a crap office job which made no use of my skills for 2 years, stupidly did my own open source projects which was basically a waste of time, literally nobody adopted etc (though did self learn alot). Then got lucky and lost my stupid job, scored job at a place doing research assistant work, turned out there was a lot of demand there for my skills and now fulltime web developer, mostly writing code that ends up on dailywtf.com ;).

    But you can't rely on luck like i did, best bet is get any old job for now and do open source at night until you can score a proper programming job

  • KICKASS (unregistered) in reply to Justin Buist
    Justin Buist:
    Indian Motto: Work harder, not smarter.
    What makes you say, this was written by an Indian. You f****ing rascist MF.
  • some guy (unregistered) in reply to Nodren
    Nodren:
    i wouldn't have done a loop for this, since they are not likely to ever add to that basic list, it would of made more sense printed out(for better code readability)

    i would do it like this:

    <input type="radio" name="EducationID" value="High school" <?=($_SESSION['EducationID'] == 'High School')?'checked':''?>>High school
    <input type="radio" name="EducationID" value="Some college" <?=($_SESSION['EducationID'] == 'Some college')?'checked':''?>>Some college
    //etc etc etc

    Ring, ring... "Hi, Nodren? This is marketing... we'd like to change the website where it says 'Grad / professional school' to read 'University'... oh, and can we add a field that says 'Technical College'? Thanks! By the way... how long is that going to take?"

    /I think I'll pass on your solution in favor of a 6-line solution from shadowman :)

  • PanaceaNot (unregistered)

    Only 5 minutes ago he was sitting on a sidewalk in New Delhi. We brought him in, offered him 3 dollar American for the next month work, and now he are a programmer.

  • (cs) in reply to joh6nn

    Even if it were more economical to use iq-in-the-room-temperature-range code like the example, the cost of making any changes would hamstring the developer.

    The maintainability against time graph for this kind of project is like this:

    | | |_ |
    |___

  • (cs) in reply to some guy
    Hmmm... so, to use an analogy, it's like being on a sinking ship and complaining that the mate rang a bell to warn you instead of blowing a horn.

    shadowman was much more constructive by providing:

    shadowman:
    
    $education = array("High School","Some College"); // and so forth
    
    foreach ($education as $ed) {
    print "<input type='radio' name='EducationID' value='" . $ed . "' ";
    if ($_SESSION["EducationID"]==$ed) print "checked";
    print " />" . $ed . "<br />";
    }
    

    This is nearly identical to the solution I would have offered and is much more suited to solving the original problem than noting that there is another less wrong, but still wrong, way to do something.

    This would be the best solution if presenting a radio array is something you only ever do once. My code would look more like this:

    $radio_array = Sprocket_Forms::RadioArray( 'EducationID', $options, $default );
    $page->add( $radio_array );
    

    Obviously $default and $options would come from the relevant model. $page is the current part of the view.

  • (cs) in reply to omgitsfletch
    omgitsfletch:
    Guys, this kind of brings up a side question I have. What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now. I get outbid by programmers like this, and I know I'm not working for near the amount I should be.

    I don't profess to be a PHP guru, but I certainly write better code than this slop. Even if it was just an entry level programming job, anything beats the slave wage work you find on some of the sites out there. Any job I've applied at in the area, I don't hear anything back. Maybe it's because I'm a "freelancer", maybe it's because I don't have an official CS degree, maybe it's my age, maybe it's something else. Is there any way for someone who's self taught to earn a fair wage programming in a situation like mine?

    //PS: I'm majoring in Engineering at the moment, but seriously considering switching to computer science, going major/minor, etc.

    Use Craigslist. You need to get a few sites on the Internet so that potential employers can take you seriously. Craigslist and other such sites will enable you to find contracts. If you know your stuff and can do the work... then you can gain some background. Once you have at least 3... start building your resume.

  • Your Name * (unregistered) in reply to laughinggrrl
    laughinggrrl:
    [...] captcha: howdy ... well, howdy pardner!!

    Ha, ha! Hilarious!

  • BillyBob (unregistered) in reply to Vechni
    Vechni:
    Actually, regarding copy and paste:

    -I probably copy+paste 80% of my code (J2EE) but thouroughly edit it (a quick template), it is simply faster than typing everything and creating solutions for what has already been solved many times. -Code solutions are uniform, very good readability. -Fast developement, writing an entire class by hand would be ridiculous. -Uniform webpages, obviously a goal

    Also, I don't think there is a readiblity difference between using if statements and not using if-else... Infact that is more readable than a loop, but more typing. Thinking outside of the box damnit!

    Sometimes this site makes you laugh, other times it makes you cry....

  • nano (unregistered)

    This is the most logical way to do radio buttons when you are paid per line. The WTF will be the manager who will sack the guy that fixed it, bellowing "I paid ten times as much for half the code!?'

  • Omar (unregistered)

    they got what they paid for? news at eleven?

  • sad (unregistered) in reply to KICKASS
    KICKASS:
    Justin Buist: Indian Motto: Work harder, not smarter.
    What makes you say, this was written by an Indian. You f****ing rascist MF.
    What makes you think that Justin Buist isn't an Indian. You f****ing rascist MF.
  • tacticus (unregistered) in reply to Vechni
    Vechni:
    Actually, regarding copy and paste:

    -I probably copy+paste 80% of my code (J2EE) but thouroughly edit it (a quick template), it is simply faster than typing everything and creating solutions for what has already been solved many times. -Code solutions are uniform, very good readability. -Fast developement, writing an entire class by hand would be ridiculous. -Uniform webpages, obviously a goal

    Also, I don't think there is a readiblity difference between using if statements and not using if-else... Infact that is more readable than a loop, but more typing. Thinking outside of the box damnit!

    About the issuea at hand: IF you want to use anythin near that if should be else if structure, theres a little something called switch... Saves a bit of writing, and is nearly as cut'n paste friendly. Not to mention it's a wee bit more readable, and expansion friendly.

    About cut'n paste in general... 80%? you kidding me? How about include, make your general stuff in nice objects or functions, stored in nice smallish include files (one file per object, and group the functions by what they do... ). If needed make a new object that inherits one of your pre-made ones. Isn't that much of the point of oop?

    captcha: atari hm, never had one, wanted one though.

  • charon (unregistered)

    the best WTF is that in PHP all of those if clauses would evaluate to true if $_SESSION["EducationID"] was an integer zero :)

    $integerZero=0; if ($integerZero=='some string that does not begin with a number') { echo 'this will really be executed in PHP! no kidding!'; }

    captcha: sanitarium

  • JDX (unregistered)

    I'd like to stand up a little bit for these coding portals. Not a lot, but a little bit. I recently started on GAF and I think some projects are reasonably priced, and some people can actually code reasonably well (like me). Of course there are a huge number of guys advertising at $2/hr but I think at least some people would rather hire me and pay more, since I speak English!

    And remember, most of the WTFs aren't from $300 code by amateurs, but from $30,000 code written by "experts"!

  • Anonymous Coward (unregistered) in reply to mielvanacker
    mielvanacker:
    Imagine you get this code with the request to add a new education level.

    The horror! [email protected]

    The horror? Why? You would refuse to refactor it and continue in the same manner?

  • 28% genius (unregistered)

    Maybe he made a really smart LISP program that implements a DSL for generating the PHP code.

    Or maybe not.

  • koni (unregistered) in reply to Mexi-Fry
    Mexi-Fry:
    I just had some dude telling me that programmers are a dime-a-dozen. I suspect that he would be very happy with such insightful code as that. Sad thing is, he claims to be a "development company" and hires programmers for <$17/hr.

    No, he hires ->coders<- for $17/hr. He obviously has never met a programmer...

  • nerdierthanu (unregistered) in reply to shadowman
    shadowman:
    bighusker:
    joh6nn:
    from a "time spent" perspective, this copy-paste monstrosity is probably a lot faster than actually good solution.

    I really don't see how this is faster than coding each radio button once and determining if it should be checked within each radio button tag. The only person who would do something this way is a person without any real web development experience.

    $education = array("High School","Some College"); // and so forth

    foreach ($education as $ed) { print "<input type='radio' name='EducationID' value='" . $ed . "' "; if ($_SESSION["EducationID"]==$ed) print "checked"; print " />" . $ed . "
    "; }

    I didn't know you could do that!

  • Qvasi (unregistered) in reply to charon
    charon:
    the best WTF is that in PHP all of those if clauses would evaluate to true if $_SESSION["EducationID"] was an integer zero :)

    $integerZero=0; if ($integerZero=='some string that does not begin with a number') { echo 'this will really be executed in PHP! no kidding!'; }

    captcha: sanitarium

    ...and if $_SESSION["EducationID"] for some reason is not set (or not one of the values tested for) NOTHING will be displayed!

    (I only need to type the captcha in the field next to it, right? ;P)

  • (cs)

    This is one of those things that we've probably all been guilty of at some point. However, we still look at it in disgust. WTF.

  • (cs) in reply to Qvasi
    Qvasi:
    (I only need to type the captcha in the field next to it, right? ;P)

    Yes :-P

  • Mark Ransom (unregistered) in reply to omgitsfletch

    << What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now >>

    In addition to working on an open source project or two, I'd suggest getting a job where you can do some programming even if it's not in your job description. I started out as a support technician and worked in time to write some small programs to automate some repetitive tasks. Later I worked on the helpdesk for another company and wrote some programs to make my own life easier, which my whole team started using. I wasn't getting paid to program, but I was free to do whatever I wanted between calls, and eventually my boss (and his boss) noticed out important my contributions were and offered to move me to a full time developer position. Just a suggestion, but there's nothing wrong with starting in the "mailroom", if you know where you want to go.

  • yuta (unregistered) in reply to Plastriq
    Plastriq:
    People that write code like this should take a break for a few months. I'm 16, self-taught, and even I write better code than this.
    I was 14 when i wrote those code, i've taken my break and now i'm 16.. and also they're a paying me $0.002 per line now.. :p
  • KICKASS (unregistered) in reply to sad
    sad:
    KICKASS:
    Justin Buist: Indian Motto: Work harder, not smarter.
    What makes you say, this was written by an Indian. You f****ing rascist MF.
    What makes you think that Justin Buist isn't an Indian. You f****ing rascist MF.

    What are you his pimp or btt f****.

  • KICKASS (unregistered) in reply to PanaceaNot
    PanaceaNot:
    Only 5 minutes ago he was sitting on a sidewalk in New Delhi. We brought him in, offered him 3 dollar American for the next month work, and now he are a programmer.

    Learn how to speak English first. It's strange how rascist some a**holes like you are. You automatically assume that all Indian programmers are bad and start spreading rumors. I am sure you never even finished high school and have wet dreams about your own mother.

  • (cs) in reply to mielvanacker
    mielvanacker:
    Imagine you get this code with the request to add a new education level.

    The horror! [email protected]

    Something very similar happened to me. Some time ago, I was asked by a friend to refactor his website in order to have it support a new product (it's a non-commercial community about certain game development IDEs); the original coder had not been heard of for months. I figured it to be two hours' worth of PHP coding and a trivial update to the database... What I got was a nightmare beyond all measure. The code looked just about like the following (linebreaks added in order to avoid scroll bars:

    [image]";
    else echo "unknown.jpg\">";
    if ($somevalue % 5 != 0) { ?><a href="<? [...]</pre>
    <p>There were 700 kilobytes of code in 20 files, each containing lines between two and 5000 characters in length. Conditionals leaving PHP tags, entering and leaving other PHP tags and ending somewhere entirely else in the file were the norm.</p>
    <p>I declined and predicted that support of the new product would only come after a full rewrite of the site. As far as I know exactly that happened some months later. I can only hope that the original coder never took up any kind of programming/web dev job...</p>
    
  • KICKASS (unregistered) in reply to sad
    sad:
    KICKASS:
    Justin Buist: Indian Motto: Work harder, not smarter.
    What makes you say, this was written by an Indian. You f****ing rascist MF.
    What makes you think that Justin Buist isn't an Indian. You f****ing rascist MF.

    People like you are the reason American companies are shifting work overseas. They just don't want to deal with stupid f***s like you. You are totally worthless and I am sure your mother reminded you this every day of your life.

  • Frenchier than thou (unregistered) in reply to omgitsfletch
    omgitsfletch:
    Guys, this kind of brings up a side question I have. What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now. I get outbid by programmers like this, and I know I'm not working for near the amount I should be.

    (snip...)

    //PS: I'm majoring in Engineering at the moment, but seriously considering switching to computer science, going major/minor, etc.

    Quickie answer: DON'T DROP THE ENGINEERING DEGREE. It's worth at least 10-15k$ a year, plus you get more credibility and respect. Plus, if the engineering profession is regulated in your jurisdiction some jobs will be reserved for you!

    As for the PHP programming jobs, try jumping to another language... PHP is associated to "low-skill" so you get crap jobs.

  • Justin (unregistered)

    This has got to be generated code, event if it's badly generated code. If it's not generated from a template, I think I might cry.

  • foo (unregistered) in reply to codemonkey
    codemonkey:
    There are so many people now-a-days that graduate "stupid", in my experience. It seems particularly prevalent in business related degrees. They get fantastic grades in all their classes and graduate top of their class, and yet have no real world knowledge and end up futzing up the simplest of concepts...like paying a little extra to get the job done right.

    I am nearly certain most people are flat out LYING about having a college degree. I mean, how would you know?

  • foo (unregistered) in reply to Frenchier than thou
    Frenchier than thou:
    omgitsfletch:
    Guys, this kind of brings up a side question I have. What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now. I get outbid by programmers like this, and I know I'm not working for near the amount I should be.

    (snip...)

    //PS: I'm majoring in Engineering at the moment, but seriously considering switching to computer science, going major/minor, etc.

    Quickie answer: DON'T DROP THE ENGINEERING DEGREE. It's worth at least 10-15k$ a year, plus you get more credibility and respect. Plus, if the engineering profession is regulated in your jurisdiction some jobs will be reserved for you!

    As for the PHP programming jobs, try jumping to another language... PHP is associated to "low-skill" so you get crap jobs.

    Funny, I still don't get any respect... and I haven't seen 10-15k more a year... I must be stupid.

  • foo (unregistered) in reply to Plastriq
    Plastriq:
    People that write code like this should take a break for a few months. I'm 16, self-taught, and even I write better code than this.

    I would hire you for that comment. You at least recognize that experience and education will make you a better programmer. You might even be counted on to go out and get that experience and education.

  • ESR (unregistered) in reply to omgitsfletch
    omgitsfletch:
    Guys, this kind of brings up a side question I have. What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now. I get outbid by programmers like this, and I know I'm not working for near the amount I should be.

    I don't profess to be a PHP guru, but I certainly write better code than this slop. Even if it was just an entry level programming job, anything beats the slave wage work you find on some of the sites out there. Any job I've applied at in the area, I don't hear anything back. Maybe it's because I'm a "freelancer", maybe it's because I don't have an official CS degree, maybe it's my age, maybe it's something else. Is there any way for someone who's self taught to earn a fair wage programming in a situation like mine?

    //PS: I'm majoring in Engineering at the moment, but seriously considering switching to computer science, going major/minor, etc.

    Languages for young programmers to avoid: PHP, Perl, Python, Ruby, Visual Basic, Pascal, Javascript, HTML

    AVOID these for the first five to ten years of your career and you'll do fine.

  • Dave Platt (unregistered)

    Is there an emoticon which means "Cat, coughing up a hairball"?

  • Gabe (unregistered) in reply to omgitsfletch

    The job portal sites are garbage. Most of the people posting jobs there don't have any experience either. Once they get bit by these low-ball bids that fail to solve their problem and offer no accountability, they will go to a real agency or freelancer.

    So my advice is to build your own portfolio... do personal projects if you can't find any clients. Do a lot of networking and over time you will build up a series of clients who will then refer you to new people (if you do a good job). Personal relationships are the most important thing for any aspiring freelancer.

  • laghinggrrl (unregistered) in reply to Anonymous Coward
    Anonymous Coward:
    mielvanacker:
    Imagine you get this code with the request to add a new education level.

    The horror! [email protected]

    The horror? Why? You would refuse to refactor it and continue in the same manner?

    You could be required to continue in the same manner "because there is no time for refactoring"... [image]

  • laghinggrrl (unregistered) in reply to Justin
    Justin:
    This has got to be generated code, event if it's badly generated code. If it's not generated from a template, I think I might cry.

    Nope, seen code hand-written in just that way.
    [image]

    Captcha: sanitarium (leave me me)... sanitarium (just leave me alone)

  • hachu (unregistered) in reply to ESR

    Out of those to avoid, the only one I think shouldn't be in the list is Pascal. While it's not widely used, it's got some semblence of a "non-low-class" programming language in that it's still fairly close to the metal. At the least you gotta give it some credit for a string that gives you it's length without crashing.

    ESR:
    omgitsfletch:
    Guys, this kind of brings up a side question I have. What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now. I get outbid by programmers like this, and I know I'm not working for near the amount I should be.

    I don't profess to be a PHP guru, but I certainly write better code than this slop. Even if it was just an entry level programming job, anything beats the slave wage work you find on some of the sites out there. Any job I've applied at in the area, I don't hear anything back. Maybe it's because I'm a "freelancer", maybe it's because I don't have an official CS degree, maybe it's my age, maybe it's something else. Is there any way for someone who's self taught to earn a fair wage programming in a situation like mine?

    //PS: I'm majoring in Engineering at the moment, but seriously considering switching to computer science, going major/minor, etc.

    Languages for young programmers to avoid: PHP, Perl, Python, Ruby, Visual Basic, Pascal, Javascript, HTML

    AVOID these for the first five to ten years of your career and you'll do fine.

  • Bigwig (unregistered) in reply to mielvanacker

    You're so right. I had to change queries at 5 different places in an application once a new field was introduced to a table. That's been horror as well. Glad I got a good DAL now.

  • Vlado (unregistered)

    Nice, if someone whant to pay me per line I will give him code smothing like this post.

  • (cs) in reply to Mark Ransom
    Mark Ransom:
    << What is the best way to get into a real PHP programmer job? I'm 20, in college, and been freelancing on these crappy job portal sites for a while now >>

    In addition to working on an open source project or two, I'd suggest getting a job where you can do some programming even if it's not in your job description. I started out as a support technician and worked in time to write some small programs to automate some repetitive tasks. Later I worked on the helpdesk for another company and wrote some programs to make my own life easier, which my whole team started using. I wasn't getting paid to program, but I was free to do whatever I wanted between calls, and eventually my boss (and his boss) noticed out important my contributions were and offered to move me to a full time developer position. Just a suggestion, but there's nothing wrong with starting in the "mailroom", if you know where you want to go.

    Agreed! I started off in Tech Support in a small company and did the same thing. Fifteen years later, I've got a ton of varied experience from working in different kinds of positions and my value as a Software Engineer is because I've "been there, done that" in most cases. This approach might work for you as well.

  • Niels (unregistered)

    As unbelievable as it is, I saw this exact type of code at my former job. It was written by a female developer with several years of experience. I actually quit when they asked me to maintain the application.

Leave a comment on “Only $0.001 per Line”

Log In or post as a guest

Replying to comment #:

« Return to Article