Презентация Few words about how to write disputably nice code онлайн
На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Few words about how to write disputably nice code абсолютно бесплатно. Урок-презентация на эту тему содержит всего 36 слайдов. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » Few words about how to write disputably nice code
Оцените!
Оцените презентацию от 1 до 5 баллов!
- Тип файла:ppt / pptx (powerpoint)
- Всего слайдов:36 слайдов
- Для класса:1,2,3,4,5,6,7,8,9,10,11
- Размер файла:613.14 kB
- Просмотров:56
- Скачиваний:1
- Автор:неизвестен
Слайды и текст к этой презентации:
№4 слайд
![Package naming conventions A](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img3.jpg)
Содержание слайда: Package naming conventions
A name for a Java package must be a sequence of one or more valid Java identifiers separated by dots (“.”)
package java.lang;
package java.io;
package java.awt;
package ru.innopolis.iis.mlkr;
Usually, the letters in the name of a package are all lowercase
If a package is to be widely distributed, it is a common convention to prefix its name with the reverse Internet domain name of the producing or distributing organization, with slashes substituted by dots.
№6 слайд
![Build in packages We build](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img5.jpg)
Содержание слайда: Build in packages
We build and run with respect of the package
One class
javac ru/innopolis/bootcamp2/BootCampSpecificClass.java
cd ru/innopolis/bootcamp2
javac BootCampSpecificClass.java
java ru/innopolis/bootcamp2/BootCampSpecificClass
java DefaultClass
All classes in package
javac ru/innopolis/bootcamp2/*.java
All classes recursively (build tree)
Ant, Maven
№11 слайд
![What is comment Comment - is](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img10.jpg)
Содержание слайда: What is comment
Comment - is a piece of text that do not affect compilation
Single line:
// something will happen here
int x = 4; //TODO: implement calculation of x!
Multiple lines (inline):
obj.callSomeMethod(a /* very important param */, b, c);
/* this is
Very long
Multiline
Comment */
№14 слайд
![Introductory comment javadoc](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img13.jpg)
Содержание слайда: Introductory comment (javadoc)
/**
* @deprecated if you recommend not to use a class
* to preserve backward compatibility
*
* @see OtherClass
*
* @serial SERIAL_NUMBER
*
* @since WHICH.VERSION.OF.THE.PROJECT/LIBRARY
*
* @version 1.0.0.1
*
* @author Stanislav Protasov
*/
*Javadoc support html
№16 слайд
![Introductory comment](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img15.jpg)
Содержание слайда: Introductory comment
/*
* @(#)Blah.java 1.82 99/03/18
*
* Copyright (c) 1994-1999 Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, California,
* 94303, U.S.A. All rights reserved.
*
* This software is the confidential and
* proprietary information of Sun Microsystems,
* Inc. ("Confidential Information"). You shall
* not disclose such Confidential Information and
* shall use it only in accordance with the terms
* of the license agreement you entered into
* with Sun.
*/
№19 слайд
![Naming conventions Divided](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img18.jpg)
Содержание слайда: Naming conventions
Divided into
Conventions about how to give meaningful names
Conventions about how names must be written
All of the names in your program should convey information about the purpose of the item they refer
Use not abbreviations for your names (only if they are in common use in normal speech)
Use descriptively named variables
Avoid ambiguous words
№20 слайд
![Class Names same for](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img19.jpg)
Содержание слайда: Class Names (same for interfaces)
Should be singular nouns, referring to the object they represent
First letter and each internal word of class or interface names is capitalized (UpperCamelCase)
Train, Event, Station
Do not put hierarchy information in class names, unless real-world names bear this information
EmployeePerson, SecretaryEmployeePerson
№21 слайд
![Method names Verbs or verbal](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img20.jpg)
Содержание слайда: Method names
Verbs or verbal forms in mixed cases
Starting with lower letter and each internal word should be capitalized (lowerCamelCase)
Methods returning a boolean usually named with verb phrases expressing the question
isRed()
Methods assigning boolean variable can be named with verb phrases beginning with "set"/"be"
beOff(), setStateOffline()
№22 слайд
![Method names Methods](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img21.jpg)
Содержание слайда: Method names
Methods returning void should be named with imperative verbs describing what they must do
openDBLink()
Methods converting a value into another should be named with verb phrases starting with "as"/"to" and
denoting the converted type
asDecimal(), toString()
Other methods should describe what they return
previousSignal()
Accessor methods may report the variable’s name prefixed with “get” or “set”
№23 слайд
![Variables Variables should be](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img22.jpg)
Содержание слайда: Variables
Variables should be named for the objects they represent
Usually named with a singular noun
If it represent a collection of objects, its name should be plural
The name should not include typing information
lowerCamelCase
One lowercase letter variable names are OK only for temporary variables, indexes, etc.
№25 слайд
![Parameter and constant names](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img24.jpg)
Содержание слайда: Parameter and constant names
Name parameters in such a way that the method call is readable
public static double power(double base, double exponent) {
//
}
Use named constants and not literal values, wherever a specific value is needed
In order to differentiate the names of constants from the other names, constants are often completely capitalized and compound names are separated by an underscore
№27 слайд
![Code readability conventions](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img26.jpg)
Содержание слайда: Code readability conventions
These conventions are often very close to design guidelines, since code readability is obtained with cohesive classes and methods
Classes and methods focused on performing a single task
Methods must be short
In Java standard less than 10 statements
Every method performs just one task, and
Every full method must fit on one screen
№30 слайд
![Putting brackets Open brace](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img29.jpg)
Содержание слайда: Putting brackets
Open brace “{” appears at the end of the same line as the class, interface, or method declaration
Closing brace “}” starts a line by itself aligned with the opening statement, except null block “{}”
No space between a method name and the parenthesis “(” starting its parameter list
Methods are separated by a blank line
When a nested statements occur within blocks
Use the 4 spaces rule, in general
№32 слайд
![Lines and wrapping When an](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img31.jpg)
Содержание слайда: Lines and wrapping
When an expression will not fit on a single line, break it according to these general principles:
Break after a comma.
Break before an operator.
Prefer higher-level breaks to lower-level breaks.
Align the new line with the beginning of the expression at the same level on the previous line.
If the above rules lead to confusing code or to code that's squished up against the right margin, just indent 8 spaces instead.
№34 слайд
![Variables declaration There](/documents_6/1dd4fbd7b7312c74e1a4238d0f19acc9/img33.jpg)
Содержание слайда: Variables declaration
There should be usually only one declaration per line to promote comments of the variables
Variables should be initialized where they are declared…
Unless the value of the variable depends on some computations to be performed later
Declarations should be placed at the beginning of the outermost block where a variable is used
Avoid declarations in inner blocks of variables with the same name as variable in outer blocks
Скачать все slide презентации Few words about how to write disputably nice code одним архивом:
Похожие презентации
-
The importance of learning how to code
-
JQuery write less, do more
-
Decompiler internals: microcode
-
RhinoScript 101 Creativity "or how to do interesting things that are not easy to do with the mouse"
-
How to create site?
-
CoDeSys - общий обзор
-
Visual Studio Coded UI Tests. Теория и практика применения в компании PVS-Studio
-
Укрощение строптивых. Оптимизация и реструктура проекта для увеличения доступности CodeEvening
-
Codecraft PHP. PHP цикл do. . . while
-
Codecraft PHP. Echo И Print команды. (Урок 2)