일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 백준 2504번
- 그래프(Graph)
- 알고리즘 개념
- 백준 2261번
- 위상 정렬(Topology Sort)
- 그리디 알고리즘(Greedy Algorithm)
- 스택(Stack)
- DFS(Depth First Search)
- 백준 1707번
- 다익스트라 알고리즘(Dijkstra Algorithm)
- DFS & BFS
- 이분 탐색(Binary Search)
- 백준 21606번
- 분할 정복(Divide and Conquer)
- 트리(Tree)
- 백준 1948번
- BFS
- 백준 10000번
- 백준 18352번
- 동적 프로그래밍(Dynamic Programming)
- 백준 2493번
- DFS
- 백준 17608번
- 큐(Queue)
- BFS(Breadth First Search)
- 이분 그래프(Bipartite Graph)
- 백준 9012번
- 위상 정렬(Topological Sort)
- 플로이드 워셜 알고리즘(Floyd-Warshall Algorithm)
- 백준 2812번
- Today
- Total
Always Be Wise
프로그래밍 패러다임 본문
명령형 프로그래밍(Imperative Programming)
명령형 프로그래밍은 프로그램이 어떻게 동작해야 하는지 명시적으로 기술하는 패러다임이다.
Imperative programming is a paradigm describing HOW the program should do something by explicitly specifying each instruction (or statement) step by step, which mutate the program's state.
Example)
List<int> collection = new List<int> { 1, 2, 3, 4, 5 };
List<int> results = new List<int>();
foreach(var num in collection)
{
if (num % 2 != 0)
results.Add(num);
}
절차적 프로그래밍(Procedural Programming)
절차적 프로그래밍에서 절차적(Procedural)이라는 의미는 프로그램이 순차적으로 명령을 수행한다는 것이 아니다.
기본적으로 프로그램은 순차적으로 명령을 수행한다.
프로시저(Procedure) 기반으로 구조화된 프로그래밍 패러다임을 의미한다.
루틴, 서브루틴, 메소드, 함수 등이 프로시저에 해당하며 이를 사용하여 추상화와 재사용성을 확보할 수 있다.
Procedural Programming can be defined as a programming model which is derived from structured programming, based upon the concept of calling procedure.
Procedures, also known as routines, subroutines or functions, simply consist of a series of computational steps to be carried out.
객체 지향 프로그래밍
객체 지향 프로그래밍은 프로그램을 명령어의 목록으로 보는 시각에서 벗어나 여러 개의 독립된 단위,
즉 객체들의 모임으로 파악하고자 하는 패러다임을 의미한다.
데이터와 기능을 추상화시켜 객체를 만들고, 객체들 간의 유기적인 상호작용을 통해 프로그램을 구성할 수 있다.
주요한 특징으로 추상화, 캡슐화, 상속, 다형성 등이 있다.
추상화(Abstraction) : 구현하고자 하는 대상의 공통적인 데이터와 기능을 도출하는 것
캡슐화(Encapsulation) : 객체에 필요한 데이터와 기능을 하나로 묶고, 은닉하는 것
상속성(Inheritance) : 기존 객체의 특징을 다른 객체에서 재사용하거나 추가하는 것
다형성(Polymorphism) : 상속을 통해 기능을 확장하거나 변경하여 다른 형태로 재구성되는 것
Object-oriented programming can be defined as a programming model which is based upon the concept of objects.
Objects contain data in the form of attributes and code in the form of methods.
선언형 프로그래밍(Declarative Programming)
선언형 프로그래밍은 프로그램이 무엇을 해야하는지 기술하는 패러다임이다.
Declarative programming is a paradigm describing WHAT the program does, without explicitly specifying its control flow.
Example)
var results = collection.Where( num => num % 2 != 0);
함수형 프로그래밍(Functional Programming)
함수형 프로그래밍은 순수 함수를 이용해서 문제를 해결하는 프로그래밍 패러다임이다.
순수 함수란 함수가 하나의 기능만을 하며 내부에서 데이터가 변하지 않으며 전역 상태가 존재하지 않는 함수를 의미한다.
Functional programming (also called FP) is a way of thinking about software construction by creating pure functions. It avoid concepts of shared state, mutable data observed in Object Oriented Programming.
Functional langauges empazies on expressions and declarations rather than execution of statements. Therefore, unlike other procedures which depend on a local or global state, value output in FP depends only on the arguments passed to the function.
반응형 프로그래밍
반응형 프로그래밍이란 비동기적 데이터 스트림을 처리하는 프로그래밍 패러다임이다.
Reactive programming describes a design paradigm that relies on asynchronous programming logic to handle real-time updates to otherwise static content.
참고 자료
1. Introduction of Programming Paradigms(Eng)
2. Declarative vs imperative(Eng)
3. What-is-the-difference-between-declarative-and-imperative-paradigm-in-programming?(Eng)
4. Differences between Procedural and Object Oriented Programming(Eng)
'기술 관련 정리' 카테고리의 다른 글
Monolithic Architecture and Micro Service Architecture (0) | 2022.06.10 |
---|---|
객체 지향 프로그래밍 (0) | 2022.04.27 |
트랜잭션이란? (0) | 2022.04.12 |
정렬 알고리즘 - 계수 정렬(Counting Sort) (0) | 2022.04.09 |
정렬 알고리즘 - 힙 정렬(Heap Sort) (0) | 2022.04.09 |