10 ms·
They've fixed the import / modules situation to a point where it's usable and much improved, and generics have been added. However, the issue this brings up ab
by implying 4y ago
They've fixed the import / modules situation to a point where it's usable and much improved, and generics have been added.
However, the issue this brings up about structs / types not explicitly declaring which interfaces they implement is a real and unaddressed problem, especially in large codebases. The only tool that I'm aware of that finds implementations is GoLand, at steep JetBrains prices.
Figuring out what type an API is asking for should not require reading every line of code in the package, and slows down every developer of large Go projects
- saturn_vk 4y agoDoesn't the official language server have support for this?
- voidfunc 4y agoWhen developers who usually make 6 figures of money complain about $90/yr IDE price I just cannot help laugh. Actually it's even better... the price elevators down from $90 -> year2 90 - 20% -> year3 90 - 40%. Over three years that's like $150-$200 total and it will save you so many headaches. But that's a steep price? Are you kidding? Why do developers hate tools that cost money when they save them time and allow them to do more?
- xigoi 4y agoProfessional developers in the USA usually make 6 figures.
- sriram_malhar 4y agoMusicians and carpenters make far less than programmers, but they still buy their tools. Software people are too entitled. Even if you are not professional, you can still afford 54c a day ($200 a year). Even a programmer in India can.
- 5e92cb50239222b 4y agoMany junior developers in my city make around $300 a month. After spending $200 on rent and most of the rest on food, you're not left with much. I understand nobody really cares about crap-holes like mine when they're making most of their money in Western Europe and North America, so just throwing it out there.
- pjmlp 4y agoAs highschool student in 80's Portugal, 10 years after 40 years dictatorship and colonial war were behind us, when software was sold as bootleg copies on bazaars, I saved enough money to eventually buy Turbo Pascal for students at 30 000 escudos. As I wanted the real deal and not a bunch of no name floppies with copied manuals. That would be around 150 euros, without taking into account the inflation to modern days. And to place the price in perspective, it was a third of the minimum wage, while the overall cost of my PC took 5 years for my parents to pay back to the bank.
- cosmodisk 4y agoFair enough, but what's the revenue per dev in your org then? Surely it's a bit more than $300/months.
- smeagull 4y agoI'm not paying that much for an editor that runs counter to my muscle memory, just so I can use a different programming language. If a language requires some IDE to make it usable, then I put it in the same camp as Java: Hope the competition are using it.
- KronisLV 4y agoI'm tempted to ask what languages you're using and what has your best experience with them been like. Because as messy as Java is, refactoring codebases in it that have been kept alive for close to a decade is surprisingly not madness-inducing (most of the time), at least in some of the sane frameworks. Apart from, you know, legacy projects basically killing your career in the long term. I'm not sure what other language I'd feel comfortable with changing how some method works across 50 other places that call it and have the IDE do most of the heavy lifting. Yes, I have Stockholm syndrome, probably. Yes, I'd prefer to retire to planting potatoes in a farm, rather than work with NullPointerExceptions.
- implying 4y agoPutting fundamental features of the language behind a price barrier at all will keep students and people who want to experiment with the language out of the ecosystem. This isn't a papercut, it's an intentional omission that has backfired and can only be fixed by tooling. If the only way to access an often necessary feature is proprietary, why not make the whole language proprietary at that point?
- Nursie 4y ago> students https://www.jetbrains.com/community/education/#students https://www.jetbrains.com/community/education/#students
- thegeekpirate 4y agoThe language has a tool that does this, and every editor I can think of uses it (https://github.com/golang/tools/tree/master/cmd/guru https://github.com/golang/tools/tree/master/cmd/guru), specifically implements.go if you're interested.
- yencabulator 4y agoGuru has been replaced by gopls, using the common LSP protocol.
- faitswulff 4y agoI would be more supportive of this message if it was a $90 LSP server that you could support by buying (a la intelephense), but software developers are very opinionated about their editors and not everyone wants to use IntelliJ products.
- sanderjd 4y agoNot to mention how much the company paying their salary (who should be paying for their IDE) makes!
- AtlasBarfed 4y agoWell, the companies won't buy it for them without wasting about 10x the cost in approval paperwork.
- beebmam 4y agoI think a tool like GitHub Copilot is worth far more than $90/year and I'll gladly pay for it. Probably up to $500/year or even $1000/year I'd pay for Copilot. It has saved me so much headache and time. There's no real competitor for that product and I'm looking forward to it going GA. I'd use emacs/vim and Copilot any day over an IDE. But I'm not sure any IDE is worth $90/year when VS Code is free. The extensions for VS Code are next-level, especially the SSH extension. No other IDE comes remotely close to how well that extension works for its use case.
- Fnoord 4y agoWith VS Code, you pay with your privacy and your resources. These add up slowly and silently.
- bmitc 4y agoWhat's even worse is getting companies to pay for this stuff. Getting a company to buy software to help you do your job is like pulling teeth.
- foolfoolz 4y agoany company will let you expense a few hundred dollars for a tool you use literally every day many hours a day. if you’re having trouble they are not good to work for or you’re asking the wrong way
- KronisLV 4y ago> if you’re having trouble they are not good to work for That is true, but also in some places that is also the status quo: especially in countries where the developers don't get 6 figure salaries and don't create as much value to their respective companies.
- Jistern 4y agoI concur.
- imaginaryNumb3r 4y agohow is this not common sense
- philderbeast 4y agoif a company wont pay for an IDE for there developers then I certainly won't be paying for it out of my pocket. if they can't justify paying ~$100 for my ide of choice, then they are costing them selves far more in lost productivity, and that's not my problem.
- cvak 4y agoIDEA is 650€/ year for our company. Not saying Company should not pay that, but it's not $100
- zenlot 4y ago
- dehrmann 4y agoI'm shocked at how often I see software engineers not paying for Sublime Text. These are people who get paid to write software not paying for software.
- deltaonefour 4y agoThe use to pirate stuff all the time. Now it's actually more convenient for me to buy it. But the philosophy I always had was that as long as there were enough people like you paying for software, I wouldn't have to.
- philliphaydon 4y agoI think most people in the industry pirated software when they were students or just beginning. But now that we make money it’s easier to just buy it. Friend of mine pirated photoshop when he was studying and after he finished and started his own business he started paying for it.
- cosmodisk 4y agoPhotoshop being easy to pirate was a feature for Apple: the uptake was absolutely insane across all possible levels and eventually nobody uses anything else. Same with Microsoft in 90s: when students asked Bill what he's planning to do with the whole China copying it, he replied that let them get used to it and we'll find a way to charge later.
- cosmodisk 4y ago*a feature for Adobe, not Apple
- Fnoord 4y agoAll too often the proprietary piece of software sucks, including their price, but its still the best. For example Burp Suite.
- sam0x17 4y ago
- srer 4y agoPretty simple for me: I like working with Free and Open software much more than proprietary software. I think it's important for society, and I have more fun that way too! Also the payoff for me has been very good, I can learn emacs once and enjoy using it for the rest of my life for all significant written language tasks on a computer. Perhaps I could be a little more efficient if I were using a jetbrains IDE, but then I wouldn't like what I was doing as much. Enjoying what I do, even if it may look slightly contrived to others, is important in me achieving results at work.
- marwis 4y agoMost of JetBrains platform is open source (Apache license). Only the language plugin is proprietary. It's not perfect but better than your typical closed source software.
- foepys 4y agoThis argument is not convincing to me, especially considering JetBrains publishes their IDE base as open source. Everytime I have to use VSC to develop typescript and angular, I am having problems with finding definitions (works 30% of the time), code search (it takes longer due to the constricted interface), git operations (want to do more than a simple pull and push? good luck), and much more. WebStorm on the other hand has a lot less bugs, a more flexible interface, and more features. I am glad that people make an effort to make an IDE instead of an editor with IDE-style features and I'll gladly pay a very small amount of my salary to them. Every workshop has higher costs than a software developer. Imagine a car mechanic propping up a car with 2 by 4 because they use what's available for free. No, they buy their $30,000 lift because they need it to get their work done quicker.
- lelanthran 4y ago> Every workshop has higher costs than a software developer. Imagine a car mechanic propping up a car with 2 by 4 because they use what's available for free. No, they buy their $30,000 lift because they need it to get their work done quicker. This is a far from convincing argument. Jetbrains IDEs are not the equivalent of a professional lift and the competing (often free) products are not the equivalent of a 2x4. Is Jetbrains good? Well, I've used it for Java and was pretty impressed. Is it $199/year[1] better than the free stuff? Well many people don't think so. It's fine if you only every use a single stack, but most of us use multiple languages and multiple stacks, now you're looking at $649/year (see link below) for all tools. Considering that my current personal development computer cost less than that years ago, is it now wonder that the price is considered too much? I think the problem is that developers are looking at the Jetbrains products and comparing it to the value they get from other development purchases. Compare: A single $1k computer will last for many years, do every single development task needed to make money, be used for entertainment, and write all the actual software that will be sold. When it is too slow for dev (in a decade from now), it'll be repurposed for something else. A single annual payment of $649 to JB results in a tiny increase in dev speed, which will disappear at the end of the year anyway. It won't make the code more robust, it won't help solve business problems any faster, it will only make code navigation faster. For a dev, look what $1000 buys, and then look at JB for $650, and it doesn't look like all that good value for money anymore. [1] the cost for Goland at https://www.jetbrains.com/go/buy/#commercial https://www.jetbrains.com/go/buy/#commercial
- kstenerud 4y agoSorry, no. I have JetBrains and have since stopped using it for go development. It's too slow, too buggy, and lacks the ecosystem that VS code has. I still use it for Java because the rest are even worse A language that depends too much on IDE integration for usability is a real problem, because now you have tool fragmentation as everyone goes different routes with varying levels of success to fix the deficiencies in your language. In the end you end up rolling your own tools as I have done, which is the absolute WORST of all worlds. Go was supposed to be simple, but all it succeeded in doing is shifting the complexity elsewhere and calling mission accomplished. When you're designing a language, it's VERY important to understand the difference between the emergent complexity of the domain, and the inherent complexity of your design. The latter can be fixed, the former can only be managed - in ways that are already well researched (or just swept under the rug, as go has done). Too much magic and too much "clever" re-purposing of existing paradigms (file names, capitalization, implicit contracts, etc) makes for an infuriatingly bad design.
- prmoustache 4y agoRegardless of the price jetbrains intellij based editors are so slow they are borderline unusable.
- X6S1x6Okd1st 4y agoYou can explicitly declare that it implements an interface: https://go.dev/play/p/VCcrSXT59w0 https://go.dev/play/p/VCcrSXT59w0
- benhoyt 4y agoI think you forgot the "hasA" type on the var line. Fixed: https://go.dev/play/p/0Amm7nd1Av4 https://go.dev/play/p/0Amm7nd1Av4
- mseepgood 4y ago> is a real and unaddressed problem No, it's not. It's one of the best features, and I wish every language did this. At least TypeScript does it, too.
- skybrian 4y agoNot sure what you mean. The types consumed by an API are declared (though they might be interface types), and reading the godoc will give you a good overview of a package. When would you want to look for all implementations of an interface? Is this something like an abstract syntax tree?
- richardsondrew 4y ago> However, the issue this brings up about structs / types not explicitly declaring which interfaces they implement is a real and unaddressed problem You can do this with a line of code below the struct definition, something like: var _ <interface> = &<struct>{} The compiler will also generate helpful errors if the struct doesn't implement the interface. Not requiring struct definition is a great feature in golang. I'm able to add an interface to a struct defined in another library to inject a different implementation for unit tests.
- thiht 4y agoIt would be cool though to be able to optionally declare the interfaces implemented by your struct, for documentation and tooling purpose. Also to validate that the struct you’re writing actually implements the interface you have in mind. I know you can make an anonymous assignment to check that, but some sugar on that would be nice.
- zbobet2012 4y agoI highly disagree with the interfaces criticism. Firstly You can literally just use one of the dozens of go lsps or code tools to search for API invocations to find what structs are passed/called into it. More importantly if you need to know you've written bad code. The entire point of an interface is that you SHOULDN'T need to know the underlying type. If you do you've violated the entire point. Just pass concrete ones. I've written Go for years and never had a problem with this, even in large open source projects like Kuberenetes. Secondly, the criticism about flipping return values order/meaning isn't a criticism of interface being structurally typed (https://en.wikipedia.org/wiki/Structural_type_system https://en.wikipedia.org/wiki/Structural_type_system). If you return int, int and the second int "should be even", you should have defined a type "Even" and returned int, Even*. Systems which are structurally typed can demonstrate functional extensionality and (https://github.com/FStarLang/FStar/wiki/SMT-Equality-and-Extensionality-in-F%2A https://github.com/FStarLang/FStar/wiki/SMT-Equality-and-Ext...) and check whether you've flipped the arguments, which would be a more valid criticism (but such checks are expensive and conflict with compile time requirements). Also Java has the same problem, if you define two interfaces with the same method signature and a single class implements both you can't disambiguate. Thirdly, the structural typing has a huge advantage, namely looser coupling and more tightly defined interfaces. If you follow the "accept interfaces return structs" go idiom, you'll see why. An open source library that does so leaves their returned structs open to be used by consumer code, that itself uses interfaces, without modification required. This means most go code has small, tightly defined interfaces, where every function on the interface is invoked in the relevant function. For example if you have a library with this definition: type Baz struct {} func (b Baz) Foo(){} func (b Baz) Bar(){} I can use Baz in my code like so: type Fooer interface { Foo() } func DoSomething(f Fooer) { } And use the underlying library, while being decoupled from it, without having to modify it. Fourthly: You can explicitly say a type implements an interface... * A good study: https://blog.boot.dev/golang/golang-interfaces/ https://blog.boot.dev/golang/golang-interfaces/ * In Idris we would do: even : Nat -> Bool even Z = True even (S k) = odd k where odd Z = False odd (S k) = even k int -> even doubler a = 2 * a
- thegeekpirate 4y agoEvery major editor I can think of has a way to find out what implements an interface using guru (https://github.com/golang/tools/tree/master/cmd/guru https://github.com/golang/tools/tree/master/cmd/guru). In VSCode, it's right-click -> Find All Implementations. vim-go has :GoImplements. Using go-mode, emacs provides go-guru-implements.
- sam0x17 4y agoIt's more than that though. There is just no standard library to be spoken of. I mean things like the most basic string processing methods, etc., are left to the programmer to sort out themself. Every time I've done contracting work on Go projects, I'm shocked by the things I have to implement from scratch (not that it isn't fun) that we take for granted in every other modern compiled languge I've tried (Rust, Crystal, Nim). I know this is more of an environment thing than a language thing, but in practice, language and environment are so intertwined it's pointless to not consider them together.
- gabereiser 4y agoThis isn’t true. Go has a basic standard package list. https://pkg.go.dev/std https://pkg.go.dev/std
- sam0x17 4y agoYes, and it's missing tons of things we take for granted in other langauges. If you look at the "strings" section it's so short. There aren't even convenience things like string reverse.
- benhoyt 4y agoOdd, I find the standard library very full-fledged and useful, including the strings package. I've almost never needed to reverse a string, except in interviews. :-) The stdlib has a full (and good) HTTP server with HTTP/2 and TLS support, HTML templating, excellent I/O support, compression, even image encoding/decoding and drawing. That said, the container types are pretty sparse, but that may change a bit now that generics are here. What, apart from string reverse, do you miss for real projects?
- sam0x17 4y agoThe fact that it's a bunch of top level functions also makes me think of PHP from the early 00s, only I was able to do more with things then tbh. Just feels super archaic.
- serial_dev 4y ago> structs / types not explicitly declaring which interfaces they implement is a real and unaddressed problem Isn't it a feature? You can have a "writer" as long as it can "write", and then use that writer anywhere where a function expects a writer?
- richardwhiuk 4y agoBut do you obey all of the semantics of the writer interface which aren't expressed in code?
- BreakfastB0b 4y agoIt's not great, but I use this pattern to check / enforce interface membership. type Bar interface { BarMethod(int, int) int } type Foo struct {} // Error: Foo does not implement Bar (missing method BarMethod) var _fooImplementsBar Bar = Foo{}
- grey-area 4y agoThe interface defines the behaviour required at the point of use - that’s the point of them. You should not need to know which types implement an interface and if you do things are deeply broken in your codebase. I’ve developed large Go codebases and never had this problem so your last sentence is false. In addition this is not an issue other go developers I’ve spoken to have ever worried or talked about.
- sudo_chmod777 4y ago> However, the issue this brings up about structs / types not explicitly declaring which interfaces they implement is a real and unaddressed problem, especially in large codebases. The only tool that I'm aware of that finds implementations is GoLand, at steep JetBrains prices. So are you trying to find implemented interfaces or interfaces' implementors? Former: In Vim I can use `:GoImplements`, which internally calls `guru` I guess. Latter: `gopls` supports this. I agree it's still a pain that one can not tell directly from code what interfaces a struct implements tho.
- Beltalowda 4y ago> However, the issue this brings up about structs / types not explicitly declaring which interfaces they implement is a real and unaddressed problem, especially in large codebases. The only tool that I'm aware of that finds implementations is GoLand, at steep JetBrains prices. Alan Donovan's guru tool could do this, but it kind of broke with modules and it was never updated and deprecated in favour of gopls. I don't know if gopls added this yet (I never really found a use for it). I don't think it's very hard to write a tool for this though; parsing Go code is fairly easy and the stdlib provides a decent API for it. I think you could have a functional tool in a day if you wanted to, although without any caching it might be a little bit slow on larger code bases.
- raxxorraxor 4y agoI don't write Golang but honestly that was one of the features that interested me the most. Automatic type compatibility. I get the criticism as you will depend on tooling to get some expected convenience. But if you are used to void *ptr anyway... To be fair, most APIs need documentation and code is just plainly not enough. At least if we are talking about specialist interfaces that aren't just another web framework.