Author Topic: Stackoverflow Boilerplate and FAQs  (Read 199 times)

Walter Mitty

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 1025
    • View Profile
Stackoverflow Boilerplate and FAQs
« on: December 18, 2011, 06:29:50 am »
I've been dabbling with Stackoverflow for some time now.  I've accumulated about 5k worth of rep points, even though my knowledge base is severely out of date.

About half of those rep points come from answering the same question over and over again.  The correct thing to do would be to set up a FAQ area under the "Database Design" tag.  I'm going to get around to that, eventually. 

Here's a sample of this question, and my answer.

http://stackoverflow.com/questions/8544435/supertype-subtype-db-design-with-subtype-cross-link

The question that keeps getting asked could be phrased thus:  "how do  I implement superclass/subclass relationships in SQL tables"?  If you'll take a close look at my answer, you'll realize that it's all boilerplate except for the last paragraph.  The last paragraph addresses the OP's need for a subordinate/supervisor relationship with some constraints. 

It took me several tries to get the boilerplate as good as it is.  I try to use a blend of OOP terminology with "relational orthodoxy" if you will.  The point is that there are a lot of readers who will "get it" if you say "superclass/subclass"  but won't get it if you say "generalization specialization".  The other point is that tutorials on database design generally gloss right over this pattern,  even though it's one that newbie DB designers are going to trip over real soon in their trajectory. 

I feel like a kid with a hammer.  In fact, my entire second career, as a database wonk can be sort of summed up in a few sentences: 

Relational joins are powerful.  Databases are simple, when you look at them from the correct level of abstraction.  The correct level of abstraction depends on what you are trying to achieve. If you get the keys wrong or the composition wrong, you can get everything else right and still lose.

It's a little more complicated than this, but not much.
« Last Edit: December 18, 2011, 08:06:44 am by Walter Mitty »

datagirl

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 740
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #1 on: December 18, 2011, 07:43:38 am »
Thanks, Walter, for providing such a good way to summarize this common scenario.

Like you, I've been doing database design so long that I tend to take these types of things for granted.  You are absolutely correct in everything you said in this post and in the linked thread.  But then, you already knew that and don't really need me to tell you so.  :)

Good job.  You da man.
-DG

Walter Mitty

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 1025
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #2 on: December 18, 2011, 08:21:38 am »
Thanks Carrie.  That means a lot to me, coming from you.

I found that, in my career as a DB wonk, I had to learn how to be an amateur business system analyst.  Particularly when it came to the semantics of the data.  A lot of programmers and a lot of other DB wonks treat the semantics of the data as outside their purview.  They'll say something like "I don't deal with that.  Go talk to the BSA".  Since you've been a BSA, you know what happens next.

I had to work in shops where there were no BSAs, or where the technical people treated the BSAs like they were all idiots.  It took me a long time to grow out of this mentality.

In particular, ER diagrams and ER modeling in general.  When I first learned ER modeling, it was treated like "relational modeling for dummies".  It took me over a year to learn that ER modeling is NOT relational modeling for dummies.  Good ER modeling tackles the sematics of the data, at least from a superficial level.  Basically, every DB value is an instance of an attribute, and every attribute describes either an entity or a relationship.  And enitites and relationships make up the subject matter.

Bad ER modeling mimics relational modeling.  It wasn't until I fooled around with "Data Architect" that I fully grasped the difference.  DA could make you an ER diagram from a conceptual data model, or a relational schematic from a physical data model.  Slick.

Way down at the other end,  I've been called to sites where the database had been declared corrupt by the DBMS  (Rdb/VMS) and the only tool that could be used was the "patch" tool.  I don't know if you've ever used that toool or not.  It's real dangerous.


datagirl

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 740
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #3 on: December 20, 2011, 07:35:00 am »
Umm, sorry to disappoint, but I'm not Carrie.  Either you had a senior moment, or you have problems keeping you women straight... which can be dangerous...  ;)

-DG

Walter Mitty

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 1025
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #4 on: December 20, 2011, 08:49:09 am »
Oops.  Big senior moment.  I have trouble keeping cyber partners straight regardless of gender.  The only women I can keep straight are my wife, my daughters and my granddaughters. 

Anyways, a big thank you for your response,  even if you are not a BSA.


I'm not quite done with this topic. 

I'm curious why new arrivals to SO never recognize a class/subclass table design issue as a probable FAQ.  These people are otherwise intelligent and reasonably well educated.  Yet they seem to think that "employee/hourly/salaried/contractor"  bears no commonality with "vehicle/truck/sedan/motorcycle".

Part of the problem is that there is no FAQ in the tag description.  when I started out, there wasn't even a tag description under "Database Design".  I wrote one.  It has subsequently been improved a little by others, but I see a lot of my writing in there.   I'm not sure how to go about building a FAQ.  I think I can cope with the mechanics.  It's the philosophy that I'm uncertain about.  And there is a low tolerance for philosophical discaussions in SO,  even in the meta area. 

In fact, that may be where my world view diverges from SO.  Many of them appear to think that if you have enough mastery of the mechanics, the philosophy will all just fall into place.  If I've learned anything in 68 years, it's that this is not true.  Mastery of mechanics enables you to avoid small pitfalls.  Philosophy is your guide around big pitfalls.

Anyways, I imagine that the first FAQ would have to be "how do I design a many-to-many relationship"?  I'm embarassed to write up such a thing,  because it's one of those things I expect a neophyte to have learned from a tutorial. 


Walter Mitty

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 1025
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #5 on: December 21, 2011, 08:09:16 am »
Here's what's satisfying to me about the exchange I linked to:

The OP ended up with a solution that worked PERFECTLY, by the OP's own account.

Here's what's unsatisfying:

Using boilerplate multiple times for multiple questions is like storing the same fact in multiple places in a database.  There has to be a better way.  In the case of a database, the better way is called data normalization.  In the case of Q&A, I imagine it to be FAQ's.

I'm going to stick with this boilerplate for a little while, and suggest in the SO meta area that somebody else build the FAQ's. 


The Gorn

  • Your agonizer, please. And be sure to keep the batteries charged!
  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 14182
  • Gornix user
    • View Profile
A boilerplate comment on Q&A Sites (*exchanges)
« Reply #6 on: December 21, 2011, 12:40:14 pm »
I'm curious why new arrivals to SO never recognize a class/subclass table design issue as a probable FAQ.  These people are otherwise intelligent and reasonably well educated.  Yet they seem to think that "employee/hourly/salaried/contractor"  bears no commonality with "vehicle/truck/sedan/motorcycle".
...
In fact, that may be where my world view diverges from SO.  Many of them appear to think that if you have enough mastery of the mechanics, the philosophy will all just fall into place. 

Here's what's satisfying to me about the exchange I linked to:

The OP ended up with a solution that worked PERFECTLY, by the OP's own account.

Here's what's unsatisfying:

Using boilerplate multiple times for multiple questions is like storing the same fact in multiple places in a database.  There has to be a better way.  In the case of a database, the better way is called data normalization.  In the case of Q&A, I imagine it to be FAQ's.

I have discerned a very similar pattern on the site onstartups.com - which is based on the same engine and whose participants follow the same operating principles.

You are complaining about newbies who believe that their particular problem of the moment is an exception to all rules and which requires a unique solution.

You are also complaining about newbies and "commoners" on Stackoverflow who don't believe in understanding certain subject matter at a deep level, believing instead that applications themselves will result in understanding.

These are tendencies that I see in abundance on OnStartups.com in the questions asked. I also see the lack of interest in being grounded in basics and trying to find prior art that reflects one's current problem.

I also see the lack of intellectual discipline - wanting a real solution but no interest in the general principles used to arrive at that solution.

All I can say is --- "Kids!"

The willingness to submit one's problem to comparison with existing best practices requires a degree of professional maturity. You have to believe in essence "I didn't think about it the first time in the history of the world so someone has done something similar to this."

Newbies really don't want to do this.

And the willingness to respect an area of endeavor as its own discipline that has its own rules is also a function of professional maturity. Programmers with databases are very bad at this, as you keep repeating. I agree. But I also provided a few rationales in the recent past as to why it might be - the database being used as local storage for just one application makes it a private concern of the developer.

But in general, a newbie blunders into a new area in ignorance, says "this ain't so complicated, just CODE SOMETHING", and lays carnage to the work. A mature professional says more like "I will probably mess this up unless I understand what is going on to at least a limited extent."

I see these tendencies in the business related questions that get asked on OnStartups. You see it in database related questions posed on StackOverflow.

My conclusion: Q&A sites are frequented by newbies and professionals in training who really aren't quite there yet (as professionals.)

'Twas ever thus.
Gornix is protected by the GPL. *

* Gorn Public License. Duplication by inferior sentient species prohibited.


The Gorn

  • Your agonizer, please. And be sure to keep the batteries charged!
  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 14182
  • Gornix user
    • View Profile
A suggestion to Walter Mitty here...
« Reply #7 on: December 21, 2011, 12:54:04 pm »
For your stated irritant/challenge, I recommend the following:

Start building a library of boilerplates. Do this by creating a Wordpress or Blogger blog.

Every time you answer a SO question that reflects a common and enduring database design issue, write up the boilerplate.

Provide the detailed specific answer in SO in your response but also provide a link to your article on some topic of, for instance, data normalization. 

You might even write up your boilerplate in a way that you can reference it directly in your answer, sort of like a macro that you tell the person asking the question to plug their parameters into. This would definitely require some finesse.

This would get around the intolerance on Exchange sites for discussion. Even though someone asking a fundamental question with the idea that it is a special snowflake tends to be misinformed and a bit egotistical and needs to be instructed on basics.

Maybe this would cast a bit of light in what is a very dark part of our industry - the Alzheimer's behavior of the young implementor who believes that he invented databases and his problems are all unique snowflakes.

However...

My guess is that this would be downvoted. It would look like the imposing of discipline and study. Which would be quite unpopular. The culture of "StackExchange" sites is that answers are spoon fed.
« Last Edit: December 21, 2011, 01:09:05 pm by The Gorn »
Gornix is protected by the GPL. *

* Gorn Public License. Duplication by inferior sentient species prohibited.


Walter Mitty

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 1025
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #8 on: December 21, 2011, 02:46:48 pm »
Gorn,

Your answer forces me to question my own level of commitment to fixing things.

I am much less willing than I once was to be an agent for cultural change. 

I'm inclined to just live with boilerplate for now.  Call it laziness, call it unprofessionalism.  I call it retirement.

"Call it love,  call it reason, call it peace or call it treason, 
but I ain't a marchin' any more."

The Gorn

  • Your agonizer, please. And be sure to keep the batteries charged!
  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 14182
  • Gornix user
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #9 on: December 21, 2011, 06:05:02 pm »
Gorn,

Your answer forces me to question my own level of commitment to fixing things.

I am much less willing than I once was to be an agent for cultural change. 

I'm inclined to just live with boilerplate for now.  Call it laziness, call it unprofessionalism.  I call it retirement.

"Call it love,  call it reason, call it peace or call it treason, 
but I ain't a marchin' any more."

Hmm, that's an interesting take.

Boilerplate as you describe is like writing a part of a text book.

Would the target of this text pay any attention?

My guess is: in the Q&A forum social environment, rarely.

Because it would require a bit of patience and discipline to figure out the application of the boilerplate to the person's problem.

It's always easier to just ask someone. There is always a sucker hungry for attention on those sites with whom you are competing.

So I agree with how you're handling it.

And I'm a bit tired of playing the sucker myself. These sites encourage laziness.
Gornix is protected by the GPL. *

* Gorn Public License. Duplication by inferior sentient species prohibited.


Walter Mitty

  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 1025
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #10 on: December 23, 2011, 04:21:32 am »
After thinking it over, I've decided that the OP in the particular question I cited was not guilty of the kind of disdain for fundamentals that you and I have been discussing.

His choice of a title was good.  By identifying the problem as a subtype/supertype problem he has correctly seen that his case is one of many with these characteristics.  And he did say that this is probably easy for an experienced designer.  Which it is.  But I remember struggling with it the first time I saw it.

He also was able to carry through with the work needed to see how my response related to his problem.  And he asked a second question in order to clarify.  So this was a pretty good use of the Q&A format.

I remember using Q&A  in my very early years as a complete novice.  I think it's a legitimate vehicle for experience transfer.  I also remmeber that Gerald Weinberg has a comment about timesharing terminals reducing the informal transfer of scuttlebutt that batch programmers used to engage in while waiting for their output.  SO has brought that back.

And, in defense of my use of boilerplate, it's pretty good boilerplate, if I do say so myself.  I'm calling it boilerplate because I have an offline copy,  and I just use cut and paste to plug it into the response.  Cut and paste saves me from repeating a whole lot of effort.  I wonder if this topic is connected to cut-and-paste programming? 

The Gorn

  • Your agonizer, please. And be sure to keep the batteries charged!
  • Trusted Member
  • Wise Sage
  • ******
  • Posts: 14182
  • Gornix user
    • View Profile
Re: Stackoverflow Boilerplate and FAQs
« Reply #11 on: December 23, 2011, 12:31:12 pm »
After thinking it over, I've decided that the OP in the particular question I cited was not guilty of the kind of disdain for fundamentals that you and I have been discussing.

His choice of a title was good.  By identifying the problem as a subtype/supertype problem he has correctly seen that his case is one of many with these characteristics.  And he did say that this is probably easy for an experienced designer.  Which it is.  But I remember struggling with it the first time I saw it.

He also was able to carry through with the work needed to see how my response related to his problem.  And he asked a second question in order to clarify.  So this was a pretty good use of the Q&A format.

How about a simple unifying statement?

"StackExchange" based sites (StackOverflow & OnStartups) and other Q&A sites are places where people can get free consulting for their problems.

That's exactly what the scenario you described indicates.

In the instance of the OnStartups site, I rarely see the glimmer of understanding that you are describing.

I suppose that Q&A sites are vital because the workplace today is so flattened and depersonalized.... you're supposed to stay attached to your desktop and "work".

In the instance of the people who use these sites, it would be nice if they were not so needy and actually helped themselves. The low quality and poor reasoning and illogic of OnStartup questions is part of why I am disgruntled with "social media". These people aren't my peers.
« Last Edit: December 23, 2011, 12:52:27 pm by The Gorn »
Gornix is protected by the GPL. *

* Gorn Public License. Duplication by inferior sentient species prohibited.



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf