View Poll Results: Does this forum need a sticky 'You're doing it wrong' thread?

Voters
16. You may not vote on this poll
  • Yes, it's a great idea! I like it.

    13 81.25%
  • No, I don't like it. The idea sucks.

    3 18.75%
Results 1 to 17 of 17

Thread: You might be doing it wrong!

  1. #1

    Thread Starter
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Lightbulb You might be doing it wrong!

    Just a thought. What do you think about a sticky thread where we can assemble typical mistakes people make when start programming in .Net?

    For example, literally every day a new person appears here having difficulties with:

    Code:
    Int(TextBox1.Text)
    then some other man with vb6 background who uses Val(TextBox1.TexT).

    Another person starts using default form instances and is happy because it's actually working:

    Code:
    Form2.TextBox1.Text = "Hello!"
    Another man comes with more serious problem showing this:

    Code:
    Dim sqlquery As String = "SELECT password FROM users WHERE username=" & txtName.Text
    Yet another new member is having troubles with the 'Cross thread operation is not valid' when he attempts to access a usercontrol member from another thread, etc

    What do you think, will this forum benefit from having such a thread? If so, then what other topics can you suggest to add?

    UPDATE

    I'll be posting a list of topics to include. The topics so far are:

    You're doing it wrong if:
    (explanations fill follow later)

    ... you're using the Int function with a textbox to obtain a numeric value;

    ... you're using the Val function;

    ... you're using form's names to refer to their instances (Form1, Form2, etc);

    ... you're constructing your SQL query right from TextBox values;

    ... you're directly accessing form's controls from a different thread;

    ... you're wondering if "2" + "2" results in "22" and not 4;

    ... you're using the Shell command;

    Please, feel free to add/discuss.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: You might be doing it wrong!

    In theory, it's a great idea. In practice, I doubt that many of the people who could benefit from it would use it. I guess we could all put a link in our signatures and direct people there but the number of people who can't click the CodeBank or Blog links already in my signature is scary. It wouldn't hurt but it wouldn't help nearly as much as it should.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: You might be doing it wrong!

    I would agree, but I noticed a strange tendency in people when between "Things that you should do!" and "Things you should not do!" they would rather pick the latter topic.

  4. #4
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    278

    Re: You might be doing it wrong!

    To a certain extent I agree, however, where do you start with such a thread? It would be a massive amount of information squished into one thread for users to trawl through.

    I personally would enjoy such a thread, simply because I'd be able to see where I could improve.

  5. #5
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: You might be doing it wrong!

    I voted "yes", but also have to agree with ohGreen.
    Perhaps you can also do this some kind of FAQ, split in several sections. It will be difficult, but got my vote.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  6. #6
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: You might be doing it wrong!

    I also voted yes. But how do you decide what content is worthy? Most of these simple thing's could be answered with a search of vbforums, or the basic task of reading the MSDN documentation regarding said issue. But the people who are to lazy to research them self's are the same people to lazy to read a sticky thread before posting.

    I guess even if it helps a handful of people then surely it is worth it?

  7. #7
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: You might be doing it wrong!

    i voted yes too.

    you might want to include:

    vb Code:
    1. dim a as integer = textbox1.text + textbox2.text

  8. #8

    Thread Starter
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: You might be doing it wrong!

    I've been righ on the verge of including:

    ... building a (brand-new) web-browser using a web-browser control, but finally decided against it After all it's not a programming mistake.

    P.S. I'll be updating the first post from time to time

  9. #9
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Angry Re: You might be doing it wrong!

    Quote Originally Posted by cicatrix View Post
    I've been righ on the verge of including:

    ... building a (brand-new) web-browser using a web-browser control, but finally decided against it After all it's not a programming mistake.

    P.S. I'll be updating the first post from time to time
    I always quite liked that one. " I am building this new advanced (i could go on all day how advanced it is) web browser "



  10. #10
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    Re: You might be doing it wrong!

    I voted no for the current implementation. I would support a board with threads for each atrocity. That way when you see something that elicits a feeling of fingernails on the chalkboard you can say "Don't use Val. Here's a thread that explains why: <link>"

  11. #11
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Re: You might be doing it wrong!

    I withheld my vote on the principle that I agree with JMC: It would be a good idea if people would read it, but since they won't, it isn't worth the effort. After all, the list of bad practices would be so huge that anybody who would really benefit from it wouldn't be able to get through the list to find the piece that mattered for them.
    My usual boring signature: Nothing

  12. #12
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: You might be doing it wrong!

    I agree... it's like the DB questions around here... if they simply looked around, or even did a search, they'd find the DB FAQ & Tutorial thread... and it would solve a number of problems... I think I point people at that thread more often than actually answering the question directly. the only time I really don't are in highly specific cases, or cases where the problem is so convoluted, that the individual problems need to be sorted out first.

    -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??? *

  13. #13
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: You might be doing it wrong!

    This is a good idea (but is it worth the effort), as JMC suggested placing a link into the signature area would be good so that when someone needs to told the proper (or suggested) method you can point them to the link. The link should be the same in any signature so that it is common and in the same position i.e. either the first or last line in the signature rather than buried in the signature. No matter how it is done I also agree with JMC that it is scary that some posters cannot find the link when directed to in a signature line.

    Information should be consistent, a short description/summary what is being explained, the reason behind it and a simple/short example of the proper method. Optionally provide at least one wrong way to achieve what appears to be a viable solution to an operation. Optional, if there are known code bank submissions to drive home the point than provide them too.

    Some example of how this is handled at MSDN Social forums
    Visual Basic .NET General FAQ
    Windows Forms Data Controls and Databinding FAQ

    Another thought to coincide with this is teaching people how to present their questions. We all know that there are plenty of times where there are countless replies just to understand the poster’s issue because they did not supply enough information.

    How To Ask Questions The Smart Way by Eric S Raymond

    No matter how much time and effort put into this there will be a percentage of members who will disregard this information especially those who are first timers and want quick solutions and will not care much how it is done. Which brings up another point, current members giving advice that provides a solution that works yet at the same time is bad in that the solution is riddled with issues such as the code assumes a string variable is all numeric and in reality contains alpha characters which are not acceptable thus raising an exception down the road.

  14. #14
    Junior Member rkinci's Avatar
    Join Date
    Jan 2012
    Location
    Maine
    Posts
    19

    Re: You might be doing it wrong!

    I would benefit from this even though I have been using the framework since 2007. The transition from vb6 was tough for me. My biggest challenge has
    been finding proper examples that 'work'.

    I am guilty of using default form instances:

    Code:
    Form2.TextBox1.Text = "Hello!"

    I would include OPTION STRICT ON.
    This is the best I can do with what I know.

  15. #15
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: You might be doing it wrong!

    TextBox1 = "This is wrong!!!!"
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  16. #16
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: You might be doing it wrong!

    Error. Unable to convert string "This is wrong!!!!" to textbox object.
    * 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??? *

  17. #17
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: You might be doing it wrong!

    Quote Originally Posted by techgnome View Post
    Error. Unable to convert string "This is wrong!!!!" to textbox object.
    Yep, that was exactly my point
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

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