RANT: Throwing around code does not REALLY help users.
Posted: Sun Dec 06, 2009 2:20 pm
I have long thought that throwing "working" code at a user in an attempt to help them was indeed not helping anyone at all. I think that it generally does a lot more harm than good. Let's take this post for example.
User A has some code that was gifted by User B. It works in one scenario, but not another scenario that User A thinks is valid. User A then makes a post asking why this gifted "working" code does not work for this scenario. Clearly, User A does not understand what the gifted code actually does and does not do. Is this a failing of User A, User B, or the code? Ultimately, I'd say that all three are are fault. Let me explain why.
1) We do not know if the code posted by User A was modified in any way, and User A doesn't give very much context about how the code is used either, aside from how some devices are set up in a virtual machine. The code in question may or may not be at fault here. It could be very possible that this code is being incorrectly called from elsewhere.
2) User A doesn't explain what debugging (if any) has been attempted so far, and what the results of that debugging were.
3) User B responds only with "you cannot use that code for this purpose. Use this other code instead." This is compounding the problem! I now fully expect User A to make a post saying "When I use the new code, the situation I had before is reversed! Device A no longer works, but Device B does!" User B makes no attempt at all to explain WHY the first code does not work as expected, or how the newly posted code is supposed to work. It is not explained if the one replaces the other, or if both pieces of code work together somehow.
We don't know if User A understands either bits of gifted code, or the underlying devices in question. Has the wiki been searched? Have the appropriate specs been read? While the general quality of those posts themselves are quite lacking, throwing code at User A certainly isn't helping to address the underlying problem: a lack of knowledge. User A isn't really helped here at all, nor is anyone else that may have a problem with User B's code in the future, should they also be inappropriately "helped" by this selfish code slinging going around. This entire thread really shouldn't even exist; User A would have been just as well served by User B if the entire thing had happened via PM, and then we wouldn't have other users reading the thread hoping for help but only being let down in the end.
Now let's take a look at another example thread.
Here the OP has a problem, and it appears that the OP has tried some debugging. The OP points out the wiki article on the subject has been read as well as some other resources, but the problems persists and so the OP would like some advice. The thread goes along reasonably well with comments and suggestions, and it appears the OP is making progress toward solving the problem.
But suddenly, there's once again a bunch of code thrown at the OP with no explanation other than "it follows the intel controller pdf." I'm wondering, which intel controller pdf? Intel has many controller datasheets available, a link to the pdf that is followed by the code would be nice. Granted, that link (or even the PDF itself) may be in the zip file that is linked to, but perhaps I'm not interested in downloading someone else's code on the off chance that it contains a datasheet that may or may not have been referenced yet. And I will point out the OP specifically asked for SUGGESTIONS, and NOT code. I'll give 5 cookies to the OP just for that. The OP is trying to learn and figure things out based on the advice of others, not their code. That is the type of positive reinforced learning that will help the OP down the road. It seems to me that the person posting the code isn't really out to help anyone at all, but rather is entirely self-serving and just looking to stroke their own ego, or have others stroke it for them. I personally do not think this is the sort of user that we need around here.
So what can we do about this? Just stop posting code entirely? Well, no. There are times when posting code may indeed be the correct solution, but quite often the largest problem there is finding the correct code to post.
Sadly, some people really do need to look at other people's code to learn. To those people, I'd like to suggest they either find another hobby, leaving OS Development (and programming in general) far far behind. But if you must continue with this hobby, then it's time to find another path. There will come a time, when you get far enough in your OS development endeavors, that tutorials and code samples become sparse. Datasheets may or may not exist. Your device may be supported by Linux, but perhaps you don't want to reference that code because it makes your eyes bleed, or because you cannot base your code for your proprietary OS project on GPL'd code. If you must refer to existing code now to write your code and get it working correctly, you really, really, really need to work on fixing that. Put your project on hold, learn to become a better programmer somehow (books, schooling, published papers, perhaps even find an Ancient Knowledge Repository and have it all downloaded into your head, but beware, there's no Asgard around to help save you later), and come back to it later. Or spend many painful eye-watering hair-pulling hours trying to figure it out for yourself, or through the advice and suggestions of others. Eventually you'll learn enough and all the proper brain connections will be made that you'll be able to apply past experience to your current situation.
For anyone that is responding to a thread and is thinking of posting some code, DON'T DO IT! Instead, perhaps suggest a wiki article, datasheet, a google search with keywords, or maybe even a tutorial. Oh, a wiki article doesn't exist for this subject? Then spend some time and create one. Does a wiki article exist, but it doesn't cover this problem, or is very hard to follow? Again, spend some time on the article. Clean it up, add missing bits of information. The wiki is for everyone, and is always going to be a work in progress. Many many more people will be helped by a good wiki article (complete with references to datasheets, publications, and/or other online resources) than will be helped by your super-awesome leet and maybe or maybe not bug ridden and semi-commented asm code that most likely doesn't have any kind of license on it (which then legally prevents anyone from doing anything with that code anyway).
In the above two referenced threads, a moderator could go delete the "here, use this code" posts, and nothing at all would change. Arguably, the OP in either case would be better off if those posts were deleted.
The forums are a great resource. There's many helpful people here, and a great many valuable threads full of very very good information. The best threads don't have complete code attached to them, either. There may be snippets here and there, but most of them either don't have any code at all, or certainly don't have complete working drop-in code.
In many cases, I view the forum as a place to say "Hey, the wiki is lacking this information. I don't have the knowledge to write an article about this, but someone here does. Would you mind writing something in the wiki?". There are many forum posts full of information that should be added to the wiki, but the relevant articles haven't been updated (or even created). We're all guilty of this, even me. If a forum post points out a shortcoming in a wiki article, it is more appropriate to update that wiki article with the correct relevant information than to continue on educating the OP in a forum thread. Or perhaps do both. If you know some information, but not all, ask in the forums if you are correct, and then go update the wiki. Not all forum posts are relevant for the wiki, but many contain detailed information about specific problems that should at least be linked to from the wiki.
I really think the focus of the forum should be community related. It is a great place to meet new people with similar interests, find someone to test your latest OS release (or perhaps even contribute to it), and get feedback that helps you grow as a programmer, advancing your knowledge and experience in the field. In my opinion, the best way to stroke your ego (if you really want to do that) isn't by throwing code around, but by helping others become the expert programmer that we all want to be. This will not only help them to accomplish their own OS related goals, but may also help them to build confidence and learn new techniques that are valuable in other areas of life outside of programming and OS development. (Yes, such areas really do exist!)
You may be thinking "many wiki articles contain code, how is that any different?". It is true, there's many wiki articles full of code. Some contain code snippets, and some contain full working examples. The wiki is a much more appropriate place for long-living code samples. It's often quite good to explain the theory behind a concept and then give some code samples (or pseudocode) that illustrate what was just discussed. That is how professional papers are written. If you read Jeff Bonwick's 1994 paper on the Slab Allocator, you will not find a complete working implementation of the slab allocator, but you will see code listings when they are appropriate to illustrate a point or concept that was just discussed.
I did not intend to call anyone out with this little rant of mine. I tried to use generalities and say things like OP, User A and User B instead of the actual users involved so that the points I was trying to make could be applied to a wider variety of situations than the threads I linked to.
User A has some code that was gifted by User B. It works in one scenario, but not another scenario that User A thinks is valid. User A then makes a post asking why this gifted "working" code does not work for this scenario. Clearly, User A does not understand what the gifted code actually does and does not do. Is this a failing of User A, User B, or the code? Ultimately, I'd say that all three are are fault. Let me explain why.
1) We do not know if the code posted by User A was modified in any way, and User A doesn't give very much context about how the code is used either, aside from how some devices are set up in a virtual machine. The code in question may or may not be at fault here. It could be very possible that this code is being incorrectly called from elsewhere.
2) User A doesn't explain what debugging (if any) has been attempted so far, and what the results of that debugging were.
3) User B responds only with "you cannot use that code for this purpose. Use this other code instead." This is compounding the problem! I now fully expect User A to make a post saying "When I use the new code, the situation I had before is reversed! Device A no longer works, but Device B does!" User B makes no attempt at all to explain WHY the first code does not work as expected, or how the newly posted code is supposed to work. It is not explained if the one replaces the other, or if both pieces of code work together somehow.
We don't know if User A understands either bits of gifted code, or the underlying devices in question. Has the wiki been searched? Have the appropriate specs been read? While the general quality of those posts themselves are quite lacking, throwing code at User A certainly isn't helping to address the underlying problem: a lack of knowledge. User A isn't really helped here at all, nor is anyone else that may have a problem with User B's code in the future, should they also be inappropriately "helped" by this selfish code slinging going around. This entire thread really shouldn't even exist; User A would have been just as well served by User B if the entire thing had happened via PM, and then we wouldn't have other users reading the thread hoping for help but only being let down in the end.
Now let's take a look at another example thread.
Here the OP has a problem, and it appears that the OP has tried some debugging. The OP points out the wiki article on the subject has been read as well as some other resources, but the problems persists and so the OP would like some advice. The thread goes along reasonably well with comments and suggestions, and it appears the OP is making progress toward solving the problem.
But suddenly, there's once again a bunch of code thrown at the OP with no explanation other than "it follows the intel controller pdf." I'm wondering, which intel controller pdf? Intel has many controller datasheets available, a link to the pdf that is followed by the code would be nice. Granted, that link (or even the PDF itself) may be in the zip file that is linked to, but perhaps I'm not interested in downloading someone else's code on the off chance that it contains a datasheet that may or may not have been referenced yet. And I will point out the OP specifically asked for SUGGESTIONS, and NOT code. I'll give 5 cookies to the OP just for that. The OP is trying to learn and figure things out based on the advice of others, not their code. That is the type of positive reinforced learning that will help the OP down the road. It seems to me that the person posting the code isn't really out to help anyone at all, but rather is entirely self-serving and just looking to stroke their own ego, or have others stroke it for them. I personally do not think this is the sort of user that we need around here.
So what can we do about this? Just stop posting code entirely? Well, no. There are times when posting code may indeed be the correct solution, but quite often the largest problem there is finding the correct code to post.
Sadly, some people really do need to look at other people's code to learn. To those people, I'd like to suggest they either find another hobby, leaving OS Development (and programming in general) far far behind. But if you must continue with this hobby, then it's time to find another path. There will come a time, when you get far enough in your OS development endeavors, that tutorials and code samples become sparse. Datasheets may or may not exist. Your device may be supported by Linux, but perhaps you don't want to reference that code because it makes your eyes bleed, or because you cannot base your code for your proprietary OS project on GPL'd code. If you must refer to existing code now to write your code and get it working correctly, you really, really, really need to work on fixing that. Put your project on hold, learn to become a better programmer somehow (books, schooling, published papers, perhaps even find an Ancient Knowledge Repository and have it all downloaded into your head, but beware, there's no Asgard around to help save you later), and come back to it later. Or spend many painful eye-watering hair-pulling hours trying to figure it out for yourself, or through the advice and suggestions of others. Eventually you'll learn enough and all the proper brain connections will be made that you'll be able to apply past experience to your current situation.
For anyone that is responding to a thread and is thinking of posting some code, DON'T DO IT! Instead, perhaps suggest a wiki article, datasheet, a google search with keywords, or maybe even a tutorial. Oh, a wiki article doesn't exist for this subject? Then spend some time and create one. Does a wiki article exist, but it doesn't cover this problem, or is very hard to follow? Again, spend some time on the article. Clean it up, add missing bits of information. The wiki is for everyone, and is always going to be a work in progress. Many many more people will be helped by a good wiki article (complete with references to datasheets, publications, and/or other online resources) than will be helped by your super-awesome leet and maybe or maybe not bug ridden and semi-commented asm code that most likely doesn't have any kind of license on it (which then legally prevents anyone from doing anything with that code anyway).
In the above two referenced threads, a moderator could go delete the "here, use this code" posts, and nothing at all would change. Arguably, the OP in either case would be better off if those posts were deleted.
The forums are a great resource. There's many helpful people here, and a great many valuable threads full of very very good information. The best threads don't have complete code attached to them, either. There may be snippets here and there, but most of them either don't have any code at all, or certainly don't have complete working drop-in code.
In many cases, I view the forum as a place to say "Hey, the wiki is lacking this information. I don't have the knowledge to write an article about this, but someone here does. Would you mind writing something in the wiki?". There are many forum posts full of information that should be added to the wiki, but the relevant articles haven't been updated (or even created). We're all guilty of this, even me. If a forum post points out a shortcoming in a wiki article, it is more appropriate to update that wiki article with the correct relevant information than to continue on educating the OP in a forum thread. Or perhaps do both. If you know some information, but not all, ask in the forums if you are correct, and then go update the wiki. Not all forum posts are relevant for the wiki, but many contain detailed information about specific problems that should at least be linked to from the wiki.
I really think the focus of the forum should be community related. It is a great place to meet new people with similar interests, find someone to test your latest OS release (or perhaps even contribute to it), and get feedback that helps you grow as a programmer, advancing your knowledge and experience in the field. In my opinion, the best way to stroke your ego (if you really want to do that) isn't by throwing code around, but by helping others become the expert programmer that we all want to be. This will not only help them to accomplish their own OS related goals, but may also help them to build confidence and learn new techniques that are valuable in other areas of life outside of programming and OS development. (Yes, such areas really do exist!)
You may be thinking "many wiki articles contain code, how is that any different?". It is true, there's many wiki articles full of code. Some contain code snippets, and some contain full working examples. The wiki is a much more appropriate place for long-living code samples. It's often quite good to explain the theory behind a concept and then give some code samples (or pseudocode) that illustrate what was just discussed. That is how professional papers are written. If you read Jeff Bonwick's 1994 paper on the Slab Allocator, you will not find a complete working implementation of the slab allocator, but you will see code listings when they are appropriate to illustrate a point or concept that was just discussed.
I did not intend to call anyone out with this little rant of mine. I tried to use generalities and say things like OP, User A and User B instead of the actual users involved so that the points I was trying to make could be applied to a wider variety of situations than the threads I linked to.