IDEs

Introduction

What

๐Ÿ† Can explain IDEs

Professional software engineers often write code using Integrated Development Environments (IDEs). IDEs support all development-related work within the same tool.

An IDE generally consists of:

  • A source code editor that includes features such as syntax coloring, auto-completion, easy code navigation, error highlighting, and code-snippet generation.
  • A compiler and/or an interpreter (together with other build automation support) that facilitates the compilation/linking/running/deployment of a program.
  • A debugger that allows the developer to execute the program one step at a time to observe the run-time behavior in order to locate bugs.
  • Other tools that aid various aspects of coding e.g. support for automated testing, drag-and-drop construction of UI components, version management support, simulation of the target runtime platform, and modeling support.

Examples of popular IDEs: Eclipse, Intellij IDEA, NetBeans, Visual Studio, DevC++, DrJava, XCode

Note: Some experienced developers, in particular those with a UNIX background, prefer lightweight yet powerful text editors with scripting capabilities (e.g. Emacs) over heavier IDEs.

  • a. Compiling.
  • b. Syntax error highlighting.
  • c. Debugging.
  • d. Code navigation e.g., to navigate from a method call to the method implementation.
  • e. Simulation e.g., run a mobile app in a simulator.
  • f. Code analysis e.g. to find unreachable code.
  • g. Reverse engineering design/documentation e.g. generate diagrams from code
  • h. Visual programming e.g. Write programs using โ€˜drag and dropโ€™ actions instead of typing code.
  • i. Syntax assistance e.g., show hints as you type.
  • j. Code generation e.g., to generate the code required by simply specifying which component/structure you want to implement.
  • k. Extension. i.e. ability add more functionality to the IDE using plugins.
  • l. All of the above are present in most IDEs and some have even more features.

l

Explanation: While all of these features may not be present in some IDEs, most do have these features in some form or other.

Debugging

What

๐Ÿ† Can explain debugging

Debugging is the process of discovering defects in the program. Here are some approaches to debugging:

  • ๐Ÿ‘Ž By inserting temporary print statements: This is an ad-hoc approach in which print statements are inserted in the program to print information relevant to debugging, such as variable values. e.g. Exiting process() method, x is 5.347. This approach is not recommended due to these reasons.

    • Incurs extra effort when inserting and removing the print statements.
    • Unnecessary program modifications increases the risk of introducing errors into the program.
    • These print statements, if not promptly removed, may even appear unexpectedly in the production version.
  • ๐Ÿ‘Ž By manually tracing through the code: Otherwise known as โ€˜eye-ballingโ€™, this approach doesn't have the cons of the previous approach, but it too is not recommended (other than a 'quick try') due to these reasons:

    • It is difficult, time consuming, and error-prone technique. If you didn't spot the error while writing code, you might not spot the error when reading code too.
  • ๐Ÿ‘ Using a debugger: A debugger tool allows you to pause the execution, then step through one statement at a time while examining the internal state if necessary. Most IDEs come with an inbuilt debugger. This is the recommended approach for debugging.