Khác biệt giữa bản sửa đổi của “Lập trình tổng quát”

Nội dung được xóa Nội dung được thêm vào
Dịch từ bài viết Anh
 
AlphamaEditor, Executed time: 00:00:07.0032243 using AWB
Dòng 2:
 
'''Lập trình tổng quát''' (tiếng Anh: ''generic programming'') là một dạng [[lập trình máy tính]] mà trong đó [[thuật toán]] được viết theo cách [[kiểu dữ liệu|kiểu]] ''được-xác-định-sau'' và sau đó được ''khởi tạo'' (''instantiate'') nếu cần cho một kiểu cụ thể mà được cung cấp như [[Tham số (khoa học máy tính)|tham số]]. Cách tiếp cận này, được tiên phong bởi [[ML (ngôn ngữ lập trình)|ML]] vào năm 1973,<ref name="Lee2008">
{{chú thích sách
{{cite book
| last=Lee
| first=Kent D.
| title=Programming Languages: An Active Learning Approach
| url=https://books.google.com/books?id=OuW5dC2O99AC&pg=PA9
| date=ngày 15 Decembertháng 12 năm 2008
| publisher=Springer Science & Business Media
| isbn=978-0-387-79422-8
| pages=9–10}}</ref><ref>{{cite conference | title=A Logic for Computable Functions with Reflexive and Polymorphic Types | accessdate=ngày 15 Octobertháng 10 năm 2016 |author1=Milner, R. |author2=Morris, L. |author3=Newey, M. | booktitle=Proceedings of the Conference on Proving and Improving Programs | year=1975}}</ref> cho phép viết các [[chương trình con|hàm]] hay [[kiểu dữ liệu|kiểu]] chung mà chỉ khác nhau ở tập các kiểu mà chúng dùng, do vậy giảm thiểu được [[trùng lặp mã|sự trùng lặp]]. Các thực thể phần mềm như vậy gọi là ''generic'' trong [[Ada (ngôn ngữ lập trình)|Ada]], [[C Sharp (ngôn ngữ lập trình)|C#]], [[Delphi (ngôn ngữ lập trình)|Delphi]], [[Eiffel (ngôn ngữ lập trình)|Eiffel]], [[F Sharp (ngôn ngữ lập trình)|F#]], [[Java (ngôn ngữ lập trình)|Java]], [[Objective-C]], [[Rust (ngôn ngữ lập trình)|Rust]], [[Swift (ngôn ngữ lập trình)|Swift]], và [[Visual Basic .NET]]. Chúng còn được gọi là ''[[đa hình tham số]]'' (''parametric polymorphism'') trong [[ML (ngôn ngữ lập trình)|ML]], [[Scala (ngôn ngữ lập trình)|Scala]], [[Haskell (ngôn ngữ lập trình)|Haskell]] (cộng đồng Haskell cũng sử dụng thuật ngữ "generic" cho khái niệm liên quan nhưng với ý nghĩa hơi khác biệt) và [[Julia (ngôn ngữ lập trình)|Julia]]; ''[[Template (C++)|template]]'' trong [[C++]] và [[D (ngôn ngữ lập trình)|D]]; và ''kiểu tham số'' (''parameterized type'') trong cuốn sách có nhiều ảnh hưởng năm 1994 ''[[Design Patterns (sách)|Design Patterns]]''.<ref name="GoF">
{{chú thích sách
{{cite book
| last1 = Gamma
| first1 = Erich
Dòng 34:
 
== Tham khảo ==
{{Reflisttham khảo}}
 
== Trích dẫn ==
{{refbegin}}
* {{Citechú bookthích sách | last1 = Musser | first1 = D. R. | authorlink1 = David Musser | last2 = Stepanov | first2 = A. A. | authorlink2 = Alexander Stepanov| chapter = Generic programming | doi = 10.1007/3-540-51084-2_2 | title = Symbolic and Algebraic Computation: International symposium ISSAC 1988 | editor = P. Gianni | series = Lecture Notes in Computer Science | volume = 358 | pages = 13–25 | year = 1989 | isbn = 978-3-540-51084-0 | ref = harv }}
* {{cite conference | url =http://www.research.att.com/~bs/hopl-almost-final.pdf |title=Evolving a language in and for the real world: C++ 1991-2006 |authorlink=Bjarne Stroustrup |last=Stroustrup |first=Bjarne |conference=ACM HOPL 2007 |year=2007}}
* {{citechú bookthích sách |title=Design Patterns: Elements of Reusable Object-Oriented Software |first1=Erich |last1=Gamma |first2=Richard |last2=Helm|first3=Ralph |last3=Johnson |first4=John |last4=Vlissides |year=1994 |publisher=Addison-Wesley |isbn=0-201-63361-2 }}
{{refend}}
 
Dòng 50:
| conference = Spring School on Datatype-Generic Programming 2006 | series = Lecture Notes in Computer Science | volume = 4719 | pages = 1–71
| publisher = Springer | location = Heidelberg | year = 2007 }}
* [[Bertrand Meyer]]. "[http://se.ethz.ch/~meyer/publications/acm/geninh.pdf Genericity vs Inheritance]." In ''OOPSLA (First ACM Conference on Object-Oriented Programming Systems, Languages and Applications),'' Portland (Oregon), 29 September–2September–ngày October2 tháng 10 năm 1986, pages 391–405.
 
== Liên kết ngoài ==
Dòng 71:
* [[Free Pascal]]: [http://www.freepascal.org/docs-html/ref/refch8.html Free Pascal Reference guide Chapter 8: Generics], Michaël Van Canneyt, 2007
* [[CodeGear Delphi|Delphi]] for Win32: [http://sjrd.developpez.com/delphi/tutoriel/generics/ Generics with Delphi 2009 Win32], Sébastien DOERAENE, 2008
* Delphi for .NET: [http://www.felix-colibri.com/papers/oop_components/delphi_generics_tutorial/delphi_generics_tutorial.html Delphi Generics], Felix COLIBRI, 2008
 
;Eiffel