banjjoknim / java-car-racing-game Goto Github PK
View Code? Open in Web Editor NEW자동차 경주 게임
자동차 경주 게임
현재 isCorrectName()
기능은 올바른 자동차 이름인지를 판별하는 역할을 합니다. 지금 현재 로직으로는 아래의 setCars()
기능에서 이 자동차 이름 판별
기능을 이용하고 있습니다.
하지만 Car 객체가 생성되는 시점에서 이를 판단하여 예외처리 한다면, 자동차 이름을 판별하는 기능
을 따로 신경쓰지 않아도 될 것입니다. 또한 객체의 예외처리가 생성되는 시점에서 진행되기 때문에, 잘못된 입력이 들어왔을 경우 불필요한 객체 생성을 방지할 수 있습니다. 또한 이런 구조로 일관적으로 예외 처리를 한다면, 예외처리를 어디서 어떻게 진행해야하는지 더 명확해질 것이고 그 위치또한 판단하기 쉬워질 것입니다.
지금까지는 따로 예외 상황에 예외를 던지고 그에 대한 대처를 하는 로직 없이 while()문을 통해 올바른 값이 들어오고 나올 때 까지 입,출력을 반복하는 방법으로 코드를 짰습니다. 다음 PR때는 이 구조를 예외처리 구조(try - catch) 로 변경해보셨으면 좋겠습니다.
Originally posted by @Rok93 in #2 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.