Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> C++

ความแตกต่างระหว่าง C++ และ Go

มาทำความเข้าใจแนวคิดของ C++ และ Go ก่อนเรียนรู้ความแตกต่างระหว่างกัน

Go

เป็นภาษาโปรแกรมมิ่งโอเพนซอร์สที่พัฒนาโดยพนักงาน Google มีเจตนาเป็นภาษาที่คอมไพล์รวดเร็ว มีการเก็บขยะ (garbage collected) แบบ strongly typed และรองรับการเขียนโปรแกรมแบบ concurrent โดยตรง

นักพัฒนาเดิม Rob Pike, Robert Griesemer และ Ken Thompson เริ่มต้นในปี 2007 ได้รับอนุญาตภายใต้ BSD license ในระบบขนาดใหญ่รองรับ static typing และ scalability

คุณสมบัติ

  • Language Design
  • Powerful standard library
  • Package Management
  • Static Typing
  • Testing Support
  • C-inspired syntax
  • Compiled
  • Safe and open source

ข้อดี

  • Security friendly
  • Supported by Google
  • Ease to use
  • Excellent documentation
  • Do more with less

ข้อเสีย

  • Development takes more effort
  • Young language
  • Less versatile
  • Takes more time for building large ecosystem
  • Consumes more computational resources

C++

ทำหน้าที่เป็นโครงสร้างพื้นฐานของโปรแกรมมากมาย งานคำนวณ และภาษาโปรแกรมมิ่งอื่นๆ เป็นภาษา procedural, functional และ multi-paradigm เปิดตัวปี 1985 โดยโปรแกรมเมอร์ชาวเดนमार्क Bjarne Stroustrup เป็นภาษา object-oriented และ general-purpose อนุญาต multiple inheritance

คุณสมบัติ

  • Speed
  • Popular and simple to use
  • Object oriented programming
  • Platform independence
  • Case sensitive
  • Compiler based
  • High level programming language
  • Dynamic memory allocation
  • Existence of Libraries

ข้อดี

  • Multi-paradigm
  • Compatibility with C
  • Portability
  • Object oriented
  • Memory management
  • Low level manipulation
  • Scalability
  • Large community support

ข้อเสีย

  • Security issues
  • Use of pointers
  • Absence of Built-in threads
  • Absence of Garbage collector

ความแตกต่างหลัก

GoC++
ภาษาโอเพนซอร์สพัฒนาโดยพนักงาน Googleภาษา object-oriented general-purpose
นักพัฒนาเดิมเริ่มต้นปี 2007เปิดตัวปี 1985 โดย Bjarne Stroustrup
ไม่รองรับ multiple inheritanceรองรับ multiple inheritance
คอมไพเลอร์ไม่มี optimizationมี SIMD optimizations ระหว่างคอมไพล์
ไม่รองรับ class-based declarationsรองรับ classes
BSD licenseOpen source project 2.0
Static และ strong typingStatic typing
ไม่มี polymorphismมี polymorphism
มี logical operatorsใช้ true, false, bool
ไม่มี template librariesมี Standard Template Library
ไม่รองรับ implicit type conversionรองรับ implicit type conversion
ไม่รองรับ const/volatile qualifiersรองรับ const และ volatile qualifiers
ไม่รองรับ inheritanceรองรับ inheritance
ไม่ใช้ while/do-while ใช้ for แทนมี while และ do-while