April 16, 2015

Week of 04/12/15 - C++ Part 1: Learning to Develop

    With my introduction to C++, LearnCpp has shown me the process of development, which is: defining the problem, designing a solution, writing a program that implements the solution, compiling the program, linking object files, testing, and debugging.

    The first part, defining the problem, is simply figuring out what you want your program to do. You can't write code for something when you don't know what it does.

    Designing a solution is determining how you solve the problem that you defined. Apparently, this is often neglected, because there are many ways to solve the problem. Good solutions are straightforward, well documented, modularized, and can be easily extended, for future-proofing.

    Next comes writing the program. This requires knowledge of a programming language and an editor. An optimal editor is one that has line numbers, syntax highlighting, coloring, and an unambiguous font.

    Compiling comes after writing, and it requires a compiler, which checks for syntax and turns source code into an object file. I am using a Mac, which runs a unix operating system. A really well known compiler for unix is called gcc and is called from the command line. However, it is not installed by default on this Mac, so I'm going to either have to use an online service, or somehow install gcc on my Mac.

    Linking combines object files and files from the runtime support library to create an executable file. You can also compile and link files with one command.

    At the end of the intro to development page, it recommends use of an IDE for development because it bundles the software used from writing code to debugging.

    The next page makes recommendations for IDEs. It gave one suggestion that I am familiar with, called Code::Blocks. One of my friends showed me this before, so I guess I'll use it. However, it says it supports compilers, so I'm still going to have to install a working compiler, probably gcc because I have just found and downloaded an installer for it. The site also recommends using Xcode or eclipse, but eclipse doesn't look too good out of the box, and neither does Xcode. Code::Blocks and eclipse both have plugin support, so I will choose to use on of those two.

No comments: