15.04.2018 Views

programming-for-dummies

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

122<br />

The Pros and Cons of Software Engineering<br />

If another programmer wants to modify that same source code, the version<br />

control program may offer four choices:<br />

✦ It may simply lock anyone else from modifying any source code that’s<br />

been checked out. This prevents multiple programmers from working on<br />

different copies of the same source code.<br />

✦ It may let another programmer check out a second copy of the source<br />

code and make any changes to it. At this point, you wind up with two<br />

modified copies of the same source code.<br />

✦ When both programmers return their modified versions of the same<br />

source code back to the repository, the version control program merges<br />

all changes back into a single copy. This has the advantage of letting<br />

multiple programmers work on the same source code but also has the<br />

disadvantage that merging changes might wind up scrambling the original<br />

source code beyond recognition.<br />

✦ For additional protection, version control programs also archive old versions<br />

of source code so if someone totally messes up the program, he or<br />

she can always retrieve an earlier version of the program and start all<br />

over again.<br />

Version control programs are essential to coordinate the activities of multiple<br />

programmers, although they can also be handy <strong>for</strong> individual programmers.<br />

The main points are to<br />

✦ Always keep a copy of your old source code (so you can retrieve it again<br />

if necessary).<br />

✦ Always keep your changes to the source code organized.<br />

The Pros and Cons of Software Engineering<br />

Programming is more than just writing code and seeing if it works. The larger<br />

the program, the more complicated it gets, and the more tools you likely<br />

need to keep everything organized. Can software engineering guarantee that<br />

you’ll write better and more reliable programs? Nope.<br />

All that software engineering techniques and practices can do is encourage<br />

you to write programs by using proven techniques. However, it’s still possible<br />

to follow every software engineering principle and wind up writing a confusing<br />

program that doesn’t work.<br />

Software engineering has improved from the early days of letting programmers<br />

loose and hoping they wrote something useful, to today’s <strong>programming</strong><br />

projects with software engineering tools available to guide a project at every<br />

step of the way.

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

Saved successfully!

Ooh no, something went wrong!