4 ms·
Sure. Fair to say that godocs is to cpan of perl. But Go doesn't present you the code on disk. I have to hunt somewhere else with a reference. With a library f
by doublerabbit 6y ago
Sure. Fair to say that godocs is to cpan of perl.
But Go doesn't present you the code on disk. I have to hunt somewhere else with a reference. With a library file, I know that prometheus::exporter::blah is related to the perl module prometherus, exporter subroutine blah
I need the code in front of me to understand how it's interacting; the whole github ruins that for me.
- hnlmorg 6y ago> But Go doesn't present you the code on disk. Yes it does. You couldn't compile the modules if they weren't on disk :)
- doublerabbit 6y agoBut only at compile time.
- q3k 6y ago`go mod download`, if you're using go modules, will fetch you the deps. This is no different, to me, than downloading a tarball of Python software with requirements.txt and not running setup.py or pip install. I don't understand the problem.
- doublerabbit 6y agoRight, then it could be I wasn't aware there is a "go mod download". If it actually gives me a file I can modify without having to create any repo, special things to apply the changes then that will assist me in the future. Go isn't my thing and the less time I play with it, the happier I am. This is only my experience of it, and my experience is it acts friendly, but is a faff.
- hnlmorg 6y ago> the less time I play with it, the happier I am. There lies the problem. If you don't want to invest the time to learn the tools then you can't really complain that your screwdriver is rubbish at hammering in nails. And it doesn't matter how easy or hard any programming language is, all languages will have a learning curve that people need to be prepared to undertake.
- doublerabbit 6y agoIt's not that I don't want to, it's more I don't have the time to invest upon. I'd read all the national library books if I could, but I just don't have the time. End of shift, I walk away from my screen and try to do something other than. I'm burnt out enough by the tech field as it is.
- q3k 6y agoIt seems to me that the problem here is your job, not Go. You could substitute Go here for any other language or technology that you don't know well and for which you're not given adequate time to learn the basics of, and you'd get the exact same result.
- doublerabbit 6y agoMy job is solid. I have time to do such. I would rather just use my time available on have more pressing issues then a language I don't really want to use. Sure knowledge is boss, but my job is fine. It's not the job at fault.
- q3k 6y agoSo it seems clear to me? You don't want to use the language, you don't want to learn the language, no-one is forcing you to use the language, then don't use the language. What are your expectations? Is it that every language should be readable to people who know Perl? Is it that you shouldn't be reading or modifying the source code of open source projects? How could this work better in an ideal world? I am puzzled.
- hnlmorg 6y agoYou can import them at any time. Most people import early so that IDE's can inspect the packages (eg for completion tools etc). Again, just like with Perl.
- q3k 6y agoIf you want to read the code, each godoc name can be clicked to directly redirect you to the source code of what you're looking for, eg. to a github page code viewer. Depending on whether you use gomodules, GOPATH, or any other build system you also can find the files locally to grep through them or use your text editor to read them locally. You can also override import resolution to point to a fork (eg. of any module if using gomodules), if you want to test drive some local patches. I do a _ton_ of code reading in my work, and I find using Godoc for that probably the best experience of any language (second only to maybe Haskell/Hoogle, but there you get much more difficult-to-grok-at-a-glance code).
- doublerabbit 6y ago> You can also override import resolution to point to a fork (eg. of any module if using gomodules), if you want to test drive some local patches. So much overhead where time is limited. I shouldn't need to fork packages, I don't want to fork.
- q3k 6y agoIt's one `cp -r` and a 1 line change in go.mod [1]. You can also just `go mod vendor` to have all modules land in a `vendor/` directory when you can edit things as you wish [2]. [1] - https://golang.org/ref/mod#go-mod-file-replace https://golang.org/ref/mod#go-mod-file-replace [2] - https://golang.org/ref/mod#vendoring https://golang.org/ref/mod#vendoring