Results 1 to 40 of 40

Thread: Terrible Code

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Terrible Code

    I spend more time in chit chat than any other forum on this site. But when people post in the PHP forum I will try to help them.

    I am not too sure if its specific to PHP or it happens in the other languages too. I review peoples code that they post and its just so terrible and so far from being useful or working that I tend to just leave without even helping them.

    How do you guys deal when you see just terrible terrible code posted that is way beyond help. Someone posted a login or registration thread in PHP forum and there was so much wrong that I just couldn't answer their question because it wouldn't fix the problem.

    I feel that with PHP its harder for people to learn when they mess up and where they mess up because unlike VB it doesn't give exact in-line runtime errors.

    I am ranting and I dont even know if this makes sense. Bye now.

  2. #2
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Largo, FL.
    Posts
    1,837

    Re: Terrible Code

    Helping people on forums is very similar to my full time support job. But the really cool difference is I can pick and choose who I help
    Wi-fi went down for five minutes, so I had to talk to my family....They seem like nice people.

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,039

    Re: Terrible Code

    Yeah, that's about it. Really horrible code generally means a beginner, so there is lots of help you can provide. The problem is in doing so without being patronizing, which is doubly hard because this is a written medium...and the internet...where we see the worst in people. Still, sometimes there's just no oxygen getting to the brain, but you usually know that within a post or two.
    My usual boring signature: Nothing

  4. #4
    Lively Member homer13j's Avatar
    Join Date
    Nov 2003
    Location
    Where the dirt bikes and ATVs play
    Posts
    80

    Re: Terrible Code

    Quote Originally Posted by Shaggy Hiker View Post
    Really horrible code generally means a beginner
    If you have ever spent time at the daily doubleyou tee eff .com (this forum won't even allow links with those three letters)

    You would see that's not always the case.
    "Bones heal. Chicks dig scars. Pain is temporary. Glory is forever." - Robert Craig "Evel" Knievel
    “Leave me alone, I know what I’m doing.” - Kimi Raikkonen

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,039

    Re: Terrible Code

    Some people never get out of first gear.
    My usual boring signature: Nothing

  6. #6
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Terrible Code

    It's not so bad when the professed beginner makes a solid attempt to better themselves, after having given it an honest try, first. But it's those that just want the 'codez 2 werkz' [damn, the inline-corrector corrected both of those words!), or the 'who cares if it works', that really give you the hopeless feeling.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Terrible Code

    depends... if it's truly bad, I'll jsut walk away... hope that someone with a better constitution can help them. And yet there are times I simply cannot pass it up, and will spend a little time re-writting it in the hopes they can learn from it.

    Sometimes it's because they've cobbled stuff togeher off the interwebs (At least they are searching) and other times it's because they took what was a simple example from class and tried to apply it to another case whre the code had no place being.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Terrible Code

    The particular problem I was trying to work on was not just a piece of code but it was a snippet of a larger login system that just by the way his snippets were written, I can tell there was a problem with the bigger picture. Suggesting changes in his snippets would have cause problems with the rest of his code which would have been messed up.

    I ended up just offering the OP resources so they can learn about proper login methods and SQL usage.
    My usual boring signature: Something

  9. #9
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Terrible Code

    Generally what I will do, if it is not a homework assignment, is write a working code for them and heavily comment the code to show them what I am doing and why. If it's a homework assignment, I try to get the particular requirements first(only arrays, only textboxes, etc.) first and then I'll judge whether they're putting forth effort to do the same thing(write the code for them and heavily comment) or just steer them in the right direction.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  10. #10
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Terrible Code

    But it's those that just want the 'codez 2 werkz'
    Yeh those really really annoy me, i used to post in them saying "well show us what you have done so far" but the normaly response is 'I havent don it yet as i dont know how, pls help and give codz' at which point i exit the thread.

    If the OP shows even a modicum of original thought or understanding, and look like they are trying to learn i am happy to help.

    I can tell there was a problem with the bigger picture. Suggesting changes in his snippets would have cause problems with the rest of his code which would have been messed up.

    I ended up just offering the OP resources so they can learn about proper login methods and SQL usage.
    Which is sometime the right response. If the code they have posted is just no good, then posting proper learning resources can be a good thing.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  11. #11
    Frenzied Member Gruff's Avatar
    Join Date
    Jan 2014
    Location
    Scappoose Oregon USA
    Posts
    1,293

    Re: Terrible Code

    I once had an OP that stumbled along for about five years.

    Everyone tried to help him.

    He never did learn the fundamentals let alone how to trouble shoot a problem.

    After I banned him he sent me an email a day asking to be re-instated.

    The only thing I could figure was that He was getting paid for the code we wrote for him.
    Burn the land and boil the sea
    You can't take the sky from me


    ~T

  12. #12
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Terrible Code

    Personally, I almost never post code: it's just not worth the effort; unless it's an interesting issue, or they have truly demonstrated the ability to learn. Usually, just the name and/or link to the object/method they need should be sufficient.

    Really most of these questions come from learning to program by youtubing. No formal education (even the ones in a formal education establishment!).

    What is really frustrating is that there definitely are the correct way and wrong way to do things, and some insist on doing it the wrong way because it works; just like running through a red light and not having an accident.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  13. #13
    Frenzied Member Gruff's Avatar
    Join Date
    Jan 2014
    Location
    Scappoose Oregon USA
    Posts
    1,293

    Re: Terrible Code

    BTW am I the only one that thinks "Code in the nose" when reading this thread's title?
    Burn the land and boil the sea
    You can't take the sky from me


    ~T

  14. #14
    Lively Member homer13j's Avatar
    Join Date
    Nov 2003
    Location
    Where the dirt bikes and ATVs play
    Posts
    80

    Re: Terrible Code

    Quote Originally Posted by Gruff View Post
    BTW am I the only one that thinks "Code in the nose" when reading this thread's title?
    I read it in Charles Barkley's voice: "Turrible, just turrible."
    "Bones heal. Chicks dig scars. Pain is temporary. Glory is forever." - Robert Craig "Evel" Knievel
    “Leave me alone, I know what I’m doing.” - Kimi Raikkonen

  15. #15
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Terrible Code

    I'll help those who have genuinely tried to solve a problem for themselves. That's the membership fee in my book

    We all have problems understanding stuff at the start - programmers are often the worst people imaginable for writing documentation. Programmers write docs for other programmers - not for the layman.

    If one asks for the answer without first trying to solve it for oneself, then one is in the wrong game. Programming, or indeed any technical pursuit whatsoever, is likely not the vocation one is best suited to.
    I don't live here any more.

  16. #16
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Terrible Code

    Part of this problem is I think, down to lack of eyeballs on this site these days.
    VBF has all but evaporated to a vestige of it's old self now.

    Threads based around newbie programming questions that would have attracted 20 helpful replies 10 years ago, now go entirely ignored.

    The talent has gone.

    So has the community.


    Someone needs to fix up an online re-union.
    I don't live here any more.

  17. #17

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Terrible Code

    I have seen the same decline in activity of the years as well. I have only been here since 2006 but It was much more active then than it is now.
    My usual boring signature: Something

  18. #18
    Addicted Member Pc Monk's Avatar
    Join Date
    Feb 2010
    Posts
    188

    Re: Terrible Code

    Quote Originally Posted by Shaggy Hiker View Post
    Some people never get out of first gear.
    and who we are exactly talking about ?
    Body Language tells the truth! even from the grave tsaeb eht morf gninnur ,nwod deaH
    All the big things started from little! teef my tsap evom sekans ,duol raor slluB
    Lietome.ir

  19. #19
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Terrible Code

    Threads based around newbie programming questions that would have attracted 20 helpful replies 10 years ago, now go entirely ignored.

    The talent has gone.

    So has the community.


    Someone needs to fix up an online re-union.
    I suspect a lot of developers probably moved to C# and ASP.Net (if they weren't doing it already) and or mobile development, those forums are almost dead now and slowly those members drifted to other sites.

    either that or Mendhak kidnapped them all and has them locked in his basement!
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  20. #20

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Terrible Code

    Ah Mendhak. Forgot about him.
    My usual boring signature: Something

  21. #21
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Terrible Code

    Pls. bring back NoteMe also.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  22. #22
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Terrible Code

    And koolsid. Wait a second...
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  23. #23
    Lively Member homer13j's Avatar
    Join Date
    Nov 2003
    Location
    Where the dirt bikes and ATVs play
    Posts
    80

    Re: Terrible Code

    Quote Originally Posted by Pc Monk View Post
    and who we are exactly talking about ?
    Shaggy put on his Bigfoot suit and disappeared into the wilderness for a few weeks. But I'm pretty sure he was responding to my post about thedaily w t f .com where all kinds of crappy code can be found written by so-called "professionals."
    "Bones heal. Chicks dig scars. Pain is temporary. Glory is forever." - Robert Craig "Evel" Knievel
    “Leave me alone, I know what I’m doing.” - Kimi Raikkonen

  24. #24
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,902

    Re: Terrible Code

    Shaggy put on his Bigfoot suit
    For which read "grew a beard"
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  25. #25
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,600

    Re: Terrible Code

    Quote Originally Posted by NeedSomeAnswers View Post
    I suspect a lot of developers probably moved to C# and ASP.Net (if they weren't doing it already) and or mobile development, those forums are almost dead now and slowly those members drifted to other sites.
    I suspect it has more to do with the flood of programming languages and platforms out there today. Remember, when VB6 was still young, it was basically only Mac, PC and about 100 different versions of Linux. Now we have tablets, ChromeBooks, iPhones, Smart TVs, Smart Phones, Raspberry Pi, Arduinos and the internet. And each of these platforms have about a dozen different tools and languages to program them so developers have spread out over all these other platforms.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  26. #26
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Terrible Code

    Quote Originally Posted by Niya View Post
    I suspect it has more to do with the flood of programming languages and platforms out there today. Remember, when VB6 was still young, it was basically only Mac, PC and about 100 different versions of Linux. Now we have tablets, ChromeBooks, iPhones, Smart TVs, Smart Phones, Raspberry Pi, Arduinos and the internet. And each of these platforms have about a dozen different tools and languages to program them so developers have spread out over all these other platforms.
    This is true, along with the fact that almost every question about a given problem has been asked and effectively answered multiple times (in the very narrow scope of 'programming language Xa'.)

    EDIT: I am now going to patent copyright and get a team of lawyers together for the new language I just developed called: Xa (Pronounced 'Zah').
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  27. #27
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Terrible Code

    Cool... I'll create an add on for it called Human Analog or HAXa (Hazah!) Of course then it will be quickly pirated (HAXa Arrr!)

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  28. #28
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Terrible Code

    I think forums are now a bit passé in general. There is more traffic on structured Q&A sites like Stack Overflow and sites with structured comments like Reddit (vBulletin has a 'threaded' view, but because it's a pref no one uses it, therefore it's pointless). Also VBForums feels like it is hosted on a tired old Pentium III sitting in Brad's basement...

  29. #29
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Terrible Code

    Quote Originally Posted by homer13j View Post
    Shaggy put on his Bigfoot suit and disappeared into the wilderness for a few weeks. But I'm pretty sure he was responding to my post about thedaily w t f .com where all kinds of crappy code can be found written by so-called "professionals."
    I'd enjoy that site if it were still just snippets of w.t.f. code with brief commentary. At some point the posts evolved into dramatic, nerdy epics and advertisements. And the blog format with its monthly 'archives' was OK in 2005 but feels pretty clunky now.

  30. #30
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Terrible Code

    Try paying £1000 per day for someone to write bad code for you. Only to be told "you don't understand, it's complicated" when you ask for it to be re-factored.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  31. #31
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Terrible Code

    Shoot, I'll write good code for you for £500 a day!
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  32. #32
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Terrible Code

    Try paying £1000 per day for someone to write bad code for you. Only to be told "you don't understand, it's complicated" when you ask for it to be re-factored.
    Well in a way they are correct, bad code often is more complicated, so by coding it badly to begin with what they are doing is discouraging re-factoring, which surely saves everyone time!!

    Shoot, I'll write good code for you for £500 a day!
    i'll do it without the shooting ( Americans for you )
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  33. #33
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Terrible Code

    Name:  pew-pew-pew-merica.jpg
Views: 182
Size:  33.3 KB
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  34. #34
    Frenzied Member Gruff's Avatar
    Join Date
    Jan 2014
    Location
    Scappoose Oregon USA
    Posts
    1,293

    Re: Terrible Code

    OMG! That looks like someone on our local law enforcement!
    I can totally see him saying something like that.
    Burn the land and boil the sea
    You can't take the sky from me


    ~T

  35. #35
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Terrible Code

    Could have fooled me. Aside from the uniform he struck me as a lot like the "agile" proponents I run into at client sites describing their "process." They always gripe that they need faster PCs because their compiles take too long to get enough of them done in one day.

    More cores = more barrels for their "shotgun coding" style.

  36. #36
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    538

    Re: Terrible Code

    I think a snazzy looking p2p application, that also posts to VBForums, could attract experienced programmers, and help newbies.

    Maybe with the option for employers to hire programmers for projects, or buy ready made code.

    * Programmers could upload working projects that employers could run over this p2p application without seeing the code.

    * When interested, they could either pay for this working code, or hire the programmer for other projects.

    * Programmers will have options to manually or automatically deny or grant the sale of ready made applications. By granting permission manually, the programmer has time to research these employers to be safe.

    * This p2p application will recieve 5% cut of all sales, which would be shared amongst developers of it.
    Last edited by Peter Porter; Apr 19th, 2015 at 04:14 AM.

  37. #37
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Terrible Code

    Michigan is only slightly larger than the UK.
    I don't live here any more.

  38. #38
    Lively Member homer13j's Avatar
    Join Date
    Nov 2003
    Location
    Where the dirt bikes and ATVs play
    Posts
    80

    Re: Terrible Code

    Quote Originally Posted by wossname View Post
    Michigan is only slightly larger than the UK.
    And it's shaped like a giant mitten.
    "Bones heal. Chicks dig scars. Pain is temporary. Glory is forever." - Robert Craig "Evel" Knievel
    “Leave me alone, I know what I’m doing.” - Kimi Raikkonen

  39. #39
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,902

    Re: Terrible Code

    Whereas Wossname is shaped like a giant kitten.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  40. #40
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Terrible Code

    Quote Originally Posted by wossname View Post
    Michigan is only slightly larger than the UK.
    You mean a whole state is only a bit larger than the UK? I'm shocked! Shocked, I tell you!
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width