Announcement

Collapse
No announcement yet.

Python 3.4 Steps Closer With New Features

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    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.

    Comment


    • #22
      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


      • #23
        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.

        Comment


        • #24
          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?

          Comment


          • #25
            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.

            Comment


            • #26
              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

              Comment


              • #27
                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.

                Comment


                • #28
                  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

                  Comment


                  • #29
                    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.

                    Comment


                    • #30
                      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!

                      Comment

                      Working...
                      X