Youtube comments of gingerBill (@GingerGames).

  1. 399
  2. 217
  3. 179
  4. 92
  5. 71
  6. 63
  7. 31
  8. 25
  9. 20
  10. 20
  11. 17
  12. 14
  13. 14
  14. 14
  15. 13
  16. 13
  17. 13
  18. 12
  19. 12
  20. 12
  21. 12
  22. 10
  23. 10
  24. 10
  25. 9
  26. 9
  27. 8
  28. 8
  29. 8
  30. 8
  31. 7
  32. 7
  33. 6
  34. 6
  35. 6
  36.  @noahhounshel104  ​ @kwanarchive ​ @Zsombor Hollay RAII on its own does not necessarily waste memory compared to other approaches, however the general culture assumes RAII means you should allocate singular things instead of thinking about your allocation separately from your single objects. As a result, a lot of memory is wasted because you off-load the allocation aspect to the single object, whereas RAII could still be useful if you did not do this. Another issue with C++ specifically is that they conflate construction/destruction with allocation/deallocation. It is extremely useful to want to allocate an object and then construct it at a later time, destruct it and then deallocate it at a later date, but due to the way C++ has been designed and the culture around C++, most people couple them together (making things bad). Constructors and destructors also do not "return a value" meaning that the only way you can signal something may have gone wrong is by throwing an exception (which might be a huge issue depending on the problem space). This is why many people will just use explicit `init` and `destroy` functions/methods instead of relying on the ctors/dtors, thus bypassing many of the features of RAII. I can give you loads of real world examples of codebases that use RAII heavily that are extremely wasteful of memory (compared to other approaches). And to clarify, RAII is not inherently wasteful but the culture around it and how it the languages that have tend to be designed nudge you to use it in such a way that is extremely uncaring about memory allocations by making them hidden.
    6
  37. 6
  38. 6
  39. 5
  40. 5
  41. 5
  42. 5
  43. 5
  44. 5
  45. 5
  46. 5
  47. 4
  48. 4
  49. 4
  50. 4
  51. 4
  52. 4
  53. 4
  54. 4
  55. 4
  56. 4
  57. 4
  58. 4
  59. 3
  60. 3
  61. 3
  62. 3
  63. 3
  64. 3
  65. 3
  66. 3
  67. 3
  68. 2
  69. 2
  70. 2
  71. 2
  72. 2
  73. 2
  74. 2
  75. 2
  76. 2
  77. 2
  78. 2
  79. 2
  80. 2
  81. 2
  82. 2
  83. 2
  84. 2
  85. 2
  86. 2
  87. 2
  88. 2
  89. 1
  90. 1
  91. 1
  92. 1
  93. 1
  94. 1
  95. 1
  96. 1
  97. 1
  98. 1
  99. 1
  100. 1
  101. 1
  102. 1
  103. 1
  104. 1
  105. 1
  106. 1
  107. 1
  108. 1
  109. 1
  110. 1
  111. 1
  112. 1
  113. 1
  114. 1
  115. 1
  116. 1
  117. 1
  118. 1
  119. 1
  120. 1
  121. 1
  122. 1
  123. 1
  124. 1
  125. 1
  126. 1
  127. 1
  128. 1
  129. 1
  130. 1
  131. 1
  132. 1
  133. 1
  134. 1
  135. 1
  136. 1
  137. 1
  138. 1
  139. 1
  140. 1
  141. 1
  142. 1
  143. 1
  144. 1
  145. 1
  146. 1
  147. 1
  148. 1
  149. 1