์‰๋„์ž‰ ์—ฐ์Šต: Object-Oriented Programming in 60 Seconds ๐Ÿ‘จโ€๐Ÿ’ป - ์˜์ƒ์œผ๋กœ ์˜์–ด ๋งํ•˜๊ธฐ ๋ฐฐ์šฐ๊ธฐ

๋ ˆ์Šจ ๋งŒ๋“œ๋Š” ์ค‘...
1
What is object-oriented programming?
2
Object-oriented programming is actually one of the most popular ways to program.
3
It separates and organizes your code around objects.
4
Let's say I'm building a game about cars.
5
I would have a class named vehicle
6
and in there would have attributes like build and year and methods like drive or reverse.
7
And this works like a blueprint so that when you create the object, it's contained in its own instance.
8
But where this gets really powerful though is through inheritance.
9
Let's say I wanted to add a boat to my video game.
10
You could create a class named boat that inherits all of the functions
11
and data of vehicle while having its own private methods like drop and anchor or whatever boats do.
12
But object-oriented programming doesn't go without its own critiques.
13
Objects usually contain mutable states, which makes them a little bit harder to debug, especially if it's being passed around a lot.
14
Make sure to follow for more dev-related content.

์ด ๋น„๋””์˜ค๋กœ ๋งํ•˜๊ธฐ ์—ฐ์Šต์„ ํ•ด์•ผ ํ•˜๋Š” ์ด์œ ๋Š”?

์œ ํŠœ๋ธŒ ์˜์–ด ๊ณต๋ถ€๋ฅผ ํ†ตํ•ด ์˜์–ด ๋งํ•˜๊ธฐ ๋Šฅ๋ ฅ์„ ํ–ฅ์ƒ์‹œํ‚ค๋Š” ๊ฒƒ์€ ๋งค์šฐ ํšจ๊ณผ์ ์ž…๋‹ˆ๋‹ค. ์ด ๋น„๋””์˜ค์—์„œ๋Š” ๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์˜ ๊ธฐ์ดˆ๋ฅผ ๊ฐ„๋žตํ•˜๊ฒŒ ์„ค๋ช…ํ•˜๋ฉด์„œ, ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ํ†ตํ•œ ์†Œํ†ต์˜ ์ค‘์š”์„ฑ์„ ๊ฐ•์กฐํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๋น„๋””์˜ค๋ฅผ ํ™œ์šฉํ•˜๋ฉด ์‹ค์ œ ์ƒํ™ฉ์—์„œ ์‚ฌ์šฉ๋˜๋Š” ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์šฉ์–ด์™€ ํ‘œํ˜„์„ ์ตํž ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์–‘ํ•œ ์˜ˆ์‹œ์™€ ๋งฅ๋ฝ ์†์—์„œ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ๋Œ€ํ™” ๊ธฐ์ˆ ์„ ์—ฐ์Šตํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๋Š” ์˜์–ด ๋ฐœ์Œ ๊ต์ •์—๋„ ํฐ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค. ํŠนํžˆ, ๊ฐ์ฒด์™€ ํด๋ž˜์Šค ๊ฐœ๋…์„ ์„ค๋ช…ํ•˜๋ฉด์„œ ํ™œ์šฉ๋˜๋Š” ์–ดํœ˜๋“ค์€ ๊ธฐ์ˆ ์ ์ธ ๋Œ€ํ™”์—์„œ ์ž์ฃผ ๋“ฑ์žฅํ•˜๋ฏ€๋กœ, ์ด์™€ ๊ฐ™์€ ์ž๋ฃŒ๋ฅผ ํ†ตํ•ด ์‹ค๋ ฅ ํ–ฅ์ƒ์„ ๋„๋ชจํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฌธ๋ฒ• ๋ฐ ๋งฅ๋ฝ ์† ํ‘œํ˜„

  • ๋ถ€์ •์‚ฌ์™€ ํ˜„์žฌ๋ถ„์‚ฌ: ๋น„๋””์˜ค์—์„œ "to create a class"๋‚˜ "having its own private methods"์™€ ๊ฐ™์€ ๊ตฌ์กฐ๋Š” ๋งํ•˜๊ธฐ์— ์ž์ฃผ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ํ‘œํ˜„์€ ๋ชฉ์ ์ด๋‚˜ ์ƒํƒœ๋ฅผ ์„ค๋ช…ํ•˜๋ฉฐ, ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ๋ฌธ์žฅ์„ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • ์กฐ๊ฑด๋ฌธ: "Let's say I wanted to add a boat"์™€ ๊ฐ™์€ ํ‘œํ˜„์€ ์ƒํ™ฉ์„ ๊ฐ€์ •ํ•  ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. ์˜์–ด ๋งํ•˜๊ธฐ ์—ฐ์Šต์‹œ ์กฐ๊ฑด์ ˆ์„ ํ†ตํ•ด ๊ฐ€์ •์  ๋ฌธ์žฅ์„ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ƒ์† ๊ฐœ๋…: "inherits all of the functions and data"์™€ ๊ฐ™์€ ํ‘œํ˜„์€ ๊ธฐ์ˆ  ์˜์–ด์—์„œ ์ค‘์š”ํ•œ ๊ฐœ๋…์ž…๋‹ˆ๋‹ค. ํ† ๋ก ์ด๋‚˜ ๋ฐœํ‘œ์—์„œ ์ƒ์†์„ ์„ค๋ช…ํ•  ๋•Œ ์ด ๋ฌธ์žฅ์„ ํ™œ์šฉํ•ด๋ณด์„ธ์š”.

์ผ๋ฐ˜์ ์ธ ๋ฐœ์Œ ํ•จ์ •

์ด ๋น„๋””์˜ค ์•ˆ์—๋Š” ๋ฐœ์Œ์ด ํ—ท๊ฐˆ๋ฆด ์ˆ˜ ์žˆ๋Š” ๋‹จ์–ด๋“ค์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, "vehicle"๊ณผ "method"๋Š” ๋ฐœ์Œ์ด ๋ณต์žกํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ํŠนํžˆ ๋น„๊ฐ•์Œ์„ ํ›ˆ๋ จํ•  ๋•Œ ์œ ์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋˜, "boat", "anchor"์™€ ๊ฐ™์€ ๋‹จ์–ด๋“ค์€ ๊ฐ•์กฐํ•  ๋•Œ ์–ต์–‘์ด ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์œผ๋‹ˆ ์ฃผ์˜๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฐ ๋‹จ์–ด๋“ค์€ shadowspeaks์™€ ๊ฐ™์€ shadowing site๋ฅผ ์ด์šฉํ•ด ๋ฐ˜๋ณต์ ์œผ๋กœ ์—ฐ์Šตํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ๋น„๋””์˜ค์˜ ๋‚ด์šฉ๊ณผ ํ•จ๊ป˜ ๋ฐœ์Œ ์—ฐ์Šต์„ ๋ณ‘ํ–‰ํ•˜๋ฉด, ๋”์šฑ ์›ํ™œํ•˜๊ฒŒ ๊ธฐ์ˆ ์ ์ธ ๋Œ€ํ™”์— ์ฐธ์—ฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์‰๋„์ž‰์ด๋ž€? ์˜์–ด ์‹ค๋ ฅ์„ ๋น ๋ฅด๊ฒŒ ํ‚ค์šฐ๋Š” ๊ณผํ•™์  ๋ฐฉ๋ฒ•

์‰๋„์ž‰(Shadowing)์€ ์›๋ž˜ ์ „๋ฌธ ํ†ต์—ญ์‚ฌ ํ›ˆ๋ จ์„ ์œ„ํ•ด ๊ฐœ๋ฐœ๋œ ์–ธ์–ด ํ•™์Šต ๊ธฐ๋ฒ•์œผ๋กœ, ๋‹ค์–ธ์–ด ํ•™์ž์ธ Dr. Alexander Arguelles์— ์˜ํ•ด ๋Œ€์ค‘ํ™”๋œ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ํ•ต์‹ฌ ์›๋ฆฌ๋Š” ๊ฐ„๋‹จํ•˜์ง€๋งŒ ๋งค์šฐ ๊ฐ•๋ ฅํ•ฉ๋‹ˆ๋‹ค: ์›์–ด๋ฏผ์˜ ์˜์–ด๋ฅผ ๋“ค์œผ๋ฉด์„œ 1~2์ดˆ์˜ ์งง์€ ์ง€์—ฐ์œผ๋กœ ์ฆ‰์‹œ ์†Œ๋ฆฌ ๋‚ด์–ด ๋”ฐ๋ผ ๋งํ•˜๋Š” ๊ฒƒโ€”โ€”๋งˆ์น˜ '๊ทธ๋ฆผ์ž(shadow)'์ฒ˜๋Ÿผ ํ™”์ž๋ฅผ ๋”ฐ๋ผ๊ฐ€๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋ฌธ๋ฒ• ๊ณต๋ถ€๋‚˜ ์ˆ˜๋™์ ์ธ ์ฒญ์ทจ์™€ ๋‹ฌ๋ฆฌ, ์‰๋„์ž‰์€ ๋‡Œ์™€ ์ž… ๊ทผ์œก์ด ๋™์‹œ์— ์‹ค์‹œ๊ฐ„์œผ๋กœ ์˜์–ด๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ณ  ์žฌํ˜„ํ•˜๋„๋ก ํ›ˆ๋ จํ•ฉ๋‹ˆ๋‹ค. ์—ฐ๊ตฌ์— ๋”ฐ๋ฅด๋ฉด ์ด ๋ฐฉ๋ฒ•์€ ๋ฐœ์Œ ์ •ํ™•๋„, ์–ต์–‘, ๋ฆฌ๋“ฌ, ์—ฐ์Œ, ์ฒญ์ทจ๋ ฅ, ๋งํ•˜๊ธฐ ์œ ์ฐฝ์„ฑ์„ ํฌ๊ฒŒ ํ–ฅ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค. IELTS ์Šคํ”ผํ‚น ์ค€๋น„์™€ ์ž์—ฐ์Šค๋Ÿฌ์šด ์˜์–ด ์†Œํ†ต์„ ์›ํ•˜๋Š” ๋ถ„๋“ค์—๊ฒŒ ํŠนํžˆ ํšจ๊ณผ์ ์ž…๋‹ˆ๋‹ค.