• What do you think?(posting code?) (any)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » What do you think?(posting code?) (any)

    Author
    Topic
    #359065

    hello

    How do you loungers feel about posting code to answer questions from other loungers?

    Rather than write the code, I like to nudge the person in the right direction. I don’t have the time to write entire routines/class modules/chunks-o-code for others. Heck, I don’t have enough time to write the code on all my assigned projects. When I post a question to this group, I hope for no more than a few hints or URLs that point me toward the solution. I don’t expect someone else to write code for me. Yet I see many posts where someone asks a question, and they get an answer handed back on a silver platter with dessert. yum Sure, it solves their immediate problem, but does the person asking the question learn from that?

    Granted if you have a mega library of cool routines/modules, and posting the code solves someone else’s problem, then that’s great. Others can incorporate those cool routines/modules into their libraries IF they have a good understanding of the code and why you did specific things in the code. They can even offer up more optimized versions of the code.

    I’ll learn more if I do a little digging on my own through KB articles, help files, MSDN, books, and magazine articles as long I was pointed in the right direction.

    No one’s going to learn to cook if you keep delivering them meals.

    Wadda ya think? What works for you? question

    Viewing 6 reply threads
    Author
    Replies
    • #537193

      I think it depends on the level of the person reading the code- and you quite often don’t know that when answering a question.

      Answering in code is clear and concise (where code is appropriate). And it can be a lot faster to write a small chunk of code. Sometimes I need to try something in code just to see if it can be done at all. And then it’s far easier for me to post the code anyway.

      I’ve seen so many answers where someone responds in a general way- where the response is “how do you do that?”. So you end up having to post code anyway.

      I guess to, that as a typical programmer, I’m probably far more comfortable writing code than writing English anyway.

    • #537207

      I’m all for posting code. I have learnt a whole lot more from looking at other peoples code than I have from all other sources combined.

      I think posting guidance doesn’t really cut it for many loungers. The newbies don’t understand it and the multi-star loungers already know it.

      Providing code drags the newbies into VBA -many of them don’t know how to install the code at first – and opens their eyes to a whole new level. The old timers can look at the code and get new ideas on problem solving and code structure. I certainly pay much closer attention to the code that people post than the words they use to describe it – at least I know the syntax has been checked evilgrin

      Good thread though – it does make me think

    • #537234

      I prefer to post hints and/or pointers to where peolpe can get info.

      IMHO, at least 30-50% of postings in various VB and VBA forums can be answered by looking at the online help, the MSFT KB (or MSDN) or a VB/VBA/related book.

      The percentage may be even higher in the user level groups.

      As someone pointed out in these forums a few months ago, the Washington Post posted an interesting article about how we have become an ALITERATE (not illiterate) society, i.e., many people CAN, but will not read.

      People need to be encourage to find answers for themselves. Yes, it is difficult at first, but we must all try to get a degree from the College of Hard Knocks.

      Not to mention, quite a bit of the code posted is outright wrong, incomplete, or too complex for an inexperienced reader.

      Oh well, this thread is likely to be a looong one.

      • #537250

        I prefer to explain how rather than post code, but sometimes it’s harder to explain that it is to demonstrate–especially when the poster is having trouble just asking the question in such a way that he/she can *get* an answer.

        I’ve learned more over the years from taking apart someone else’s code than from lengthy explanations anywhere, so I think posting code is also a legitimate way of teaching posters how they could do something. I do have a fairly large library of code that I’m always tweaking and adding to, so it is sometimes faster to simply drag out a routine that will work (perhaps with minor modifications) than to try simplifying an explanation to the point where the poster can understand it. This is especially true now that ADO has become such a major part of Office. Even someone who is familiar with DAO may find themselves floundering with ADO at times–I know I do even though I make my living as a programmer. So I consider it more helpful at times to post code that shows at least one way of doing it than to try to explain all the differences and possibilities.

        As for looking it up in the help files, I agree that they should try there, and I often post phrases to use in searching the help files. However, the advent of HTML help was a major setback to those struggling to learn VBA (and I’ve had Microsoft technical people agree with me that it’s difficult to use), so I am not surprised when someone has trouble finding an answer in HTML help. Even in the previous version of Help, you often had to resort to the Find tab to really get answers by anything but dumb luck and unusual patience.

      • #537475

        Lemme clarify before I go watch Columbo.

        I believe that code examples should be posted, but not in discussion thread, rather at well known web sites such as http://www.allapi.net.

        • #537504

          My thoughts as someone who is new to VBA and Access, I post questions for others to answer. As an IT department of one person (me), I sometimes need another person’s perspective. I have to agree with Charlotte who says that it is easier to post the code than to explain. Usually, when someone explains code to me, it doesn’t help much, but if I see the code than I am able to break it apart line by line and learn from it and tweak it from there.

          Everyday I read the digest version from the day before to study the code that has been written and see if it would apply to any of my situations. There have been numerous times that I have been able to improve my database based on someone else’s question.

          This forum is a great learning tool and has helped me fix problems when I couldn’t find the answer in Help or in any of my books. Thanks to all who contribute. I am looking forward to the day that I am able to post a solution instead of a question.

        • #537513

          Isn’t that being a bit unfair, both to those who need an answer without being constantly redirected to another site and to those, like me, who do *not* want to maintain a web site of code?

          • #537582

            The only way to get good code is to go to well estabished sites that specialize in posting such code.

            For example:

            http://www.slipstick.com for Outlook
            http://www.allapi.net for API

            It takes time for each of us to learn which sites are useful.

            We are doing someone a very big favor when responding to a, say, API question by indicating that they can likely find their answer at http://www.allapi.net.

            And, Charlotte, ort anybody else, can contribute postings to some of those sites.

            I find the sites that do NOT allow such unreferred postings to be more useful. Just last night i was searching at one of the better known VB sites (don’t ask, I should have first gone to allapi) and found lots of postings on the subject. Each posting carries along a thread of comments. In some cases, the code just did not work, tho, for some of those there was a later correction.

            Using such sites properly does require experience, but by not directing people to those sites, we are robbing them of the opportunity to do things right.

            Centralized archiving of such code, especially when moderated forum, can produce high(er) quality examples.

            Anyway, no more time for such discussions.

            Bye bye!

      • #537839

        Maybe I should report this to the local bird watcher’s group. I just spotted a Classic Aliterate bird.

        This bird asked how to “round” in Access.
        Well, I quickly fetched my bird watching binoculars and noticed that using Help in Access identifies several “round” functions.

        I guess I’ve encountered a member of the species Classic Aliterate.

        • #537856

          You might have missed noticing the version. There was no Round function in Access 97.

          • #537868

            The Classic Aliterate bird I saw did not mention the version of Access.

            Could be that the bird did mention that in another posting, but not the one I saw.

        • #537862

          Hmm. It seems I read somewhere that Access 97 doesn’t have a Round Function like Excel has had for a long time, nor like the one introduced in Access 2000. Access 97 has Type Conversion Functions when one looks up Rounding in the index of its help files. Go ahead, give it a try.

          Do you really think that an Access Neophyte is going to gain a whole wealth of information with the Type Conversion Functions? Once again, in case you READ over it, that’s Access NINETY SEVEN

          Here’s a great READ on Math in Access 97 (or Office 97 for that matter) Rounding being a topic covered.
          http://www.fmsinc.com/tpapers/math/index.html

          Wonderful post Howard, what an honorable man. Can’t wait for the birds to read it! They will benefit greatly, really learn to fly! I say, GOOD SHOW! Hope you reported the “Classic” bird to the proper authorities!

          Is that ATYPICAL of Howard to be so NICE?

          FWIW

          • #537869

            The version was not mention in the posting I saw.

          • #537870

            I had no need to report the bird to the authorities.
            This species is, alas, not extinct, so it is subject to open hunting all year long. The authorities want us to eradicate the critters.

            FYI: My roots in computing are in numerical analysis, statistics and econometric programming.

            For example, I was a member of the Functions subcommittee of the original ANSI BASIC committee.

            Back in 1974, I gained fame by publicizing an issue related to accuracy, i.e., operator precedence. Because of this all programming standards are required to state certain things that were previously left wide open.

            I was also involved in the early years of the committee that developed the IEEE floating point format.

    • #537246

      I agree with you. As a veteran programmer in many languages, I get irritated when people ask questions that could of easily been answered by pressing F1 rtfm or spending 15 minutes with a book or using the infinite resources on the Internet. I will bend over backwards to help someone learn, but only if they make some effort to figure things out on their own. I’ve taught classes too and most people want you to open their heads and pour in the knowledge instead of having to think (your comment about not wanting to read). I try to give enough hints and pointers of where to look for the info and if they make a sincere effort to find the answer and fail, then I’ll help 1000%. That’s the only way to learn stuff but few people are willing to do that. Eight months ago I knew zero about Excel or VBA but after reading every single page (several times) in Walkenbach’s book, and John Green’s Excel VBA books AND typing in all the code examples and playing with it in the de######s, I’m pretty confident with what I know (I don’t know it all though, but I do know that I could figure it out if I had to and that’s the point).

      So as not to sound too elitist grin, I’m sure many of these posts are not from professional programmers but rather those who only need a quick fix for a one-time problem. They don’t need to create a major 15,000 line VBA program that their company is going to sell. Now that’s a different thing all together….

      Deb shrug

    • #537251

      If it’s a trivial problem that I see in help, I’ll tell how to search for the keywords in help. But in many cases, it’s a chance for me to learn stuff. And then when it’s done, I gotta share. Not the best pedagogy, but truth be told, I guess I’m not really here to teach. Bottom line, I have to do what’s right for me. (Warts coming?)

      • #537258

        I don’t know why you would expect warts for that. It seems perfectly reasonable to me. I learn more from writing a piece for code to solve a problem that I do from reading someone else’s code to solve the same problem–even if I like there solution better. shrug

      • #537270

        Having come late to this thread, I get to tack on to what others have already said.

        There are many posters, with many different levels of expertise. If you know from previous posts that the person has coding experience, there’s no point replying with more than a pointer in the right direction.

        But many of the requests for code, particularly on the Word forum, are from folks who have that one-time need for something that’s way beyond their current abilities to do for themselves – no use pointing them to a VBA book ’cause they ain’t going to learn it.

        Those are the ones I consider fair game for coming up with a complete solution (as long as it can be done quickly!) – it’s a fun challenge ’cause it takes me into areas I never get to get into at work. And people come back and say ‘thanks, you made me look good at work!’ – nothing wrong with that.

        On the VBA forum, I tend to be more on the receiving side since 90% of what I do is read the responses and code of people who know more than I do – and I’m grateful for all the code I get to learn from here. I don’t think that makes me lazy (well, more lazy than I already am) since most of it’s about things I’ve never had to work with, and it opens my eyes to what can be done. (and if at work and am stuck for some little piece of code, you bet I’m going to do a Search on the VBA forum).

        So I agree about teaching a man to fish, but mostly I say habeas codus.

        • #537273

          I’d agree with all of the above. It also seems to me that posting code tends to lead to an expansion of the topic, which may or may not contribute to the original question, but I suspect almost always leads to some benefit for the readers – people chipping in with “I’d do it this way”, “Why did you do that” or “You could add this to make it more generic” etc. This means that, while the original poster may simply grab the code and disappear (the Lounge being, IMHO, here to help, not necessarily to teach), others may benefit from a critique of their own (or others’) coding techniques. A pretty useful side effect, I reckon.
          Just my tuppence ha’penny worth.

        • #537309

          Some interesting points brought up in this thread.

          Just brain stormin’ here, but there’s two things I can think of that might help.(Hey, we need a brainstorming smiley!)

          • Would there be a way in your profile to put what you think your programming expertise is? Maybe on a 1 to 10 scale.(1 being “What’s a program?” and 10 being “I write API calls in my sleep.”) Then others responding to your posts can respond appropriately.
          • Also, is it time for a FAQ? yikes As with most boards, the same questions get asked over and over. Is there a way to make a FAQ thread always bubble to the top of the list no matter what?
            [/list]
          • #537348

            Some FAQ threads in other forums are marked as star posts, which makes them stand out pretty well. Did you have any candidates in mind? If those threads constantly floated to the top, they’d eventually push the new threads off the map. shrug

            • #537358

              scratch Just brain stormin’ again.

              Maybe have a single post that is the FAQ. No one can reply to it. Have it bubble up to the top. It could even point to threads that elaborate on the answers. Then again, would anyone read it? shrug

            • #537460

              Part of our jobs as moderators and of the WMVPs role as well, is pointing out existing threads that may answer questions. The star posts serve some of that purpose as well. The Lounge used to have “sticky” posts but it wasn’t really used, so it was removed in favor of other creative features. After all, who is supposed to decide which posts are most useful or important, especially in long rambling threads like many of those in VB/VBA/.Net? shrug

              As for ranking your expertise in your profile, I’ve know people who called themselves developers but who learned how to do one thing one way and never learned anything new, but they’ve done that one thing for *years*. Would you really expect them to evaluate themselves honestly? I suspect we’re going to have to live with evaluating the posts on their own merits. You can usually tell whether someone is a total novice–in fact, they’ll usually tell you straight out. Most of us in the Lounge, novice and pro alike, tend to understate our knowledge rather than bragging about it and making fools of ourselves. Egg on the face is a great teacher and a true humbler of egos! grin

            • #537464

              The Search Engine is designed to do exactly that. Type in the keyword(s) of your problem and you should get what you want.

    • #537288

      Code: To Post or Not to Post, that is the question!

      This required lots of thought, a careful reading, and many parts to the answer. BTW Howard, thanks for explaining aliterate, I never would have figured that one out 😉

      IMHO a combination of nudging and posting code is a great help to many. There is also a real need, at times, for nudging some away from using code.

      When someone asks a question it is often helpful to look for a non programmed solution first, when someone isn’t necessarily looking for code. For example, in a WOPR lounge discussion, long ago and far away before the original boards got obliterated, someone asked how to rearrange a string of text in an Access database. The person asking mentioned they had no programming experience, and the Access Archon chimed right in with a VBA solution. While her solution was good, the person asking then needed to know all sorts of things, where do I put the code, do I save it as a module, do I put in in a form, where do I find the time to learn to code, etc. A response given shortly after suggested to simply build an update query with a formula that would rearrange the string. The person asking the question was very grateful. They didn’t have to take time off their regular job and learn to code, and they had a workable solution until they had time to learn to code or hire a programmer.

      Another example I remember is once someone asked how to have a specific date format be applied when using Access as a data source for a mail merge. Once again, someone gave a very lengthy coded solution that worked, however, the person asking also didn’t necessarily want to learn to code. A simple solution that worked for them, was to use a query for their data source instead of a table, and use the Format function to provide a calculated field that would merge into Word in the date format they were looking for. Again, they were steered away from using code in the solutions that they used. I remember the threads well enough to say that.

      The two examples above were asked by loungers who did not have programming experience, were looking for User Interface solutions, were presented with coding solutions, and when it came down to it, there situations were suited to a User Interface solution. The coded solutions presented worked, but were really designed to be used as applications that could be built to solve the problems at hand.

      It can be helpful to nudge someone in the right direction, however, when someone doesn’t know enough, they could easily be nudged in the wrong direction. The main reason I joined the WOPR lounge was two Excel questions I once read. One got a response of look it up in help, with no pointer as to what to look up. The other got a response to look up a particular feature of Excel that works only with numeric data, when the person asking was very clearly looking for something to work with text.

      Posting code is extremely helpful to the poster. Case in point, my lame solution one day was turned into a one liner of code from “Mankaman” If the original poster took my code and went away, they missed out on Mankaman’s refined answer. However, those reading the thread benefited from the discussion. So is posting code all bad, no not at all. Look at some of the stuff that Robin Trew posted over the years. (Sadly all blown away when the original lounge was sold with a server) Was my solution the most efficient, no not at all, but it got the job done and I benefited from learning from my mistakes as well as the original poster.

      While true posted code can be outright wrong, incomplete, or too complex for an inexperienced reader. I have seen pointers to the wrong sources of help in discussion threads. I have seen books provide code with typos and/or backwards code which if the reader didn’t know, could cause hours of trouble. Someone posting code could be an expert programmer or not, while someone pointing a poster in a certain direction, may be pointing in the right direction or not.

      Going back to the cooking example. What if the Chef never cooked the meal for the Chef’s apprentice? Would the Chef’s apprentice know what Chicken Piccata was supposed to taste like from a book?

      Oh my, did I ramble on. I hope this makes sense to someone who reads this in our aliterate society!
      FWIW my $.02

      • #537300

        [indent]


        someone who reads this in our aliterate society!


        [/indent]I thought that was Howard’s point … the aliterate don’t bother to read explanations! I guess you’ll just have to talk to the rest of us, Tom. grin

      • #537308

        I tend to agree with TomG on this one.
        One of my co-workers says something to the tune of “If you have a hammer, all your problems are nails.” bash We tend to try to solve problems the same way over and over. If you’re a VB/VBA programmer, then all your problems can be solved by writing VB/VBA. You don’t gravitate toward finding another solution to the problem. Microsoft has packed piles of functionality into these Office apps. Only king Woody knows a higher percentage of it than most, and he’s making it known as fast as he can. Years ago, I took an advanced Excel class and I was blown away by advanced filtering, subtotals, pivot tables and other advanced features that are somewhat buried and not easily understood. As programmers, we need to know these things or we’re just wasting our time duplicating functionality that already exists in the app. We can solve many peoples problems by just showing them the functionality that exists in the apps, and not having to write a single line of code. Also, we can spend less time writing our programs if we take advantage of this functionality.

        • #537370

          Most courses are too short to be of much use to any but experienced programmers.

          With a book, you can proceed at your own pace.

          Most importantly, if you can arrange it, is to retain the services of ONE person who can follow your progress, give you exercises, etc. Indeed, just this month, I’ve started offerring such a service. It’s ideal for doing this over the internet. (P.S.: A few minutes ago, I signed up my first client for this new service).

          Posting in newsgroups, etc. is a less effective way to get answers, especially on a continuing basis. Once you have some experience and know HOW to research things and HOW to ask questions, then you can break the cord or use the support person less. Of course, if one is aliterate, too bad and no sympathy from me.

          It’s really sad how bad of a job the publishing industry has done in producing “adequate” low level VBA related books, for Word worst of all.

          • #537414

            Howard has the ultimate solution here. Although not new it is exactly what is needed in the programming world. A programmer’s apprenticeship program. Just like Plumbers and Carpenters had for years!

            That is a very good service to offer, Howard. I hope it works out well for you.

            FWIW

            • #537419

              It will for the first Client.

              This Client is also a Consultant, so understands the value, and has even more Word VBA books than I have.

              Some day, I’ll get around to announcing details of this service at my web site.

          • #537416

            It’s really sad how bad of a job the publishing industry has done in producing “adequate” low level VBA related books, for Word worst of all.

            Ah, yes, very sad indeed. Sometimes the person writing has very little real world experience with the subject they’re writing about. Don’t even get me started on “Courseware” from training companies. YIKES!

        • #537413

          Sometimes not always.

          o There is a time for a VBA solution
          o There is a time for a VB solution
          o There is a time for a “Built-in to the application” solution.

          😉

      • #537681

        Here’s an example of what I meant about trying a User Interface solution first.

        Client needed serious database application built. Client looked into Access 97 and started building an application to use for a particular business need, with the help of a programmer. Client said they needed to be able to select records based on certain criteria from already built queries to show subsets of records. Programmer rushed off to program a solution, when someone gently reminded programmer, Filter By Selection was a very good built-in function for this. Programmer agreed, but that was after spending a huge chunk of time essentially building the Filter By Selection feature into a form.

        In this case the addition of the Filter By Selection in Access 97 (and Beyond) was good enough for the client, giving the programmer “freedom” to work on more complicated matters.

        I am not saying that there’s always a User Interface solution. IF that were true, we wouldn’t have VBA now would we?

        FWIW

    • #537349

      Just to toss my 2 cents in the ring…

      It’s the old fish for a day vs. fish for a lifetime debate. But in this case, examining the fish, as it were, can lead to better fishing in the future.

      Or rather than post code in its entirety, which is hard for some basic users to abstract back to concepts, perhaps post pseudo-code. That is, english language version of the code that explains the concept of the procedure without giving them the exact syntax. A bit of a carrot…

      That said, of course posting the code isn’t always the answer, but sometimes there is nothing better than asking a question and having a nice Lounger present you with your answer on a silver platter. Goodness knows I’ve enjoyed that luxury on more than one occasion, and learned from the experience later when I had time to digest it!

    Viewing 6 reply threads
    Reply To: What do you think?(posting code?) (any)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: