본문 바로가기

DEV/프로그래밍 기본지식

좋은 프로그래밍 코드 작성하려면?스타일가이드(Convention)

숙련된 개발자들은 코드만 보고도 그 사람의 실력을 알 수 있다.

그렇다면 좋은 코드의 기준은 무엇일까? 가독성 좋은 코드라고 할 수 있다.

가속성 좋은 코드를 작성하기 위해서는 적절한 코멘트와 변수이름 등이 있으며 그 기준을 삼기 위해 가장 적절하게

각 언어에는 스타일 가이드가 있다.

 

언어+스타일가이드로 구글에 검색하면 상세하게 나오는 데 해당하는 언어를 작성할 때 어느정도 스타일가이드에 맞게 작성하면 깔끔하고 좋은 언어라는 인식이 있다. 협업이 중요한 프로젝트를 할 때 한 번 쯤 숙지하고 작성해보자

 

 

ython 스타일 가이드

Python의 경우 PEP8(Python Enhance Proposal 8)이라는 스타일 가이드가 있다. Python 공식 스타일 가이드(일명: PEP8) https://www.python.org/dev/peps/pep-0008/

Google Python 스타일 가이드 글로벌 IT 기업인 Google에서 사용하는 스타일 가이드이다. PEP8과 비교해서 가장 다른 점은 “Docstring”을 작성하는 법에 대해 좀 더 깊이 다루고 있다. https://github.com/google/styleguide/blob/gh-pages/pyguide.md

JavaScript 스타일 가이드

JavaScript 표준 스타일 가이드 https://standardjs.com/

Airbnb JavaScript 스타일 가이드 https://github.com/airbnb/javascript

Google JavaScript 스타일 가이드 https://google.github.io/styleguide/jsguide.html

Java 스타일 가이드

Java를 소유한 회사 오라클의 스타일 가이드 https://www.oracle.com/technetwork/java/codeconvtoc-136057.html

Google Java 스타일 가이드 https://google.github.io/styleguide/javaguide.html

 

Google Java Style Guide

1 Introduction This document serves as the complete definition of Google's coding standards for source code in the Java™ Programming Language. A Java source file is described as being in Google Style if and only if it adheres to the rules herein. Like ot

google.github.io

 

 

참조

프로그래밍언어이해하기.컴퓨터개론.코드잇

https://www.codeit.kr/learn/courses/intro-to-computer/2565