15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

120<br />

Automating Software Engineering with CASE<br />

1. Design a program in a specific <strong>for</strong>mat, such as a UML diagram.<br />

2. Feed that model (UML diagram) in to the code generator.<br />

The code generator cranks out working code in a specific <strong>programming</strong><br />

language.<br />

3. Modify or compile this source code and have a working program that<br />

accurately reflects your original design.<br />

If you change your design, the code generator can crank out new code based<br />

on your revised design. Code generators keep your design and code synchronized.<br />

In the early days of computers when people had to write programs in assembly<br />

language, compilers were considered code generators because you could<br />

give them source code written in a language, like FORTRAN or COBOL, and<br />

the compilers would generate the proper machine language commands from<br />

that source code.<br />

Formatting source code automatically<br />

If you write a program by yourself, the source code <strong>for</strong> your entire program<br />

likely looks consistent. However, if you’re working on a large program with<br />

multiple programmers, every programmer has his or her own unique style.<br />

Ultimately, the program may work, but it resembles a patchwork collection<br />

of code where each chunk of code can look completely different even if the<br />

entire program is written in the same <strong>programming</strong> language, as shown in<br />

Figure 5-6.<br />

To solve this problem, computer scientists have created source code <strong>for</strong>matters.<br />

These programs rearrange the appearance of source code so that it<br />

appears uni<strong>for</strong>m. Now instead of looking at a patchwork collection of code<br />

written by different programmers, an entire large program can look like it<br />

was written in a single style.<br />

By looking at source code that’s <strong>for</strong>matted the same, programmers can<br />

easily read and understand the entire program.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!