Live data from Hacker News

Copilot regurgitating Quake code, including sweary comments

twitter.com

201–210 of 672 posts

Re: Copilot regurgitating Quake code, including sweary comments

#201
post #175

Earlier quoted context omitted.

Every front office finance project I have ever worked on has used floating point, so take the dogma with a grain of salt. It depends entirely on the context.

They probably just accumulate the rounding errors into an account and write it off periodically without even realising why it happens.

It's not like decimal or fixed point does not suffer from rounding errors either. In fact for many calculations, binary floating point gives more accurate answers.

In accounting there are specific rules that require decimal system, so one must be very careful with the floating point if it is used.

Re: Copilot regurgitating Quake code, including sweary comments

#202
post #107

Earlier quoted context omitted.

It's very easy: don't use copilot code verbatim, and you won't have GPL code verbatim.

> It's very easy: don't use copilot Fixed that for you. Verbatim isn't the problem / solution. If you take a GPL'ed library and rename all symbols and variables, the output is still a GPL'ed library. Just seeing the output of GPL'ed code spitted by copilot and writing different code "inspired" by it can result in GPL'ed code. That's why "clean room"s exist. Copilot is going to make for a very interesting to follow la…

Stack Overflow content is licensed under CC-BY-SA. Terms [1]:

* Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

* ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

In over a decade of software engineering, I've seen many reuses of Stack Overflow content, occasionally with links to underlying answers. All Stack Overflow content use I've seen would clearly fail the legal terms set out by the license.

I suspect Copilot usage will similarly fail a stringent interpretation of underlying licenses, and will similarly face essentially no enforcement.

[1] https://creativecommons.org/licenses/by-sa/4.0/

Re: Copilot regurgitating Quake code, including sweary comments

#203

Earlier quoted context omitted.

> The python example is using floats for currency. Dumb question, but what is the proper way to handle currency? Custom number objects? Strings for any number of decimal places?

This is a complex topic, mainly for two reasons: 1. it works on two layers (storage and code) 2. there is a context to take care of. [Modern] programming languages have decimal/rational data types, which (within limits) are exact. Where this is not possible, and/or it's undesirable for any reason, just use an int and scale it manually (e.g. 1.05 dollars = int 105). However, point 2 is very problematic and important t…

The problem is also stupid people and companies.

My last job they wanted me to invoice them hours worked, which was some number like 7.6.

This number plays badly when you run it through GST and other things - you get repeaters.

So I looked up common practice here, even tried asking finance who just said "be exact", and eventually settled on that below 1 cent fractions I would round up to the nearest cent in my favour for each line item.

First invoice I hand them, they manually tally up all the line items and hours, and complain it's over by 55 cents.

So I change it to give rounded line items but straight multiplied to the total - and they complain it doesn't match.

Finally I just print decimal exact numbers (which are occasionally huge) and they stop complaining - because excel is now happy the sums match when they keep second guessing my invoices.

All of this of course was irrelevant - I still had to put hours into their payroll system as well (which they checked against) and my contract specifically stated what my day rate was to be in lieu of notice.

So how should you do currency? Probably in whatever form that matches how finance are using excel, which does it wrong.

Re: Copilot regurgitating Quake code, including sweary comments

#204

Earlier quoted context omitted.

> The python example is using floats for currency. Dumb question, but what is the proper way to handle currency? Custom number objects? Strings for any number of decimal places?

This is a complex topic, mainly for two reasons: 1. it works on two layers (storage and code) 2. there is a context to take care of. [Modern] programming languages have decimal/rational data types, which (within limits) are exact. Where this is not possible, and/or it's undesirable for any reason, just use an int and scale it manually (e.g. 1.05 dollars = int 105). However, point 2 is very problematic and important t…

>[Modern] programming languages have decimal/rational data types

This caveat is kind of funny, in light of COBOL having support for decimal / fixed precision data types baked directly into the language.

It's not a problem with "non-modern" languages, it's a problem with C and many of its successors. That's precisely why many "non-modern" languages have stuck around so long.

https://medium.com/the-technical-archaeologist/is-cobol-hold...

Additionally, mainframes are so strongly optimized for hardware-accelerated fixed point decimal computing that for a lot of financial calculations it can be legitimately difficult to match their performance with standard commercial hardware.

Re: Copilot regurgitating Quake code, including sweary comments

#205

With apologies to Martin Niemöller[1]: First the automation came for the farmers, and I did not speak out — Because I was not a farmer. Then the automation came for the factory workers, and I did not speak out — Because I was not a factory worker. Then the automation came for the accountants, and I did not speak out — Because I was not a accountant. Then the automation came for me (a programmer) — and there was no on…

Honestly I’ve automated a large chunk of my day job. The trick is keeping it secret!

Re: Copilot regurgitating Quake code, including sweary comments

#206
post #16

Earlier quoted context omitted.

Awesome summary and thanks for trying it for the rest of us! Copilot sounded terrible in the press release. The idea that a computer is going to pick the right code for you (from comments, no less) is really just completely nuts. The belief that it could be better than human-picked code is really way off. You bring up a really important point. When you use a tool like Copilot (or copypasta of any kind), you are intro…

While I accept most of the concerns, it's better than your comment suggests. I see some promise for it as a tool for reminding you of a technique or inspiring you to a different approach than you've seen before. For example, I wrote a comment along the lines of "Find the middle point of two 2D positions stored in x, y vectors" and it came up with two totally different approaches in Ruby - one of which I wouldn't have…

This is good stuff. As a search engine, it could very well be useful. As another poster pointed out, if some context or explanation were provided along with the source suggestions, its utility as a reference would really grow.

I totally agree with you that prompted help is a big deal and just going to get bigger. We have developed a language for fact checking called MSL that works exactly this way in practice -- suggesting multiple options rather than just inserting things.

One of the things that interests me about this thread is the whole topic of UI vs. AI and how much help really comes from giving the user options (and a good UI to discover them) vs how much is "AI" or really intelligence. I think the intelligence has to belong to the user, but a computer can certainly sift through a bunch of code to find a search engine result and, those results could be better than you get now from Google &Co.

Re: Copilot regurgitating Quake code, including sweary comments

#207

Earlier quoted context omitted.

If someone asks how to handle money the best answer is integers or fixed precision decimals. There may be a valid case for using floats, but if someone asks they shouldn't be using floats. Also I'm hard pressed to come up with a case where floats would work. Can you give an example?

> Can you give an example? The answer is the same as _any_ time you should use floats: where you don't care about answers being exact, either (1) because calculation speed is more important than exactness, or (2) because your inputs or computations involve uncertainty anyway, so it doesn't matter. This is more likely to be the case in, say, physics than it is in finance, but it's not impossible in the latter. For exa…

That's fair, though the example code I mentioned is the start of an expense tracker.

Re: Copilot regurgitating Quake code, including sweary comments

#209
post #20

I get why marketing calls machine learning “AI”. I don’t get why engineers would think this is. Dumb.

I still consider anything with more than 3 if-statements to be AI. We just need more sensible expectations about what AI can do haha.

Re: Copilot regurgitating Quake code, including sweary comments

#210
post #130

Earlier quoted context omitted.

Depends. If you find useful code on Github, Stack Overflow or anywhere else in the internet, you still need to check whether it is suitable with your licensing or not.

But Copilot won't accurately tell you if it's directly copying code, and if so what the license is. If it provides MIT licensed code that I then need to include, how do I know that? Do I need to search for each set of lines of code it provides on GitHub? When a person gets code from another source on the internet, they generally know where the code has come from.

In a real world scenario you wouldn't be mindlessly pressing Tab right after linebreak and accepting the first suggestion that comes your way. While entertaining, nobody gets paid to do that.

What you get paid is to write your own code. When you write your own code, generally you think first and then type. Well, with Copilot you think first and then start typing a few symbols before seeing automatic suggestions. If they are right, you accept changes and if they happen to be similar to any other code out there, you deal with it exactly the same as if you typed those lines yourself.

Post reply on HN