Разделы презентаций


Good written code

Some important best practices for writing readable code:1 - Commenting & DocumentationThe comment should disclose things that can not be immediately learned from the code.

Слайды и текст этой презентации

Слайд 1Good written code
Use indentation to highlight the structure of code

Good written codeUse indentation to highlight the structure of code

Слайд 2Some important best practices for writing readable code:
1 - Commenting

& Documentation
The comment should disclose things that can not be

immediately learned from the code.
Some important best practices for writing readable code:1 - Commenting & DocumentationThe comment should disclose things that

Слайд 32 - Consistent Indentation
But that is only a matter of

preference. There is no "best" style that everyone should be

following. Actually, the best style, is a consistent style. If you are part of a team or if you are contributing code to a project, you should follow the existing style that is being used in that project.
2 - Consistent IndentationBut that is only a matter of preference. There is no

Слайд 4When you use unclear and non-descript names for variables, classes,

and functions, you’re essentially obfuscating the application logic from any programmer

who reads the code, including yourself.

3. Use Descriptive Names

What does a variable named dxy actually mean? Who knows. You’d probably have to read the entire chunk of code to reverse engineer its meaning. On the other hand, the meaning of a variable like distanceBetweenXY is instantly recognizable.

But, this doesn't necessarily apply to temporary variables. They can be as short as a single character.

Consistent Naming Scheme

mysql_real_escape_string()

MysqlRealEscapeString()

When you use unclear and non-descript names for variables, classes, and functions, you’re essentially obfuscating the application logic

Слайд 54 - Avoid Obvious Comments

4 - Avoid Obvious Comments

Слайд 65 - Code Grouping

5 - Code Grouping

Слайд 76 - DRY Principle
DRY stands for Don't Repeat Yourself. Also

known as DIE: Duplication is Evil.

6 - DRY PrincipleDRY stands for Don't Repeat Yourself. Also known as DIE: Duplication is Evil.

Слайд 87 - Avoid Deep Nesting
Too many levels of nesting can

make code harder to read and follow.

7 - Avoid Deep NestingToo many levels of nesting can make code harder to read and follow.

Слайд 9Functions and procedures   

Functions and procedures   

Слайд 10Computer programs can consist of thousands of lines of code,

just like a textbook can have thousands of words.
In the

same way that a textbook is divided into chapters, a program is divided into related functionality using modules.
Computer programs can consist of thousands of lines of code, just like a textbook can have thousands

Слайд 11The C # program is built from modules, the role

of which is performed by classes.
The functionality of the class

is provided by methods.

In C #, these methods are of two kinds: procedures and functions.

The syntax for declaring a method allows you to uniquely determine what the method is, a procedure or a function.

The C # program is built from modules, the role of which is performed by classes.The functionality

Слайд 12 void (parameters)
{
body procedures
}

(parameters)
{
Body functions
Return ;
}
Example
What is the class name?
How many methods does

the class include?
What are the names of these methods?
What access modifier?
What kind of methods, procedures or functions?
What events correspond to the methods?
What actions are performed when these methods are called?
What parameters?
void (parameters) {body procedures}  (parameters){Body functionsReturn ;}ExampleWhat is the class name?How many methods does the

Слайд 13Global variable - declared at the start of the program, their

global scope means they can be used in any procedure or subroutine

in the program

Local variable declared within subroutines or programming blocks, their local scope means they can only be used within the subroutine or program block they were declared in

Global variable - declared at the start of the program, their global scope means they can be used in any

Слайд 14 void (parameters)
{
body procedures
}

(parameters)
{
Body functions
Return ;
}
What are the differences?

void (parameters) {body procedures}  (parameters){Body functionsReturn ;}What are the differences?

Слайд 15What are the procedures and functions for?
They help you structure

your code

They allow you to create a common routine once

and re-use as many times as you want

They allow you to share code with other programs

They allow you to test sub routines independently of the rest of the code
What are the procedures and functions for?They help you structure your codeThey allow you to create a

Слайд 16Draw a triangle and calculate its area

Draw a triangle and calculate its area

Обратная связь

Если не удалось найти и скачать доклад-презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое TheSlide.ru?

Это сайт презентации, докладов, проектов в PowerPoint. Здесь удобно  хранить и делиться своими презентациями с другими пользователями.


Для правообладателей

Яндекс.Метрика