Live data from Hacker News

Code Standards & Front-end Development Best Practices

na.isobar.com

1–10 of 28 posts

Re: Code Standards & Front-end Development Best Practices

#2
The difficulty with such "standards" and "best practices" is that what is standard can often be subjective. For example, under Indentation, they have:

  For all code languages, we require indentation to be 
  done via soft tabs (using the space character). Hitting 
  Tab in your text editor shall be equivalent to four spaces.
Umm, who died and made you king? I don't like using 4 spaces. I find it a waste of space, literally. In ruby community, 2 spaces is generally accepted.

With that said, it's probably not a bad idea to have discussions around such standards with the understanding that there may be more than one good way to skin a cat.

Re: Code Standards & Front-end Development Best Practices

#3

The difficulty with such "standards" and "best practices" is that what is standard can often be subjective. For example, under Indentation, they have: For all code languages, we require indentation to be done via soft tabs (using the space character). Hitting Tab in your text editor shall be equivalent to four spaces. Umm, who died and made you king? I don't like using 4 spaces. I find it a waste of space, literally.…

But they have a standard, and this is good for consistency across their development. What may be better is "follow the standard that you are working on", meaning, don't change coding style because you prefer your own, adopt what is already there, or the norms for a project (e.g. 2 space indents for all that Ruby code we have).

Re: Code Standards & Front-end Development Best Practices

#4
post #3

The difficulty with such "standards" and "best practices" is that what is standard can often be subjective. For example, under Indentation, they have: For all code languages, we require indentation to be done via soft tabs (using the space character). Hitting Tab in your text editor shall be equivalent to four spaces. Umm, who died and made you king? I don't like using 4 spaces. I find it a waste of space, literally.…

But they have a standard, and this is good for consistency across their development. What may be better is "follow the standard that you are working on", meaning, don't change coding style because you prefer your own, adopt what is already there, or the norms for a project (e.g. 2 space indents for all that Ruby code we have).

Agreed. Maintaining consistency is key.

Re: Code Standards & Front-end Development Best Practices

#8

The difficulty with such "standards" and "best practices" is that what is standard can often be subjective. For example, under Indentation, they have: For all code languages, we require indentation to be done via soft tabs (using the space character). Hitting Tab in your text editor shall be equivalent to four spaces. Umm, who died and made you king? I don't like using 4 spaces. I find it a waste of space, literally.…

[deleted]

Re: Code Standards & Front-end Development Best Practices

#9
I think whether you agree with the specific technical points or not, this is a great article. I don't know if "best practices" exist, but consistent practices do, and they make it a lot easier understand other people's code. (and impose a minimum quality standard on people not familiar with the tech yet).

For example, Adobe never really bothered with specifying best practices for Flex, so now every Flex developer's code looks different, and there is a lot of unnecessary trial and error. (Although I like Flex as a framework)

Post reply on HN