oneat

F*ck Stack Overflow, Read The F*cking Manual

Apr 8th, 2021 (edited)
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. # F*ck Stack Overflow, Read The F*cking Manual
  2.  
  3. ### Before we start
  4.  
  5. There are different types of documentation.
  6. In this article I am talking about reference documentation teaching you technology step by step:
  7.  
  8. https://docs.docker.com/engine/reference/builder/
  9.  
  10. not javadoc, api style like:
  11.  
  12. https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/annotation/AnnotationBeanUtils.html
  13.  
  14. ## Introduction
  15.  
  16. Hello there.
  17. I noticed that a lot of people tend to google stuff instead of learning technology properly.
  18. And it seems like a standard...
  19. Now 3 years of experience means three years of googling solutions from stack overflow and code is created by f*ckup driven development.
  20. It really pisses me off.
  21. In this article I would like to show why googling stuff is bad and why you shoul LEARN!
  22. Therefore I present you:
  23.  
  24. ## 3 reasons why you should read the documentation
  25.  
  26. ### Learn how to do stuff properly
  27.  
  28. Do you know what happens when you run tests in intellij idea?
  29. Some strange magic happens, but it works, so nobody cares.
  30. Ok, so now we have an integration test that starts MySQL database in docker in maven.
  31. You can't have in memory database, because you have DDL queries in particular SQL and you want to test it too.
  32. So now you have to run this test using `mvn integration-test` and it seems that debugging it from intellijidea is not working.
  33.  
  34. So now you are stucked and you have two options:
  35.  
  36. First Option: You start this database manually and run those tests from intellijidea.
  37. Soon you realise that the database gets cluttered, so somehow you need to clear this database.
  38. Therefore you manually recreate this database (you use docker so good for you) every time you need to test. This is the way of "I don't know how to solve the problem so let's avoid it".
  39.  
  40. Second Option: You search "how to debug tests in maven", you learn that there is `maven-failsafe-plugin` that runs this test for you and you add `debugForkedProcess` to its configuration, to make it debuggable. However then you would need to attach your debugger manually everytime you run this step. Still bad.
  41.  
  42. However, if you read the documentation, then you would know that `maven-failsafe-plugin` forks the testing process for greater isolation. That's why debugging maven step in intellijidea is not picking any breakpoints in the tests. If you would like to configure it to make it debuggable then, the easiest way is just to turn off the forking capability by setting `forkCount` to zero (however, it has its drawbacks, but after reading docco, you would know of them). Then intellijidea will be able to plug into tests without further problems.
  43.  
  44. As you see because of the documentation, you could understand how stuff works and therefore configure it to your needs. However, you could say: I would find it after some time nevertheless! Maybe you could, or maybe you would give up - I will counterargument this approach in the next section.
  45.  
  46. ### Learn faster
  47.  
  48. Let's take some big framework for example (Hibernate for Java, Angular for frontend).
  49. Big, complicated frameworks.
  50. Let's simulate how much work you would need to do to learn it.
  51.  
  52. You go with google driven development, then everytime you don't know what to do, then you need to:
  53. - google the question
  54. - filter all questions that do not apply
  55. - realise that found answer is not sufficient
  56. - try to search more
  57. - ask the question on stackoverflow
  58. - get wrong answers
  59. - finally get some snippset that started to work by accident
  60.  
  61. And when the problem is harder and more specific, the more research needs to be done to find it, great! And this one time, maybe, nobody will be able to answer it, then what? There are infinite possibilities of combining the code, finding your case may not be easy.
  62.  
  63. Of course this approach is better than reading documentation because it will take you only one day of doing 'almost nothing'. Investing three days for reading docco would be waste of time - you are paid for doing stuff, not knowing it, duh! Googling 30 days for 30 bugs is much better than 3 days of learning and then fixing stuff in 7 days. It is 3 times more money that you can spend for your burnout therapist. However reading about stuff is boring, isn't it?
  64.  
  65. ### Learn to do 'boring' stuff
  66.  
  67. People tend to go around the boring stuff, they don't like to read books or spend time on planning - they love DOING (yes, we love wasting our precious time). In my opinion it comes from impulsive gathering of information from portals like stackoverflow or facebook that makes us this way. However, is reading books and documentation not fascinating? It would be, however we don't exercise our delayed gratification.
  68.  
  69. People usually meditate to clear their mind and be able to be focused for longer.
  70. Try reading documentation for instance and you will notice the similar outcomes.
  71.  
  72. And you may think that it will be always boring and it will be always a pain.
  73. However gratification will be there!
  74. - In bugs you don't need to tackle
  75. - With might that you will feel when using those libraries
  76. - In time saved because you know what, how and why.
  77. You will learn how to work smart not hard. And if you don't like gratification delayed, then think during reading about all problems you were having in the past that the new knowledge suddenly clarifies. I tend to get my motivation from this surge of programming power while reading - feel the power!
  78.  
  79. ## Summary
  80.  
  81. Try binge reading doccos!
  82. This approach may be hard at the beginning, but it will get better by time.
  83. You will work faster, better and you will be more happy by not getting in the traps of inexperience and lack of knowledge.
  84.  
  85. For me the best thing is the fact that going this way allowed me to write the code the way I need and want, not the way that the google results say. It makes framework and libraries fit into your mindset, not your thinking fit into them!
  86.  
Add Comment
Please, Sign In to add comment