Google Go Vs C Purpose

first Introduction

" The importance of language in the evolution of culture lies in the fact that man has set up a different world around the other world, a place that was so firm that he could lift the rest of the world from his hinges while standing, and know how to make a long-term belief in the concept and name of things, as in asternae veritates, that it has committed itself to the pride that has risen above the animal itself: it really thought it was knowledge of the world in its language . ”Fredrick Nietzsche.

All computer programmers have a few notes that the programming language is the best. and special functions are required depending on our application reasons why there are so many programming languages ​​and a new, which is being introduced almost daily. Despite the great interest and attention to language design, many modern programming languages ​​do not always provide innovation in language design, for example, Microsoft and Apple only offer variations.

It's not too far in history when C entered the computing world and became the basis for many other successful programming languages. Most members of this family have approached their infamous mother and very few have been able to disappear and distinguish themselves as individual beings. However, the computing landscape has changed since C's birth. Computers are thousands of times faster using multi-core processors. The internet and web access are widely available and the devices are getting smaller, smaller numbers and mobile computing come into the mainstream. In this era, we want a language that makes our lives better and easier.

According to the TOOBER Index, Go and C were among the fastest growing languages, especially in 2009, and Go was given the same year as the programming language of the year. TIOBER can obtain results by indexing on a monthly basis. Indexing is updated using data from qualified programmers, training and software vendors. These data are collected by Google, Bing, Yahoo, Wikipedia and YouTube search engines for TIOBER. The results were more predictable for the C-object, because it is the iPhone and Mac language, and Apple is running strongly on the market. However, this result is much more interesting because it didn't take long because the technology kindly introduced its programming language GO.

2. A Little Story

Go's infamous mother, Google, dominated the search, email and more. So the introduction of the new programming language is not shocking! Like Google's open source projects, Go began a 20 percent project that Google is experimenting with, and later became something more serious. Robert Griesemer, Rob Pike, and Ken Thompson officially announced Design and Go in November 2009. Google has released the BS under a BSD-style license in the hope that the programming community will develop and build on software development. Currently Go is still very young and experimental. Even Google does not use Go for large-scale applications. While the site that stores the code is running a server built with the Go application as evidence, the primary purpose of the release was to attract developers and build a Go community. Despite its excellent status, Go already supports the standard tools expected from the system language.

C Objective There is, however, a longer and more bold story. Today, it is mainly used on Apple Mac OS and iPhone. The C target is the primary language of Apple's COCOA API. Goal C was created by Brad Cox and Tom Love in the early 1980s at StepStone. In 1986, Cox published the main description of C-objective in its original form Object-oriented programming, evolutionary approach . Since then, the C-object has been compared to other functions with features, and now it's Steve Jobs & # 39; chosen language.

There are several aspects that contribute to the design, success or failure of a programming language. In this article I will try to compare the two most important languages ​​in the future.

3. General Comparison

Nowadays, the world is full of programming languages ​​and becomes more and more general and general, but they still have their specialties and features, and each language has its disadvantages and advantages.

Generally, languages ​​can be divided into different categories. The following table does not include a complete list of all possible comparable features. When comparing the two selected programming languages, we selected slightly more important attributes and give a brief explanation for each of them.

3.1 Paradigm

Objective-C is an essential object-oriented language, which means that the status of objects can change. Objective-C also provides the full power of a true object-oriented language, along with a syntax for the original C and many other keywords. Of course, object-oriented programs are built around objects, so all objects have roots in the C-object. One class is used to produce similar objects, copies of the class. The classes are used to insert the data and methods that belong to each other. The methods are Objective-C's data-related operations that are identified by message selectors. Objective-C supports polymorphism, which means that multiple classes have the same name method. Custom inheritance can also be used to reuse the code. To obtain multiple inheritance, the closest one is to create a class that has instance variables in references to other objects. However, the Objective-C philosophy is that programmers do not need multiple inheritance and discourage it.

The GO is a little different. Go designers have chosen the message forwarding model for parallel programming. The language offers two basic constructs for Goroutines and the channels to reach the paradigm. Google FAQs written by Google and not object-oriented in Design FAQs! Although Go types and methods exist and simulate an object-oriented programming style, there is no type hierarchy. The lack of type hierarchy makes Go objects much easier than the objective C object. Go uses an innovative approach for objects and programmers who don't have to worry about big object trees. Because go is not really an object-oriented language, the programmer can solve the problem in any way and still enjoy object-oriented features.

I don't really think of an object-oriented language that has no hierarchical inheritance mechanism. But for those who have this, it creates a better model of flexibility and reuse. The lack of inheritance in Go is really interesting! As far as I can remember, inheritance has always been taught to me as a stop of the object's orientation. The reality is that inheritance is not the only possible mechanism for reuse in object orientation. The composition is arguably a stronger mechanism for sharing behavior than inheritance.

Object-oriented programming has become extremely popular, especially in large companies, as it is an appropriate approach to software development and increases the chances of successful projects with teams of mediocre programmers. Object-oriented programming uses standards for these programmers and prevents individuals from too much damage. The price is that the resulting code is full of duplication. This is not a very high price for large companies because their software will be full of copies.

3.2 Syntax

The C-object is the extension of the standard ANSI C, and existing C-programs can be adapted to use software frames without losing the work they are developing. In Objective C, all the benefits of the C programmer are given in the C program when working within Objective C. The programmer may decide to do something in an object-oriented manner, such as determining a new class or adhering to procedural programming techniques. The C-object is generally considered to be a hybrid between C and Smalltalk. Lessons from the learning curve may be the basic knowledge of the C Programming Program, before entering into the world of the CC object, such as syntax and Object-oriented programming, often the new programmers and the Lens AC show a long and difficult learning curve. exception.

Go is also a C family member, but I think the Go guys break the coding style and make it somehow different. Compared to objective C, declarations are back. In C, notification is that a variable is called a type that represents its type as in Basic, which I think is a nice idea.

by Go: var a, b * int;

I find that getting closer to a human natural language, for example, this is the expression "the variable integer" is shown:

var the int;

This is clearer, clearer and more regular.

Go also allows multiple assignments that occur in parallel.

i, j = j, i // i and j.

Go instructions do not accept parentheses. While it is the most common control statement, if it were, "if (me) {" in C and most OO languages. But Go would have the following form

if alone {

Another difference in Go is that semicolons are not recommended. However, any Go instruction can be removed with a semicolon. In reality, semicolons are for analysts and Google has eliminated them as much as possible. No statement requires a semicolon that is comfortable enough.

Go is a reverse language that resembles a C. There are currently two Go compilers available, one for the x86 platform and the other for AMD. Go's translation speed is very fast. When I first tried it (deliberately or without proper measurement), it was hurt too fast! My experience in programming languages ​​is limited and I focus on object-oriented languages ​​like Java, so I never saw such speed! One of the main promising goals of Go is that things can really be coordinated quickly. According to the official Go Presentation video Go's performance is within 10-20% of C. However, I do not believe that it is really reliable until we get performance indicators in the near future.

3.3 Exceptions and Generations

The C object has no generic types where the programmer decides to use the C ++ templates in their individual collection classes. Objective-C uses dynamic typing, which means that running time does not interest the type of objects because it can receive all object messages. When a programmer adds an object to the built-in collection, they are treated as if they were a type identifier. Like C ++, the Objective-C language has an exception handling syntax. The

Go type system does not support general types. At least they haven't considered it so far. The generics are comfortable, but the system and run time are high-level, and Go can't survive! Like generics, exceptions remain an open question. Many programmers are likely to find it difficult to approach the Go exception while being innovative and useful. The Google code base is not exception-tolerant, so exceptions are similar stories and skipped the language. Instead, the programmer can use multiple return values ​​to handle call-related errors. Because Go is a garbage collection, the lack of exceptions is less of a problem than C ++, but there are still cases where things like file management or external resources need to be cleaned up. Many programmers believe that exceptions are essential in a modern programming language. However, I don't like the exception because I find nasty treatment in most languages. In a language such as Go, where more values ​​can be returned from the functions, programmers can do things, such as restoring the result and status code, and handling errors using status codes.

3.4 Type Systems

Compared to other C object oriented languages, Objective C is very dynamic. Nowadays, programmers choose dynamically typed languages, such as C-target. The downside is that less information is available during the translation period. This dynamics means you can send a message to an object that is not specified on its surface. The compiler contained detailed information about the runtime objects. Any decisions made during the translation period will be delayed until the program is running. This ensures the flexibility and performance of the C programs.

The problem of dynamically typed languages ​​may be infinite run time errors that may be uncomfortable and confusing. However, Objective-C allows the programmer to identify the class of the object, and in these cases the compiler uses a strong typing method. Goal C executes most of the decisions at runtime. The poorly typed metrics are often used for things like collection classes, where the exact type of objects in the collection may be unknown. For programmers who use consistent typed languages, the use of poor typing would cause problems, so some can give up flexibility and dynamism. At the same time, while dynamic C substitution is slower than a static language. Many developers believe that extra flexibility is definitely worth the price, and most desktop applications are rarely using more than 10% of the modern CPU. I do not agree with the above justification that only 10% of the CPU is used. So what ?! It is not a very good trend that minimalist approaches to efficiency and performance are replaced by wasteful programs that largely accept hardware performance, and I personally work with more static type testing.

Go also tries to respond to this growing trend of dynamically typed languages ​​and offers an innovative system. Finally, Go gives you a programmer by typing the Pythonish duck. Go really has an unusual type of system: it does not inherit and does not fill in the clarity between the types. Instead, programmers can define the types of structure and then create methods to operate them. As with C, programmers can also define interfaces. The Go is strongly Typ, but the good thing is that it is not as strong! The programmer does not need to explicitly declare the types of variables. Instead, Go implicitly assigns the type to the untyped variable when the value is first assigned to the variable. there is a dynamic type of information beneath the covers that the programs can use to do interesting things.

3.5 Garbage collection

It is very important today that garbage collection is one of the greatest sources of keeping everything clean and handling memory. In C objective C 2.0, garbage collection was introduced. This is certainly good news for the new iPhone and Mac developers, who are very useful for Java. Garbage collection has simplified things, but programmers still need to be cautious about memory management. The Objective-C 2.0 garbage collector is a conservative collector, which means that not only do developers have full access to C language performance, but also the ability to integrate with C ++ code and libraries. Using the application of the C-C object, the programmer can create a large part of its application, allowing the garbage collector to handle the memory and, where necessary, to escape the performance of C and C ++.

In Go, as parallel and multithreaded programming, memory management is very difficult because objects can move between threads and it is very difficult to guarantee that they will be safely released after we want to get rid of them. Automatic garbage collection facilitates simultaneous coding. With the idea that a person like me, who has long been accustomed to high-level, safe, garbage collection languages, it is so boring news. on the other hand, at the low level of system programming languages, this type of change is revolutionary, especially when the desired performance is achieved. Go Focus focuses on speed, and the performance of garbage collection. However, the advancement of garbage collection technology has allowed him to not have a significant delay and allowed Google to include it in Go.

4. Future and Conclusions

The popularity of these two languages ​​should be increasing. Perhaps the reason is that Microsoft's light is shrinking; Apple and Google are rapidly taking over their own ecosystem. Go is a language supported by Google, which is an indispensable advantage of popularity, reputation, and technical coverage, and the C-objective is supported by the massive Steve Job empire.

Objective C benefits from cocoa libraries delivered to Mac OS. Mac OS X and iPhone have the greatest difference in language delivery. Recently, huge iPhone applications are emerging, and the ability to create simple money with simple programming projects is quite high. And I think this fundamental human fact greatly contributes to the future growth of C. Objective. Because the more developers use the language and test it in different situations, the better and stronger the language will be.

Go is really an interesting language. With Google's support and resources, programmers can be confident that Go will have some future, even if it's not too bright! I think the language has a potential, but it takes time, not a very short time before the developers can roll up their current platform and choose Go. Go is still a small language. It is experimental and not recommended in a production environment. There is no IDE integration and there are few code examples. Go is incomplete and has published what they got and encouraged developers. contribution. As an open source project supported by Google, I think that Go will soon create an IDE and an ecosystem, as it seems that the TIOBER index mentioned earlier has indeed been well received. But it is impossible to predict how big the ecosystem will be. If the language is capable of generating an ecosystem, things go smoothly. I think it will be necessary later to support the Windows operating system and integrate Eclipse with IDE in order to further expand it among programmers.

Apple and Objective C stress are all object-oriented programming for object-oriented programming and language-related documentation. So there is a huge difference between C and Go in this sense. But like any other human or machine language, Objective C and Go can be compared according to certain criteria, and I tried to make a general comparison between the two. However, it may take a lot of time for these two languages ​​to actually reach. Go is young and full of uncertainties. This makes it difficult to compare the two programming languages, or maybe it is "impossible", according to my programmer friend. Go has to make a proper assessment of the unbiased judges for a reasonable time to be more comparable, but I'm sure we will hear more about these two languages ​​in the near future.

Source by Esfandiar Amirrahimi

Leave a Reply

Your email address will not be published. Required fields are marked *