Thread: How important is objective oriented programming and Debugging for microcontrollers?

  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    40

    How important is objective oriented programming and Debugging for microcontrollers?

    How important is objective based programming and Debugging for programming microcontrollers?

    There's a chapter in my book called "objective oriented programming" and another called "Debugging Programs."

    How importnat are these 2 things when it comes to programming microcontrollers like PICs and Arduinos?

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Debugging is always important. The programming methodology you choose to implement affects the way you debug. Since in object oriented programming your variables are encapsulated, you only have to look to operations that modify a certain variable related to a bug.

    Object oriented programming is possible on microcontrollers, but the ease of implementation will depend on the language you choose.

  3. #3
    Registered User
    Join Date
    Jan 2013
    Posts
    40
    Quote Originally Posted by whiteflags View Post
    Debugging is always important. The programming methodology you choose to implement affects the way you debug. Since in object oriented programming your variables are encapsulated, you only have to look to operations that modify a certain variable related to a bug.

    Object oriented programming is possible on microcontrollers, but the ease of implementation will depend on the language you choose.
    I will be using C to program the microcontrollers. What language will "ease the implementation?"

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    C++ or Java if they are available choices are good options. Since you are using C, you will probably want to search the web for C-related ways to use OOP, if you are interested. Search | Embedded

  5. #5
    Registered User
    Join Date
    Jan 2013
    Posts
    40
    Quote Originally Posted by whiteflags View Post
    C++ or Java if they are available choices are good options. Since you are using C, you will probably want to search the web for C-related ways to use OOP, if you are interested. Search | Embedded
    Ahh I don't know those 2 languages. Is there a disadvantage to using C?

  6. #6
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Not really. I am keeping my replies relevant to your question.

  7. #7
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Arduino is an implementation of C++ which uses OOP - This can simplify some designs.

    At the moment, I program a PIC in C for a living, and I always try to set up objects using structs and divide the program into different sections. Note that if you want function calls from a struct, use function pointers.

    For my last program, I chose a paradigm called "cooperative multitasking", which isolates the controlling code into different sections. I used the struct objects to divide the code in different sections.

    Bottom line is that you need to make sure your code is organised and it's up to you how you do it.
    Fact - Beethoven wrote his first symphony in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 01-16-2013, 07:59 PM
  2. Replies: 6
    Last Post: 11-04-2010, 12:30 PM
  3. C Programming for Microcontrollers
    By CB4 in forum C Programming
    Replies: 4
    Last Post: 03-07-2005, 08:34 AM
  4. does anyone here do programming in objective C
    By Silvercord in forum C++ Programming
    Replies: 7
    Last Post: 03-19-2003, 03:48 PM
  5. Programming Objective C in Mac OSX
    By MacUser in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-17-2002, 08:12 AM