반응형
Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
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
Archives
Today
Total
05-19 00:03
관리 메뉴

ImJay

프로그래밍언어론 01장 문제풀이 (Concepts of programming languages chapter 1) 본문

대학생활/프로그래밍언어론

프로그래밍언어론 01장 문제풀이 (Concepts of programming languages chapter 1)

ImJay 2022. 4. 3. 23:59
반응형

Programming Language Assignment #1


1.    Do you believe the solving a problem in a particular algorithmic step requires programming language skills? Support your opinion.

 

I believe that programming language technology is only a way to express an algorithm in a form that can be executed on a computer, and is not an essential element for solving algorithm problems. In addition to programming languages, I believe that various algorithm expression methods such as natural language, pseudo code, and flowchart can also replace programming languages.

 

프로그래밍 언어 기술은 알고리즘을 컴퓨터에서 실행할 수 있는 형태로 표현하기 위한 방식일 뿐, 알고리즘 문제 해결을 위해 필수적인 요소는 아니라고 생각합니다. 프로그래밍 언어 외에 자연어, 의사 코드, 순서도 등 다양한 알고리즘 표현 방식 또한 프로그래밍 언어를 대체할 수 있다고 생각합니다.

 

2.    Who is said to be the first programmer in human history? Use the Internet for help.

 

The first programmer in human history was Ada Lovelace. She was an English mathematician and writer, known primarily for her work on the Analytical Engine, Charles Babbage's early mechanical general-purpose computer. Her notes on the engine credited her as being the first algorithm intended to be processed by a machine.

 

인간 역사에서 첫 프로그래머는 Ada Lovelace입니다. 그녀는 Charles Babbage의 초기 기계 범용 컴퓨터인 Analytical Engine에 대한 작업으로 주로 알려진 영국 수학자이자 작가였습니다. 엔진에 대한 그녀의 메모에는 기계가 처리하도록 의도된 최초의 알고리즘으로 인정받았습니다.

 

3.    Which characteristics of programming language do you think are the most important and why?

 

I think the most important characteristic of a programming language is readability, because today the focus of programming is not on efficiency, but on cost of maintenance. So, no matter who wrote the code, it should be easy for anyone to read. Easy to read reduces maintenance time, which can have a huge impact on costs.

 

저는 프로그래밍 언어의 특성 중 가장 중요한 것은 가독성이라고 생각합니다.왜냐하면 오늘날 프로그래밍의 초점은 효율성이 아니라 유지 관리 비용이기 때문입니다. 따라서 누가 짠 코드이든, 누군가가 쉽게 읽을 수 있어야 합니다. 읽기 쉬워야 유지 보수 진행 시간이 줄어들고, 이는 곧 비용에도 막대한 영향을 끼치기 때문입니다.

 

4.    Explain how the orthogonality in a programming language is closely related to simplicity.

 

Orthogonality is closely related to simplicity because it deals with how to combine a relatively small number of components in a relatively small number of ways to achieve the desired result. This is because the more orthogonal the language design, the fewer exceptions the language rules require. The fewer exceptions, the more regular the design, the easier it is to learn, read, and understand the language.

 

직교성(Orthogonality)은 원하는 결과를 얻기 위해 상대적으로 적은 수의 구성 요소를 상대적으로 적은 수의 방법으로 결합하는 방법을 다루기 때문에 단순성과 밀접한 관련이 있습니다. 언어 디자인이 직교할수록 언어 규칙에 필요한 예외가 줄어들기 때문입니다. 예외가 적을수록 디자인의 규칙성이 높아져 언어를 더 쉽게 배우고 읽고 이해할 수 있습니다.

 

5.    Describe some design trade-offs between security and modularity in some language you know.

 

In C++ programming I learned in sophomore year, I used the features of the Windows library that allow users to put Windows functions in custom functions outside of the default ones. This is one of the ways that programmers can trade off security while maintaining the modularity of their programs without having to combine some features into others.

 

2학년 중 배웠던 C++ 프로그래밍에서 사용자가 기본 기능 외부의 사용자 정의 기능에 Windows 기능을 넣을 수 있도록 하는 Windows 라이브러리의 기능을 사용해보았습니다. 이는 프로그래머가 보안을 절충하면서 일부 기능을 다른 기능으로 결합하지 않고도 프로그램의 모듈성을 유지할 수 있도록 하는 방법 중 하나입니다.

 

6.    Can we call any programming language complete, in your opinion? Why or why not?

 

In my opinion, the expression of completion in the current programming language will not exist in the future. This is because all programming languages so far each have their own pros and cons, and the languages that were mainly used in the past are now being created as new versions of languages that have removed the shortcomings and are being used more by people. In the future, even programming languages that are currently in the spotlight for various reasons will be pushed back when new languages that remove the shortcomings are released, and since this phenomenon will continue, there seems to be no word of completion in programming languages.

 

제 생각에는 지금의 프로그래밍 언어에서 완성이라는 표현은 앞으로도 없을 것 같습니다. 왜냐하면 지금까지의 모든 프로그래밍 언어들은 각자 고유한 장단점들이 존재하고, 과거에 주로 사용했던 언어들이 현재는 단점을 제거한 새로운 버전들의 언어로 탄생하여 사람들에게 더 많이 쓰이고 있기 때문입니다. 앞으로도 현재 여러한 이유로 사람들에게 각광받는 프로그래밍 언어들도 언젠간 단점을 제거한 새로운 언어들이 나오면 뒤로 밀려날 것이고, 이러한 현상은 계속 지속될 것이기 때문에 프로그래밍 언어에 완성이라는 단어는 없을 것 같습니다.

 

7.    Was the first high-level programming language you learned implemented with a pure interpreter, a hybrid implementation system, or a compiler?

 

The first high-level programming language I first learned was C, implemented with Visual C++, and implemented with a compiler.

 

제가 처음 배운 첫 고급 프로그래밍 언어는 Visual C++로 구현된 C언어 이며 컴파일러로 구현되었습니다.

 

8.    Describe the advantages and disadvantages of using different computer architecture for writing a program.

 

The advantage of using different computer architectures to write programs is that using different computer architectures allows programmers to make their programs compatible with other computer architectures they use. A disadvantage of using different computer architectures to write programs is that different computer architectures behave differently when executing the program's statements. This can create incompatibilities between the program and the computer architecture and can lead to errors.

 

프로그램을 작성하기 위해 다른 컴퓨터 아키텍처를 사용할 때의 장점은 다른 컴퓨터 아키텍처를 사용하면 프로그래머가 자신의 프로그램을 자신이 사용한 다른 컴퓨터 아키텍처와 호환되도록 할 수 있다는 점이 있습니다. 프로그램을 작성하기 위해 다른 컴퓨터 아키텍처를 사용할 때의 단점은 다른 컴퓨터 아키텍처가 프로그램의 명령문을 실행할 때 다르게 동작한다는 것입니다. 이것은 프로그램과 컴퓨터 아키텍처 사이에 비호환성을 생성할 수 있고 오류를 유발할 수 있습니다.

 

9.    Does a Just-In-Time (JIT) implementation system affect the execution of code? Why or why not?

 

I think the JIT implementation system affects code execution especially over time. JIT initially translates a program into an intermediate language and compiles the intermediate language into machine language during execution. The JIT system improves the runtime performance of computer programs based on bytecode that runs slower than compiled machine code. Programs in JIT are stored as bytecode in memory, but the currently executing code segment is compiled into the physical machine, so I think code execution is much faster.

 

저는 JIT implementation system은 특히 시간에 코드 실행에 영향을 미친다고 생각합니다. JIT는 초기에 프로그램을 중간 언어로 번역하고 실행 중에 중간 언어를 기계어로 컴파일합니다. JIT 시스템은 컴파일 된 기계어 코드보다 느리게 실행되는 바이트 코드를 기반으로 컴퓨터 프로그램의 런타임 성능을 향상시킵니다. JIT의 프로그램은 메모리에 바이트 코드로 저장되지만 현재 실행 중인 코드 세그먼트는 물리적 시스템으로 컴파일 되므로, 코드 실행이 훨씬 빠르다고 생각합니다.

 

10. Some programming languages – for example, SQL- use “=” to check the equality of two expressions, while C uses it to assign values to variable. Which of these, in your opinion, is most natural and least likely to result in syntax errors? Support your answer.

 

It may be the effect of learning C as my first programming language, but in my opinion, using “==” to check equality of two expressions and “=” to assign variables is the least error-prone and most I think it's natural. I had never used the expression “==” when learning math before, so I felt awkward when I first learned it. However, the more I came into contact with programming languages, the more I realized that there was no substitute for the expression “==”. Because if we unify the expression “=” for checking equality and assigning variables, it will cause a lot of confusion in checking equality when we use a programming language. In terms of readability of the code, it will take more time to interpret the code, as we have to distinguish in every code whether the "=" is used to check equality or to assign a variable.

 

제가 첫 프로그래밍 언어로 C언어를 배웠던 영향일 수도 있겠지만, 제 생각에는 두 표현식의 동등성을 확인하는데 “==”를 사용하고, 변수를 할당하는데 “=”를 사용하는게 오류가 발생할 가능성이 가장 낮고 가장 자연스럽다고 생각합니다. 기존에 수학을 배울 때에는 “==”라는 표현을 사용한 적이 없어 처음 배울 때 어색한 감이 있었습니다. 그러나 프로그래밍 언어를 많이 접할 수록 “==”라는 표현을 대체할 표현은 없다고 생각이 들었습니다. 왜냐하면, 동등성을 확인하는 것과 변수를 할당하는 것에 “=”라는 표현을 통일시킨다면, 우리가 프로그래밍 언어를 사용함에 있어 동등성을 확인하는데 큰 혼란을 야기할 것이기 때문입니다. 코드의 가독성에 있어서, 우리는 모든 코드마다 “=”가 동등성을 확인하는 것인지, 변수를 할당하는데 사용하는 것인지 구분해야 하므로 코드를 해석하는데 더 많은 시간이 걸릴 것입니다.

반응형
Comments