4 ms·
I've been programming for 25 years. Thanks to LLM assistance I hope to never have to hand-write code that converts XML to JSON ever again. (Last night I ended
by simonw 3y ago
I've been programming for 25 years. Thanks to LLM assistance I hope to never have to hand-write code that converts XML to JSON ever again.
(Last night I ended up writing that kind of code because GPT-4 didn't quite get it right for me, but 90% of my code like that has been LLM-created in the past 6 months and I look forward to that creeping closer to 100%)
- ado__dev 3y agoI think us folks that have been coding for 20+ years can properly utilize AI coding assistants because we can take the code it spits out and usually understand it pretty quickly and debug it if needed. It's just a skill that comes from writing code for so long. I have seen many jr level programmers struggle with AI coding assistants because they ask a question, get some code, paste it in, realize it doesn't work, but don't know why or the right questions to ask to properly debug it and get it working.
- jaredsohn 3y agothen they should ask the ai questions about it to learn. Even ask it what the right questions are if needed.
- lupire 3y agoDoes that work? Can a novice an LLM into coaxing requirements out of the novice?
- kolinko 3y agoYes. You ask an LLM to ask you questions until it's clear what you want to do.
- ado__dev 3y agoYou can do this, and sometimes it works, but more often than not it does not. it's basically the blind leading the blind. With the current state of LLM hallucinations, it's very easy to be given bad or outright wrong answers, and if you don't know any better (which as a jr you probably don't) you'll just end up running in circles. I think this will def get better over time though.
- visarga 3y agodamn right, I tried using GPT-4 for to make a text editor enhanced with CodeMirror 6, but the model kept confusing with version 5, and the thing is, they moved stuff around and deleted some modules, so it was a total mess when you refactor the whole framework you should change its name to keep docs straight, a mere version change is not strong enough for LLMs
- deleted 3y ago[deleted]
- kolinko 3y agoAs for jr programmers, otherwise they'd spend time trying to find a stackoverflow answer :)
- ado__dev 3y agoNothing wrong with SO or even using an AI assistant as a jr. You should use any tool that helps you, but I still believe nothing beats practice and doing some manual coding to really learn and understand the concepts.
- Atotalnoob 3y agoI suggest to my juniors not to copy and paste, but to write the code out by hand while looking at whatever they would copy and paste. A lot of them say they find that useful, even though it’s slower, they HAVE to read the code they are copying and pasting
- skydhash 3y agoI still think one should reach out to a book first, then goes on to whatever method is best (asking a senior/mentor, SO, ChatGPT,...). It gives you more information and the material for better questions.
- brittlecode 3y ago[dead]
- Workaccount2 3y agoI can only imagine that given current trends, this period of "LLM writes boilerplate/broken code and SWE builds on it/fixes it" will be incredibly fleeting.
- mrcode007 3y agoWhy would you write code for that? It’s just a few lines of XSLT!
- simonw 3y agoXSLT is the perfect example of a technology that I might consider using today if I can get an LLM to do all of the work for me - see also jq and AppleScript which I use frequently now after avoiding them both for years.
- mrcode007 3y agoI think you missed the point. People attempt to solve problems with LLMs that are problems only to them because they are unaware of existing solutions that have solved the these “problems” a long time ago. If you don’t know something exists, you can’t ask an LLM about it.
- simonw 3y agoAsking "give me options for" is one of my go-to prompts for this kind of thing. I just tried "Give me options for converting XML to JSON" and XSLT was 5th out of the 6 it gave me: https://chat.openai.com/share/85aa3e93-f557-426c-b0ce-f3bce7822cb3 https://chat.openai.com/share/85aa3e93-f557-426c-b0ce-f3bce7...
- bonzini 3y agoDoes it do escaping in a reasonable way?
- simonw 3y agoI played around with it a bit and it looks like you have to do some pretty gnarly things to get JSON string escaping to work in XSLT output - at least for the XSLT 1.0 version supported by most web browsers: https://chat.openai.com/share/4bc7922b-b1c2-411c-aef9-b41b0f0e9936 https://chat.openai.com/share/4bc7922b-b1c2-411c-aef9-b41b0f...
- 3y ago
- tibbydudeza 3y agoI stand on the shoulders of giants - all the kind folks who freely contributed to the Python package system. I can now spend time solving actual problems rather than reinventing the wheel.
- zer00eyz 3y agoYou (and i) are more of a raccoon picking though a dumpster looking for working scraps of code that you can glue together. Let's be candid, we all have package management Stockholm syndrome to some degree... the reality is that our laziness keeps us going back for more. The performance gain comes at the cost of not knowing how some large percentage of your stack works or if it is going to be the next XZ. Im not going to stop using packages, because that would suck, but I'm not so rosy eyed about them any longer. There are lots of problems in ecosystems and we're bad about addressing them.
- williamcotton 3y agoThere is no such thing as a free lunch!
- enceladus06 3y agoLots of different ecosystems. Mamba + docker are great though. Pip is ok. Apt works, but we were using the same thing in 2006. If these different bits didn't exist, and have ChatGPT telling me that they exist then most work wouldn't get done...so there's that.
- tibbydudeza 3y agoAgree - nodejs npm system - some of the code - eish. I love the racoon analogy :). Pandas for me a was game changer and a new career path.
- int_19h 3y agoVernor Vinge very accurately predicted how programming will develop 25 years ago. "Pham Nuwen spent years learning to program/explore. Programming went back to the beginning of time. It was a little like the midden out back of his father’s castle. Where the creek had worn that away, ten meters down, there were the crumpled hulks of machines — flying machines, the peasants said — from the great days of Canberra’s original colonial era. But the castle midden was clean and fresh compared to what lay within the Reprise’s local net. There were programs here that had been written five thousand years ago, before Humankind ever left Earth. The wonder of it—the horror of it, Sura said — was that unlike the useless wrecks of Canberra’s past, these programs still worked! And via a million million circuitous threads of inheritance, many of the oldest programs still ran in the bowels of the Qeng Ho system. Take the Traders’ method of timekeeping. The frame corrections were incredibly complex — and down at the very bottom of it was a little program that ran a counter. Second by second, the Qeng Ho counted from the instant that a human had first set foot on Old Earth’s moon. But if you looked at it still more closely… the starting instant was actually about fifteen million seconds later, the 0 - second of one of Humankind’s first computer operating systems. So behind all the top-level interfaces was layer under layer of support. Some of that software had been designed for wildly different situations. Every so often, the inconsistencies caused fatal accidents. Despite the romance of spaceflight, the most common accidents were simply caused by ancient, misused programs finally getting their revenge. “We should rewrite it all,” said Pham. “It’s been done,” said Sura, not looking up. She was preparing to go off-Watch, and had spent the last four days trying to root a problem out of the coldsleep automation. “It’s been tried,” corrected Bret, just back from the freezers. “But even the top levels of fleet system code are enormous. You and a thousand of your friends would have to work for a century or so to reproduce it.” Trinli grinned evilly. “And guess what — even if you did, by the time you finished, you’d have your own set of inconsistencies. And you still wouldn’t be consistent with all the applications that might be needed now and then.” Sura gave up on her debugging for the moment. “The word for all this is ‘mature programming environment.’ Basically, when hardware performance has been pushed to its final limit, and programmmers have had several centuries to code, you reach a point where there is far more signicant code than can be rationalized. The best you can do is understand the overall layering, and know how to search for the oddball tool that may come in handy ...”"
- bugfix 3y agoIt's a great tool when you can actually read and understand the code AI is feeding you. When you don't really know how the language works or don't know programming in general, you end up getting stuck trying to guess why this valid piece of code (that looks like it should do what you asked the LLM for), is not working properly.
- llm_trw 3y ago>(Last night I ended up writing that kind of code because GPT-4 didn't quite get it right for me, but 90% of my code like that has been LLM-created in the past 6 months and I look forward to that creeping closer to 100%) I have bad news for your long term employability if that's the case. I find that my code is 25% LLM-able on a good day with minor editing. On a bad day it is 10% LLM-able with me having to edit every line to get them to fit together.
- simonw 3y agoI wasn't talking about all of the code I write, I was talking about code along the lines of "convert this XML format to JSON".
- llm_trw 3y agoFair enough. I have to admit I've written a gpt4 api shell utility which transforms text based on descriptions like "split string on '-' after a '~' but only if it's in a the second csv column and select the third". I feel dirty using it - send your data to the cloud and use a ~peta flop- but it's faster than trying to remember how to do it in awk for under 1000 lines.
- kragen 3y agoi really don't think simon motherfucking willison needs to worry about his long-term employability, unless either he suffers a disabling injury, or llms get better than humans at everything, or somehow people stop wanting software
- Animats 3y ago> Thanks to LLM assistance I hope to never have to hand-write code that converts XML to JSON ever again. There is that. Although, if you need, say, to convert .fbx to Collada, there won't be enough examples out there for an LLM to infer how to do it. There's progress; most tools that wrangle meshes now speak glTF, so at least you only need O(N) converters, not O(N^2). There are a number of programming in the large problems that tend not to be taught. A large collection of problems revolve around having state in one place that you want somewhere else. Sometimes you can just pack up the whole state and send it. That works if it's not too big and doesn't change too often. Perhaps the data is huge. Or somebody isn't allowed full access to it. Or it's changing rapidly. Or you need to keep up with changes with low latency. Or you must have guaranteed eventual consistency. Those problems come up all the time in areas from finance to game dev. Inefficient solutions to such problems lead to bloated browsers, slow web pages, and inefficient back ends. An example is XMLRPC. Efficient solutions to those problems are complex, hard to modify, obscure, and hard to debug. An example is the internal representation of Microsoft Word .doc documents. Much of the web is trying to ship state from somewhere to somewhere else, in rather bulky ways. This can have business implications. In the metaverse area, where I've been doing some things, Improbable tried to deal with such synchronization problems in a very general way. They blew through about US$400 million in venture capital, and produced a working system that needs so much server capacity that five indy games went bust, and their big demo, Otherside, is so expensive to run that they only turn it on for demos a few times a year. This may also be why Meta blew their metaverse business so badly and spent so much money. Doing this by special casing code results in an obscure, hard to modify system with race conditions and consistentency problems. That's the classic MMO approach, and is used by Second Life/Open Simulator. A general understanding of such problems is useful, and is teachable. But what do you read for that? Not books on "how to do thing X in framework Y".
- mirsadm 3y agoI've been programming for about as long but I've yet to see a case where searching on Google (and often opening Stack overflow) wasn't quicker than ChatGPT. More often than not if I'm looking something up I'll get a bunch of answers on SO and quickly skim through them to get what I was looking for. This is way quicker than prompting over and over again hoping to get an answer. But after programming for so long the types of things I'm searching are basically API references. I know exactly where I'm going I don't need help getting there.
- simonw 3y agoYou have to learn how to most effectively use ChatGPT etc. If you use it the same way you use Google you'll probably get better results from Google. Here's an example from yesterday where I knocked together a tool for converting Atom XML to JSON using XSLT in a couple of minutes on my phone, just out of curiosity to see what it would look like: https://chat.openai.com/share/4bc7922b-b1c2-411c-aef9-b41b0f0e9936 https://chat.openai.com/share/4bc7922b-b1c2-411c-aef9-b41b0f...