13

In C++, it's bad when classes become friends, because then they show their privates.

Comments
  • 3
    the feeling when you find out tabs are a piece of code in python
  • 1
    Friends with benefits
  • 2
    @HyperCoder Worse: literally the absence of tabs is treated as a piece of code in Python. It's how the parser detects and represents the end of a scope.

    Oh and also Python lets you vary the number of spaces in indents, it only has to be consistent within each scope.
  • 4
    But remember, that derived classes/children, cannot access their parent's privates. This is really important.
  • 1
    But "for x in y" is a blessing
  • 2
    You will be hearing from my boy @Fast-Nop soon
  • 5
    @AleCx04 I'll just watch, pretending that C is outdated anyway, then kill the winner from behind. :)
  • 1
    I seem to remember a post on Hackernews not too long ago essentially making fun of python programmers and that most tasks can be broken into smaller pieces and run on something like C or C++
  • 1
    @Demolishun what if the parent and the child are friends? 🤔
  • 1
    @vintprox if you're working with arrays
  • 0
    @darksideofyay you mean iterables, of course?
  • 0
    @vintprox that for each logic is kinda stupid if you just want to do a loop x times. why declare a range to do that if i could just tell it to repeat until x. except I can't, because it's python
  • 0
    @darksideofyay As long as iterator from "range" is integral to language, it's an OK practice. X doesn't have to do the same as Y and Z. In fact, one can receive good lesson or two from this generator pattern.
Add Comment