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. C vs Python

C vs Python

Scheduled Pinned Locked Moved The Lounge
hardwarecsharppythonvisual-studioannouncement
11 Posts 9 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.
  • Y Ygnaiih

    Python is featured as the programming language for the Raspberry PI. I’m new to this maker thing and now I am also playing with the Arduino. Last night I was working with an Arduino video and found that you can use a version of C. That was so much easier than Python. Admittedly I program in C# every day and C was my first programming language course. With the version compatibility problems in Python, all that indention thing, C is my choice. Curly braces forever!

    J Offline
    J Offline
    Jochen Arndt
    wrote on last edited by
    #2

    Even Python is written in C :-D

    1 Reply Last reply
    0
    • Y Ygnaiih

      Python is featured as the programming language for the Raspberry PI. I’m new to this maker thing and now I am also playing with the Arduino. Last night I was working with an Arduino video and found that you can use a version of C. That was so much easier than Python. Admittedly I program in C# every day and C was my first programming language course. With the version compatibility problems in Python, all that indention thing, C is my choice. Curly braces forever!

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #3

      Python is easier for higher level stuff... since there are so many libraries available for it. I'm definitely a C/C++ guy though. I'm right in the middle of coding some C++ optimizations in a DSP library as we speak. :-D

      1 Reply Last reply
      0
      • Y Ygnaiih

        Python is featured as the programming language for the Raspberry PI. I’m new to this maker thing and now I am also playing with the Arduino. Last night I was working with an Arduino video and found that you can use a version of C. That was so much easier than Python. Admittedly I program in C# every day and C was my first programming language course. With the version compatibility problems in Python, all that indention thing, C is my choice. Curly braces forever!

        R Offline
        R Offline
        Rage
        wrote on last edited by
        #4

        Python is fun. Missing an indent can be a PITA, though[^]. I used to be very fluent, I would probably completely lost today...

        Do not escape reality : improve reality !

        B 1 Reply Last reply
        0
        • Y Ygnaiih

          Python is featured as the programming language for the Raspberry PI. I’m new to this maker thing and now I am also playing with the Arduino. Last night I was working with an Arduino video and found that you can use a version of C. That was so much easier than Python. Admittedly I program in C# every day and C was my first programming language course. With the version compatibility problems in Python, all that indention thing, C is my choice. Curly braces forever!

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

          Earl Owens wrote:

          Python is featured as the programming language for the Raspberry PI

          Where? Simply runs every .NET language. Including WinForms.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

          Y 1 Reply Last reply
          0
          • L Lost User

            Earl Owens wrote:

            Python is featured as the programming language for the Raspberry PI

            Where? Simply runs every .NET language. Including WinForms.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

            Y Offline
            Y Offline
            Ygnaiih
            wrote on last edited by
            #6

            What I mean by featured the UI has two versions of the programming interface.

            1 Reply Last reply
            0
            • Y Ygnaiih

              Python is featured as the programming language for the Raspberry PI. I’m new to this maker thing and now I am also playing with the Arduino. Last night I was working with an Arduino video and found that you can use a version of C. That was so much easier than Python. Admittedly I program in C# every day and C was my first programming language course. With the version compatibility problems in Python, all that indention thing, C is my choice. Curly braces forever!

              D Offline
              D Offline
              Dan Neely
              wrote on last edited by
              #7

              Syntactic whitespace is an abomination that should've died when computers capable of compiling something more complex than COBOL went on sale.

              Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

              1 Reply Last reply
              0
              • R Rage

                Python is fun. Missing an indent can be a PITA, though[^]. I used to be very fluent, I would probably completely lost today...

                Do not escape reality : improve reality !

                B Offline
                B Offline
                Bitbeisser
                wrote on last edited by
                #8

                Yup, that "whitespace is significant" mantra of Python is pure nonsense. And together with the fact that it is an interpreter, so for real world end user application it is both too slow and insecure, it's more than just a PITA...

                1 Reply Last reply
                0
                • Y Ygnaiih

                  Python is featured as the programming language for the Raspberry PI. I’m new to this maker thing and now I am also playing with the Arduino. Last night I was working with an Arduino video and found that you can use a version of C. That was so much easier than Python. Admittedly I program in C# every day and C was my first programming language course. With the version compatibility problems in Python, all that indention thing, C is my choice. Curly braces forever!

                  M Offline
                  M Offline
                  Member 10731944
                  wrote on last edited by
                  #9

                  Umm - it's not "a version of C" - it is C (AVR C - and actually C and C++ mixed together). The compiler is GCC. The "front" you see (with the setup() and loop() functions) - those functions are called by a simple main() - essentially setup() is called first, then loop() is called over and over in a for(;;) construct (or something similar). A preprocessor loads in the main library (Arduino.h or WProgram.h - depending on the version being used) - see http://www.arduino.cc/en/Hacking/BuildProcess[^] for more details. That library is actually a huge monster - with tons of compiler directives and checks for which processor is being compiled for - to get the pin and other assignments correct. It's one reason why (on an objective scale) that Arduino code can be comparatively "slow" - because at the core, a ton of checks and other things are being done for you behind the scenes by the library (not to mention the fact that the compiler flags are set to optimize for size over speed - given that you only have a few kilobytes of program space, and even less of memory - that's a good thing). Could you make your code faster and smaller? Sure - but only at the expense of the code being able to be compiled for only one platform. If you wanted to move the code to another platform, you would be out of luck, until you modified things and recompiled. The system could have probably been made better (ie - independent main libraries per platform, instead of one single giant library) - but given it's origins (the Wiring and Processing hardware/software platform combo) - it's saddled with some baggage that seems impossible to move away from without breaking something or making it more complex for the Arduino's target audience (ie - artists and students, some of whom have never programmed or understand programming). It's also why the IDE is such a (lovable to some) dog - it's based off the Processing IDE, and shares much with it. You can go more bare metal - remember, the Arduino is not the board or the microcontroller - but an entire platform and a community. Nothing says you have to forever only use the Arduino system. If you get better at things, you can certainly ditch the bootloader, and code for the ATMega328 (or other) in straight AVR C (and include inline assembler if you want). In fact, the bootloader and the main library are all done in regular AVR C/C++ - check i

                  Y 1 Reply Last reply
                  0
                  • Y Ygnaiih

                    Python is featured as the programming language for the Raspberry PI. I’m new to this maker thing and now I am also playing with the Arduino. Last night I was working with an Arduino video and found that you can use a version of C. That was so much easier than Python. Admittedly I program in C# every day and C was my first programming language course. With the version compatibility problems in Python, all that indention thing, C is my choice. Curly braces forever!

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

                    Earl Owens wrote:

                    Curly braces forever!

                    Hear! Hear!

                    1 Reply Last reply
                    0
                    • M Member 10731944

                      Umm - it's not "a version of C" - it is C (AVR C - and actually C and C++ mixed together). The compiler is GCC. The "front" you see (with the setup() and loop() functions) - those functions are called by a simple main() - essentially setup() is called first, then loop() is called over and over in a for(;;) construct (or something similar). A preprocessor loads in the main library (Arduino.h or WProgram.h - depending on the version being used) - see http://www.arduino.cc/en/Hacking/BuildProcess[^] for more details. That library is actually a huge monster - with tons of compiler directives and checks for which processor is being compiled for - to get the pin and other assignments correct. It's one reason why (on an objective scale) that Arduino code can be comparatively "slow" - because at the core, a ton of checks and other things are being done for you behind the scenes by the library (not to mention the fact that the compiler flags are set to optimize for size over speed - given that you only have a few kilobytes of program space, and even less of memory - that's a good thing). Could you make your code faster and smaller? Sure - but only at the expense of the code being able to be compiled for only one platform. If you wanted to move the code to another platform, you would be out of luck, until you modified things and recompiled. The system could have probably been made better (ie - independent main libraries per platform, instead of one single giant library) - but given it's origins (the Wiring and Processing hardware/software platform combo) - it's saddled with some baggage that seems impossible to move away from without breaking something or making it more complex for the Arduino's target audience (ie - artists and students, some of whom have never programmed or understand programming). It's also why the IDE is such a (lovable to some) dog - it's based off the Processing IDE, and shares much with it. You can go more bare metal - remember, the Arduino is not the board or the microcontroller - but an entire platform and a community. Nothing says you have to forever only use the Arduino system. If you get better at things, you can certainly ditch the bootloader, and code for the ATMega328 (or other) in straight AVR C (and include inline assembler if you want). In fact, the bootloader and the main library are all done in regular AVR C/C++ - check i

                      Y Offline
                      Y Offline
                      Ygnaiih
                      wrote on last edited by
                      #11

                      Thank you! I've been stagnating in a job where I make web apps for a federal agency, using .NET. At my very ripe old age I feel like a nube in so many areas. The Arduino and Raspberry Pi are hobbies that take the place of vegetating in front of the TV. I have started on Jeremy Blum's Electrical Engineering series using Arduino. I am over half way into Learning Python the Hard Way. It just felt so good to be using curly braces again. BTW I am keeping a copy of your reply for reference and use as a base for further study.

                      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