It’s generally claimed that reading other people’s code is harder than writing your own. I mean, everybody loves writing code on a greenfield project but hates maintenance of legacy code, right? So, why do people like these code generators? The only explanation I can see is that people use them and then don’t read the code . Which would be horrifying. (I stay away for obvious copyright reasons.)
I figured out how to get GitHub Copilot to run in the terminal
101–105 of 105 posts
Re: I figured out how to get GitHub Copilot to run in the terminal
#102It’s generally claimed that reading other people’s code is harder than writing your own. I mean, everybody loves writing code on a greenfield project but hates maintenance of legacy code, right? So, why do people like these code generators? The only explanation I can see is that people use them and then don’t read the code . Which would be horrifying. (I stay away for obvious copyright reasons.)
I think many people see GitHub Copilot as a code generator, without having used it, and then wonder like you. But afaik almost everybody uses it as autocomplete on steroids. So the reasoning behind using it is the exact same as using autocomplete in I.e. Intellij. It's just slightly more powerful, since it will usually autocomplete the whole line (occasionally a bit more), instead of just the current keyword.
I do find it's much better in some languages though. And probably especially with languages you're new in. It doesn't do much for me in PHP, but does a lot in JavaScript.
Re: I figured out how to get GitHub Copilot to run in the terminal
#103This claims to do Bash integration, but instead it seems to do Vim integration (I don't use Vim, but I do use Bash). Can anyone fill me in?
Once you get to "vimshell %", you could just run bash and disable the vim keybindings.
A less hacked together solution would probably be running nvim in the background, feeding it the content from the current terminal session, intercepting the copilot suggestions, and then returning them as terminal suggestions (I'd use `tmux send-keys` and `tmux read-pane` with some regex to get the copilot results). Even less hacked together would be to implement a bash plugin to send out the necessary copilot API requests.
Re: I figured out how to get GitHub Copilot to run in the terminal
#104Earlier quoted context omitted.
It is absolutely amazing for writing boilerplate code that is also context aware. It saves me hours of typing. It's hard to explain if you've never tried it because you're ideologically opposed to it, but stop being close minded and try it out, I promise it's a great tool to assist your programming.
Good codebases don't need boilerplate to do basic stuff: in this sense, copilot is a patch over the real problem, which can be solved with better frameworks and more code reuse. I tried copilot during the beta, and apart from the obvious legal licensing issues, I simply could not find a valid usecase for any of the codebases I usually work with. At my day job, I spend more time thinking of better ways to do X, rather…
10%+ speedup is a huge, obvious win. Anything that increases my productivity is good.
Re: I figured out how to get GitHub Copilot to run in the terminal
#105Earlier quoted context omitted.
Why? Wiki doesn't say anything about it and when I run it, the result looks fine > $ for((i=1;i > rand.txt ; done > $ cat rand.txt | sort | uniq -c 1051 1 932 10 1012 2 1042 3 983 4 1015 5 1042 6 1035 7 992 8 995 9
`cat /dev/urandom | od -N 1 -An -i` gives you a uniform random number between 0 and 255. The following mod 10 in the awk command introduces "modulo bias", which you can read about here https://research.kudelskisecurity.com/2020/07/28/the-definit... You can see it quite intuitively if you iterate over all possible numbers between 0 and 255: $ (for i in {0..255}; do; echo $i | awk '{print $1 % 10 + 1}'; done) | sort -n…