This is the way of beginners. The truth is, read the source code of these libraries. You'll realize a lot of stuff on SO is just copypasta work-arounds, while a more elegant, more efficient solution may exist that just wasn't documented well for your use case.