{{Short description|Way to categorize assembly languages}} The label of '''second-generation programming language''' ('''2GL''') is a generational way to categorize assembly languages.<ref name="Computer Hope">[http://www.computerhope.com/jargon/num/1gl.htm "Computer Hope, Generation languages"]</ref><ref name="Brookshear">{{cite book |last1=Brookshear |first1=J. Glenn |title=Computer science : an overview |year=2012 |publisher=Addison-Wesley |isbn=978-0-13-256903-3 |pages=240–241 |edition=11th}}</ref><ref name=":0">{{Cite web|url=http://www.uni-miskolc.hu/~geofiz/Oktatok/vass/Generations_and_paradigms.pdf|title=Programming Language generations and Programming Paradigms|last=Vass|first=Péter|access-date=2019-06-11|archive-date=2020-01-29|archive-url=https://web.archive.org/web/20200129065933/http://www.uni-miskolc.hu/~geofiz/Oktatok/vass/Generations_and_paradigms.pdf|url-status=dead}}</ref> They belong to the low-level programming languages.
The term was coined to provide a distinction from higher level machine independent third-generation programming languages (3GLs) (such as COBOL, C, or Java) and earlier first-generation programming languages (machine code)<ref name="Brookshear" /><ref name=":1">{{Cite web|url=http://www.wisegeek.com/what-are-programming-language-generations.htm|title=What Are Programming Language Generations?|website=wiseGEEK|language=en-US|access-date=2019-06-11}}</ref>
==Second-generation programming language== {{further| Assembly language}} Second-generation programming languages have the following properties: *Lines within a program correspond directly to processor commands, essentially acting as a mnemonic device overlaying a first generation programming language. *The code can be read and written by a programmer. To run on a computer it must be converted into a machine readable form, a process called assembly.<ref name=":1" /> *The language is specific to a particular processor family and environment.<ref name="Brookshear" />
Second-generation languages are sometimes used for parts of kernels or device drivers, and are sometimes used in video games, graphics programs, and other intensive programs.<ref name="Computer Hope" />
In modern programs, second generation assembly languages are rarely used.<ref>{{Cite web|url=http://statisticstimes.com/tech/top-computer-languages.php|title=Top Computer Languages 2019 - StatisticsTimes.com|website=statisticstimes.com|access-date=2019-06-11|archive-url=https://archive.today/20190612064009/http://statisticstimes.com/tech/top-computer-languages.php|archive-date=2019-06-12}}</ref> Programming in second generation languages may yield speed benefits, but several disadvantages have led to its decline:
* Programming is expressed in terms of individual processor instructions, rather than higher level logic.<ref name="Brookshear" /><ref name=":0" /> * Low-level memory and hardware details must be manually managed which is often bug-prone.<ref name="Brookshear" /> * Programs are machine-dependent, so different versions must be written for every target machine architecture.<ref name=":0" />
The vast majority of programs are written in a third-generation programming language or a fourth-generation programming language. Assembly's main advantage, speed, has degraded by the fact that well written C code can often be as fast or even faster than handwritten assembly.<ref name="Brookshear" /><ref>{{cite web |last1=Walls |first1=Colin |title=Why C is faster than assembly |url=https://blogs.mentor.com/colinwalls/blog/2013/02/18/why-c-is-faster-than-assembly/ |website=Mentor, a Sieman's Business |publisher=Mentor Inc. |archive-url=https://web.archive.org/web/20200129065925/https://blogs.mentor.com/colinwalls/blog/2013/02/18/why-c-is-faster-than-assembly/ |access-date=11 June 2019|archive-date=2020-01-29 }}</ref>
Second generation languages are perhaps most significant in their place in computing history. For a long time, Second generation assembly languages were the only good option for development for many machines, such as the NES or the Commodore 64.<ref>{{cite web |last1=Commodore corporation |title=C64 programmer's reference |url=https://www.commodore.ca/manuals/c64_programmers_reference/c64-programmers_reference_guide-05-basic_to_machine_language.pdf |publisher=Commodore corporation |access-date=11 June 2019}}</ref><ref>{{cite web |author1=Wikibooks contributors |title=NES assembly |url=https://en.wikibooks.org/w/index.php?title=NES_Programming&oldid=3551383 |website=Wikibooks: NES Assembly |access-date=11 June 2019}}</ref> Second generation languages represented a massive step away from the tradition of programmers conforming to the needs of a machine, and the first step towards the machine accommodating for the programmer, a phenomenon that would be repeated in all subsequent programming language generations.<ref name="Brookshear" /><ref name=":0" />
==References== {{Reflist}}
{{Programming language generations}}
Category:Programming language classification