AppendixC - Programming Style Guidelines HLA Programming...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Style Guidelines Beta Draft - Do not distribute © 2001, By Randall Hyde Page 1411 HLA Pr ogramming Style Guidelines Appendix C C.1 Introduction Most people consider assembly language programs dif fi cult to read. While there are a multitude of rea - sons wh y people feel this w ay , the primary reason is that assembly language does not mak e it easy for pro - grammers to write readable programs. This doesn’ t mean it’ s impossible to write readable programs, only that it tak es an e xtra ef fort on the part of an assembly language programmer to produce readable code. One of the design goals of the High Le v el Assembler (HLA) w as to mak e it possible for assembly lan - guage programmers to write readable assembly language programs. Ne v ertheless, without discipline, pande - monium will result in an y program of an y decent size. Ev en if you adhere to a fi x ed set of style guidelines, others may still ha v e trouble reading and understanding your code. Equally important to follo wing a set of style guidelines is that you follo wing a generally accepted set of style guidelines; guidelines that others are f amiliar and agree with. The purpose of this appendix, written by the designer of the HLA language, is to pro vide a consistent set of guidelines that HLA programmers can use consistently . Unless you can sho w a good reason to violate these rules, you should follo wing them carefully when writing HLA programs; other HLA programmers will thank you for this. C.1.1 Intended Audience Of course, an assembly language program is going to be nearly unreadable to someone who doesn’ t kno w assembly language. This is true for almost an y programming language. Other than b urying a tutorial on 80x86 assembly language in a program’ s comments, there is no w ay to address this problem 1 other than to assume that the reader is f amiliar with assembly language programming and specifi cally HLA. In vie w of the abo v e, it mak es sense to defi ne an "intended audience" that we intend to ha v e read our assembly language programs. Such a person should: Be a reasonably competent 80x86 assembly language/HLA programmer. Be reasonably familiar with the problem the assembly language program is attempting to solve. Fluently read English 2 . Have a good grasp of high level language concepts. Possess appropriate knowledge for someone working in the field of Computer Science (e.g., understands standard algorithms and data structures, understands basic machine architecture, and understands basic discrete mathematics). C.1.2 Readability Metrics One has to ask "What is it that mak es one program more readable than another?" In other w ords, ho w do we measure the "readability" of a program? The usual metric, "I kno w a well-written program when I see one" is inappropriate; for most people, this translates to "If your programs look lik e my better programs then the y are readable, otherwise the y are not." Ob viously , such a metric is of little v alue since it changes with e v ery person.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/08/2011 for the course CS 101 taught by Professor Jitenderkumarchhabra during the Summer '11 term at National Institute of Technology, Calicut.

Page1 / 38

AppendixC - Programming Style Guidelines HLA Programming...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online