• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Programming in Go - author background?

 
Ranch Hand
Posts: 125
1
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark Summerfield,

Thank you for participating in the giveaway and answering questions. I'm always curious about the personal preferences and experience of the writer, so with that in mind:

1. I see that you've written books on Python, C++ and QT as well as this one. Do you still like those two languages and the QT toolkit? If you were starting a new application from scratch, do you think there are many cases where you would select Python or C++ over Go for technical reasons? I am not as interested in the political reasons, I'm sure there are many companies where you could start a new Python or C++ project and recruit skilled team members immediately.

2. What other languages have you used extensively? Are there any others you really enjoy besides the ones you have written books about?

3. Can you realistically see C++ losing its position as one of the most commonly used programming languages? Between the amount of skilled developers and the mountains of legacy C++ code, every time I consider working on another language I wonder if I am hurting my career prospects by ignoring that C++ is ubiquitous. I've been following in the tech news - but, I confess, not yet putting any real effort into learning - a number of languages that are clear attempts to be a better C++: D (from Walter Bright, who wrote a C++ compiler - the language was started in 2001 but got a major rewrite for version 2 starting in late 2007), Rust (from the Mozilla project), Vala (from the GNOME project), and Go. Have you looked at the three others aside from Go? If so, what do you think?

4. Functional programming is getting a lot of attention these days. You don't have a chapter devoted to it, but I see from the table of contents that Go supports closures, function currying, and of course recursion. So my understanding is that while it could not be a pure functional language the developer could still write in a functional style. Do you think that's an important feature of Go? Did you consciously choose not to include a chapter on Functional programming in the book, or did you simply decide that other topics were more important? Do you have a strong opinion on functional programming's usefulness in general, one way or the other?
 
author
Posts: 37
VI Editor Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael,

1.a. Go is my favorite compiled language. Python 3 is my overall favorite language. C++98/03 is interesting and I still enjoy using it, but is is a very big and complicated language. C++11 is far bigger and more complicated than earlier versions and I (like most people I suspect) will end up just using the subset of it that I'm comfortable with. As I mentioned to Chun Chu:

In general my approach is: write it in Python 3 if possible (because I've been using Python for so long that I write it faster than anything else); otherwise write it in Go (i.e., if speed and/or lots of concurrency is critical); otherwise write it in C++ (i.e., if you need third party libraries that don't have Go bindings and you don't want to write your own using cgo or SWIG).



My reasons for preferring Python are that I have used it for more than 12 years so I have a lot of experience with it. Also, I love its clean yet readable syntax and the fact that types, functions, and methods are all first class objects. I also like its support for generators and coroutines. The only deficiency is that there is no support for declaring statically typed objects: but there are at least three libraries that offer this feature (called "traits"). Basically, for me, Python 3 is the most expressive programming language I know.

The reasons I like Go so much is that it compiles down to a single executable file. This means that Go programs are easy to distribute. And because Go programs are compiled they run fast---which matters in some cases. Go also has a very lightweight syntax and is very expressive.

C++ is big complex easy to make mistakes in and very slow to compile. As Bruce Eckel has said:

The complexity of C++ (even more complexity has been added in the new C++), and the resulting impact on productivity, is no longer justified. All the hoops that the C++ programmer had to jump through in order to use a C-compatible language make no sense anymore -- they're just a waste of time and effort. Now, Go makes much more sense for the class of problems that C++ was originally intended to solve.


C++ is often what I have to use; but Go or Python are what I'd prefer to use. Programs written in Go or Python should always be shorter and easier to write and maintain compared with C++ (and to a lesser extent than Java).

1.b. Qt4 is the best cross-platform desktop GUI application development framework that I know of. It can be programmed purely in C++ or purely in Python (PySide/PyQt4). I have very mixed feelings about Qt5 because it seems to require that programmers code in C++ (or Python) plus JavaScript (QML) --- which I really dislike. My hope is that Digia will provide a C++ API for all the stuff that is done in QML so that programmers can once again program Qt purely in C++ or Python. I think Gtk+ is interesting especially the introspection stuff that makes it scripting-language agnostic; I wish Digia would do the same for Qt.

2. I have written quite a lot of BASIC, C, and Perl (in the 1990s). But no, my favorites are Python and Go. I do have a fondness for Prolog, but I've never written anything serious in it.

3. C++ has been slowly losing ground to Java for at least a decade, although C++11 might slow the decline. Back in the 1980s "everything" was written in COBOL; now nothing (new) is; so yes, I think that C++ could be displaced. One major change is the number of computers around: with the growth of smartphones effectively we have billions of computers. So I suspect that there will no longer be one dominant language. After all, for Apple you have to use Objective-C; for Microsoft they are pushing C# (although .NET is a bit more agnostic); for Google you have Java/Python/Go on the App Engine and Java for Android. I think sticking with C++ would be a safe choice in the near term but I would certainly learn Go even if only to see how to program in a very different kind of way. I haven't looked at Vala; I did look at D but felt that it was too similar to C++ (a sort of C++ with fewer warts); whereas Go is a clean break.

4. I like functional style programming and cover that in my Python 3 book. I didn't cover it explicitly in the Go book because Go doesn't provide the functional style support that Python does (e.g., comprehensions and generators). You can most certainly program Go in a functional style and I personally quite like functional style programming. However, right now it seems much harder to model everything that is easy to model in OOP using functional style, so for me it is something to use at appropriate times rather than all the time.
 
Michael Swierczek
Ranch Hand
Posts: 125
1
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark Summerfield,

Thank you for your detailed answer, I am grateful you took the time to explain everything.

C++ is often what I have to use; but Go or Python are what I'd prefer to use. Programs written in Go or Python should always be shorter and easier to write and maintain compared with C++ (and to a lesser extent than Java).



That makes sense to me. I really have come to appreciate the value of fast compile times (or in the case of scripting languages, save and run). I've probably wasted hundreds of hours of my life surfing the web because I was bored waiting for my code to recompile.

I did look at D but felt that it was too similar to C++ (a sort of C++ with fewer warts); whereas Go is a clean break.



I don't want to launch yet another language war. I think the fact that C++ should be replaced by something that among other things is easier to learn and faster to compile is more important than what the actual replacement is.

 
I think she's lovely. It's this tiny ad that called her crazy:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic