Coding Conventions for C++ and Java applications
|
|
|
- Candace Johnston
- 10 years ago
- Views:
Transcription
1 Coding Conventions for C++ and Java applications Table of Contents Source Code Organization Files and project organization Header Files Naming Conventions Function Names Class Names Variable Names Source Documentation Module Comments and Revision History Commenting Data Declarations Commenting Control Structures Commenting Routines Programming Conventions Use of Macros Constants and Enumerations Use of return, goto and throw for flow control Error Handling Style and Layout Testing/Debug Support Class Invariant Assertions and Defensive Programming Validation Tests Tracing Conclusion Section Contents Subscribe to our list to be notified by when there is a new Column. Archive of past columns A full list of our software development articles from previous weeks Coding Conventions for C++ and Java One of our most popular pages -- Coding conventions for C++ and Java, written by our Chief Architect and used by our developers. (1 of 16) [10/1/2000 7:12:06 PM]
2 Glossary References History Other Coding Conventions on the Web Source Code Organization Files and project organization The name of files can be more than eight characters, with a mix of upper case and lower-case. The name of files should reflect the content of the file as clearly as possible. As a rule of thumb, files containing class definitions and implementations should contain only one class. The name of the file should be the same as the name of the class. Files can contain more than one class when inner classes or private classes are used. Special care should be given to the naming of header files because of potential conflicts between modules. If necessary, a module prefix could be added to the filename. For example, if two modules have a garbage collector class: Database and Window, the files could be named: "DBGarbageCollector.H" and "WINDOWGarbageCollector.H". The following table illustrates the standard file extensions used. Extension Description.C C Source Files.CPP C++ Source files.h C/C++ Header files.inl C++ Inline function files.idl (.ODL) Interface Description language.rc Resource Script.Java Java Source file Header Files Include Statements Include statements should never refer to a header file in terms of absolute path. For example, the following statement: #include "/code/telephonymgr/include/tmphoneline.h" is wrong, while: #include "TMPPhoneLine.h" is right provided that the makefile has the appropriate paths set-up for compilation. Also: #include "../include/tmphoneline.h" (2 of 16) [10/1/2000 7:12:06 PM]
3 is also right if the project topology is a "relative" topology where include files could be gathered in common areas. Multiple Inclusion of a header file As you probably know, multiple inclusion of a header file can have unexpected and unwanted effects. To avoid this, guarding pre-compiler code must be added to every header file. #ifndef _TMPhoneLine_H_ #define _TMPhoneLine_H_... Rest of Header File... #endif // _TMPhoneLine_H_ To avoid the possibility of a naming conflict, DevStudio will often append a GUID to the filename in the #define statement. This is not a necessary practice unless it is used to avoid an existing conflict. The use of the "#pragma once" directive is allowed and encouraged to optimize compilation times. However, it doesn't replace the #ifndef guarding block because it is a non-standard extension of Microsoft's compiler and therefore not portable. Ideally, every header file should look like this. #pragma once #ifndef _Filename_H_ #define _Filename_H_... Rest of Header File... #endif // _Filename_H_ All header files must be self-sufficient, such that a module including the file does not need to explicitly include other header files required by the interface. The header file must include other header files depended upon. Naming Conventions Function Names Class member functions follow Java conventional naming. The function name is a concatenated string of words with the first letter of all word capitalized except for the first one. For example: ismemberset, printreport, consume. Functions exported from DLLs, that are not in a class or a namespace should include an uppercase abbreviation of the module name. For example: DEBUGTrace or DBGTrace. A good name for a routine clearly describes everything the routine does. Here are guidelines for creating effective routine names. (The guidelines are quoted from [MCCO01]. In this context, we should not consider procedures that only return an error code as functions. They should be seen a procedures.) (3 of 16) [10/1/2000 7:12:06 PM]
4 For a procedure name, use a strong verb followed by an object. A procedure with functional cohesion usually performs an operation on an object. The name should reflect what the procedure does, and an operation on an object implies a verb-plus-object name. printreport(), calcmonthlyrevenues(), and repaginatedocument() are samples of good procedure names. In object-oriented languages, you don't need to include the name of the object in the procedure name because the object itself is included in the call. For a function name, use a description of the return value. A function returns a value, and the function should be named for the value it returns. For example, cos(), nextcustomerid(), printerready(), and currentpencolor() are all good function names that indicate precisely what the functions return. Avoid meaningless or wishy-washy verbs. Some verbs are elastic, stretched to cover just about any meaning. Routine names like handlecalculation(), performservices(), processinput(), and dealwithoutput() don't tell you what the routines do. At the most, these names tell you that the routines have something to do with calculations, services, input, and output. The exception would be when the verb "handle" was used in the specific technical sense of handling an event. Sometimes, the only problem with a routine is that its name is wishy-washy, the routine itself might actually be well designed. If handleoutput() is replaced with formatandprintoutput(), you have a pretty good idea of what the routine does. In other cases, the verb is vague because the operations performed by the routine are vague. The routine suffers from a weakness of purpose, and the weak name is a symptom. If that's the case, the best solution is to restructure the routine and any related routines so that they all have stronger purposes and stronger names that accurately describe them. The properties of a class should be accessible through getter and/or setter methods. Those methods should always be declared like this: public get(); public void set( a); For boolean properties, the use of "is" can replace the "get": public boolean is(); Examples: Color getcurrentpencolor() void setcurrentpencolor(color c) boolean isprinterready() void setprinterready(boolean ready) Class Names Classes follow Java conventional naming. The name is a concatenated string of words with the first letter of all word capitalized. For example: FocusEvent, DeviceContext, Customer. Interface names follow COM conventional naming. The name is a concatenated string of (4 of 16) [10/1/2000 7:12:06 PM]
5 words with the first letter of all word capitalized. A capital "I" is used as a prefix. For example: IWindowModel, IUnknown. Variable Names Variable names are a concatenated string of words with the first letter of all word capitalized except for the first one. The name chosen should clearly represent the content of the variable. For example: windowhandle, eventconsumed, index. All variables that are a member of a class should have a "m_" prefix. For example: m_windowhandle, m_eventconsumed, m_index. Constant (static final for Java) variables make exception to all these rules. They should follow the same standard as C++ #define statements. Constant variables should be named using capitalized names separated by an underscore character ('_'). For example: MAX_ARRAY_LENGTH, SIZE_PROPERTY_NAME. Source Documentation When applicable, all source documentation should be in a format compatible with JavaDoc formatting. However, it is important that the formatting codes included in the comment blocks do not overwhelm the comment block. Don't forget that the comment block is meant to be read in the source first. Inline comments should be made with the "//" comment style and should be indented at the same level as the code they describe. End of line comments should be avoided with the exception of function parameters. Module Comments and Revision history Module headers are block headers placed at the top of every implementation file. The block comment should contain enough information to tell the programmer if she reached her destination. /* ** FILE: filename.cpp ** ** ABSTRACT: ** A general description of the module's role in the ** overall software architecture, What services it ** provides and how it interacts with other components. ** ** DOCUMENTS: ** A reference to the applicable design documents. ** (5 of 16) [10/1/2000 7:12:06 PM]
6 ** AUTHOR: ** Your name here ** ** CREATION DATE: ** 14/03/1998 ** ** NOTES: ** Other relevant information */ Note that all the block comments illustrated in this document have no pretty stars on the right side of the block comment. This deliberate choice was made because aligning those pretty stars is a large waste of time and discourages the maintenance of in-line comments. It is sometimes useful to include a history of changes in the source files. With all the new source control tools now available, this information is duplicated in the source control database. If you choose, you can use a revision history block in your modules. However, only use the revision history block if you intend to maintain it. It is pretty much useless when it's not maintained properly. Here's the preferred style for a revision history block: /* ** HISTORY: ** Nov 91 - M. Taylor - Creation ** Dec 91 - J. Brander - Insert validation for ** unitlength to detect ** buffer overflow */ Commenting Data Declarations Comments for variable declarations describe aspects of the variable that the name can't describe. Comment the units of numeric data. If a number represents lengths, indicate whether it is expressed in inches, feet, meters or kilometers. If its time, indicate whether it's expressed in elapsed seconds since , milliseconds since the start of the program and so on. Comment the range of allowable numeric values. If a variable has an expected range of values, document the expected range. (6 of 16) [10/1/2000 7:12:06 PM]
7 Document flags to the bit level. If a variable is used as a bit field, document the meaning of each bit. Document global data. If global data is used, annotate each piece well at the point which it is declared. The annotation should indicate the purpose of the data and why it needs to be global. Commenting Control Structures The place before a control structure is usually a natural place to put a comment. If it is an if or a case statement, you can provide the reason for the decision and a summary of the outcome. If it is a loop, you can indicate the purpose of the loop. Commenting Routines Here are a few guidelines about commenting routines. Describe each routine in one or two sentences at the top of the routine. If you can't describe the routine in a short sentence or two, you probably need to think harder about what it is supposed to do. It might be a sign that the design isn't as good as it should be. Don't be tempted to explain everything in the block header. Instead, add comments in the code close to the code that it is commenting. It will be much more tempting to maintain those comments if the code changes. In the block header, indicate which variables are input and output variables. To help describe the interface of a method, attributes similar to the ones used in.idl could be used. ([in], [out], [in, out]) In addition, the return of function should also be described. Document variables where they are declared. If you're not using global data, the easiest way to document variables is to put comments next to their declarations. Document interface assumptions. Like the fact that a variable has to be initialized before being passed. Comment on the routine's limitations. If the routine provides a numeric result, document the accuracy of the result. If the computations are undefined under certain conditions, document the conditions. If you ran into gotchas during the development of the routine, document them too. Document the routine's global effect. If the routine modifies global data, describe exactly what it does to the global data. Don't forget that global data is as much a part of your interface as parameters are. Document the source of algorithms that are used. If you have used an algorithm from a book or magazine, document the volume and page number you took it from. If you developed the algorithm yourself, indicate where the reader can find the notes you've made about it. Programming Conventions (7 of 16) [10/1/2000 7:12:06 PM]
8 Use of Macros In the past, parameterized macros were used frequently instead of simple routines. This was done mostly for performance reasons. This is not necessary with compilers that are more modern because they can be replaced by inline routines. Macros are very hard to debug because the compiler doesn't generate the proper symbols for it. Unless they are necessary for conditional compilation or a similar purpose, they should not be used and should be replaced by inline routines. Constants and Enumerations It is generally good practice to replace literal values (strings and numbers) by a more descriptive identifier. It is very frequent to see #define statements used to create those identifiers. Instead of using a #define statement, constant variables should be used. Constant variables carry type information and are protected by the compiler from some dangerous forms of "implicit" translation. Furthermore, the debugger can show the value of a constant variable. It cannot show the value of a #define identifier. For similar reasons, enumerated types should be used for defining groups of values that are related together. (Flags passed to a routine for example) Use of return, goto and throw for flow control According to [MCCO01]: Computer scientists are zealous in their beliefs, and when the discussion turns to gotos, they get out their jousting poles, armor and maces, mount their horses and charge through the gates of Camelot to the holy wars. According to common programmer lore: Each function must have a single entry and exit structure. The use of multiple return statements to return control from a function may only occur to handle error exits. The use of gotos should be avoided at all costs. Most programmers agree with these guidelines and they are good ideas in principle. In practice however, it is not rare to see a routine that needs more than one exit structure. The major risk of using returns to prematurely leave a routine is to leave some resources behind. Cleaver use of classes makes it easier for resources to be picked-up in case of a premature exit. This is one of the ideas behind CStrings and smart pointers. One simple way to avoid multiple exit points is to use a goto statement. This will be considered the only acceptable use of a goto statement. If your routine needs to terminate prematurely and has resources to clean-up, the use of a goto is allowed if it is used in the following manner: HRESULT theroutine() HRESULT theresult = S_OK; (8 of 16) [10/1/2000 7:12:06 PM]
9 ? Some code here? if (SomeExceptionalCondition) theresult = S_FAILED; goto RoutineCleanup;? Some more code here? RoutineCleanup:? Free the resources used by the routine? return theresult; In java, the same example can be written using the finally() clause: int theroutine() int theresult = S_OK; try? Some code here? if (SomeExceptionalCondition) throw new SuperException();? Some more code here? finally()? Free the resources used by the routine? return theresult; In the case of exceptional conditions, it is sometimes useful to simply throw an (9 of 16) [10/1/2000 7:12:06 PM]
10 exception. If you want to use the throw statement, you have to exercise the same cautions as when using the return statement. Throw statements constitute an exit point of your routine and your have to make sure that all the resources that the routine uses are cleaned-up automatically. Fortunately, objects declared on the stack will be cleaned-up properly. In addition, routines that throw exceptions must mention it in their documentation. If you are the caller of routines that can throw exceptions, it is important that you prepare for that eventuality. You can decide to catch the exception yourself and handle it. You can also decide to let it pass through. If you do, you must behave as if you were throwing the exception yourself and mention it in your documentation. For Java programs, in addition to mentioning the exception in your documentation, adding the throws clause is mandatory. Never forget that exceptions should be used for exceptional conditions. They are a heavyweight technique for controlling flow. They shouldn't be used for "casual" flow control because they are slow. If you are writing a routine that is accessible through a COM interface, you cannot throw exceptions as COM doesn't support it. Pointers to objects declared on the stack will not be freed automatically when an exception is thrown. Error Handling Many programmers think that: As a rule, all functions calls returning diagnostic data (i.e. indication of success, failure, time-out, error, etc.?) should be followed by error checking code. In certain situations, when no meaningful error handling may be devised, diagnostic return data can be ignored. Such cases, however, form the exception rather than the norm and have to be individually justified and commented. Again, this is a very good idea in principle. However, this can lead to two things: No one will write routines that send a return value. More than 90 percent or your program is going to be error handling code. Let's try those guidelines instead. A failure should never leave a class in an undefined state. The class can be put in a state where it can't do much but it should be a defined state. For example, if you are writing a file class, failure to open the physical file shouldn't put the class in limbo. The class can't do much else but it will not fail. An error should be detected and handled if it affects the execution of the rest of a routine. For example, if you try to allocate a resource and it fails, this affects the rest of the routine if it uses that resource. This should be detected and proper action taken. However, if releasing a resource fails, it doesn't affect the rest of the routine? It can therefore be ignored. (What are you going to do about it anyway?) In an error is detected in a routine, consider notifying your caller. If the error has a potential to affect your caller, it is important that the caller be notified. For example, the "Open" methods of a file class should return error conditions. Even if the class stays in a valid state and other calls to the class will be handled properly, the caller might be interested in doing some error handling of his own. (10 of 16) [10/1/2000 7:12:06 PM]
11 Don't forget that error handling code is code. It can also be defective. It is important to write a test case that will exercise that code. Don't design a routine where error conditions are identified as a special case of an "out" parameter. Instead, use a specific error condition parameter. That will make the logic of the caller much simpler and easier to understand. For example, try and avoid methods that return null to identify a specific error case. Style and Layout Layout, like goto is a religious issue with most programmers. Layout is more like the aesthetic aspect of code and that is mostly a matter of personal preference. However, one should not forget that the fundamental theorem of formatting is that good visual layout should show the logical structure of the program. A complete chapter of Code Complete [MCCO01] is dedicated to code layout. Layout Styles This document presents one layout style called the "Begin-end". You can can add personal variations to the style but it is important that you stay consistent and that the layout style doesn't change through a single file. Note: All "tabs" in the proposed layout are set to 2 spaces. The settings of your editor should be set to replace all tabs with spaces. void checksomething( int firstparameter, string secondparameter) char currentchar; dosomething(); while (condition) dosomething(); dosomethingelse(); if (condition) dosomething(); switch (condition) case CASE_1: dosomething(); (11 of 16) [10/1/2000 7:12:06 PM]
12 break; case CASE_2: dosomething(); break; default: dosomething(); Complicated Expressions For complicated expressions, separate conditions should be on separate lines. For example: if ((?0' <= inputchar && inputchar <=?9') (?a' <= inputchar &&inputchar <=?z') (?A' <= inputchar && inputchar <=?Z')) dosomething(inputchar); Should be replaced by: if ( (?0' <= inputchar && inputchar <=?9') (?a' <= inputchar && inputchar <=?z') (?A' <= inputchar && inputchar <=?Z') ) dosomething(inputcharput); Large Function Calls When a routine has a large parameter list, or when its name is very long, typing it all in one single line makes the program hard to read. The preferred way to layout such a function is to align the parameters with the end of the function name to make it stand (12 of 16) [10/1/2000 7:12:06 PM]
13 out. drawline( Window.north, Window.south, Window.east, Window.west, currentwidth, currentheight); When the function name is very long or the variables passed as parameters have long names. The parameters should be aligned 2 characters passed the name of the method. theclientwindow.drawfilledpolyline( Window.north, Window.south, Window.east, Window.west, currentwidth, currentheight, normalbackgroundfillcolor); Testing/Debug Support In this section, the term "non-trivial routine" Is used. There is no formal definition of a non-trivial routine. The definition is left to the programmer at coding time and to the reviewer at review time. Class Invariant According to [MCGR01]: The class invariant is a statement about constraints on objects that belong to the class. These constraints should always be maintained by the implementation. In other words, the class invariant is a condition that always holds true for a class no matter what state it's in. For example: The invariant for a queue class might contain a clause that requires that the current size of the queue be between zero and the maximum size of the queue inclusive. Every class should supply a function to perform a sanity check on the class that will verify if the class invariant holds. Assertions and Defensive Programming Each non-trivial routine in your classes should have the following parts before performing (13 of 16) [10/1/2000 7:12:06 PM]
14 any actions. Sanity check Parameter checking Method Invariant The routine should call the sanity check method to verify that the class invariant still holds. The routine should verify that all the parameters passed to the routine are valid in their type, value and range. An invalid parameter that would disrupt the behavior of the routine should be caught at this point and terminate the routine. In addition to performing the sanity check for the class, the routine should make sure that the class is in a proper state for this routine to be called. For example, you can't remove an item from a list if it is empty. All of these checks should use an ASSERT statement to complain loudly if something goes wrong. In a release build, those ASSERT statements should be compiled-out. Don't use assertions to check error codes of a function. If a function can fail, you should handle the error with "real" error handling code, not an assertion. You can still use an assertion to complain loudly for debugging purposes. Use assertions to guard pieces of code that should never logically be executed. Like virtual methods that you expect to be overwritten by a derived class or the default clause of a switch statement. Don't forget that assertions are compiled-out of production code. Don't put anything else but conditions in ASSERT statements. Any code put into an assertion statement will not be executed in the production version of you program. For example, don't do: ASSERT(pFile = fopen(...)!= NULL); How much defensive programming should be left in production code? Remove code that hinders performance. In your debug build, special error checking code has the potential to reduce the performance of a system. If this is the case, it is important to remove that code from the production build. Leave in code that checks for important errors. Decide which errors can slip through the cracks without too much effect. For example, a test that verifies that a string fits in a dialog is only a cosmetic check and can be removed. However, a test that verifies that states are valid for telephony events should stay in because it might result in dropped calls. Leave in code that helps the program crash gracefully. If your routine performs validation on the parameters it receives and this helps your function degrade gracefully when parameters are wrong, that code should be left in. See that the messages you leave in the code are friendly. Never forget that the messages you display for debugging and tracing might make it in production code. Validation Tests If possible, build tests into your subsystems instead of on top of them. If you know of a second algorithm that can test your first one (even if it much slower or takes more memory), code it and put it in debug code, running alongside with your production code. (14 of 16) [10/1/2000 7:12:06 PM]
15 If you optimize an algorithm in your system, the old algorithm can make a very good validation test. Have it run with your new algorithm and ASSERT that the results are the same. You shouldn't worry too much about the performance of the system in this case because your validation test will be compiled-out of production code. Conclusion Glossary Term Description A related group of classes. Usually used to implement a feature or Class Category function of the system COM Component Object Model. Microsoft's Object technology DevStudio Microsoft's development environment. GUID Globally Unique Identifier References MAGU01 Writing Solid Code, Steve Maguire, Microsoft Press MCCO01 Code Complete, Steve Mcconnel, Microsoft Press Functional testing of classes, John D. McGregor Dept. of C.S. Clemson MCGR01 University History Date Contributor Comments 16/01/1998 Francis Beaudet Creation Added standard for function naming of property 20/01/1998 Claude Monpetit accessors. Added the mandatory use of the throws clause. 22/01/98 Fred Boulanger Stephane Lussier Added the mention of the "spaces for tabs" note. Added the creation date to the module header. Clarified the portion about commenting parameters. Clarified the restriction for the "one class per file" rule. Other Coding Conventions on the Web Java Coding Standard by Doug Lea, Professor of Computer Science, State University of New York (15 of 16) [10/1/2000 7:12:06 PM]
16 Writing Robust Java Code - AmbySoft's Java Coding Standards Disclaimer and other small print: The code in this article is provided "as is". Any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author or contributors be liable for any direct indirect, incedental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, profits, or limbs; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software code, even if advised of the possiblity of such damage. [HOME] [SYNDEO] [NEWS] [COMPANY] [SERVICES] [COLUMN] [CAREERS] [CONTACT US] Macadamian Technologies Inc. - [email protected] Copyright Macadamian Technologies Inc. - All Rights Reserved To Comment on our Web Site - [email protected] (16 of 16) [10/1/2000 7:12:06 PM]
Some Scanner Class Methods
Keyboard Input Scanner, Documentation, Style Java 5.0 has reasonable facilities for handling keyboard input. These facilities are provided by the Scanner class in the java.util package. A package is a
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON
PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London
Hands-on Exercise 1: VBA Coding Basics
Hands-on Exercise 1: VBA Coding Basics This exercise introduces the basics of coding in Access VBA. The concepts you will practise in this exercise are essential for successfully completing subsequent
Taxi Service Coding Policy. Version 1.2
Taxi Service Coding Policy Version 1.2 Revision History Date Version Description Author 2012-10-31 1.0 Initial version Karlo Zanki 2012-11-18 1.1 Added a section relative to Java/Android Fabio Kruger 2013-01-02
CHAPTER 4 ESSENTIAL DATA STRUCTRURES
CHAPTER 4 ESSENTIAL DATA STRUCTURES 72 CHAPTER 4 ESSENTIAL DATA STRUCTRURES In every algorithm, there is a need to store data. Ranging from storing a single value in a single variable, to more complex
Introduction to Python
WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language
AppendixA1A1. Java Language Coding Guidelines. A1.1 Introduction
AppendixA1A1 Java Language Coding Guidelines A1.1 Introduction This coding style guide is a simplified version of one that has been used with good success both in industrial practice and for college courses.
Software Engineering Techniques
Software Engineering Techniques Low level design issues for programming-in-the-large. Software Quality Design by contract Pre- and post conditions Class invariants Ten do Ten do nots Another type of summary
First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science
First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca
Coding conventions and C++-style
Chapter 1 Coding conventions and C++-style This document provides an overview of the general coding conventions that are used throughout oomph-lib. Knowledge of these conventions will greatly facilitate
Designing with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219
Designing with Exceptions CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Testing vs. Debugging Testing Coding Does the code work properly YES NO 2 Debugging Testing
Communication Protocol
Analysis of the NXT Bluetooth Communication Protocol By Sivan Toledo September 2006 The NXT supports Bluetooth communication between a program running on the NXT and a program running on some other Bluetooth
csce4313 Programming Languages Scanner (pass/fail)
csce4313 Programming Languages Scanner (pass/fail) John C. Lusth Revision Date: January 18, 2005 This is your first pass/fail assignment. You may develop your code using any procedural language, but you
The Power of Ten Rules for Developing Safety Critical Code 1. Gerard J. Holzmann NASA/JPL Laboratory for Reliable Software Pasadena, CA 91109
The Power of Ten Rules for Developing Safety Critical Code 1 Gerard J. Holzmann NASA/JPL Laboratory for Reliable Software Pasadena, CA 91109 Most serious software development projects use coding guidelines.
Import Filter Editor User s Guide
Reference Manager Windows Version Import Filter Editor User s Guide April 7, 1999 Research Information Systems COPYRIGHT NOTICE This software product and accompanying documentation is copyrighted and all
Setting Up Database Security with Access 97
Setting Up Database Security with Access 97 The most flexible and extensive method of securing a database is called user-level security. This form of security is similar to methods used in most network
C Coding Style Guide. Technotes, HowTo Series. 1 About the C# Coding Style Guide. 2 File Organization. Version 0.3. Contents
Technotes, HowTo Series C Coding Style Guide Version 0.3 by Mike Krüger, [email protected] Contents 1 About the C# Coding Style Guide. 1 2 File Organization 1 3 Indentation 2 4 Comments. 3 5 Declarations.
CSE 308. Coding Conventions. Reference
CSE 308 Coding Conventions Reference Java Coding Conventions googlestyleguide.googlecode.com/svn/trunk/javaguide.html Java Naming Conventions www.ibm.com/developerworks/library/ws-tipnamingconv.html 2
The programming language C. sws1 1
The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan
Computing Concepts with Java Essentials
2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann
IVI Configuration Store
Agilent Developer Network White Paper Stephen J. Greer Agilent Technologies, Inc. The holds information about IVI drivers installed on the computer and configuration information for an instrument system.
Outline. 1 Denitions. 2 Principles. 4 Implementation and Evaluation. 5 Debugging. 6 References
Outline Computer Science 331 Introduction to Testing of Programs Mike Jacobson Department of Computer Science University of Calgary Lecture #3-4 1 Denitions 2 3 4 Implementation and Evaluation 5 Debugging
C++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
KITES TECHNOLOGY COURSE MODULE (C, C++, DS)
KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php [email protected] [email protected] Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL
Getting Started with IntelleView POS Administrator Software
Getting Started with IntelleView POS Administrator Software Administrator s Guide for Software Version 1.2 About this Guide This administrator s guide explains how to start using your IntelleView POS (IntelleView)
Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas
CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage
Programming in Access VBA
PART I Programming in Access VBA In this part, you will learn all about how Visual Basic for Applications (VBA) works for Access 2010. A number of new VBA features have been incorporated into the 2010
Volume I, Section 4 Table of Contents
Volume I, Section 4 Table of Contents 4 Software Standards...4-1 4.1 Scope...4-1 4.1.1 Software Sources...4-2 4.1.2 Location and Control of Software and Hardware on Which it Operates...4-2 4.1.3 Exclusions...4-3
How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)
TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions
CISC 181 Project 3 Designing Classes for Bank Accounts
CISC 181 Project 3 Designing Classes for Bank Accounts Code Due: On or before 12 Midnight, Monday, Dec 8; hardcopy due at beginning of lecture, Tues, Dec 9 What You Need to Know This project is based on
Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
#!/usr/bin/perl use strict; use warnings; use Carp; use Data::Dumper; use Tie::IxHash; use Gschem 3; 3. Setup and initialize the global variables.
1. Introduction. This program creates a Bill of Materials (BOM) by parsing a gschem schematic file and grouping components that have identical attributes (except for reference designator). Only components
Hypercosm. Studio. www.hypercosm.com
Hypercosm Studio www.hypercosm.com Hypercosm Studio Guide 3 Revision: November 2005 Copyright 2005 Hypercosm LLC All rights reserved. Hypercosm, OMAR, Hypercosm 3D Player, and Hypercosm Studio are trademarks
Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:
Introduction to Programming and Algorithms Module 2 CS 146 Sam Houston State University Dr. Tim McGuire Introduction To Computers And Java Chapter Objectives To understand: the meaning and placement of
ECE 341 Coding Standard
Page1 ECE 341 Coding Standard Professor Richard Wall University of Idaho Moscow, ID 83843-1023 [email protected] August 27, 2013 1. Motivation for Coding Standards The purpose of implementing a coding standard
Week 2 Practical Objects and Turtles
Week 2 Practical Objects and Turtles Aims and Objectives Your aim in this practical is: to practise the creation and use of objects in Java By the end of this practical you should be able to: create objects
ACCESS 2007. Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818) 677-1700
Information Technology MS Access 2007 Users Guide ACCESS 2007 Importing and Exporting Data Files IT Training & Development (818) 677-1700 [email protected] TABLE OF CONTENTS Introduction... 1 Import Excel
Understanding class definitions
OFWJ_C02.QXD 2/3/06 2:28 pm Page 17 CHAPTER 2 Understanding class definitions Main concepts discussed in this chapter: fields methods (accessor, mutator) constructors assignment and conditional statement
Lecture 5: Java Fundamentals III
Lecture 5: Java Fundamentals III School of Science and Technology The University of New England Trimester 2 2015 Lecture 5: Java Fundamentals III - Operators Reading: Finish reading Chapter 2 of the 2nd
CS106A, Stanford Handout #38. Strings and Chars
CS106A, Stanford Handout #38 Fall, 2004-05 Nick Parlante Strings and Chars The char type (pronounced "car") represents a single character. A char literal value can be written in the code using single quotes
CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions
CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly
1 Using CWEB with Microsoft Visual C++ CWEB INTRODUCTION 1
1 Using CWEB with Microsoft Visual C++ CWEB INTRODUCTION 1 1. CWEB Introduction. The literate programming technique is described by Donald Knuth in Literate Programming and The CWEB System for Structured
[MD5 Message Digests] derived from the RSA Data Security, Inc. MD5 Message Digest Algorithm
[MD5 Message Digests] derived from the RSA Data Security, Inc. MD5 Message Digest Algorithm [RegExp] Copyright (c) 1986, 1993, 1995 by University of Toronto. Written by Henry Spencer. THIS IS AN ALTERED
Consulting. Personal Attention, Expert Assistance
Consulting Personal Attention, Expert Assistance 1 Writing Better SQL Making your scripts more: Readable, Portable, & Easily Changed 2006 Alpha-G Consulting, LLC All rights reserved. 2 Before Spending
3 Improving the Crab more sophisticated programming
3 Improving the Crab more sophisticated programming topics: concepts: random behavior, keyboard control, sound dot notation, random numbers, defining methods, comments In the previous chapter, we looked
Appendix K Introduction to Microsoft Visual C++ 6.0
Appendix K Introduction to Microsoft Visual C++ 6.0 This appendix serves as a quick reference for performing the following operations using the Microsoft Visual C++ integrated development environment (IDE):
Dinopolis Java Coding Convention
Dinopolis Java Coding Convention Revision : 1.1 January 11, 2001 Abstract Please note that this version of the Coding convention is very much based on IICM s internal Dino coding convention that was used
1 Abstract Data Types Information Hiding
1 1 Abstract Data Types Information Hiding 1.1 Data Types Data types are an integral part of every programming language. ANSI-C has int, double and char to name just a few. Programmers are rarely content
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm
INSTALL NOTES Elements Environments Windows 95 Users
NEURON DATA INSTALL NOTES Elements Environments Windows 95 Users Modifying Environment Variables You must modify the environment variables of your system to be able to compile and run Elements Environment
AN11241. AES encryption and decryption software on LPC microcontrollers. Document information
AES encryption and decryption software on LPC microcontrollers Rev. 1 25 July 2012 Application note Document information Info Content Keywords AES, encryption, decryption, FIPS-197, Cortex-M0, Cortex-M3
Pseudo code Tutorial and Exercises Teacher s Version
Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy
Code convention document Argus-viewer
Code convention document Projectnaam: Auteur(s): Reviewer(s): Software Process case voor master-studie Software Engineering 2007/2008. Robert Baarda (Q&A) Studentnr.: 5821258 Martijn van Beest (Q&A) Ka-Sing
ios Team Administration Guide (Legacy)
ios Team Administration Guide (Legacy) Contents About ios Development Team Administration 5 At a Glance 6 Team Admins Manage Team Membership and Assign Roles in the Member Center 6 Development Devices
Kofax Export Connector 8.3.0 for Microsoft SharePoint
Kofax Export Connector 8.3.0 for Microsoft SharePoint Administrator's Guide 2013-02-27 2013 Kofax, Inc., 15211 Laguna Canyon Road, Irvine, California 92618, U.S.A. All rights reserved. Use is subject to
Activelock Customer Management 1.0
Activelock Customer Management 1.0 Mark Bastian January 19, 2009 Contents Overview... 3 Activelock EULA... 3 Activelock Customer Management Forms... 4 Main Menu... 4 Customer Management... 5 New Software
The C Programming Language course syllabus associate level
TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming
Chapter 13 - The Preprocessor
Chapter 13 - The Preprocessor Outline 13.1 Introduction 13.2 The#include Preprocessor Directive 13.3 The#define Preprocessor Directive: Symbolic Constants 13.4 The#define Preprocessor Directive: Macros
Access Queries (Office 2003)
Access Queries (Office 2003) Technical Support Services Office of Information Technology, West Virginia University OIT Help Desk 293-4444 x 1 oit.wvu.edu/support/training/classmat/db/ Instructor: Kathy
Chapter 1: Key Concepts of Programming and Software Engineering
Chapter 1: Key Concepts of Programming and Software Engineering Software Engineering Coding without a solution design increases debugging time - known fact! A team of programmers for a large software development
NØGSG DMR Contact Manager
NØGSG DMR Contact Manager Radio Configuration Management Software for Connect Systems CS700 and CS701 DMR Transceivers End-User Documentation Version 1.24 2015-2016 Tom A. Wheeler [email protected] Terms
Architecting the Future of Big Data
Hive ODBC Driver User Guide Revised: October 1, 2012 2012 Hortonworks Inc. All Rights Reserved. Parts of this Program and Documentation include proprietary software and content that is copyrighted and
Data Integrator. Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA
Data Integrator Event Management Guide Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA Telephone: 888.296.5969 or 512.231.6000 Fax: 512.231.6010 Email: [email protected]
Multicurrency Bank Reconciliation 9.0
Multicurrency Bank Reconciliation 9.0 An application for Microsoft Dynamics ΤΜ GP 9.0 Furthering your success through innovative business solutions Copyright Manual copyright 2006 Encore Business Solutions,
Using SNMP with OnGuard
Advanced Installation Topics Chapter 8: Using SNMP with OnGuard SNMP (Simple Network Management Protocol) is used primarily for managing and monitoring devices on a network. This is achieved through the
Xcode User Default Reference. (Legacy)
Xcode User Default Reference (Legacy) Contents Introduction 5 Organization of This Document 5 Software Version 5 See Also 5 Xcode User Defaults 7 Xcode User Default Overview 7 General User Defaults 8 NSDragAndDropTextDelay
VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
Digger Solutions. Intranet Open Source. Administrator s Guide
Digger Solutions Intranet Open Source Administrator s Guide Hello and welcome to your new Intranet! Welcome to Digger Solutions Intranet Open Source. If you have any questions please review the product
An Incomplete C++ Primer. University of Wyoming MA 5310
An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages
Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur
Module 10 Coding and Testing Lesson 23 Code Review Specific Instructional Objectives At the end of this lesson the student would be able to: Identify the necessity of coding standards. Differentiate between
ibolt V3.2 Release Notes
ibolt V3.2 Release Notes Welcome to ibolt V3.2, which has been designed to deliver an easy-touse, flexible, and cost-effective business integration solution. This document highlights the new and enhanced
Chapter 7: Software Development Stages Test your knowledge - answers
Chapter 7: Software Development Stages Test your knowledge - answers 1. What is meant by constraints and limitations on program design? Constraints and limitations are based on such items as operational,
Introduction to Embedded Systems. Software Update Problem
Introduction to Embedded Systems CS/ECE 6780/5780 Al Davis logistics minor Today s topics: more software development issues 1 CS 5780 Software Update Problem Lab machines work let us know if they don t
Object-Oriented Programming in Java
CSCI/CMPE 3326 Object-Oriented Programming in Java Class, object, member field and method, final constant, format specifier, file I/O Dongchul Kim Department of Computer Science University of Texas Rio
1.2 Using the GPG Gen key Command
Creating Your Personal Key Pair GPG uses public key cryptography for encrypting and signing messages. Public key cryptography involves your public key which is distributed to the public and is used to
SolarWinds Technical Reference
SolarWinds Technical Reference Understanding Orion Advanced Alerts Orion Alerting... 1 Orion Advanced Alerts... 2 The Alert Process... 2 Alert Status and Action Delays... 3 Alert Creation, Storage and
Xcode Project Management Guide. (Legacy)
Xcode Project Management Guide (Legacy) Contents Introduction 10 Organization of This Document 10 See Also 11 Part I: Project Organization 12 Overview of an Xcode Project 13 Components of an Xcode Project
CS 111 Classes I 1. Software Organization View to this point:
CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects
EVALUATION. WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration COPY. Developer
WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration Developer Web Age Solutions Inc. USA: 1-877-517-6540 Canada: 1-866-206-4644 Web: http://www.webagesolutions.com Chapter 6 - Introduction
UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming
UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming 1 2 Foreword First of all, this book isn t really for dummies. I wrote it for myself and other kids who are on the team. Everything
vector vec double # in # cl in ude <s ude tdexcept> tdexcept> // std::ou std t_of ::ou _range t_of class class V Vector { ector {
Software Design (C++) 3. Resource management and exception safety (idioms and technicalities) Juha Vihavainen University of Helsinki Preview More on error handling and exceptions checking array indices
Approach of Unit testing with the help of JUnit
Approach of Unit testing with the help of JUnit Satish Mishra [email protected] About me! Satish Mishra! Master of Electronics Science from India! Worked as Software Engineer,Project Manager,Quality
USC Marshall School of Business Marshall Information Services
USC Marshall School of Business Marshall Information Services Excel Dashboards and Reports The goal of this workshop is to create a dynamic "dashboard" or "Report". A partial image of what we will be creating
technical brief Optimizing Performance in HP Web Jetadmin Web Jetadmin Overview Performance HP Web Jetadmin CPU Utilization utilization.
technical brief in HP Overview HP is a Web-based software application designed to install, configure, manage and troubleshoot network-connected devices. It includes a Web service, which allows multiple
AN11008 Flash based non-volatile storage
Rev. 1 5 January 2011 Application note Document information Info Content Keywords Flash, EEPROM, Non-Volatile Storage Abstract This application note describes the implementation and use of a library that
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui
APPROACHES TO SOFTWARE TESTING PROGRAM VERIFICATION AND VALIDATION
1 APPROACHES TO SOFTWARE TESTING PROGRAM VERIFICATION AND VALIDATION Validation: Are we building the right product? Does program meet expectations of user? Verification: Are we building the product right?
In this Lecture you will Learn: Implementation. Software Implementation Tools. Software Implementation Tools
In this Lecture you will Learn: Implementation Chapter 19 About tools used in software implementation How to draw component diagrams How to draw deployment diagrams The tasks involved in testing a system
The Rules 1. One level of indentation per method 2. Don t use the ELSE keyword 3. Wrap all primitives and Strings
Object Calisthenics 9 steps to better software design today, by Jeff Bay http://www.xpteam.com/jeff/writings/objectcalisthenics.rtf http://www.pragprog.com/titles/twa/thoughtworks-anthology We ve all seen
Official Android Coding Style Conventions
2012 Marty Hall Official Android Coding Style Conventions Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
General Software Development Standards and Guidelines Version 3.5
NATIONAL WEATHER SERVICE OFFICE of HYDROLOGIC DEVELOPMENT Science Infusion Software Engineering Process Group (SISEPG) General Software Development Standards and Guidelines 7/30/2007 Revision History Date
Visual Basic. murach's TRAINING & REFERENCE
TRAINING & REFERENCE murach's Visual Basic 2008 Anne Boehm lbm Mike Murach & Associates, Inc. H 1-800-221-5528 (559) 440-9071 Fax: (559) 440-0963 [email protected] www.murach.com Contents Introduction
Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives
Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,
Information Server Documentation SIMATIC. Information Server V8.0 Update 1 Information Server Documentation. Introduction 1. Web application basics 2
Introduction 1 Web application basics 2 SIMATIC Information Server V8.0 Update 1 System Manual Office add-ins basics 3 Time specifications 4 Report templates 5 Working with the Web application 6 Working
#820 Computer Programming 1A
Computer Programming I Levels: 10-12 Units of Credit: 1.0 CIP Code: 11.0201 Core Code: 35-02-00-00-030 Prerequisites: Secondary Math I, Keyboarding Proficiency, Computer Literacy requirement Semester 1
idp Connect for OutSystems applications
idp Connect for OutSystems applications THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
PL / SQL Basics. Chapter 3
PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic
