Code Monkey home page Code Monkey logo

best-practices's Introduction

best-practices's People

Contributors

aomader avatar edwinm avatar samkaufman avatar stevekwan avatar thomasballinger avatar yuchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

best-practices's Issues

Talk about what defines scope.

In gotcha's you say the word "scope" a lot but never define it.

JavaScript scope is defined by functions. There is no block scope (ie. for loops, if else, etc.). Only function and global scope.

Its also worth talking about how primitives are passed by value and objects are passed by reference.

Also, your attitude toward JS makes me ๐Ÿ˜ข

Function declaration, best is actually only good...

myFunction = function(arg1, arg2) {};     // NEVER do this!
function myFunction(arg1, arg2) {};       // This is OK, but...
var myFunction = function(arg1, arg2) {}; // This is best!

It should actually be

myFunction = function(arg1, arg2) {};     // NEVER do this!
function myFunction(arg1, arg2) {};       // This is OK, but...
var myFunction = function(arg1, arg2) {}; // This is good.
var myFunction = function myFunction(arg1, arg2) {}; // This is best!

which is much better for debugging purposes.

Function declaration reasoning

Under the functions section, with regards to this syntax:

function myFunction(arg1, arg2) {};       // This is OK, but...

You go on to state that this options "is better, and is properly scoped, but it leads to certain syntax problems once you get into closures." But you don't explain why or how it leads to syntax problems. You just expect me to believe your sentence without an example or evidence. I've never heard of issues with this syntax, and I'm disinclined to believe your statement without actual justification or reasoning behind it. Would you be able to at least link to an article or something to explain why?

Invalid example

Hey there, in the Combined var declarations section, the bug that you illustrate through accidentally forgetting a comma in a list of combined variable declarations is easily avoided by using the 'use strict'; directive, which causes an Uncaught ReferenceError to be thrown rather than silently creating a global variable.

I agree that using combined or multiple var statements is a personal preference rather than a best-practice, but using strict mode wherever possible, definitely is a best practice :)

Why preferably Less?

Is because node is more easy to install than ruby , or for working with bootstrap?.Because the last time i check, sass had more features and there were port of bootstrap in sass.

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.