Live data from Hacker News

Copilot regurgitating Quake code, including sweary comments

twitter.com

321–330 of 672 posts

Re: Copilot regurgitating Quake code, including sweary comments

#321

Earlier quoted context omitted.

>2/ The boilerplate is what bothers me the most (as someone who believes in the declarative approach to software engineering). The future for programming and programming languages should be an attempt to step up to a higher level of abstraction, that has been historically the way we step up to higher levels of productivity. As applications get larger and code-bases grow significantly we need abstraction, not more boi…

Tools like xsd or T4 (in the .NET ecosystem) are great time-savers, but you would never consider directly modifying the code they generate. You would leave the generated code untouched (in case it ever needed to be generated again) and subclass it to make whatever changes you intend. I think Copilot is so unfortunate because it's not building abstractions and expecting you to override parts of them. It's acting as an…

Linq2Db is a great example of T4 code generation that works. It creates partial classes from database schema. Together with C# I have strongly typed database access.

https://github.com/linq2db/linq2db

Re: Copilot regurgitating Quake code, including sweary comments

#322
post #30

They have 4 hand picked examples on their homepage: https://copilot.github.com/ One has the issue with form encoding: https://news.ycombinator.com/item?id=27697884 The python example is using floats for currency, in an expense tracking context. The golang one uses a word ("value") for a field name that's been a reserved word since SQL-1999. It will work in popular open source SQL databases, but I believe it would bom…

Copilot appears to be “give more efficiency leverage to the worst kind of coder.”

I find it is reducing my research time by providing a decent starting solution space. Especially for boring stuff where you just need to google the signature of some standard library function.

Re: Copilot regurgitating Quake code, including sweary comments

#323

I hate to be the one that says this but I think it‘s true: "So you are an SWE and you take a break from work to go to Hackernews to complain that Github's Copilot, which is an AI-based solution meant to help SWEs, is utter shit and completely unusuable. And then you go back to writing AI-based solutions for some other profession. Which is totally not shit or anything.“ Can anybody put this more elegantly?

There are probably good ways to apply AI to software development (has anybody tried to build a linter already?). It is this product that is very bad.

The same certainly apply to other tasks.

Re: Copilot regurgitating Quake code, including sweary comments

#324

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?

In its base unit. So cents in USD. Which can be an int64 Or if your language has something specific built in, use that.

> In its base unit. So cents in USD. Which can be an int64.

Note that if you use cents in the US so that everything is an integer then as long as you do not have to deal with amounts that are outside the range [-$180 trillion, $180 trillion] you can also use double. Double can exactly represent all integer numbers of cents in that range.

This may be faster than int64 on some systems, especially on systems that do not provide int64 either in hardware or in the language runtime so you'd have to do it yourself.

Re: Copilot regurgitating Quake code, including sweary comments

#326

Earlier quoted context omitted.

Copilot appears to be “give more efficiency leverage to the worst kind of coder.”

I'm not really sure that type of tool could really be anything else. How would a model become aware of all of the various edge cases that depend on which SQL database you use or differences in language versions over time?

> I'm not really sure that type of tool could really be anything else.

It can't be, because they've chosen to use a deep learning approach. That makes it a dead end right from the start.

> How would a model become aware of all of the various edge cases that depend on which SQL database you use or differences in language versions over time?

A lot of things that we call "edge cases" are only a problem for humans. They're not "edge cases" from the point of view of the grammar / semantics of programming languages and libraries. The way a hypothetical, better Copilot could work, is by having directly encoded grammars and semantics metadata corresponding to popular languages and tools. It could generate code in principled and introspectable way, by having a model of the computation it wants to express and encoding it in a target language.

Of course, such hypothetical Copilot is a harder task - someone would have to come up with a structure for explicitly representing understanding of the abstract computation the user wants to happen, and then translate user input into that structure. That's a lot of drudgery, and from my vague understanding of the "classical" AI space, there might be a bunch of unsolved problems on the way.

Real Copilot uses DNNs, because they let you ignore all that - you just keep shoving code at it, until the black-box model starts to give you mostly correct answers. The hard work is done automagically. It makes sense for some tasks, less for others - and I think code generation is one of those things where black-box DNNs are a bad idea.

Re: Copilot regurgitating Quake code, including sweary comments

#327
post #263

Earlier quoted context omitted.

Hmm... I mean, these all seem like mistakes I could make and I don't think I'm the "worst kind of coder". The currency one I learned a while back, but it's not like I intuited using integers by default. Value being a reserved keyword, I'm not sure I'd know that and I do Postgres work as part of my myriad duties at the startup I work at. Maybe I'd make that mistake in a migration, maybe I have already. In a way, is it…

Is this any worse? Maybe not. Is it better? Absolutely not. This kind of tool will only further entrench the production of mediocre, bug-ridden code that plagues the world. As implemented, this will not be a solution; it is a express lane in the race to the bottom.

it is a race to the bottom, and people are trying to win. any skilled trade is being turned into an unskilled job. it might suck, the results might suck, but it's more profitable, and that's what matters.

Re: Copilot regurgitating Quake code, including sweary comments

#328

Earlier quoted context omitted.

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-archaeolog…

It is quite simple to do the same in Julia

Re: Copilot regurgitating Quake code, including sweary comments

#329
post #301
post #279

Earlier quoted context omitted.

It is also trivial to keep doing C mistakes with a C++ compiler, hence no matter how many ISO revisions it will still have, lack of safety due to C copy-paste compatibility will never be fixed.

> [...] no matter how many ISO revisions it will still have, lack of safety due to C copy-paste compatibility will never be fixed. Okay, no idea how that's relevant to "built-in decimal types" vs "library-defined decimal types", but if it makes you feel better, you can do the same in Rust or Python, two languages which are "modern" compared to COBOL, don't inherit C's flaws, and which enable defining custom number ty…

Rust I agree, Python not really as the language doesn't provide any way to keep invariants.

Re: Copilot regurgitating Quake code, including sweary comments

#330

I've always assumed that we would eventually have a low-code, or no-code junior dev replacement, and was wondering if this was it. GH and MS actually have [Ed. had?] some cred for this kind of thing. Nope. Game over. Play again?

Most low-code and no-code platforms go for junior dev empowerment, and senior dev replacement. This one also seems to be aimed at empowering juniors, but looks like it missed the senior replacement by miles.
Post reply on HN