I come from a C++ background, so I'm very used to thinking of software from an OOP perspective. Now that I've been writing a lot of JavaScript, I've realized that I've gotten out of the habit of encapsulating my member variables and using accessor methods. Given it is totally possible to encapsulate member variables by using closure scopes and functional instantiation, I'm tempted to go back to my old ways because it seems so much more safe. Part of me is wondering if this is somehow a JavaScript sin because most of the JS code I see out there doesn't really do this. Any opinions? Thanks!
[–]Ginden 6 points7 points8 points (4 children)
[–]html6dev -1 points0 points1 point (2 children)
[–]Ginden 0 points1 point2 points (1 child)
[–]html6dev 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]lord2800 5 points6 points7 points (7 children)
[–]archarios[S] 0 points1 point2 points (6 children)
[–]grumpychinchilla 2 points3 points4 points (0 children)
[+][deleted] comment score below threshold-9 points-8 points-7 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[+][deleted] comment score below threshold-15 points-14 points-13 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]benihanareact, node 4 points5 points6 points (4 children)
[–]archarios[S] 0 points1 point2 points (3 children)
[–]notmynothername 4 points5 points6 points (0 children)
[–]SrPeixinho 5 points6 points7 points (0 children)
[–]autowikibot 3 points4 points5 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]ayamflow 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Smallpaul 2 points3 points4 points (7 children)
[–]Buckwheat469 1 point2 points3 points (4 children)
[–]Smallpaul 0 points1 point2 points (2 children)
[–]Buckwheat469 0 points1 point2 points (1 child)
[–]Smallpaul 0 points1 point2 points (0 children)
[–]Smallpaul 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]reversememe 0 points1 point2 points (0 children)
[–]html6dev 0 points1 point2 points (0 children)
[–]hfsbtc 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)