9 ms·
Go is the language that made me realize I’m not much of a production quality software engineer. Normally I would be quite happy riffing with ideas in Ruby or P
by gorgoiler 7y ago
Go is the language that made me realize I’m not much of a production quality software engineer.
Normally I would be quite happy riffing with ideas in Ruby or Python, and just running my code and iterating trying to figure out what to do.
When I tried this in Go, every time I wanted to change the shape of my code to try doing things slightly differently I had to do a lot of work to get the code to compile again.
I feel like a professional coder wouldn’t hit that road block because they’d have a better idea what they were doing in the first place.
I have scurried back to Ruby with my amateur tail between my legs, but I hope to try Go again some day and find a style that’s a bit more forgiving of my not-Staff-SWE skills.
- bluntfang 7y agothis is a toxic mindset. just because the tooling is poor doesn't make you an amateur. if you're getting paid, you're doing great. keep it up and use the tools that work to get the job done.
- nostrademons 7y agoThere's a software lifecycle. At the beginning of a software project, nobody knows anything about what to do, because (if the market niche isn't already filled) nobody has done it before. Python and Ruby are great for that. Then as the software grows up, the requirements become more well-known, and more people start using it, you need to transition to more maintainable code that runs more quickly. Go is ideal for companies in that growth stage - it runs fast, it's easy to communicate what the code does, it doesn't allow a lot of tricks that can trip up other developers, and it encourages relatively robust code. Once you get to the massive scale stage like Google you probably need to be in C++ anyway, but by definition growth companies are where a lot of the action is.
- kerng 7y agoAgreed, for creative coding endeavours other languages are better suited, especially when doing rapid prototyping and refacturing. Sometimes even simple bash scripting allows for quicker results.
- save_ferris 7y agoI felt the same way the first time I used go, but I came to realize that languages like go really force developers to think about details that languages like ruby don’t care as much about, like handling nil. Sure, you can’t move quite as fast in go as you can in ruby, but you also get the benefit of not having to deal with errors like “undefined method foo for nil:NilClass” in production, which is nice.
- eropple 7y agoI would entreat you to not be afraid of Golang. To be frank its adoption speaks to a desire to make software that does not require (or, often, benefit from "staff SWE" skills). Treat it as what it is, a jumped-up, terser, and in some ways gutted Java, and give it another go. It is designed, to a fault--and this is a little pejorative, I absolutely do not enjoy writing Golang because of it--to be not that hard.
- wutbrodo 7y agoThis is my impression too. I was at Google when Golang v1 was released, and my friends and I were hobbyist language geeks and decided to play around with it. We were....not fans. We were already in the habit of writing extremely clean and healthy code[1], and having a language hand-holding and hectoring us into doing things in its narrow, specific way was just too much of a hit to productivity. Now that I work in a C++ codebase full of very smart domain experts but light on engineering expertise, I can appreciate Go's value in certain circumstances, but if you're lucky enough to work with a talented and experienced engineering team, Go is a pain in the ass for anything but beginners. [1] A habit I'm paradoxically trying to unlearn a little at my newer company, due to being on a different point on the short-term velocity/long-term health spectrum
- eropple 7y agoThis is largely where I'm at. I've never gotten paid to write C++, though I've written my share, and I went through Scala, Ruby, Kotlin, a little Elixir and a little Rust, and now almost exclusively TypeScript--and I just don't need what Golang wants to make me do to do a good job and to output high-quality code.
- apta 7y agogolang is not terser than Java for any non-trivial code bases, it's quite the opposite.
- eropple 7y agoFWIW, I don't disagree. That is, however, the general impression. :)
- cbhl 7y ago"Guess and check" is a technique that I have also used in Go code, and it is fine. A lot of the compiler errors really could be errors in pre-commit hooks (like, the one about unused variables), but the language designers made a trade-off to be Even More Opinionated (than, say, Rails) because they thought it was best from a pedagogical perspective.
- jpgvm 7y agoThis isn't true at all. Go is not the tool of choice for experienced professional programmers for exactly this reason. The ability to quickly refactor code is very important and Go fails at it horribly for a number of reasons. 1) sheer verbosity. 2) multiple return makes altering function signatures tedious. 3) no generics mean code is written in hard to refactor styles out of the box 4) poor reflection support 5) poor tooling compared to professional grade languages (Java/C#/etc) I could go on but long story short it's not you, it's the tool. These issues can be overcome by remaining vigilant but for the most part they are part of the accepted "cost" of Go. Which is to mean you pay them in return for a language that is very easy to learn (albeit hard to master because of the above problems), has a great runtime and has reasonable out of the box performance and memory footprint and stellar compile times. These tradeoffs can actually be right for some teams, i.e larger ones with less experienced engineers that can afford to spend more cycles doing busy work refactorings. However it's often a poor fit for small teams trying to work on software that is evolving quickly and can benefit from features of more powerful languages.
- nappy-doo 7y agouse a better editor. VSCode, vim with vimgo, emacs with whatever those apes use.
- jpgvm 7y agoThis helps but doesn't solve the core issues. I generally use Goland whenever editing Go code (as I am currently doing sigh) but even with such a powerful IDE the language is the main limiting factor in carrying out refactorings (which again, I'm doing right now).
- dlsniper 7y agoWhat kind of refactorings would you like to do but GoLand doesn't help with? I'd be interested in that kind of feedback. Thank you!
- centimeter 7y agoI shouldn't need an industrial-strength editing engine to efficiently express my ideas. (And don't, if I'm using a nice expressive language.)
- empath75 7y ago> I had to do a lot of work to get the code to compile again. That's fine, in most cases, writing python code, you find out that you fucked up when you run the script. Compiler errors catch whole classes of errors that you ordinarily wouldn't find unless you ran the code.
- gorgoiler 7y agoMy experience was that I would have an idea for a new model and change my code. Later on I would find that new model would be flawed, but only after fixing compiler type errors in many different places when all I really needed to find was that one error that showed my model was flawed. I should add that it’s heartening Pike actually acknowledges this in the interview, regarding limited typing and how it helps playfulness in languages like Python and Ruby.
- takeda 7y agoI'm Python you can also define types in the annotations, and with IDE that understands them it will catch errors, have working autocomplete and make it very easy to refactor.
- throwanem 7y agoSpeaking as a professional with 15 years of career in software engineering under his belt: don't be so hard on yourself. I mean, I don't typically prototype or iterate on ideas in Typescript, either; I do that in Javascript, and reserve strong typing for when I know what I need to build, and it's just a matter of doing so in a way that's reliable, maintainable, and secure. The point is that flexibility and strictness both have value, and it's more worth knowing which is more useful at a given point in a project's lifespan than trying to be dogmatic about one or the other.
- zozbot234 7y ago> When I tried this in Go, every time I wanted to change the shape of my code to try doing things slightly differently I had to do a lot of work to get the code to compile again. Ha. Try Rust if you like a challenge: at least you will get outstanding compiler diagnostics while refactoring, and far better performance as an end result.
- seph-reed 7y agoI love Rust like I love Dark Souls. It's difficult, but fair. I can not praise enough the software developers that realize proper errors are vastly superior to extensive docs.
- BookHeretykow 7y agoFine taste in language and games
- troutwine 7y agoHaving done a fair bit of work in both languages I find Rust's type system here is much more of a help. I've got a clear sense of where things have gone sideways in Rust, even if that clear sense can sometimes feel like a long hike to get through. Go leaves me constantly wondering if I remembered to implement all the right functions for this or that interface, among concerns put elsewhere in this thread by others.
- bfrog 7y agoLiking Go has nothing to do with being a quality software engineer. Go itself is probably the least software engineering friendly language out there. The goal of a computer language is to express your thoughts and instructions into something a machine can understand. Full stop. Go is absolutely terrible at letting you the human express what you want the machine to do. It has compile time type checks, but then fails to provide the hatches needed to work with types sanely. It has the ability to call out to large bodies of C code, but not without significant costs. It compiles fast, which is good, because your going to write a lot more code to do the same things you'd do in other languages, even other compiled languages.
- takeda 7y agoYeah the type system is absolutely horrid. Just try to use any other type size than int, int64, float64 then you will be in a lot of pain casting every time you use them. It's so silly for example that math.Min/Max only works on float64, it won't work with float32 without casting, or integers (although for ints is highly discouraged, because casting to float could cause you to get a different number, it is encouraged to just do if statement yourself) It is a horrible language, only popular because it came from Google. It's biggest benefit was that it supposed to be easy to pick up, but it also demonstrates that the simplicity doesn't help at all with a significant code base, you still have to spend the same amount of time to learn it as in any other language.
- throwaway894345 7y ago> Go itself is probably the least software engineering friendly language out there My experience with software engineering went from "the language (type system, grammar, syntax, etc) is super important!" to "the language is one of the least important considerations in choosing a language". The more important features are tooling and ecosystem. I don't want to have to learn a new configuration language or imperative DSL just to add project dependencies or setup tests. I don't want to have to learn yet another documentation framework for generating documentation from code comments. I don't want to have to spend lots of time setting up CI/CD pipelines to build my source code and documentation packages and publish them to their respective repositories. I don't want to have to worry about whether my users or fellow developers have the right versions of dependencies or the runtime installed on their system. I don't want to have to make unmaintainable Dockerfiles because it's the only way to have performant builds in the happy path. I want to minimize time wasted during code review on comments about style or programming paradigms. Similarly I don't want to waste time waiting for code to compile. If the language is type safe in 95% of cases, that's good enough--people still make lots of money writing lots of 100% untyped JS and Python and Clojure and so on--the extra 5% would be nice to have but I'm not going to trade tooling, ecosystem, and developer velocity for it. Basically, as I become more experienced, I begin to understand the difference between programming and software engineering (my heart is in programming, but software engineering pays the bills). Go is a great language for software engineering, but most of its criticism seems to be directed at programming concerns.
- potta_coffee 7y agoI had an initial period where Go felt really difficult, coming from Python. Now I've adapted and I actually feel like refactoring things is easier than it was before coming to Go. Just the fact that arguments and their return values are more strictly defined helps a lot.
- takeda 7y agoThis is not that obvious, since many people are resisting it, but if you ever tried to use type annotations in Python, it dramatically improves refactoring (from my experience PyCharm it actually is more reliable than GoLand), you get autocompletion and bug detection. Highly recommend this for large Python projects.
- potta_coffee 7y agoI didn't like type annotations in Python, but I didn't like Go's type system either when I started. I'd be willing to take a second look at types in Python now. But, my real reason for choosing Go was for performance, and it blows our previous solution out of the water. Go isn't perfect but I'm pretty happy with it for right now. I still use Python for a lot of other things though.
- takeda 7y agoWell, if performance is the objective, then I can't suggest Python, because that isn't the goal. You can still have a performant application implemented in Python, I for example had it encode video stream on the fly, but this of course is done through extensibility via C extensions and the core work wasn't really done in Python itself. Sometimes with the right approach (mapping PostgreSQL calls 1:1) and right tooling (uvloop, Cython) you can write code in Python and still squeeze better performance than in Go[1], but you need to know what you're doing. If you want to explore types, these resources[2][3] were useful for me. [1] https://github.com/MagicStack/asyncpg https://github.com/MagicStack/asyncpg [2] https://mypy.readthedocs.io/en/stable/ https://mypy.readthedocs.io/en/stable/ [3] https://docs.python.org/3/library/typing.htm https://docs.python.org/3/library/typing.htm
- myvoiceismypass 7y agoOne of Go's downsides (imho) - immature tooling (lagging ide support especially compared to other languages), definitely makes your job harder as a software engineer. That is not a reflection on you or your quality. If it feels like it is getting in the way - it is okay to prefer other languages or platforms to express and codify your ideas. The languages don't define you :)
- christiansakai 7y agoI do JS/TS profesionally, I play around with various languages on the side including Haskell/Rust. The more I work in JS the more I realized that I'm dumb. I'm not worthy to hold the power that JS has, much more other more complicated languages. I tried Go. I like it. It makes me feel safe and smart enough to write production grade app. Small docs, small language, no need fancy IDE, just any regular text editor like Vim works. Easy to read, easy to reason about. Everything is easy. Now I finally can focus on other non-programming passion instead of chasing endless language features in other programming languages. I like Go. The language for mediocre SWE like me. I code, I go home, I enjoy life.
- thefounder 7y ago>> Now I finally can focus on other non-programming passion instead of chasing endless language features in other programming languages. I think this is really the best feature of Go. It's a pragmatic language. The only complain I have is the incomplete/half backed reflect package.
- christiansakai 7y agoMy only complaint is the use of capitalization as public private. Because I quickly run out of naming variables/instances/structs, and naming is hard!
- slx26 7y agoSorry, but I have to be honest: in my opinion most of the replies you got to this comment are extremely misleading. As a user of Go and Ruby I can tell you that: Ruby is an awesome language, and there's nothing else that beats it at getting things done quickly and painlessly (unless you have a mathematical mindset, in which case nothing gets shorter and more elegant (at least the day you write it) than functional programming). It has many other defects, like safety in larger codebases, speed, some weird quirks, etc., but it's an awesome language, don't expect many other languages to be less painful than Ruby (on small programs at least). Don't listen to those that say professional programmers won't use Go. The only reason a professional programmer will say hard no to Go is for extremely optimized or mission critical code that can't tolerate garbage collection (even though the GC in Go is very low latency) or need a more sophisticated type system, or numerical applications for which Go isn't really well suited. If you compare Ruby and Python to Go, the transition might be hard if you haven't studied computer science formally. That said, it's a matter of making the switch, understanding that all those objects (boxes to put data in) that you had in Ruby, now are statically typed; this means that a box is of exactly one type and can't change midway (and even subtle changes need explicit casting/conversion). You also need to learn the difference between composition and inheritance, which might be tricky depending on how you learned to program... but beyond that, Go is a very small and easy-to-write-code-in language. You might like the syntax more or less, but it's easy to write good code in Go. It has many other gotchas and hoops you will need to jump through (var initialization, error handling, new vs make, weird append/len, learn to printf, learn pointers, etc), but it's a good step after Ruby / Python, if you need things bigger than what Ruby / Python allow you to comfortably manage. A hello world might require defining a package, importing another package, and a more verbose print statement than python / ruby, but those are all great (and minimal) appliances when developing at a larger scale.
- vpner 7y agoDon't confuse the shortcomings of the tools you use with your intellectual limits. This is a very insidious philosophy and there is no good reason to internalize it. Always remember that tools must be subservient to user needs because they're tools.
- kovac 7y agoDon't beat yourself up for that. I tried Go sometime back (year or so may be) and found it an awkward language. It probably has its own design philisophy may be that I missed. Things like lack of generics and type system makes you repeat things quite a lot (e. g. It was pretty impossible to write a true ORM or a DI system in go). I found the interface system quite awkward in that types implicitly implement an interface if they have the same method signature was weird to me. I think method overloading wasn't supported either, if I remember correctly. I think people who loved Go initially probably came from C. It feels a lot like C with better standard library, memory safety and fast compile times. I like Go for the same reasons actually. But until there's at least some way to write generic code, it's an awkward language to anyone coming from more expressive languages. I program in C# mostly which is an extremely expressive language with classes, interfaces, generics, expression trees, linq, delegates (akin to function pointers). Go is far behind other languages for application development, my two cents. But for systems programmers used to C which is a very small language, Go must be like a transition to paradise :)
- zeroc8 7y agoI came from C++, where accidentally changing the wrong header file resulted in a 2 hour long build cycle. No thanks. Modern C++ has its good parts, but Go has made me enjoy the profession again.
- kovac 7y agoInteresting you said that. Recently, I started doing some work in C++ again to stay up to date with what's going on in the C++ world. Do you really feel it's not worth it? I'm thinking about something new to do, and C++ is what I picked. I started implementing a TUI email client. The build time of C++ can be really long. I noticed it too.
- zeroc8 7y agoI don't know, I guess it depends, what kind of software you are planning to write. All I can say is that learning C++ properly is a huge effort with diminishing results. I'd say, invest your time wisely. Things are changing rapidly and old languages are usually solving problems that are not quite as important anymore as they used to be.
- monkey26 7y agoI consider myself able to write production quality code. When I started with Go I thought it was awesome. As my projects grew I found them to become less maintainable than my previous Java projects, and still less maintainable than my newer Rust projects.