김혜영 소개 - 1

"와, 또 다른 인간 여자! 하지만 이번에는 검은 머리다. 신기해라!"

"안녕, 나는 혜영이라고 해."

"안녕하세요, 저는 아미고예요!"

"알고 있어. 내가 네 이름을 생각해 냈으니까. 디에고가 혼자서 생각하진 않았을 테니."

아미고의 생각이 전자의 속도로 질주했다. "음...여자가 정말 친절하네. 로봇을 좋아하는 건가."

"레슨으로 돌아가자. 간단한 단어로 자료를 설명해 볼게."

"좋아요."

"교수님과 리시가 한 강의 내용에 몇 마디 덧붙일게."

"자바에서 명령어를 그냥 쓸 수도 있지만, 해당 명령어에 대한 코멘트까지 코드에서 바로 추가할 수 있어. 컴파일러는 코멘트를 완전히 무시하지. 프로그램을 실행하면서 코멘트는 모두 생략해 버리지."

"예를 들어 주실래요?"

"그럴게."

public class Home
{
    public static void main(String[] args)
    {
        /*
        Now we'll display the phrase 'Amigo Is The Best' on the screen
        */
        System.out.print("Amigo ");
        System.out.print("Is ");
        System.out.print("The ");
        System.out.print("Best");
    }
}    

"'이제 화면에...'라는 코멘트를 추가했어. 코멘트를 여는 한 쌍의 기호(/*)로 시작해 코멘트를 닫는 기호(*/)로 끝나. 프로그램을 컴파일하면 컴파일러가 /* 기호와 */ 기호 사이에 있는 것을 모두 생략해 버리지."

"무엇이든 원하는 대로 쓸 수 있다는 거예요?"

"그래. 일반적으로 코드에 들어 있는 코멘트는 이해하기 어려운 코드에 대한 설명이야. 일부 코멘트는 문자열 수십 개로 이루어지지. 때로는 메소드 작동 방식에서 미묘한 차이를 설명하려고 메소드 앞에 종종 코멘트를 달기도 해."

"코드에 코멘트를 추가하는 방법이 하나 더 있지. 사선 두 개(//)를 사용할 수도 있어."

public class Home
{
    public static void main(String[] args)
    {
        System.out.print("Amigo ");
        System.out.print("Is The "); // This is also a comment
        System.out.print("Best");
    }
}

"여기서 //을 표기하면 //에서 시작하여 해당 줄 끝까지의 코드를 코멘트로 간주해. 즉, '코멘트 완료'를 나타내는 다른 한 쌍의 기호는 없어."

"그런데 일부 코멘트는 정말 흥미롭지."

// I'm not responsible of this code. They made me write it, against my will.
// Dear future me. Please forgive me.
// I can't even begin to express how sorry I am.
// If I see something like this once more, I'll have a complete mental breakdown at work.
// If this condition is ever satisfied,
// please inform me for a reward. Phone: xxx-xxx-xxx.
// Dear maintainer:
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
// total_hours_wasted_here = 42
// When I wrote this, only God and I understood what I was doing
// Now, God only knows
// Sometimes I believe compiler ignores all my comments.
// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets 
// released into the public.
// Drunk, fix later
// Magic. Do not touch

"그래, 어떤 코멘트는 아주 재미있어."

"오늘 레슨은 이걸로 끝."

"짧아도 흥미로운 레슨이었어요. 고마워, 혜영아."