Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I knew i was suspicious of python for a reason

I knew i was suspicious of python for a reason

Scheduled Pinned Locked Moved The Lounge
csharppythonrubyquestion
28 Posts 17 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • OriginalGriffO OriginalGriff

    Not just "significant whitespace" but "significant matching whitespace". So two identical seeming lines can be unmatched because one uses TABs and one uses spaces. Heck, even the editor you use is significant in Python. I'm becoming convinced that it was designed because the author thought VB wasn't quite "Mickey Mouse" enough. :sigh:

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!

    H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #3

    It's a shame, because there's a lot to like about python but the grammar always turned me off of it.

    Real programmers use butterflies

    1 Reply Last reply
    0
    • H honey the codewitch

      The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

      multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

      Which presumably means

      var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

      WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

      Real programmers use butterflies

      D Offline
      D Offline
      dandy72
      wrote on last edited by
      #4

      honey the codewitch wrote:

      and then there's pass. Pass seems like it should never exist in any language.

      Like, a keyword? Maybe it's there to serve as a warning...those who know, should pass on any language that has a "pass" keyword...

      H E 2 Replies Last reply
      0
      • H honey the codewitch

        The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

        multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

        Which presumably means

        var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

        WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

        Real programmers use butterflies

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #5

        honey the codewitch wrote:

        Pass seems like it should never exist in any language.

        Ha ha, I just used it today for the first time.

        H 1 Reply Last reply
        0
        • L Lost User

          honey the codewitch wrote:

          Pass seems like it should never exist in any language.

          Ha ha, I just used it today for the first time.

          H Offline
          H Offline
          honey the codewitch
          wrote on last edited by
          #6

          did it make you feel dirty? :laugh:

          Real programmers use butterflies

          1 Reply Last reply
          0
          • D dandy72

            honey the codewitch wrote:

            and then there's pass. Pass seems like it should never exist in any language.

            Like, a keyword? Maybe it's there to serve as a warning...those who know, should pass on any language that has a "pass" keyword...

            H Offline
            H Offline
            honey the codewitch
            wrote on last edited by
            #7

            Yeah, it's a keyword. It's like a non-op used to cajole the parser into accepting a "statement" where you don't want one. Or at least that's what I've gleaned of it so far. There may be other uses. In any case, it's ridiculous.

            Real programmers use butterflies

            1 Reply Last reply
            0
            • H honey the codewitch

              The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

              multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

              Which presumably means

              var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

              WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

              Real programmers use butterflies

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #8

              Always be wary of scripting languages.

              K H 2 Replies Last reply
              0
              • P PIEBALDconsult

                Always be wary of scripting languages.

                K Offline
                K Offline
                kalberts
                wrote on last edited by
                #9

                Some are worse than others. Tcl is far worse than Python. This is not an objection to your statement. Quite to the contrary. Scripting languages are bad.

                1 Reply Last reply
                0
                • P PIEBALDconsult

                  Always be wary of scripting languages.

                  H Offline
                  H Offline
                  honey the codewitch
                  wrote on last edited by
                  #10

                  I generally am. I haven't found one I like yet.

                  Real programmers use butterflies

                  1 Reply Last reply
                  0
                  • H honey the codewitch

                    The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

                    multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

                    Which presumably means

                    var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

                    WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

                    Real programmers use butterflies

                    G Offline
                    G Offline
                    Gary R Wheeler
                    wrote on last edited by
                    #11

                    honey the codewitch wrote:

                    Pass seems like it should never exist in any language.

                    ;

                    The equivalent of Python's pass in C, C++, and C#. Most useful as a loop body when the loop construct does all of the work.

                    Software Zen: delete this;

                    H C 2 Replies Last reply
                    0
                    • G Gary R Wheeler

                      honey the codewitch wrote:

                      Pass seems like it should never exist in any language.

                      ;

                      The equivalent of Python's pass in C, C++, and C#. Most useful as a loop body when the loop construct does all of the work.

                      Software Zen: delete this;

                      H Offline
                      H Offline
                      honey the codewitch
                      wrote on last edited by
                      #12

                      ah, fair enough. Gosh, I don't like the look of it though.

                      Real programmers use butterflies

                      1 Reply Last reply
                      0
                      • H honey the codewitch

                        The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

                        multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

                        Which presumably means

                        var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

                        WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

                        Real programmers use butterflies

                        B Offline
                        B Offline
                        Brady Kelly
                        wrote on last edited by
                        #13

                        The Python seems more readable that the statement with a ternary expression. I have just started learning python, but the `if/else` is very clear to me.

                        "'Do what thou wilt...' is to bid Stars to shine, Vines to bear grapes, Water to seek its level; man is the only being in Nature that has striven to set himself at odds with himself." —Aleister Crowley

                        1 Reply Last reply
                        0
                        • H honey the codewitch

                          The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

                          multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

                          Which presumably means

                          var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

                          WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

                          Real programmers use butterflies

                          M Offline
                          M Offline
                          Member 9167057
                          wrote on last edited by
                          #14

                          The different order of notation doesn't seem that worthy of a WTF. That's just a bit getting used to, nothing more. The real WTFs with Python I've seen are negative notation for hexadecimal numbers instead of two's complement and the inability to find the entry point in anything remotely complex because Python doesn't have a main method, it's just a script language evaluating from the top. Doesn't help when debugging control flow.

                          1 Reply Last reply
                          0
                          • H honey the codewitch

                            The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

                            multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

                            Which presumably means

                            var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

                            WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

                            Real programmers use butterflies

                            P Offline
                            P Offline
                            Peter Shaw
                            wrote on last edited by
                            #15

                            HA HA HA.... Excellent. COBOL 2 point O What goes around, comes around.

                            G 1 Reply Last reply
                            0
                            • H honey the codewitch

                              The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

                              multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

                              Which presumably means

                              var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

                              WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

                              Real programmers use butterflies

                              O Offline
                              O Offline
                              obermd
                              wrote on last edited by
                              #16

                              honey the codewitch wrote:

                              and then there's pass. Pass seems like it should never exist in any language.

                              And the rest is a Fail.

                              1 Reply Last reply
                              0
                              • G Gary R Wheeler

                                honey the codewitch wrote:

                                Pass seems like it should never exist in any language.

                                ;

                                The equivalent of Python's pass in C, C++, and C#. Most useful as a loop body when the loop construct does all of the work.

                                Software Zen: delete this;

                                C Offline
                                C Offline
                                Chris Maunder
                                wrote on last edited by
                                #17

                                I always feel dirty when there's the need to do that. I usually just unravel the loop construct so there's a loop body.

                                cheers Chris Maunder

                                G 1 Reply Last reply
                                0
                                • H honey the codewitch

                                  The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

                                  multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

                                  Which presumably means

                                  var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

                                  WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

                                  Real programmers use butterflies

                                  K Offline
                                  K Offline
                                  Kirk 10389821
                                  wrote on last edited by
                                  #18

                                  As someone who taught a few CS courses... for a NEW programmer, the Python Syntax makes MORE sense than the C style syntax. x = 3 if I_Need_A_Small_Number else 3333 which is even cleaner in error checking: addError("You can't have this") if X = 0 addError("You can't have this") if Y = 0 ... showErrors() This was a feature of DEC Basic-Plus 2 (I called it an outside if) and in a world where something had to be tweaked in a block of code, and you did not want to affect program flow... Wow, it was a gift. The C syntax is best explained as a "fake function" IIF() => X = IIF(cond, true_val, false_val); but invariably the kids ask the correct question: Wouldn't that be BETTER/CLEARER syntax? (And I would explain that is why we have a PRE-PROCESSOR, LOL). And again, I LOVE the PL/SQL DECODE() statement, which is "?:" on Steroids: X = Decode(v0, V1, R1, V2, R2, V3, R3, R4) -> Where R4 (the extra param is the ELSE condition) It is literally a CASE statement in function form! That said. Python has ONE THING I absolutely hate. THE WHITESPACE inequity. I wish they treated a single tab as 2 spaces. Life would be simply. My editors convert Tabs to spaces. But ONLY when I edit a line. OMFG this *might* be bad in Python. LOL.

                                  H 1 Reply Last reply
                                  0
                                  • D dandy72

                                    honey the codewitch wrote:

                                    and then there's pass. Pass seems like it should never exist in any language.

                                    Like, a keyword? Maybe it's there to serve as a warning...those who know, should pass on any language that has a "pass" keyword...

                                    E Offline
                                    E Offline
                                    englebart
                                    wrote on last edited by
                                    #19

                                    Sounds like Fortran's CONTINUE statement. Basically a NO-OP. It was used to help structure loops or it could be the target of a GOTO.

                                    1 Reply Last reply
                                    0
                                    • K Kirk 10389821

                                      As someone who taught a few CS courses... for a NEW programmer, the Python Syntax makes MORE sense than the C style syntax. x = 3 if I_Need_A_Small_Number else 3333 which is even cleaner in error checking: addError("You can't have this") if X = 0 addError("You can't have this") if Y = 0 ... showErrors() This was a feature of DEC Basic-Plus 2 (I called it an outside if) and in a world where something had to be tweaked in a block of code, and you did not want to affect program flow... Wow, it was a gift. The C syntax is best explained as a "fake function" IIF() => X = IIF(cond, true_val, false_val); but invariably the kids ask the correct question: Wouldn't that be BETTER/CLEARER syntax? (And I would explain that is why we have a PRE-PROCESSOR, LOL). And again, I LOVE the PL/SQL DECODE() statement, which is "?:" on Steroids: X = Decode(v0, V1, R1, V2, R2, V3, R3, R4) -> Where R4 (the extra param is the ELSE condition) It is literally a CASE statement in function form! That said. Python has ONE THING I absolutely hate. THE WHITESPACE inequity. I wish they treated a single tab as 2 spaces. Life would be simply. My editors convert Tabs to spaces. But ONLY when I edit a line. OMFG this *might* be bad in Python. LOL.

                                      H Offline
                                      H Offline
                                      honey the codewitch
                                      wrote on last edited by
                                      #20

                                      significant whitespace in a programming language is just a terrible idea

                                      Real programmers use butterflies

                                      1 Reply Last reply
                                      0
                                      • H honey the codewitch

                                        The grammar for python is ridiculous to me. Significant whitespace being the leading cause of my WTF. But I just taught myself python so i could try out some particular python code in C# I'm looking through some examples and i find this gem:

                                        multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

                                        Which presumably means

                                        var multiple = (a_kilobyte_is_1024_bytes)?1024:1000;

                                        WTF and then there's pass. Pass seems like it should never exist in any language. That is all.

                                        Real programmers use butterflies

                                        P Offline
                                        P Offline
                                        patbob
                                        wrote on last edited by
                                        #21

                                        I don't get the hate on python. It's a typical 1980s language. It is what it is because it's a product of the time it was invented in. You can't apply today's values to a language whose syntax was designed almost 40 years ago and expect it to hold up. Yeah, I know C was around back then, and is the dominant syntax today, but back then, C didn't have much penetration and Fortran was king. Python is kind of an ugly stepchild of Fortran, and shows it.

                                        I live in Oregon, and I'm an engineer.

                                        H F 2 Replies Last reply
                                        0
                                        • P patbob

                                          I don't get the hate on python. It's a typical 1980s language. It is what it is because it's a product of the time it was invented in. You can't apply today's values to a language whose syntax was designed almost 40 years ago and expect it to hold up. Yeah, I know C was around back then, and is the dominant syntax today, but back then, C didn't have much penetration and Fortran was king. Python is kind of an ugly stepchild of Fortran, and shows it.

                                          I live in Oregon, and I'm an engineer.

                                          H Offline
                                          H Offline
                                          honey the codewitch
                                          wrote on last edited by
                                          #22

                                          patbob wrote:

                                          Python is kind of an ugly stepchild of Fortran

                                          The explains a lot. Honestly, I didn't know Python was that old. However, significant whitespace there's really no excuse for in any language, as the problems with it - both lexing it and using it - were pretty well known by the 1980s, AFAIK. :sigh: That's why i'll never adopt it. Half my editors won't even work with it very well. (tabs to spaces can easily kill a python program)

                                          Real programmers use butterflies

                                          F 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups