For me OOP is how you think about the code. You can use this thoughts with most language, either if the language designer think you should or not. With some language its easy and with some language its harder. Most people think its easy to think in a OOP way with python.
Announcement
Collapse
No announcement yet.
Python 3.4 Steps Closer With New Features
Collapse
X
-
As a c++ guy I have to agree with the python view. For me the whole c++ qualifier, encapsulation business is nothing more than language enforced coding/documentation convention (and performance/optimisation help to some degree).
It would work just fine without, maybe except for the const qualifier, a must for any language that allows mutable objects imho.
Comment
-
Originally posted by alcalde View PostPython doesn't force things on people. Someone once said that some languages put up barbed wire and land mines to prevent developers from doing certain bad things. Python employs rainbows and sunshine on the good path instead so users are never tempted to go down the bad paths.
Comment
-
-
Originally posted by curaga View PostI can format my braces however I want.
Yes, the indentation-controls-scope feature of Python is a bit scary when you start. And it is horrible when you have very long blocks of code.
But the neat thing is that since that is horrible, you will actively try to make your blocks of code shorter which usually means prettier and more understandable.
EDIT:
Also, the problem with scope and long blocks of code is primarily when they are both long and have deep nestings. So avoid long deep nestings
Comment
-
Originally posted by curaga View PostI disagree, Python is the very example of languages that force things on people. Let's start with its absolutely horrible forced indentation.
It encourages clean code, code sharing, code re-use and consistent code style.
It's just too bad the amount of indention is optional, PEP 8 document specifies that 4 spaces should be used, but some people use 2, 3 and 8 spaces.
Comment
-
Originally posted by uid313 View PostI love the forced indention in Python.
It encourages clean code, code sharing, code re-use and consistent code style.
It's just too bad the amount of indention is optional, PEP 8 document specifies that 4 spaces should be used, but some people use 2, 3 and 8 spaces.
Comment
-
Originally posted by curaga View PostI can format my braces however I want. I can't use what indentation I like with python. It's quite a different degree of forcing.
By the way in 10 years of programming I have never seen a brace-language project that had code indented in a way that wasn't not 100% standard - aside from the cases where it was recognized bad code and eventually fixed.
Comment
-
Originally posted by pankkake View PostBy the way in 10 years of programming I have never seen a brace-language project that had code indented in a way that wasn't not 100% standard.
Comment
Comment