Giter Club home page Giter Club logo

unix-termproject's Introduction

Unix-TermProject

윾닉스 텀프로젝트

1. 네이밍 규칙

1.1. 절대 줄여쓰지 않기

// 매우 나쁜 예
char *strbuf;

// 아주 모범적인 예
char *stringBuffer;

1.2. 메서드 이름, 변수 이름: camelCase

// 첫 단어는 소문자, 그 이후는 대문자 시작
public bool isGoodGame(char *gameName, int price)
{
  int index;
  int inputLength;
  bool isListEmpty;
  char *inputMessage;
  
  return false;
}

2. 괄호 스타일

https://ko.wikipedia.org/wiki/%EB%93%A4%EC%97%AC%EC%93%B0%EA%B8%B0_%EB%B0%A9%EC%8B%9D 우리는 BSD방식을 씁니다. ㅇㅇ;;

2.1. BSD 우리가 사용할 스타일

// BSD
if (a == 1)
{
    for (int index = 0; index < 1000; index++)
    {
        if (b == 10)
        {
            처리();
        }
        else if(c == 10)
        {
            처리();
        }
    }
}

2.2. K&R (나쁜 예)

// K&R
if(a == 1) {
    for (index = 0; index < 1000; index++) {
        if (b == 10) {
            처리();
        } else if(c == 10) {
            처리();
        }
    }
}

3. 지역변수 선언 위치

메서드 시작부분에 몰아 넣지 않기

// GOOD :)
void kappa(char *input)
{
  int inputLength;
  inputLength = strlen(input);
  
  // do something
  
  char output[1024];
  for (int index = 0; index < inputLength; index++)
  {
    output[index] = input[index];
  }
  
  pid_t pid;
  switch (pid = fork())
  {
  }
} 

// REALLY BAD!!!
void kappa(char *input)
{
  int inputLength;
  int index;
  char output[1024];
  pid_t pid;
  
  inputLength = strlen(input);
  
  // do something
  
  for (index = 0; index < inputLength; index++)
  {
    output[index] = input[index];
  }
  
  switch (pid = fork())
  {
  }
} 

4. 나머지

  1. 탭 크기는 스페이스바 4번

unix-termproject's People

Contributors

gardenerios avatar supernova911 avatar

Watchers

 avatar

Forkers

gardenerios

unix-termproject's Issues

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.