Git Product home page Git Product logo

important-coding-principles's Introduction

Important coding principles ๐Ÿ‘พ

1.DRY

DRY is an abbreviation for Don't Repeat Yourself .

WRONG: It doesn't mean to not repeat code.

CORRECT: Don't repeat business logic. Meaning to not repeat code that has an specific objective.

A good way to look at it is, if you are coding the same behavior more the 3 times then perhaps you should move that to abstract that code.

2.KISS

KISS is an abbreviation for Keep It Simple and Stupid .

It means to keep you code easy to ready and understand for someone that never seen it before, keeping you parameter, const, variables with readable names.

WRONG:

function showUsersInformation(data) {
	return data.map(u => {
		name: u.name,
		age: u.age
	}
}

CORRECT:

function getUsersNameAndAge(users) {
	return users.map(user => {
		name: user.name,
		age: user.age
	}
}

3.YAGNI

YAGNI is an abbreviation for You Ain't Gonna Need It .

It means to not implement tools and features just for the sake of implementing it, over complicating your application before you actually need to implement those tools or features.

important-coding-principles's People

Contributors

ypazevedo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.