Slashdot Mirror


What is a Good Open Source Code Analysis Tool?

carlmenezes asks: "I volunteer when I can to help a poor educational institution in India with their computing needs. As you can imagine, most computers are from donations and very little money (if any) can be spent on software licensing. Therefore, the installed software is all Open Source and I do all of the software installation by myself. I have already installed Linux on 16 PCs, with Firefox. The default desktop is KDE and the kdeedu package (klettres in particular) has several loyal fans. Incidentally, the kids don't find it hard to use at all and the lack of 3D doesn't bother them in the least :) I would like to ask the community about a good source code analysis tool. I have already installed Source Navigator. Is there any other comparable open source tool?" "The analysis tools would be for those students that show more interest than the others in programming. There is a lot of source code in there for them to look at it if they want to. I'm looking more at C/C++ than anything else. There are some very bright students and I would like them to be able to move beyond ordinary school programming if they feel like it. No, there is no Internet connection. I bring in the software on CDs and install it."

5 of 53 comments (clear)

  1. What are the requirements? by MarkLewis · · Score: 2, Insightful

    Maybe I didn't fully understand your question, so please correct me if I am mistaken.

    But what about popular C/C++ IDE's as KDevelop and Anjuta? Are those not the sort of tools you're looking for?

  2. The best tool is the human body by JPyObjC+Dude · · Score: 4, Insightful

    Just do the following:

    1) Learn how to program.
    -- nuf said.
    2) Write clean code
    -- Proper indenting **
    -- sufficient commenting
    3) Less code is more
    -- More lines is more intimidating that less
    -- However, there is a limits (ie Perl)
    -- More you can fit on one screen the easier to debug
    4) Be a structured programmer
    -- It should not matter what language you are programming in. The structures should always be the same.
    5) Learn and use language level error handling
    -- This will enable you to fully understand how to debug your code
    -- Stack traces are a must for any procedural or OO code
    6) Make your programs chatty
    -- Log files are good but make sure there is a way to easily turn off logging features so that you can speed up programs when you are happy.
    7) Learn how to tail log files
    -- tail is available on every operating system
    --- GNUUtils for win32
    --- *nix (Linux, Unix, OSX ...)
    8) Write blind code as much as possible
    -- IDE's are very powerful but I always write all my code in a text editor totally blind (no compilation, syntax validation...)
    -- If you become dependant on the system to tell you what is wrong, you will not learn to SEE the problem.
    --- Often times, when I get an error and I know I just changed a piece of code I will not even read the error. I'll just look at the line of code that I changed and visually look for the error. If you don't learn how to do this, then programming probably is not for you.
    9) Got errors, don't worry
    -- All coders get errors.
    -- Only a few times I have written dozens of lines of blind code and not gotten at least one error. I was amazed when I did.
    -- Don't get stressed out. Just be pragmatic and move being objective with the error.

    That's probably a good start.

    Personally I would not trust programs in telling me where coding problems are anyhow. I find it akin to using anti-spyware programs on a win32 box where it would be easier to just not use IE and be more concious of the operating system we use. The latter takes a little more understanding but in the end all will be better :]

    JsD
    (Java+Python+ObjC-on-BSD-with-firefox==happ iness:)

    1. Re:The best tool is the human body by angel'o'sphere · · Score: 4, Insightful


      8) Write blind code as much as possible
      -- IDE's are very powerful but I always write all my code in a text editor totally blind (no compilation, syntax validation...)
      -- If you become dependant on the system to tell you what is wrong, you will not learn to SEE the problem.
      --- Often times, when I get an error and I know I just changed a piece of code I will not even read the error. I'll just look at

      Thats probably a good way for learning programming (I learned like that, because today tools where magic at my time), but I doubt its a good way to work.
      With a good IDE you are ten times faster than with notepad like simple editors. Even VI or VIM with a good ctags/jtags support and codecompletition is already nice.

      For C++/Java etc. use Eclipse.
      For Java use Eclipse/IDEA IntelliJ or CodeGuide (in reverse order).

      Probably you should determine the language you want to teach first. If you use Python, you should look for a decent Python IDE.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  3. Doxygen by gregRowe · · Score: 2, Insightful

    Doxygen is fantastic for source code browsing. http://www.doxygen.org

    --
    There\'s no place like ~
  4. Re:Use Java instead by jdowland · · Score: 2, Insightful

    He wants a source navigator to look at existing code - how many quality open source apps are written in java? Ok, now how many of them are they likely to have experienced, using Linux/KDE/kdeedu?