READ & WRITE "TASK 16. BASED ON A ETHICAL THEORY, PROVIDE IT-RELATED EXAMPLE OF APPLICATION"

 Social Contract Theory


MARK BEFORE I START

My discussion and examples of such ethical theory will be based - how I understood it, how I interpreted it and which of the IT method more suitable for such ethical aspect. 


Clean Coding 

Main Principles of Clean Coding 

# Clean 

# Understandable 

# Maintainable


In short, to understand what is clean coding, you understand that you are not alone, and others "Your Colleges" will also take part in development, so they should understand the code.

In case of Clean principle - you should avoid additional spaces, breaks, braces and etc.

In case of Understandable - you should assign different variables with understandable name, such as: $ amount_of_cars; $ amount_of_clients.

Also, you should avoid, duplications, unclosed braces, again, little stuff like spaces, follow pre-defined rules, how to create functions, what datatype's used for them and for other variables, what external libraries you can use and so on.

In case of Maintainable - you should structure your code, regarding to pre-written rules, you should keep logic with previously used variables, avoid to create a huge amount of them, avoid to comment "code parts" such as:

/*

$var = input("Enter something: ");

if ($var == hello){

    print("sup");

}else {

    print("dummy");

*/

because, others will think, that this commented part of code, will be in use further, but in reality, you just forgot to delete it, and it may confuse your teammates. 

Of course, you should leave comments, but not of the unused code, but leave comments above, about for what answering specific part of code or function, try to comment variable, for what they are gonna be used. 

Example: 

// example of commented code

$amount_of_boys = 15; // reserved value for variable 

$amount_of_girls = 9;  // reserved value for variable 

$sum_of_students = $amount_of_buys + $amount_of_girls;  // summary of students


Why I mentioned here Clean Coding? 

Because main principal of Social Contract Theory - The society should strive to develop a set of rules that make sense to everyone (making people follow them voluntarily).

If we will learn how to Clean Code and implement in case of development, it will facilitate our teamwork programming.

Everyone will understood shared code, and be able to change parts of code without any fear.

Also, I would like to provide, my php project, which was created for web technologies subject, where I tried to follow clean coding. 

In short, about project - Insurance management, where you can buy different type of services, such as - Traffic Insurance, Casco Insurance, Home insurance and Life Insurance. 

Example of clean coding: 


On a screenshot, variable of $table_casco is a query for database, $search_result is a result of output from request to database.

Me and my teammate, agreed, to use such format and such structure for our requests to database. 

In conclusion, I would like to say, that we have to agreed on something, to use general standard for everyone, One of the examples of such standard related to Estonia is Ekool and Moodle.

Ekool have same interface and same functionality for every school, it's a standard educational system for middle school.

Moodle is pretty similar as Ekool by the idea, mostly, user interface (colors, sometimes location of buttons) in Moodle for different universities also is different, but the functionality is same, so when you visiting another university moodle page, it will be different only by style.




Комментарии

Популярные сообщения из этого блога

READ & WRITE "TASK 15. Good illustrative real-life case of the principle "if a person has control over any function, it can also be used to control the computer"."

Read & Write "Task 2. Two technologies, one of them successful to nowadays, second - not"