An introduction to programming in Go

“Computer programming is the art, craft and science of writing programs which define how computers operate. This book will teach you how to write computer programs using a programming language designed by Google named Go.” Freely available book on Go.

53 Comments

***I know this comment is controversial and I am not trying to flame bait or make start a war but I am really interested to know what are the opinions. So before down voting this comment leave your reply.***

As much as I would like to see (use?) new languages on my everyday work, will we see anything of this new crop of languages actually make any dent in the market? Companies that started with PHP or Rails started moving away from that

Heard a lot about Go and Scala, also Groovy and Rails. But somehow the hype around those faded away and we are back to the old axis of languages.

What is the opinion of everyone around here? What about the merits of individual languages and why they dont stick?

Well, one of the main particularities of C++ is that it tries to integrate every programming language feature known to man in a huge bundle. As stated multiple times by Stourstrup on his website, this was done on purpose, so as not to enforce a particular coding standard upon developer. However, it causes several problems :

-Teaching students about the whole language within a reasonable time frame is impossible. Even if it was possible, they would not remember it all anyway. Therefore, every C++ dev uses a unique subset of the languages’ features, and may not be familiar with the subset of other devs even with years of coding experience behind him.

-Compilers have a hard time keeping up with the flow of new features. This is especially apparent today with C++11, since features whose inclusion in the standard was decided almost a decade ago are still not properly supported by most commercial compilers.

-Design effort is spread between all the features, thus there is little manpower available to polish individual features. Rough edges are frequent because of this, and fixed slowly if ever (think about all the intricacies of operator overloading, or how long it took for the language to gain fixed-size integer types).

-Library compatibility with other languages is minimal unless people use a very small subset of the available features in them (essentially coding all interface code in C)

D seems to follow the same path as C++ on this front. It individually adresses every gripe that people have with C++, but does not even attempt to do so in a clean and small package. Thus, if D got the popularity of C++, it would likely suffer as much issues in the long run. The fact that the language has already went through a first incompatible revision of the spec in its short existence is especially telling on this front.

This complaint can also be addressed to Ada, Modula-3, Delphi, C#, Scala, Lisp, Haskell, ML…

Programming is a complex subject and invariably all languages that start as a movement against complex languages, end up getting complex as people realize that the features the designers left out actually exist for a reason.

The way Go throws out the window two decades of language research made me change from a initial contributor to the language, to a D/Rust fan.

It’s nice that the standard is that long, but irrelevant. A great deal of that standard (if it’s anything like Scheme’s) deals with implementation details, which are mostly irrelevant to programming (at least until you get to the optimization stage.)

The fact of the matter is that Lisp’s form makes it simple, to use and understand. Regardless of how large the standard document is.

Of course, as you might gather, I’m more of into Scheme than Common Lisp. Which also more truly embodies the “simple” description.

This complaint can also be addressed to Ada, Modula-3, Delphi, C#, Scala, Lisp, Haskell, ML…

Considering that most of these have either fallen into disuse or been restricted to a niche these days, I am not sure how this large list is supposed to impress me.

Programming is a complex subject and invariably all languages that start as a movement against complex languages, end up getting complex as people realize that the features the designers left out actually exist for a reason.

Please correct me if I’m wrong, but you give me the impression that in your view, programming languages are mostly interchangeable, to the point their features might easily be enumerated in a standard way and compared using giant tables without further information.

It seems to me that to the contrary, if you want to get the most out of a programming language, you need to stop blindly looking for familiar features from other languages which you already know, and instead learn through tutorials the idiomatic constructs that achieve the same goal in your new language. Here are some examples :

-In C/++, arrays and pointers are closely related. To parse an array, most C devs take a pointer to the first element and increment it on every loop iteration with the ++ operator. Many other programming languages, on the other hand, won’t have such a basic array implementation because it is a recipe for buffer overflow. Are they worse because they ask you to use either range-based fors or counter variables and square brackets ?

-In C/++, parsing an array is typically done using for loops, complete with some iterator magic if you’re using C++’s containers. In MATLAB, interpreter performance is not a priority for devs so for loops are horribly slow, however you have efficient built-ins for matrix manipulation and the idiomatic way to do most repetitive mathematic operations on some set of data is to express them as a matrix operation. Would you use for loops anyways ?

-In C++, if you want a bunch of objects that share some common methods, say Save() and Load(), you make yourself some gigantic class hierarchy and put near the bottom of it some basic class that has Save() and Load() as pure virtual methods. In Go, you create an interface that has methods Save() and Load(), and use it as a generic way to designate any object that has these methods. Is the latter way of doing things somehow worse than the former, in spite of requiring much less design work ?

If you follow this reasoning, you will find that it does not really matter if a given programming language has a specific feature X or Y. Feature parity is useful for beginners, because it means that they can reuse their knowledge from another language right away, but from the point of view of expert users, the only thing that matters is that the language should offer a way to achieve the same results with comparable efficiency. Only the end matters, not the means used to reach it.

The way Go throws out the window two decades of language research made me change from a initial contributor to the language, to a D/Rust fan.

How exactly does Go fail to take into account all these years of language research ? In which way is it more comparable to languages from 20 years ago than more modern languages ?

This complaint can also be addressed to Ada, Modula-3, Delphi, C#, Scala, Lisp, Haskell, ML…

Considering that most of these have either fallen into disuse or been restricted to a niche these days, I am not sure how this large list is supposed to impress me.

Some of those languages failed in the market due to the way their owners/designers tried to promote them, not because of lack of technical merits.

Programming is a complex subject and invariably all languages that start as a movement against complex languages, end up getting complex as people realize that the features the designers left out actually exist for a reason.

Please correct me if I’m wrong, but you give me the impression that in your view, programming languages are mostly interchangeable, to the point their features might easily be enumerated in a standard way and compared using giant tables without further information.

To a certain extent yes.

In proper software engineering you should learn about algorithms, data structures and ways to organize code (OO, FP, Logical, …).

Then you need to have a broad set of programming languages background that enables you for a given project, using all requirements as input, to choose the best set of languages/libraries/operating systems to solve the real problem the customer has.

Getting to know every detail of a specific tool leads to useless specialization.

I would rather leave my plumbing repairs to a plumber that knows how to get the job done, than to one that knows every detail of the special wrench XTY.

The way Go throws out the window two decades of language research made me change from a initial contributor to the language, to a D/Rust fan.

How exactly does Go fail to take into account all these years of language research ? In which way is it more comparable to languages from 20 years ago than more modern languages ? [/q]

Actually Go is even worse than that if we take in consideration that languages like Turbo Pascal or Ada are older than 20 years, and already have richer data structures available.

Go lacks:

– exceptions;

– enumerations;

– generic types;

– direct use of OS APIs, without the need of writing wrappers;

– currently only static compilation is available;

– due to static compilation only model, there are issues with 3rd party code;

– no support for meta-programming;

– rich set of available libraries;

– the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languages

Go is just a re-branded Limbo (Plan9) with ADT data type exchanged by interfaces.

I bet that if it wasn’t being developed at Google, almost no one would care for it. All their Go PR talks is about showing web applications that can be equality easily done in any available mainstream language.

Try to find one that is not about doing REST APIs, or front-ends with Ajax calls.

Anyone with a proper compiler design curriculum in their CS degree can easily find languages/libraries that offer similar features.

It occurs to me that you miss the entire point of Go. It was never about having all of the features, it was always about choosing features that compliment each other and work well together (while achieving most functionality.) It doesn’t matter if other languages provide a feature Go does, what matters is if it’s as easy to use (and it usually isn’t.)

You’ll probably disagree, but static linking is a good thing. There really isn’t any benefit to dynamic linking these days (well, there really never was.)

“Please correct me if I’m wrong, but you give me the impression that in your view, programming languages are mostly interchangeable, to the point their features might easily be enumerated in a standard way and compared using giant tables without further information.”

To a certain extent yes.

In proper software engineering you should learn about algorithms, data structures and ways to organize code (OO, FP, Logical, …).

Then you need to have a broad set of programming languages background that enables you for a given project, using all requirements as input, to choose the best set of languages/libraries/operating systems to solve the real problem the customer has.

Getting to know every detail of a specific tool leads to useless specialization.

I would rather leave my plumbing repairs to a plumber that knows how to get the job done, than to one that knows every detail of the special wrench XTY.

I think that we are each defending extreme sides of what is in reality a compromise there.

I don’t think that devs should necessarily know “every detail” about their programming language either, but some level of specialization seems still necessary if you want to make proper use of your specific tool.

In your plumber example, if my plumber had bought one of these fancy keys with a free-wheeling functionality, I would expect him to know how to use it, and not spend a few minutes randomly flinging it around or parsing the manual while trying to find the switch that toggles fastening mode and loosening mode. I agree, however, that he doesn’t need to know the specific procedure required to clean and grease it in order to do that job.

Can we agree on that ?

Actually Go is even worse than that if we take in consideration that languages like Turbo Pascal or Ada are older than 20 years, and already have richer data structures available.

Go lacks:

– exceptions;

Wrong (see panic/recover)

– enumerations;

Wrong (see iota)

– generic types;

Although the specific feature is not there, Go provides generics-like features through interfaces. The language FAQ states that they will add some if someone can clearly point out why they are needed and how they are worth the complexity cost : http://golang.org/doc/go_faq.html#generics

– direct use of OS APIs, without the need of writing wrappers;

That’s cheating, OS APIs will always look fugly in any language but the one in which these APIs have been written (see Windows API in Delphi back in the day, yuck !)

– currently only static compilation is available;

Same in C/++ to the best of my knowledge, and that never prevented them from being largely successful. Dynamic compilation is only useful in some specific use cases, such as when the code is supposed to run on heterogenous architectures and cannot be easily recompiled after development.

– due to static compilation only model, there are issues with 3rd party code;

Such as ?

– no support for meta-programming;

See comment on generic types above.

– rich set of available libraries;

There’s already quite a bit of packages available for such a young language, if you ask me, and the use of a standard package manager makes it easier to deal with third-party libraries than in, say, C.

– the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languages

They exist elsewhere indeed, go simply acknowledges their importance in today’s programming landscape and thus propose a standard, well-integrated, less cumbersome way to use them.

It’s as if you said that C++ is a garbage-collected language because there are C++ libs that implement garbage collection. Sure, C++ *can* be garbage-collected, but it is not a standard part of the language, students do not learn it, those who learn it as part of their work will often separately use gazillions of different, incompatible libraries… And I guess you see where I’m going from there.

Go is just a re-branded Limbo (Plan9) with ADT data type exchanged by interfaces.

I don’t know much about Limbo, but if it was a fine language recycling ideas from it sounds sensible. No need to reinvent the wheel every time.

I bet that if it wasn’t being developed at Google, almost no one would care for it. All their Go PR talks is about showing web applications that can be equality easily done in any available mainstream language.

Try to find one that is not about doing REST APIs, or front-ends with Ajax calls.

I am not interested in Google’s PR, only in Go as a publicly documented programming language that sounds interesting and happens to have gained a bit of traction, so I won’t discuss that part.

Anyone with a proper compiler design curriculum in their CS degree can easily find languages/libraries that offer similar features.

In your plumber example, if my plumber had bought one of these fancy keys with a free-wheeling functionality, I would expect him to know how to use it, and not spend a few minutes randomly flinging it around or parsing the manual while trying to find the switch that toggles fastening mode and loosening mode. I agree, however, that he doesn’t need to know the specific procedure required to clean and grease it in order to do that job.

Can we agree on that ?

Yes.

Go lacks:

– exceptions;

Wrong (see panic/recover)

Panic/recover usually lead to very ugly code similar to setjmp/longjmp and resemble poor man’s exceptions.

- enumerations;

Wrong (see iota)

Wrong, with iota you are not able to offer what real enumerations mean.

Strong type assignment between enumerations, conversion to string, parse string to enumeration, cycle between enumeration values, compile exceptions when not all cases are referred in switch/case statements.

- generic types;

Although the specific feature is not there, Go provides generics-like features through interfaces. The language FAQ states that they will add some if someone can clearly point out why they are needed and how they are worth the complexity cost : http://golang.org/doc/go_faq.html#generics

Generics-like features through interfaces don’t work for primitive types. Plus you get performance hit when casting everywhere.

- direct use of OS APIs, without the need of writing wrappers;

That’s cheating, OS APIs will always look fugly in any language but the one in which these APIs have been written (see Windows API in Delphi back in the day, yuck !)

Taking Delphi as example, you are able to bind directly to the OS API, while in Go you need to write a wrapper using the CGO tool, which requires a C compiler to compile the generated wrapper.

- currently only static compilation is available;

Same in C/++ to the best of my knowledge, and that never prevented them from being largely successful. Dynamic compilation is only useful in some specific use cases, such as when the code is supposed to run on heterogenous architectures and cannot be easily recompiled after development.

All commercial C++ compilers offer dynamic compilation as well. I was using it with Turbo C++ 3.1 back in 1996.

- due to static compilation only model, there are issues with 3rd party code;

Such as ?

You cannot make use of LGPL libraries.

- no support for meta-programming;

See comment on generic types above.

How does this apply to meta-programming?

- rich set of available libraries;

There’s already quite a bit of packages available for such a young language, if you ask me, and the use of a standard package manager makes it easier to deal with third-party libraries than in, say, C.

Sure, but why should I try to convince our customers to allow us to use Go over the plethora of options we have already available today?

- the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languages

They exist elsewhere indeed, go simply acknowledges their importance in today’s programming landscape and thus propose a standard, well-integrated, less cumbersome way to use them.

It’s as if you said that C++ is a garbage-collected language because there are C++ libs that implement garbage collection. Sure, C++ *can* be garbage-collected, but it is not a standard part of the language, students do not learn it, those who learn it as part of their work will often separately use gazillions of different, incompatible libraries… And I guess you see where I’m going from there.

Bad example. C++11 has a garbage collection API for compiler vendors to implement their own GC.

A proper GC might be part of C++17 standard.

Go is just a re-branded Limbo (Plan9) with ADT data type exchanged by interfaces.

I don’t know much about Limbo, but if it was a fine language recycling ideas from it sounds sensible. No need to reinvent the wheel every time.

May be, on the other hand, it looks like the authors are not willing to learn anything else and do not assume the world has moved on.

Anyone with a proper compiler design curriculum in their CS degree can easily find languages/libraries that offer similar features.

Panic/recover usually lead to very ugly code similar to setjmp/longjmp and resemble poor man’s exceptions.

I can’t tell, since ugly is a subjective concept and in my own view, exceptions overall are an ugly solution to the error management problem. But can you explain more clearly what kind of “clean” exception-based code you would not be able to efficiently implement in Go ?

[W]ith iota you are not able to offer what real enumerations mean.

Strong type assignment between enumerations,

The following Go code defines a strongly typed enumeration of type “Type1” :

type Type1 int

const (

First1 Type1 = iota

Second1

Last1

)

conversion to string, parse string to enumeration

In which situation would you use those features outside of a debugging context, considering how they leak implementation details in program I/O ?

cycle between enumeration values

How is this different from a for loop ?

compile exceptions when not all cases are referred in switch/case statements.

Are default statements considered as a reference to all cases which are not explicitly referred to when this feature is enabled ?

If not, this feature basically breaks them as soon as it is enabled. If yes, it fails to meet its apparent goal of helping devs update their code when new elements are added in an enum.

“Although the specific feature is not there, Go provides generics-like features through interfaces. The language FAQ states that they will add some if someone can clearly point out why they are needed and how they are worth the complexity cost : http://golang.org/doc/go_faq.html#generics

”

Generics-like features through interfaces don’t work for primitive types. Plus you get performance hit when casting everywhere.

Few languages, if any, will let you mess with primitive types. Languages with operator overloading do let you go the other way around and have custom types behave loosely like primitive ones, but that’s generally a bad idea unless your custom types *do* happen to offer similar functionality as primitive ones (ex : float vectors vs float numbers)

As for the performance cost of interfaces, I don’t see why it should be much different from that of templating, considering that the internal mechanism is very similar (resolve references to the interface function at compile time, just like you’d do with references to the unknown type in templates).

Taking Delphi as example, you are able to bind directly to the OS API, while in Go you need to write a wrapper using the CGO tool, which requires a C compiler to compile the generated wrapper.

You make it sound like Object Pascal and C code link by magic when brought close to each other. The Borland guys rather took some time to create headers for C libraries and functions to convert idiomatic Pascal types to encapsulated C types, then document the whole mess. Which is pretty much a wrapper. As I said, writing one seems inevitable when two unrelated languages have to communicate with each other.

“Same in C/++ to the best of my knowledge, and that never prevented them from being largely successful. Dynamic compilation is only useful in some specific use cases, such as when the code is supposed to run on heterogenous architectures and cannot be easily recompiled after development. ”

All commercial C++ compilers offer dynamic compilation as well. I was using it with Turbo C++ 3.1 back in 1996.

Alright, my mistake.

[D]ue to static compilation only model, […] [y]ou cannot make use of LGPL libraries.

Well, it’s more like you cannot make use of them in a proprietary package as you have to contribute your source back. But I see you point.

“See comment on generic types above.”

How does this apply to meta-programming?

Sorry, I just made the C++ dev mistake of equating generics and metaprogramming. Well, aside from genericity through interfaces, Go also provides some support for reflection in the reflect package, which you might want to take a look at : http://golang.org/pkg/reflect

“There’s already quite a bit of packages available for such a young language, if you ask me, and the use of a standard package manager makes it easier to deal with third-party libraries than in, say, C.”

Sure, but why should I try to convince our customers to allow us to use Go over the plethora of options we have already available today?

To have the benefits and drawbacks of static languages in a more modern package than C++, with still a fair amount of popular libraries at hand.

By more modern, I mean that like other recent languages, Go learns from common C/++ dev mistakes and prevents them, with safe pointers and arrays, a “defer” keyword for resource release, modules rather than duplicated prototypes in headers, range-based fors, message passing for inter-thread communication…

However, unlike other modern languages, Go does not fully jail developers into what is considered safe behaviors. As an example, facilities for arbitrary pointer manipulation, required for low-level work, are provided, only put aside with a big warning next to them.

Go designers also spent quite a bit of effort into designing a language that is easy to teach and enforces common coding practices among its users. Including by keeping the feature set small. For companies, this means that less work is necessary to make Go devs work together. Bloated and universally hated “coding standard” documents that will only be read under the threat of a code audit should not be required nearly as much as in other languages.

Finally, although this last one is perhaps a bit subjective, I think that Go also helps producing more maintainable code in the long run. The syntax goes through great lengths to remove visual clutter, it’s easier for one dev to get familiar with another dev’s code, and lots of features are designed to survive code and language evolution (defer, interfaces, shorthand assignment without an explicit type statement…).

“[Features similar to goroutines and channels] exist elsewhere indeed, go simply acknowledges their importance in today’s programming landscape and thus propose a standard, well-integrated, less cumbersome way to use them.

It’s as if you said that C++ is a garbage-collected language because there are C++ libs that implement garbage collection. Sure, C++ *can* be garbage-collected, but it is not a standard part of the language, students do not learn it, those who learn it as part of their work will often separately use gazillions of different, incompatible libraries… And I guess you see where I’m going from there.”

Bad example. C++11 has a garbage collection API for compiler vendors to implement their own GC.

A proper GC might be part of C++17 standard.

C++17 ? More like C++25 if the standard team works on it in the same way as with C++11. Anyway, I don’t want to discuss language merits based on speculation on future language revisions, otherwise I might as well speculate that Go will support dynamic linking in 10 years.

“I don’t know much about Limbo, but if it was a fine language recycling ideas from it sounds sensible. No need to reinvent the wheel every time.”

May be, on the other hand, it looks like the authors are not willing to learn anything else and do not assume the world has moved on.

Why ?

”

“Anyone with a proper compiler design curriculum in their CS degree can easily find languages/libraries that offer similar features.”

Such as ? (Genuine question)”

– Modules (available since Modula-2)

– goroutines (Tasks, Actors, Fibers, Asynch)

– Channels (Events, Actors, Queues)

– Interfaces (Protocols, Structural Typing, Dynamic Types)

Oh, right. I did not mean to claim that Go’s features, taken separately, are necessarily new or revolutionary (although some might). But can you think of a language that presents a similar feature set ?

Panic/recover usually lead to very ugly code similar to setjmp/longjmp and resemble poor man’s exceptions.

I can’t tell, since ugly is a subjective concept and in my own view, exceptions overall are an ugly solution to the error management problem. But can you explain more clearly what kind of “clean” exception-based code you would not be able to efficiently implement in Go ?

Taking Delphi as example, you are able to bind directly to the OS API, while in Go you need to write a wrapper using the CGO tool, which requires a C compiler to compile the generated wrapper.

You make it sound like Object Pascal and C code link by magic when brought close to each other.

You did no get my point. With Delphi you just need something like,

procedure my_syscall; external; library ‘lib.dll’;

With Go, you need a C compiler to compile the CGO generated code, that is also able to use Go’s calling conventions.

By more modern, I mean that like other recent languages, Go learns from common C/++ dev mistakes and prevents them, with safe pointers and arrays, a “defer” keyword for resource release, modules rather than duplicated prototypes in headers, range-based fors, message passing for inter-thread communication…

However, unlike other modern languages, Go does not fully jail developers into what is considered safe behaviors. As an example, facilities for arbitrary pointer manipulation, required for low-level work, are provided, only put aside with a big warning next to them.

There are more languages in town. I can get that with Ada, Delphi, C#, just to name a few of many possible options.

For me, I’m using Go on Google App Engine (GAE) for my hobby site that hosts a couple board games. (See, http://www.slothninja.com). I’m really happy with the performance and the language. Given Go is compiled, it seems to be much more resource friendly than the other two GAE languages, Java and Python. Also, Go’s compilation is so quick it truly feels like programming in a scripting language with the added advantage of type checking.

Is Go perfect? No. It definitely took me some time to get used to it’s object model and how to write reusable code. But, once you start to grok Composition and Interfaces, it really becomes a pleasure to use.

With that said, only time will tell if it gains any traction. But, as along is Google keeps supporting it on GAE, it will meet my needs. Also, I believe a Go front-end is now formally part of GCC so it is unlikely it will disappear soon even if Google drops it.

I think old languages are much more complete, they are established, lots of people have experience and have published lots of examples, tutorials and books.

New languages have more bugs, are less complete and have less Google search hits. They may have some advantage over older languages, but lack in other areas. To improve these things you need a lot of users, but it’s hard to get those if they’ll quickly fall back on the languages they already master.

I’m no expert on this, but my understanding is that all of these languages tend to have some particularly attractive feature that’s often not found in other similar languages.

For example, Go offers an element of static (compile-time) duck typing, which is unusual. The only other language I’m aware of that achieves this is StaDyn: http://www.reflection.uniovi.es/stadyn/ This is great for combining the speed and robustness of static typing while making programming easier.

I don’t know Go, so I’m sure there are other good reasons to use it (e.g. very fast compile time). No doubt there are similar arguments for the other languages you mention.

The fact is though, there’s strong resistance to using new languages simply because existing languages have built up broad collections of tools and libraries (and jobs!).

That doesn’t mean these new languages aren’t important though. The benefits of newcomer languages eventually seep in to other languages. Occasionally a new languages capturing a sensible collection of benefits disrupts the community and sticks. This happened with Java and .Net (I’m guessing partly because their creators invested heavily in developing extensive tool and library support from release).

This is all just my opinion of course, since you did ask for opinions!

I would say that JavaScript has made a dent in the market. Yeah, it started as a language that people used because it’s the only language runtime supported by web browsers. Yeah, it has an peculiar object model. Yeah, the syntax can be annoying });

But the runtime engines are really fast, and it’s not so bad as a meta-language upon which better languages can be built using frameworks and pre-compilers.

Yeah, JavaScript is inferior to Lua in every possible way, but it’s caught on, and it’s here to stay.

Well, I’ve enjoyed a lot the “tour of Go” which I’ve taken in July, so here’s my impression.

As for the merits of the language, I can sum it up by the fact that it manages to be conceptually simple (look at how short and clear the spec is !) and powerful at the same time. The other languages with a small feature set which I know of, which are C, ASM and BF (yeah…), tend to make everyday coding tedious as a side-effect. Go manages to have a well-picked feature set that is expressive and restrained at the same time, and I have to applaud Rob Pike and his coworkers for that achievement.

Now, as for why these new language won’t stick, I think that C and C++ have simply been around for too long. They have this huge amount of libraries written for them, these extremely optimized compilers, this huge amount of developers who know them and teach them.

Perhaps what a new programming language needs in order to gain acceptance after such a period of stagnation is the support of a well-received new OS or platform. After all, one can well argue that C wouldn’t be where it is without UNIX; that HTML, Javascript, PHP, Java and Flash wouldn’t be where they are if the Web hadn’t grown this way; that C# would have never achieved significant developer acceptance without the support of Microsoft…

The only popular languages whose success I can’t explain this way are C++ and Python. As far as I can tell, these became successful first and only then received the support of OSs. Perhaps they are the only languages that have gained developer acceptance by the sole virtue of their intrinsic merits, or perhaps I am just missing something…

Python seems to have gained popularity via back door. People didn’t like perl so they switched to Python. Then you got mass… followed by adoption (also I believe the source engine uses python for scripting.)

C++ probably got popular because of C (in that it’s a super set of C, meaning you can just go ahead and add your stuff to old C code.)

I mostly agree, however, I don’t really feel it’s performance is so poor as to be an issue. I do really miss the union type, however, if I remember correctly there was issues with the gc (and interfaces can cover in language needs to a certain extent.)

I mostly agree, however, I don’t really feel it’s performance is so poor as to be an issue.

Well it was mainly that of me expecting near c-performance as that was a stated goal, however I also think the lack of (my expected) performance is primarily due to the lack of a mature gc and better optimized math functionality. Maybe I should do a tip build to see if there’s been any substantial improvements of late.

I do really miss the union type, however, if I remember correctly there was issues with the gc (and interfaces can cover in language needs to a certain extent.)

Yes I can see it potentially causing problems for a memory safe language like Go, still it’s really only a problem if you are using external code like c-libraries, if you code 100% in Go I presume you can efficiently design around a need for it.

Even if you look at those graphs from an absolute perspective instead of a relative one, it becomes pretty obvious that there’s a very healthy demand for programmers who understand when to use dynamic languages.

…I haven’t looked at it since it was first released. It wasn’t easy to use on Windows at the time.

I don’t understand why Ada never took off, it had everything you find in the modern languages: tasks, low-level bit manipulation, OS assembly language interface, packages, OOP-like, even its own build dependency system. And I just like it.

…I haven’t looked at it since it was first released. It wasn’t easy to use on Windows at the time.

I don’t understand why Ada never took off, it had everything you find in the modern languages: tasks, low-level bit manipulation, OS assembly language interface, packages, OOP-like, even its own build dependency system. And I just like it.

I bought the book for Ada 2005, and being the C++ fanboy I am, I seriously wish C++ adopted a whole bunch of Ada features. It seemed really strange with C++11 that there was all the hype about concepts that were ditched due to difficulty when Ada has a much more clean way to specify template requirements. Was it seriously that hard for the standards committee to look outside of C-like languages?

The only thing that still puts me off Ada is it’s OO implementation. I still can’t get my head around the rules of elaboration or the rules for getting the [type].[method] syntax to work.

I loved Ada, but it had the stigma of being government mandated. Worse, when PC Ada compilers were first introduced, the government wouldn’t let them use the name “Ada” because they weren’t certified to the spec (because DOS was… well, DOS).

Kiss of death.

My favorite Ada anecdote was the government commission to determine what was needed to make Ada a commercial success. Their recommendation to congress was to EITHER (1) invest $15 million in establishing an Ada promotions board, OR (2) invest nothing, because less that $15 million would fail.

re: cost… true. I had “free access” to an excellent compiler and even had the pleasure and privilege of working on a VMS component written in Ada. I know the first iteration of Ada was not fully OOP (oop-like) but you could fudge it. Ahhh… I think I still have my Booch book lying around somewhere.

The need of new languages is due to modern technologies and patterns, 20 years ago the internet it wasn’t the boom it is today, and there are two paths to take, modernize a 30 years old language or create a new one that takes in count all the new technologies.

Go is a modern language that do this, it is designed for fast compilation and it is web aware, I believe it has a future.

<blockquote> Of course, this brought me face to face once again with Python’s pons asinorum, the significance of whitespace. This time, however, I charged ahead and roughed out some code for a handful of sample GUI elements. Oddly enough, Python’s use of whitespace stopped feeling unnatural after about twenty minutes. I just indented code, pretty much as I would have done in a C program anyway, and it worked.

That was my first surprise. My second came a couple of hours into the project, when I noticed (allowing for pauses needed to look up new features in Programming Python) I was generating working code nearly as fast as I could type. When I realized this, I was quite startled. An important measure of effort in coding is the frequency with which you write something that doesn’t actually match your mental representation of the problem, and have to backtrack on realizing that what you just typed won’t actually tell the language to do what you’re thinking. An important measure of good language design is how rapidly the percentage of missteps of this kind falls as you gain experience with the language.

When you’re writing working code nearly as fast as you can type and your misstep rate is near zero, it generally means you’ve achieved mastery of the language. But that didn’t make sense, because it was still day one and I was regularly pausing to look up new language and library features! </blockquote>

IOW, it’s not the whitespace that’s the issue, it’s your refusal to recognize that you’re indenting anyway. You’re giving up on a language long before you give it a chance for the wrong reason. 🙂

A couple years ago I contracted for an architectural engineering firm, and it stuck me that software is a shockingly undisciplined field compared to other engineering professions. Their work is based on industry-standard conventions. A design drawing or an equipment schedule always follows the same style and structure regardless of which firm produced it. In most other engineering fields, firms are legally and financially liable for design defects.

Maybe software isn’t ready for industry-wide standards. But is it too much to ask that code is consistent in style and structure across its language, that all Python code or all Go code looks the same no matter who wrote it? Our industry has to grow up. The modern world depends on software, and we’re simply not meeting expectations.