Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 45

Thread: Python 3.4 Steps Closer With New Features

  1. #21
    Join Date
    Jul 2011
    Posts
    342

    Default

    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.

  2. #22
    Join Date
    Jul 2010
    Posts
    444

    Default

    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.

  3. #23
    Join Date
    Feb 2008
    Location
    Linuxland
    Posts
    4,987

    Default

    Quote Originally Posted by alcalde View Post
    Python 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.
    I disagree, Python is the very example of languages that force things on people. Let's start with its absolutely horrible forced indentation.

  4. #24
    Join Date
    Feb 2011
    Posts
    1,066

    Default

    Quote Originally Posted by curaga View Post
    I disagree, Python is the very example of languages that force things on people. Let's start with its absolutely horrible forced indentation.
    Which is different than forced braces or forced end statements how, exactly?

  5. #25
    Join Date
    Feb 2008
    Location
    Linuxland
    Posts
    4,987

    Default

    Quote Originally Posted by TheBlackCat View Post
    Which is different than forced braces or forced end statements how, exactly?
    I 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.

  6. #26
    Join Date
    Nov 2012
    Posts
    199

    Default

    Quote Originally Posted by curaga View Post
    I can format my braces however I want.
    And there's your problem right there

    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

  7. #27
    Join Date
    Dec 2011
    Posts
    2,001

    Default

    Quote Originally Posted by curaga View Post
    I disagree, Python is the very example of languages that force things on people. Let's start with its absolutely horrible forced indentation.
    I 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.

  8. #28
    Join Date
    Apr 2012
    Posts
    117

    Default

    Quote Originally Posted by uid313 View Post
    I love the forced indention in Python.
    It encourages clean code, code sharing, code re-use and consistent code style.
    Agreed
    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.
    Or just plain tabs

  9. #29
    Join Date
    Sep 2011
    Posts
    40

    Default

    Quote Originally Posted by curaga View Post
    I 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.
    You can't escape syntax; in other languages you can't escape using braces. In Python indentation is syntax, so you can't escape it eiter.
    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.

  10. #30
    Join Date
    Jul 2009
    Location
    Germany
    Posts
    480

    Default

    Quote Originally Posted by pankkake View Post
    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.
    Because it's so easy with brace-languages! You write your code in sloppy and formless way and just run an indention program on save I love the brace-languages!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •