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. Python a snake in the grass...

Python a snake in the grass...

Scheduled Pinned Locked Moved The Lounge
python
4 Posts 4 Posters 0 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.
  • G Offline
    G Offline
    glennPattonPub
    wrote on last edited by
    #1

    Hi, I come from the C back ground, where white space is free, lines are terminated with ; & loops are in { } and all is right with the world. Moving to Python white space appears to terminate functions and loops, the structure is now a tuple. I appreciate that white space thing is easier for beginners but it's a little confusing for someone who is just trying to pick up the language quickly... :wtf:

    L M J 3 Replies Last reply
    0
    • G glennPattonPub

      Hi, I come from the C back ground, where white space is free, lines are terminated with ; & loops are in { } and all is right with the world. Moving to Python white space appears to terminate functions and loops, the structure is now a tuple. I appreciate that white space thing is easier for beginners but it's a little confusing for someone who is just trying to pick up the language quickly... :wtf:

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

      Try working through The Python Tutorial — Python 3.4.8 documentation[^], it's not perfect but certainly helped. My background also being C, but with ++ and # in recent years.

      1 Reply Last reply
      0
      • G glennPattonPub

        Hi, I come from the C back ground, where white space is free, lines are terminated with ; & loops are in { } and all is right with the world. Moving to Python white space appears to terminate functions and loops, the structure is now a tuple. I appreciate that white space thing is easier for beginners but it's a little confusing for someone who is just trying to pick up the language quickly... :wtf:

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #3

        Python is not unique in this. Haskell, F#, other FP languages... Basically, you get used to it. At least I did, pretty quickly. Because it can get fuzzy, I tend to use a blank line to separate the end of an "if" or "loop" so I know something important is happening. That, and writing very small functions in Python. I have been known to write (psuedocode example, my Python is getting rusty!)

        OperateOnList(someList)
        foreach(item in somelist)
        DoSomething(item)

        Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

        1 Reply Last reply
        0
        • G glennPattonPub

          Hi, I come from the C back ground, where white space is free, lines are terminated with ; & loops are in { } and all is right with the world. Moving to Python white space appears to terminate functions and loops, the structure is now a tuple. I appreciate that white space thing is easier for beginners but it's a little confusing for someone who is just trying to pick up the language quickly... :wtf:

          J Offline
          J Offline
          jmussetter
          wrote on last edited by
          #4

          I recently in the last year or so had to pick up python syntax as well. I have similar background, with C, some C++/C#. I can usually read and follow other derivatives like Java as well. Python is described as being "easy" to learn for beginners, but for those of us used to "normal" languages, it's not so easy. My personal description is that it's a 'loosy, goosy' language to me. It seems that some syntax can be what ever you want, the interpreter just figures it out. The not having {} and ; chars drives me nuts. The data structures like tuples, and the fact that everything is a dict can be confusing. Add in that it's not strongly typed, and instantiates vars on the fly, and it's like a recipe for disaster for someone like me who is used to working with RULES! I know you can compile it in some cases, but the fact it's not compiled is even worse, as unless your IDE of choice is REALLY good, you can't even rely on the compiler catching trivial syntax/typo errors. I often find myself trying to do things in Python like I would do it in other languages, it works usually, but then the Python religious will call out, "but that isn't pythonic!". When was the last time you heard someone say that about C or C#?..."You can't do it that way, it's not C-thonic!" As someone who doesn't use it all the time, and still goes back and forth between Python and C languages, my only suggestion, is just "throw out what you think you know of programming, and learn Python like a beginner". While I didn't do that, my only conclusion is that it would help. Good luck, I still am not 100% comfortable with it.

          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