Skip to main content

I just found out about V2 of the Arduino IDE (Integrated Development Environment) and downloaded it, specifically version 2.0-rc6.  Seems to have a number of modern (post-1986 ) development features and aids.  And apparently it has a debugger!!  Yippee!!!  I have debugged complex code with print statements - slow and painful to say the least.  This is especially useful as the code for running the Open Hearth simulation is growing in complexity and size (+350 SLOC) at this point.

Anybody worked with it or have any thoughts or impressions?  Any tips or gotcha's?

Thanks,

George

Original Post

Replies sorted oldest to newest

George: I am aware of the newer version but am waiting for them to work out any problems before I move away from the tried and true. I'm using version 1.8 something of the original.

The newer version doesn't look too difficult and has some nice features that are built in. I like the dark background; easy on the eyes.

I doubt that you'll run into any real problems. I'm just overly cautious. If you do find something that doesn't make sense, you should check to see if others have reported a similar situation.

The debugger might be considered a plus. But generally I find them just adding to the confusion. If you suspect a problem with your code, try something different and leave the debugger alone. Well placed print statements are just as effective for finding errors in your code and saves you the effort of learning the debugger. But don't take my word for it if you're so inclined.

I would advise that you suspect your code before jumping on the IDE as a source of problems. Even though it is a new version, they would not have put it out there without extensive in-house testing.

George: I am aware of the newer version but am waiting for them to work out any problems before I move away from the tried and true. I'm using version 1.8 something of the original.

The newer version doesn't look too difficult and has some nice features that are built in. I like the dark background; easy on the eyes.

I doubt that you'll run into any real problems. I'm just overly cautious. If you do find something that doesn't make sense, you should check to see if others have reported a similar situation.

The debugger might be considered a plus. But generally I find them just adding to the confusion. If you suspect a problem with your code, try something different and leave the debugger alone. Well placed print statements are just as effective for finding errors in your code and saves you the effort of learning the debugger. But don't take my word for it if you're so inclined.

I would advise that you suspect your code before jumping on the IDE as a source of problems. Even though it is a new version, they would not have put it out there without extensive in-house testing.

Leo,

My views on debuggers have evolved.  Back in the day (the early 1980s), I tended to rely more on print statements and what was then called "desk checking".  And the choice of language (and its readability) also had an effect.  I didn't have too much trouble with languages like Fortran.  My programs tended to be smaller.

The first (and best) in-line debugger I ever used was the VAX symbolic debugger.  This was an extraordinary piece of software - it could run and debug programs written in any VAX native high-level language (Fortran, Cobol, C, Pascal, assembler ...).

Later in my career I got involved in Ada compiler development.  Trying to debug a large piece of complex code written in Modula-2 (the Ada compiler was written in Module-2 (a 2nd generation Pascal)) with only the assembler listing (and print statements) was torturous and horribly error-prone.  It was easily the worst development environment I ever worked in.  

I also did some work in Turbo Pascal with its debugger (and second monitor).  That worked very nicely as I recall.

I definitely do consider the debugger and this new Arduino IDE a plus, especially for a language like C, which tends to be difficult to read.  The program has to keep track of many states and timings, which makes it hard to figure out where the d***** "{" and "}" match up (or if they do).  I will trust the IDE rather than my code, especially given my minimal experience with C.

George

George: I believe that the last time I used a debugger was in the early 80's to single step through some machine language code for a PDP-11. You could look at just about anything you wanted but it was tedious.

About this same time, I was introduced to the C language. You could get the compiler to output the machine language code that it generated and when I saw how well it did with that, I never looked back. Very efficient.

Symbolic debuggers for C didn't show up until a bit later. But by then I was well versed in the methods of exploratory print statements to check intermediate results. I'm still doing it that way. Who says the dinosaurs are extinct?

@BillYo414 posted:

I haven't installed it but I'll jump to it and start there since I have no real Arduino experience.

Bill,

If you've never used an IDE, the second version might be confusing.  Version 1 is on the left and resembles a simple text editor.  It's perfectly fine for starting out.  Version 2 is on the right.  I like it because it has a debugger and because it has these vertical lines that indicate and match up the open { and closing }.  It's not a big deal for simpler programs, but as the logic gets a bit more complex it is very useful.

Arduino1 IDEArduino2 IDE

If you'd like a good explanation of the differences among the IDE's, check out this YouTube video:

https://www.youtube.com/watch?v=4lTERoWGXeE

I'm telling you - YouTube is your friend on this topic.    Lots of good stuff there on the Arduino and programming.

George

Attachments

Images (2)
  • Arduino1 IDE
  • Arduino2 IDE
@BillYo414 posted:

The left picture looks more helpful because of the vertical lines to be honest @G3750. I can appreciate the way it helps organize things in bigger programs. We'll see when we get there though!

Those vertical lines (I think you meant in the image on the right) help trace the open & closed parentheses and thus keep branches of conditional "clauses" straight.  Of all the languages I've used, C is the most challenging (at least to me) in that particular aspect.  So I very much appreciate that feature and by itself probably makes my choice of IDE for me.  Because the Arduino IDE really doesn't have what's called a "pretty-printer" (a utility or feature that produces well-behaved printer listings), the alternative is to cut and paste the code into another document (Word or Notepad or the equivalent), format it to fit on a page, print it, and then use a ruler to match up the parentheses.  Ugh - it's 1975 again!     Might as well go back to punch cards...  

George

George: The IDE has an "auto format" feature that will align brackets and indentation in a standard way. I use it all the time. If you're missing a closing bracket, this helps to show what's missing or out of alignment vertically. It will also apply a standard look for the long comment sections that start with "/*" and end with "*/".

I would suggest reducing the length of your code by using more functions to isolate common procedures or just to better organize the pieces into smaller chunks. Some of these subroutines may even be put into different files to help isolate their use.

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×