Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Computer programming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Modern programming== ===Quality requirements=== {{main|Software quality}} Whatever the approach to development may be, the final program must satisfy some fundamental properties. The following properties are among the most important:<ref>{{cite magazine |magazine=[[InformationWeek]] |url=https://www.informationweek.com/cloud/nist-to-develop-cloud-roadmap/d/d-id/1093958? |title=NIST To Develop Cloud Roadmap |date=November 5, 2010 |quote=Computing initiative seeks to remove barriers to cloud adoption in security, interoperability, portability and reliability.}}</ref> <ref>{{cite news |newspaper=[[Computerworld]]|date=April 9, 1984 |page=13 |title=What is it based on |quote=Is it based on ... Reliability Portability. Compatibility}}</ref> *[[Reliability engineering#Software reliability|Reliability]]: how often the results of a program are correct. This depends on conceptual correctness of algorithms and minimization of programming mistakes, such as mistakes in resource management (e.g., [[buffer overflow]]s and [[race condition]]s) and logic errors (such as division by zero or [[off-by-one error]]s). *[[Robustness (computer science)|Robustness]]: how well a program anticipates problems due to errors (not bugs). This includes situations such as incorrect, inappropriate or corrupt data, unavailability of needed resources such as memory, operating system services, and network connections, user error, and unexpected power outages. *[[Usability]]: the [[ergonomics]] of a program: the ease with which a person can use the program for its intended purpose or in some cases even unanticipated purposes. Such issues can make or break its success even regardless of other issues. This involves a wide range of textual, graphical, and sometimes hardware elements that improve the clarity, intuitiveness, cohesiveness, and completeness of a program's user interface. *[[Software portability|Portability]]: the range of [[computer hardware]] and [[operating system]] platforms on which the source code of a program can be [[compiled]]/[[interpreter (computing)|interpreted]] and run. This depends on differences in the programming facilities provided by the different platforms, including hardware and operating system resources, expected behavior of the hardware and operating system, and availability of platform-specific compilers (and sometimes libraries) for the language of the source code. *[[Maintainability]]: the ease with which a program can be modified by its present or future developers in order to make improvements or to customize, fix [[Software bug|bugs]] and [[Vulnerability (computing)|security holes]], or adapt it to new environments. Good practices<ref>{{Cite web |url=http://wisdomgeek.com/programming/tips-become-good-programmer |title=Programming 101: Tips to become a good programmer - Wisdom Geek |date=May 19, 2016 |website=Wisdom Geek |language=en-US |access-date=2016-05-23 |archive-date=May 23, 2016 |archive-url=https://web.archive.org/web/20160523063915/http://wisdomgeek.com/programming/tips-become-good-programmer |url-status=live }}</ref> during initial development make the difference in this regard. This quality may not be directly apparent to the end user but it can significantly affect the fate of a program over the long term. *[[Algorithmic efficiency|Efficiency]]/[[performance engineering|performance]]: Measure of system resources a program consumes (processor time, memory space, slow devices such as disks, network bandwidth and to some extent even user interaction): the less, the better. This also includes careful management of resources, for example cleaning up [[temporary file]]s and eliminating [[memory leak]]s. This is often discussed under the shadow of a chosen programming language. Although the language certainly affects performance, even slower languages, such as [[Python (programming language)|Python]], can execute programs instantly from a human perspective. Speed, resource usage, and performance are important for programs that [[Bottleneck (software)|bottleneck]] the system, but efficient use of programmer time is also important and is related to cost: more hardware may be cheaper. Using [[Test automation|automated tests]] and [[Fitness function|fitness functions]] can help to maintain some of the aforementioned attributes.<ref>{{Cite book |title=Fundamentals of Software Architecture: An Engineering Approach |publisher=O'Reilly Media |year=2020 |isbn=978-1492043454}}</ref> ===Readability of source code=== In computer programming, [[readability]] refers to the ease with which a human reader can comprehend the purpose, [[control flow]], and operation of [[source code]]. It affects the aspects of quality above, including portability, usability and most importantly maintainability. Readability is important because programmers spend the majority of their time reading, trying to understand, reusing, and modifying existing source code, rather than writing new source code. Unreadable code often leads to bugs, inefficiencies, and [[Code duplication|duplicated code]]. A study found that a few simple readability transformations made code shorter and drastically reduced the time to understand it.<ref>{{cite journal|doi=10.1145/358589.358596|title=Improving computer program readability to aid modification|journal=Communications of the ACM|volume=25|issue=8|pages=512–521|year=1982|last1=Elshoff|first1=James L.|last2=Marcotty|first2=Michael|s2cid=30026641|doi-access=free}}</ref> Following a consistent [[programming style]] often helps readability. However, readability is more than just programming style. Many factors, having little or nothing to do with the ability of the computer to efficiently compile and execute the code, contribute to readability.<ref>{{cite web|url=http://docforge.com/wiki/Readability|title=Readability|author=Multiple (wiki)|work=Docforge|url-status=live|archive-url=https://web.archive.org/web/20200429211203/http://www.docforge.com/wiki/Readability|archive-date=2020-04-29|access-date=2010-01-30}}</ref> Some of these factors include: *Different [[indent style]]s (whitespace) *[[Comment (computer programming)|Comments]] *[[decomposition (computer science)|Decomposition]] *[[Naming conventions (programming)|Naming conventions]] for objects (such as variables, classes, functions, procedures, etc.) The [[separation of presentation and content|presentation]] aspects of this (such as indents, line breaks, color highlighting, and so on) are often handled by the [[source code editor]], but the content aspects reflect the programmer's talent and skills. Various [[visual programming language]]s have also been developed with the intent to resolve readability concerns by adopting non-traditional approaches to code structure and display. [[Integrated development environment]]s (IDEs) aim to integrate all such help. Techniques like [[Code refactoring]] can enhance readability. ===Algorithmic complexity=== The academic field and the engineering practice of computer programming are concerned with discovering and implementing the most efficient algorithms for a given class of problems. For this purpose, algorithms are classified into ''orders'' using [[Big O notation]], which expresses resource use—such as execution time or memory consumption—in terms of the size of an input. Expert programmers are familiar with a variety of well-established algorithms and their respective complexities and use this knowledge to choose algorithms that are best suited to the circumstances. ===Methodologies=== The first step in most formal software development processes is [[requirements analysis]], followed by testing to determine value modeling, implementation, and failure elimination (debugging). There exist a lot of different approaches for each of those tasks. One approach popular for requirements analysis is [[Use Case]] analysis. Many programmers use forms of [[Agile software development]] where the various stages of formal software development are more integrated together into short cycles that take a few weeks rather than years. There are many approaches to the Software development process. Popular modeling techniques include Object-Oriented Analysis and Design ([[OOAD]]) and Model-Driven Architecture ([[Model-Driven Architecture|MDA]]). The Unified Modeling Language ([[Unified Modeling Language|UML]]) is a notation used for both the OOAD and MDA. A similar technique used for database design is Entity-Relationship Modeling ([[Entity-Relationship Model|ER Modeling]]). Implementation techniques include imperative languages ([[Object-oriented programming|object-oriented]] or [[procedural programming|procedural]]), [[functional programming|functional languages]], and [[logic programming]] languages. ===Measuring language usage=== It is very difficult to determine what are the most popular modern programming languages. Methods of measuring programming language popularity include: counting the number of job advertisements that mention the language,<ref>{{cite web|url = http://www.computerweekly.com/Articles/2007/09/11/226631/sslcomputer-weekly-it-salary-survey-finance-boom-drives-it-job.htm|title = SSL/Computer Weekly IT salary survey: finance boom drives IT job growth|date = 11 September 2007|first = Nicholas|last = Enticknap|url-access = registration|access-date = June 24, 2009|archive-date = October 26, 2011|archive-url = https://web.archive.org/web/20111026035734/http://www.computerweekly.com/Articles/2007/09/11/226631/SSLComputer-Weekly-IT-salary-survey-finance-boom-drives-IT-job.htm|url-status = live}}</ref> the number of books sold and courses teaching the language (this overestimates the importance of newer languages), and estimates of the number of existing lines of code written in the language (this underestimates the number of users of business languages such as COBOL). Some languages are very popular for particular kinds of applications, while some languages are regularly used to write many different kinds of applications. For example, [[COBOL]] is still strong in corporate data centers<ref>{{cite web|last1=Mitchell|first1=Robert|title=The Cobol Brain Drain|url=http://www.computerworld.com/article/2504568/data-center/the-cobol-brain-drain.html|publisher=Computer World|access-date=9 May 2015|date=2012-05-21|archive-date=February 12, 2019|archive-url=https://web.archive.org/web/20190212185631/https://www.computerworld.com/article/2504568/data-center/the-cobol-brain-drain.html|url-status=live}}</ref> often on large [[mainframe computer]]s, [[Fortran]] in engineering applications, [[scripting language]]s in [[World Wide Web|Web]] development, and [[C (programming language)|C]] in [[embedded software]]. Many applications use a mix of several languages in their construction and use. New languages are generally designed around the syntax of a prior language with new functionality added, (for example [[C++]] adds object-orientation to C, and [[Java (programming language)|Java]] adds memory management and [[bytecode]] to C++, but as a result, loses efficiency and the ability for low-level manipulation). ===Debugging=== {{main|Debugging}} [[File:First Computer Bug, 1945.jpg|thumb|The first known actual bug causing a problem in a computer was a moth, trapped inside a Harvard mainframe, recorded in a log book entry dated September 9, 1947.<ref>{{cite web| url = https://www.nationalgeographic.org/thisday/sep9/worlds-first-computer-bug| title = Photograph courtesy Naval Surface Warfare Center, Dahlgren, Virginia, from National Geographic Sept. 1947| date = July 15, 2020| access-date = November 10, 2020| archive-date = November 13, 2020| archive-url = https://web.archive.org/web/20201113163443/https://www.nationalgeographic.org/thisday/sep9/worlds-first-computer-bug/| url-status = live}}</ref> "Bug" was already a common term for a software defect when this insect was found.]] Debugging is a very important task in the software development process since having defects in a program can have significant consequences for its users. Some languages are more prone to some kinds of faults because their specification does not require compilers to perform as much checking as other languages. Use of a [[static code analysis]] tool can help detect some possible problems. Normally the first step in debugging is to attempt to reproduce the problem. This can be a non-trivial task, for example as with parallel processes or some unusual software bugs. Also, specific user environment and usage history can make it difficult to reproduce the problem. After the bug is reproduced, the input of the program may need to be simplified to make it easier to debug. For example, when a bug in a compiler can make it crash when [[parsing]] some large source file, a simplification of the test case that results in only few lines from the original source file can be sufficient to reproduce the same crash. Trial-and-error/divide-and-conquer is needed: the programmer will try to remove some parts of the original test case and check if the problem still exists. When debugging the problem in a GUI, the programmer can try to skip some user interaction from the original problem description and check if the remaining actions are sufficient for bugs to appear. Scripting and [[breakpoint]]ing are also part of this process. Debugging is often done with [[Integrated development environment|IDE]]s. Standalone debuggers like [[GDB]] are also used, and these often provide less of a visual environment, usually using a [[command line]]. Some text editors such as [[Emacs]] allow GDB to be invoked through them, to provide a visual environment.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)