개발자 1년차, 5년차, 10년차 코드

1 개요[ | ]

The Evolution of a Software Engineer
소프트웨어 엔지니어의 진화
개발자 1년차, 5년차, 10년차 코드

2 1년차[ | ]

class HelloWorld
{  
	public static void main(String args[])
	{
		// Displays "Hello World!" on the console.
		System.out.println("Hello World!");
	}
}

3 2년차[ | ]

/**
 * Hello world class
 *
 * Used to display the phrase "Hello World!" in a console.
 *
 * @author Sean
 */
class HelloWorld
{
    /**
     * The phrase to display in the console
     */
    public static final String PHRASE = "Hello World!";
     
    /**
     * Main method
     *
     * @param args Command line arguments
     * @return void
     */
    public static void main(String args[])
    {
        // Display our phrase in a console.
        System.out.println(PHRASE);
    }
}

4 3년차[ | ]

/**
 * Hello world class
 *
 * Used to display the phrase "Hello World!" in a console.
 *
 * @author Sean
 * @license LGPL
 * @version 1.2
 * @see System.out.println
 * @see README
 * @todo Create factory methods
 * @link https://github.com/sean/helloworld
 */
class HelloWorld
{
    /**
     * The default phrase to display in the console
     */
    public static final String PHRASE = "Hello World!";
     
    /**
     * The phrase to display in the console
     */
    private String hello_world = null;
     
    /**
     * Constructor
     *
     * @param hw The phrase to display in the console
     */
    public HelloWorld(String hw)
    {
        hello_world = hw;
    }
     
    /**
     * Display the phrase "Hello World!" in a console
     *
     * @return void
     */
    public void sayPhrase()
    {
        // Display our phrase in a console.
        System.out.println(hello_world);
    }
     
    /**
     * Main method
     *
     * @param args Command line arguments
     * @return void
     */
    public static void main(String args[])
    {
        HelloWorld hw = new HelloWorld(PHRASE);
        try {
            hw.sayPhrase();
        } catch (Exception e) {
            // Do nothing!
        }
    }
}

5 5년차[ | ]

/**
 * Enterprise Hello World class v2.2
 *
 * Provides an enterpirse ready, scalable buisness solution
 * for displaying the phrase "Hello World!" in a console.
 *
 * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
 * TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER
 * PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS
 * PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
 * ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
 * DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
 * LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
 * DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
 * YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO
 * OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER
 * OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGES.
 *
 * @author Sean
 * @copyright Sean 2012
 * @license LGPL
 * @version 2.2
 * @see System.out.println
 * @see README
 * @see license.txt
 * @todo Test of OS compatibility
 * @link https://github.com/sean/helloworld
 */
class HelloWorld
{
    /**
     * The first phrase
     */
    public static final string PHRASE_HELLO = "Hello";
     
    /**
     * The second phrase
     */
    public static final string PHRASE_WORLD = "World";
     
    /**
     * The first word in our phrase
     */
    private Word hello = null;
     
    /**
     * The second word in our phrase
     */
    private Word world = null;
     
    /**
     * Constructor
     *
     * @param hello First word to display in the console
     * @param world Second word to display in the console
     * @Required
     */
    public HelloWorld(Word hello, Word world)
    {
        this.hello = hello;
        this.world = world;
    }
     
    /**
     * Display the phrase "Hello World!" in a console
     *
     * @return void
     */
    public void sayPhrase()
    {
        // Display our phrase in a console.
        string first = this.hello.toString();
        string second = this.world.toString();
        System.out.println(first + " " + second);
    }
     
    /**
     * Sets the phrase to use for hello
     *
     * @param h The first phrase
     * @return void
     */
    public void setHello(string h)
    {
        this.hello.setWord(h);
    }
     
    /**
     * Gets the phrase to use for hello
     *
     * @return Word
     */
    public Word getHello()
    {
        return this.hello;
    }
     
    /**
     * Sets the phrase to use for world
     *
     * @param w The second phrase
     * @return void
     */
    public void setWorld(string w)
    {
        this.world.setWord(w);
    }
     
    /**
     * Gets the phrase to use for world
     *
     * @return Word
     */
    public Word getWorld()
    {
        return this.world;
    }
     
    /**
     * Main method
     *
     * @param args Command line arguments
     * @return void
     */
    public static void main(String args[])
    {
        // Create a new dic so we can display our phrase on the
        // command line.
        DIC d = DependencyInjectionContainer::factory();
        HelloWorld hw = null;
         
        // Check for errors!
        try {
            hw = d.newInstance(HelloWorld.class);
        } catch (DICInstanceException $e) {
            System.err.println("There was an error creating an instance of HelloWorld.");
            return;
        }
         
        // Display the phrase on the command line.
        try {
            hw.setHello(PHRASE_HELLO);
            hw.setWorld(PHRASE_WORLD);
            hw.sayPhrase();
        } catch (IOException e) {
            System.err.println("There was an IO error.");
        } catch (ConsoleException e) {
            System.err.println("There was a console error.");
        } catch (Exception e) {
            System.err.println("There was an unknown error.");
        }
    }
}
<beans xmlns="http://www.framework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.framework.org/schema/context"
    xsi:schemaLocation="http://www.framework.org/schema/beans
    http://www.framework.org/schema/beans/beans-2.5.xsd
    http://www.framework.org/schema/context
    http://www.framework.org/schema/context/context-2.5.xsd">
  
    <context:annotation-config />
  
    <bean id="HelloWorldBean" class="com.my-pragmatic-journey.beans">
        <property name="hello" value="Word" />
        <property name="world" value="Word" />
    </bean>
</beans>

6 10년차[ | ]

/**
 * Used to display the phrase "Hello World!" in a console
 *
 * @author Sean
 * @see README
 */
class HelloWorld
{  
    public static void main(String args[])
    {
        System.out.println("Hello World!");
    }
}

7 같이 보기[ | ]

8 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}