6 ms·
Go at SoundCloud
- mseepgood 14y agoʕ ◔ϖ◔ʔ <- Gopher
- truebosko 14y agoThe way they describe Go as a WYSIWYG language makes me think of functional programming languages (e.g. mostly of elimination of side effects.)
- geoka9 14y agoIt makes me think of getting rid of OOP and saying goodbye to the overengineering overhead it involves. It took us 25 years to begin to see that the king is naked! UPDATE: I have a feeling that in 25 years we'll be dissing the current fad du jour - functional programming.
- mseepgood 14y agoBut Go doesn't get rid of OOP, it just fixes it.
- sausagefeet 14y agoDoes it? Seems like Go just has somewhat weak structural typing and a poor (by 2012 standards) type system. No parametric polymorphism? Whaaaaaaa
- mseepgood 14y agoParametric polymorphism has nothing to do with OOP.
- deleted 14y ago[deleted]
- pjmlp 14y ago> But Go doesn't get rid of OOP, it just fixes it. The only problem with OOP is people using OO without taking the time to learn it properly.
- exDM69 14y agoI agree. For some reason the whole OOP thing got really out of hands and has been force fed into a whole generation of programmers. Yet there's no real evidence that OOP is the right way to go. And then there was the whole Java deal where the "everything is an object" mantra was taken so far that it hurts. The result is probably the most expensive mistake in the history of computing with machines. > UPDATE: I have a feeling that in 25 years we'll be dissing the current fad du jour - functional programming. In 25 years, we will be laughing at the present for sure. I just disagree on what that fad is (functional programming is hardly popular enough to be called a "fad", but it's been bubbling under for 30+ years). I think it is dynamic programming languages like Ruby and Python, which to some degree are great but fall apart quickly. Another candidate is Node.js -style asynchronous programming, which will be laughed at once a mainstream language ships with a proper async model like the IO manager of Haskell or Erlang.
- Symmetry 14y agoIt got out of hand, but it's still a rather nice paradigm if you're actually simulating a system or designing a GUI. Teaching it as the One True Paradigm is certainly bad, but it certainly has its uses.
- tomp 14y ago> designing a GUI Not really. HTML/CSS/JavaScript combination is not really OO, but works really really well. In general, I think that any "programming language" for GUI is a fail - we need to develop a declarative approach to GUI (like HTML/CSS, but with more features (e.g. effects) and more emphasis on Application Development (e.g. it's still really hard to create a photoshop-like interface in HTML), less on text presentation).
- exDM69 14y agoRelated: http://www.youtube.com/watch?v=4moyKUHApq4 http://www.youtube.com/watch?v=4moyKUHApq4 An interesting approach to declarative GUI programming from Adobe.
- 14y ago
- stcredzero 14y ago> It took us 25 years to begin to see that the king is naked! That king is an impostor. http://c2.com/cgi/wiki?AlanKayQuotes http://c2.com/cgi/wiki?AlanKayQuotes > UPDATE: I have a feeling that in 25 years we'll be dissing the current fad du jour - functional programming. Only if unwashed masses start doing a half-baked version of FP without really understanding it. This is what happened to OO. It's similar to what happens to musical genres.
- jbooth 14y agoIn 25 years, the kids will still be trying to decide which approach is black-and-white "correct", while the experienced will still be using a blend of styles depending on the given problem. Eliminating side effects sounds brilliant until you start interacting with filesystems or networks. What, you can't memoize those ops or split them across a pmap?
- pcwalton 14y agoMy favorite illustration of the reason why OO and FP each have their strengths is the expression problem: http://en.wikipedia.org/wiki/Expression_problem http://en.wikipedia.org/wiki/Expression_problem Briefly, functional programming is good at one use case (adding new operations over the data type) and weak at one use case (adding new data type variants), while OO is the opposite (adding new data type variants is easy, while adding new operations is not). You have to choose between OO and FP based on which notion of extensibility is more important to you for the problem at hand (unless you use the relatively exotic solutions of multimethods or the generics trick that Wadler originally proposed). My takeaway is that OO and FP both have their time and place, and the pragmatic programmer will learn when to use one or the other instead of choosing one camp and bashing the other side.
- zemo 14y ago...Go still has objects. It's not the notion of binding functions to data that's flawed; it's classical inheritance that's flawed.
- tomp 14y agoIn my opinion, even the former notion is to a large extent flawed... Sure, there are several classes of different datatypes that really are different (e.g. mathematical objects, such as vectors, matrices, real numbers, ratios, complex numbers, ..., then strings, channels, binary data, time data...), but most data structures used in most programs are simply either sequences, or maps (dictionaries). I prefer Lisp's/Clojure's approach here - have many functions operating on few data types, as opposed to the inverse.
- zemo 14y ago>I prefer Lisp's/Clojure's approach here - have many functions operating on few data types, as opposed to the inverse. ...that doesn't accurately describe a flaw in Go at all, and stems from a common misconception of Go's type system; namely that it is Java's type system, which it is decidedly not. The interfaces make a big difference. An interface is simply a set of methods. Any object that implements those methods implements that interface. Adhering to an interface is implicit; you never have to say "type Stanley implements the Cat interface". If the Cat interface is just a "Meow" method, and Stanley can "Meow", Stanley is a Cat. Take, for example, the io.Writer interface. io.Writer is a method set that contains a single method: the write method. This is the definition for io.Writer: type Writer interface { Write(p []byte) (n int, err error) } This interface definition says "a Writer is any object that has a Write method. The Write method must accept a slice of bytes as its only argument, and it returns an integer and an error". Any object that implements this method also implements io.Writer. Therefore, any function that accepts an io.Writer may accept any object that defines this method. (when accepting io.Writer, the object's type is io.Writer; the only thing you can do with an io.Writer object inside of a method that accepts an io.Writer parameter is utilize its Write method, since that's the only thing you know it has). So, for example, in the encoding/json package, there is an Encoder object. The Encoder object has just one method: the Encode method. This is the signature for the Encode method: func (enc *Encoder) Encode(v interface{}) error this method definition reads "the function for the * Encoder type called Encode accepts an interface{} v and returns an error". interface{} is the empty interface; all objects implement at least zero methods, so any object can be supplied; it is valid to pass any object into the Encode method. The returned "error" value will let us know if something has gone wrong. Now then. We know that we're encoding data to the json format, but to where is it being encoded? Where is the output going? The io.Encoder object embeds an io.Writer object; encoded items are written into the writer. That's a big leap. How do we know which io.Writer to write to? We inject the io.Writer when we create the encoder. This is the signature for the function that creates a json encoder: func NewEncoder(w io.Writer) *Encoder It has only one argument; io.Writer. io.Writer has only one method; the Write method. That means that for any data target at all, if you define a Write method, you can encode json to it. So what io.Writers are commonly found? There is an io.Writer for a UDP socket, a TCP socket, a websocket, an http response, a file on disk, a buffer of bytes, etc. The list goes on. With this one Encode method, and this one Write interface, we are able to Encode json data to arbitrary targets. There's none of that JSONFileWriter, JSONHTTPResponseWriter, JSONUDPSocketStreamer stuff like you would get in other statically typed languages.
- anon01 14y agoWe've just started using Go as well. It smokes our Python app in terms of speed, and is fun to use (maybe just because it's new?). I have always wondered, however, that if moving to a new language seems great because of the language, or because you have such a better understanding of the implementation of the problem you are trying to solve.
- agentultra 14y agoYou bring up an interesting point about "new." New is fun. Exploration is fun. I think a lot of people will swear by a new language simply because it's not old and probably doesn't suffer many of the same deficiencies they're used to in their "every day," language. This to me is an illusion however. One must remain skeptical and treat new, untested languages with even more scrutiny than an old one. Many of these new languages will make extraordinary claims. Discovering the evidence to support these claims is often left as an exercise to the programmer. That being said, new has a lot of advantages. It's free to try to break away from past paradigms that perhaps limited programmers. Stability can always come later once the core ideas have been fleshed out. And it's always fun to work on fresh ideas rather than refining the same old ones that we're plagued with. Personally I wouldn't use a language and compiler that only just reached 1.0 this year in a production system. If I was really interested in Go I'd certainly hack with it and perhaps on it, but I wouldn't trust it to be reliable. Maybe that makes me an old, stodgy fart but I trust wisdom over brilliance when it comes to building systems that are dependable and robust.
- luriel 14y agoGo has been surprisingly reliable and stable, even before it hit 1.0 a few months ago quite a few people (including Google) were using it in production: http://go-lang.cat-v.org/organizations-using-go http://go-lang.cat-v.org/organizations-using-go With Go 1.0 there is an even greater focus on stability: http://golang.org/doc/go1compat.html http://golang.org/doc/go1compat.html Go is also quite different from most 'new' languages, many people find it to be the most fun language they have used in a long time (even after using many other new languages). This might be in part because one of the things that makes Go special (and my favorite "feature") is not just the features it has, but all the stuff it doesn't have. Go is simple and doesn't get on the way and lets you focus on the problem, other "new" languages are often described as "powerful", but much of the work involves using their "features", when Go is more often described as productive, the focus is not in the language and its features but on the problem you are trying to solve and the language gets out of the way.
- zaiste 14y agoNowadays, polyglot approach is the only right path for a software company. When I arrived in Berlin a month ago, I was positively surprised that SoundCloud supports local Clojure or functional programming groups. Keep up with great work!
- _ak 14y agoAnd, of course, they regularly host the Berlin Go User Group.
- ungerik 14y agoGo also works very well at STARTeurope, powering our event-platform http://startuplive.in/ http://startuplive.in/ Developing a high level webframework from scratch just for one website was a bit of a crazy undertaking: https://github.com/ungerik/go-start https://github.com/ungerik/go-start (sorry, the documentation needs a big update and a tutorial. Most time was spent on running stuff and shipping features...).
- ungerik 14y agoJust don't use Go on 32bit systems, the 32bit garbage collector leaks. On 64bit systems everything is rock solid.
- Symmetry 14y agoGarbage collection is actually a lot easier with 64 bit pointers, since the odds of a random collision between pointers and non-pointer data goes way, way down. And because the ratio of memory in use to total address space goes down.
- shortlived 14y agoespecially, as most new engineers on Go projects lament, during error handling Does any have pointers to reading material or care to explain the lack of error handling in Go?
- zemo 14y agoit's not there there's no error handling; it's that there's no exceptions. Instead, you use multiple return values, one of which is an error, and you check the return value for an error. It forces you to handle errors at the call site and makes diapers unimplementable.
- chengiz 14y agoHow does it force you to handle errors? Cant you choose to ignore the return value?
- osi 14y agoYou can absolutely ignore it. Or in the case of the Write call, which only returns an error, just never assign it. go's error handling is nice, but since it doesn't force it on you, it leads to errors of omission.
- skybrian 14y agoIf the function returns a useful value and an error then you'll have to assign to error to "_" to ignore it, which is a pretty big hint to the reviewer that it's being suppressed. So in cases where you want to "force" error checking, returning multiple values is probably good enough.
- awj 14y ago> It forces you to handle errors at the call site and makes diapers unimplementable. I don't see how the latter is true. What's the practical difference between wrapping a function call in a try/(no-op)catch and entirely ignoring the error return value?
- 14y ago
- fjellfras 14y agoWhat sort of development environment are others here using for go (if using it at all, of course) ? I've had reasonably good experience with the go-mode in emacs.
- redbad 14y agoSublime Text 2 + GoSublime has been a really great experience for me. http://www.sublimetext.com/2 http://www.sublimetext.com/2 https://github.com/DisposaBoy/GoSublime https://github.com/DisposaBoy/GoSublime
- fjellfras 14y agoInteresting that sublime text comes up. I have been looking for a "bells and whistles" sort of IDE for python for a few days now, I am traditionally a unix person so I have moved along nicely with both vim and emacs as needed, but at this point I need to work with a full featured IDE. I am using the evaluation version of pycharm and I must say it is quite impressive, although paying for an editor does seem odd after using emacs for so many years but it is a well designed software and I think worth the price. That said I have been asked to give sublime text a try and I must say it looks a lot better than pycharm, I think will give it a try next (it is certainly a lot cheaper and if I understand correctly has much wider language support than pycharm).
- Lewisham 14y agoSublime Text will never be a bells-and-whistles IDE like PyCharm or PyDev on Eclipse, it just won't work that way. The question is whether the extra niceities offered by those IDEs offer enough productivity gains over their heavyweight design which leads to them being clock-time slow to get things done (launching, navigating around files etc. etc.) I think for experienced devs, a text editor is quicker for dynamic languages (less experienced people will get good mileage from an IDE). Go is sort of weird in that it reads like a dynamic language, so a text editor is Good Enough, while the static compiler helps to catch the sort of bugs that float up when you're doing manual (and hence, human-error-prone) refactoring work, like changing the type of something, which IDEs tend to automate for you before compile time. That's why GoSublime really is all you need for Go, as far as I can tell. (NOTE: I've not written anything like even a medium project in Go).
- goostavos 14y agoI'm still a bit of a novice, could someone elaborate on what he means by operator overloading being "problem creating?" I thought that was one of the main, 'core' concepts of OOP. Inheritance, and polymorphism. How would you make something like a GUI without being able to specialize classes by overriding certain methods? Have I misunderstood his point?
- paraboul 14y agoOpertor overloading is really horrible. By reading the code "foo + bar" you can't know what is really doing internally. He is talking about operator (+-*=[]&) overloading. Not method overloading.
- gurkendoktor 14y agoAnd how do you know what add(foo, bar) does internally?
- azylman 14y agoadd(foo, bar) isn't any clearer than foo + bar, but usually an overloaded operator doesn't correspond to "add". For example, in Javascript: "Hello" + " " + "World!". What the operator there is doing is concatenating the strings, so if you had a method to do it you wouldn't call it add - you'd call it concat.
- numeromancer 14y agoBut then you lose the information that both ((usually modular) arithmetic, and strings with concatenation, et al.) are monoids, and have a similar structure, and creating generic functions which might use that symmetry becomes more difficult.
- rat87 14y agoIn python you can overload + and a lot of other numeric operators by implementing certain methods __add__ for +, see others here: http://docs.python.org/reference/datamodel.html#emulating-numeric-types http://docs.python.org/reference/datamodel.html#emulating-nu... In ruby you can implement certain numerical methods including + In smalltalk + is a binary method, you can give your methods all sort of symbol names. Same with Scala I think.
- laktek 14y agoShameless plug for my Go articles for anyone who wants to get a start - http://laktek.com/tag/go http://laktek.com/tag/go (Yes, I will commit to finish the rest of the series)
- deleted 14y ago[deleted]
- jurre 14y agois this from looking at their jobs page? because usually those 'requirements' are just guidelines to make sure the people applying know their stuff, and if you contact the company it turns out they're a little more flexible.
- user911302966 14y agoI'm confused. I see the word "engineer" appear several times, but the company appears to offer MP3 recording technology and a "share" button. Where are the moving parts?
- wetbrain 14y agoI've heard the same about Twitter. All they do is publish short messages, why do they have 1000 employees? There's always many problems that aren't immediately apparent but difficult.
- brandoncapecci 14y agoWhy can't people just be satisfied with Ruby or Python...
- emmett 14y agoBecause this is how progress happens. You could have equally asked about Ruby, why can't people be satisfied with Perl and PHP? Why would this bother you that they are trying new things and learning?
- brandoncapecci 14y agoChanging languages is not how progress happens. It's only progressive when the long-term benefits of the language outweigh the inefficiency of training all your devs to use it. Assuming that is true for Go (debatable), at the end of the day, SoundCloud still gimps their hiring pool far more than if they choose something like Node. Learning doesn't bother me at all - I like learning - but I can't advocate for battle-testing Go in a mainstream environment when their are plenty of other fast and tested languages. If Go evolves into a language that is more desirable in the everyday stack, that process should be organic, just as it was when people decided to switch to Ruby.
- cloudhead 14y agowould that make your day?
- brandoncapecci 14y agoDoes it make your day every time you see another unnecessary language or framework on the HN homepage? I'm just as indifferent to those as I am to caring about what SoundCloud does, if not more so.