๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90

ํด๋ฆฐ์ฝ”๋“œ2

[๋งˆ๋ฌด๋ฆฌ] ํด๋ฆฐ์ฝ”๋“œ์™€ ๋‹Œ์ž์ฝ”๋“œ ๐Ÿฅท ๋‹Œ์ž์ฝ”๋“œ๋‹Œ์ž๋ผ ๋ถˆ๋ฆฌ๋˜ ์ „์„ค ์† ๊ฐœ๋ฐœ์ž๋“ค์€ ์œ ์ง€๋ณด์ˆ˜ ๋‹ด๋‹น ๊ฐœ๋ฐœ์ž๋ฅผ ํ˜น๋…ํ•˜๊ฒŒ ํ›ˆ๋ จํ•˜๊ธฐ์œ„ํ•ด ๋‹ค์–‘ํ•œ ํŽธ๋ฒ•์„ ์‚ฌ์šฉํ–ˆ๋‹ค.์ฝ”๋“œ ์งง๊ฒŒ ์“ฐ๊ธฐ๊ธ€์ž ํ•˜๋‚˜๋งŒ ์‚ฌ์šฉํ•˜๊ธฐ์•ฝ์–ด ์‚ฌ์šฉํ•˜๊ธฐํฌ๊ด„์ ์ธ ๋ช…์‚ฌ ์‚ฌ์šฉํ•˜๊ธฐ์ฒ ์ž๊ฐ€ ์œ ์‚ฌํ•œ ๋‹จ์–ด ์‚ฌ์šฉํ•˜๊ธฐ๋™์˜์–ด ์‚ฌ์šฉํ•˜๊ธฐ์ด๋ฆ„ ์žฌ์‚ฌ์šฉํ•˜๊ธฐ์žฌ๋ฏธ๋กœ ์–ธ๋”์Šค์ฝ”์–ด ์‚ฌ์šฉํ•˜๊ธฐ๊ณผ์žฅ ํ˜•์šฉ์‚ฌ ์‚ฌ์šฉํ•˜๊ธฐ์™ธ๋ถ€ ๋ณ€์ˆ˜ ๋ฎ์–ด์“ฐ๊ธฐ๋ถ€์ž‘์šฉ์ด ์žˆ๋Š” ์ฝ”๋“œ ์ž‘์„ฑํ•˜๊ธฐํ•จ์ˆ˜์— ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ ๋„ฃ๊ธฐ// ์ถœ์ฒ˜: ์•„์ฃผ ์œ ๋ช…ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌi = i ? i  ๐Ÿ“Œ ํด๋ฆฐ์ฝ”๋“œ์™€ ๋‹Œ์ž์ฝ”๋“œ ๋น„๊ต๊ฐ€๋…์„ฑ๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ดํ•ด ๊ฐ€๋Šฅ์ž‘์„ฑ์ž ๋ณธ์ธ๋งŒ ์ดํ•ด ๊ฐ€๋Šฅ์œ ์ง€๋ณด์ˆ˜์„ฑ์ˆ˜์ • ๋ฐ ํ™•์žฅ์ด ์šฉ์ด์ˆ˜์ • ์‹œ ์˜ค๋ฅ˜ ๋ฐœ์ƒ ๊ฐ€๋Šฅ์„ฑ ๋†’์Œ์ฝ”๋“œ ์Šคํƒ€์ผ๋ช…ํ™•ํ•œ ๋„ค์ด๋ฐ, ์ค‘๋ณต ์ตœ์†Œํ™”, ๊ฐ„๊ฒฐํ•œ ๊ตฌ์กฐ์งง๊ณ  ์ถ•์•ฝ๋œ ์ฝ”๋“œ, ๊ฐ€๋…์„ฑ ๋‚ฎ์Œ์—๋Ÿฌ ์ฒ˜๋ฆฌ์ ์ ˆํ•œ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์ œ๊ณต๋ถˆ๋ช…ํ™•ํ•œ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ๋ฐฉ์‹ ๐Ÿ’ป ๋‹Œ์ž์ฝ”๋“œ ์˜ˆ์‹œclass L.. 2024. 10. 17.
[๋งˆ๋ฌด๋ฆฌ] ํด๋ฆฐ์ฝ”๋“œ ๐Ÿ‘ฉ‍๐Ÿ’ป ํด๋ฆฐ์ฝ”๋“œ# ์ฝ๊ธฐ ์‰ฌ์šด ์ฝ”๋“œ๊ฐ€ ํด๋ฆฐ์ฝ”๋“œ์ด๋‹ค.๋”๋ณด๊ธฐ"I like my code to be elegant and efficient. The logic should be straightforward and make it hard for bugs to hide, the dependencies minimal to ease maintenance, error handling complete according to an articulated strategy, and performance close to optimal so as not to tempt people to make the code messy with unprincipled optimizations. Clean code does one thing w.. 2024. 10. 16.
728x90