Developers using AI run leaps and bounds around developers rawdogging code

2 years ago by Drew to c/programmingcirclejerk

crmsnbleyd 43 points 2 years ago

This is fact. My source is that I made it the fuck up

path: 0 15004820, hotness: undefined, score: 43, children: 11
Vinny_93 14 points 2 years ago

It's simple, really. If you don't understand what the AI is telling you to code, you'll spend five times what it would take a rawdogger to code it.

If you write the stuff yourself from scratch you know your train of thought, you know what it means and you know what it needs to be better.

Show me a head to head comparison of several coders doing the same assignment and let half of them use AI. Then we can assess the effects. My hypothesis is that the fastest one would have used AI. The slowest one wouldn't have used AI but is a crappy coder. But there will probably will be non-AI coders quicker than some AI coders.

path: 0 15004820 15005064, hotness: undefined, score: 14, children: 10
dotslashme 15 points 2 years ago

I'd also bet on AI making isolated solutions, that will be impossible to integrate without incurring massive technical debt.

path: 0 15004820 15005064 15005614, hotness: undefined, score: 15, children: 3
fartsparkles 7 points 2 years ago

This. Coding challenges aren’t indicative of building an actual application. So far, I’ve found AI vastly inferior to any human I work with. Only use I’ve found is writing a bunch of basic tests to save some monotony. Still requires a bunch of extra tests to be written though since it never fully groks the code.

path: 0 15004820 15005064 15005614 15005749, hotness: undefined, score: 7, children: 0
Dkarma -3 points 2 years ago

Claiming an ai can't write a single simple function well is such a joke take I can't tell if you're serious or not.

path: 0 15004820 15005064 15005614 15006762, hotness: undefined, score: -3, children: 1
dotslashme 5 points 2 years ago

Maybe it was unclear, but my point wasn't isolated functions, rather the trying to glue several of them together into a coherent application.

path: 0 15004820 15005064 15005614 15006762 15016582, hotness: undefined, score: 5, children: 0
Dungrad 5 points 2 years ago
path: 0 15004820 15005064 15006445, hotness: undefined, score: 5, children: 0
Chocrates 2 points 2 years ago

I tried chatgpr on something I didn't understand and it lead me down the wrong path. Ai is only good for boilerplate and finding out interesting ways to refactor imo.

path: 0 15004820 15005064 15006123, hotness: undefined, score: 2, children: 0
TropicalDingdong 1 point 2 years ago

Show me a head to head comparison of several coders doing the same assignment and let half of them use AI. Then we can assess the effects. My hypothesis is that the fastest one would have used AI. The slowest one wouldn’t have used AI but is a crappy coder. But there will probably will be non-AI coders quicker than some AI coders.

You need to introduce one more independent variable, which would be level of coding/ programing experience. If you really do already know what you are doing, and you know how to structure a good query, and know how to confirm if the code assistant/ AI got it right, it absolutely does make you much faster. Also, for really low level stuff, like defining helper functions, it rarely gets them objectively wrong, although they are often pretty... plain? or naive? So I would extend this hypothesis to cover the range of skill levels in individual coders and programmers. I think this is actually the striking difference. If you already know enough to code these things from scratch, it does make a huge difference.

Here is an example that I would use (prompt), and the result. Prompt:

I want a python function to pull imagery for a bounding box in latitude longitude, for a specific year, and a specific band order from this arcgis REST server (https://map.dfg.ca.gov/...). I always want a 512 by 512 pixel tile. The layer pattern for the server is NAIP_XXXX_ZZZZ where XXXX is the year, and ZZZZ is either 4Band, CIR, or NDVI, or missing (including the underscore) for RGB. I want the data as a spatially projected geotiff. Have the function query the server first to confirm the layer options before querying.

Response:

import requests import rasterio from rasterio.io import MemoryFile import numpy as np

def get_arcgis_imagery(bbox, year, band_order, output_path):

"""
Pulls imagery from the ArcGIS REST server for a given bounding box, year, and band order.

Parameters:
- bbox: (min_lon, min_lat, max_lon, max_lat)
- year: YYYY (e.g., 2020)
- band_order: '4Band', 'CIR', 'NDVI', or '' for RGB
- output_path: Path to save the output GeoTIFF
"""
base_url = "https://map.dfg.ca.gov/arcgis/rest/services/Base_Remote_Sensing"
service_url = f"{base_url}/NAIP_{year}_{band_order}/ImageServer" if band_order else f"{base_url}/NAIP_{year}/ImageServer"

# Confirming the layer exists
response = requests.get(f"{service_url}?f=json")
if response.status_code != 200:
    raise ValueError(f"Layer NAIP_{year}_{band_order} does not exist on the server.")

# Defining export parameters
params = {
    'bbox': f"{bbox[0]},{bbox[1]},{bbox[2]},{bbox[3]}",
    'bboxSR': 4326,
    'size': '512,512',
    'imageSR': 3857,  # Projected coordinate system
    'format': 'tiff',
    'f': 'image'
}

# Requesting the imagery
export_url = f"{service_url}/exportImage"
image_response = requests.get(export_url, params=params)
if image_response.status_code != 200:
    raise ValueError("Failed to retrieve image data.")

# Saving the image as a GeoTIFF
with MemoryFile(image_response.content) as memfile:
    with memfile.open() as dataset:
        profile = dataset.profile
        data = dataset.read()

        with rasterio.open(output_path, 'w', **profile) as dst:
            dst.write(data)

This function appears in just a second, and I don't even need to consider its details. Its well written, commented, and it just works.

path: 0 15004820 15005064 15005764, hotness: undefined, score: 1, children: 3
LaMouette 2 points 2 years ago

But this is something a third grader could do. This is not engineering work at all. This may not be production read code as it should also consider the context where this will be inserted, what is your strategy for handling errors etc ... And last but not least I bet this is the first stackoverflow post content when asking the same question to google. Not worth burning the planet in my opinion.

path: 0 15004820 15005064 15005764 15025500, hotness: undefined, score: 2, children: 2
TropicalDingdong 2 points 2 years ago

Show me a third grader who understands the technical underpinnings of GDAL and WMS sufficiently to implement this without documentation and I'll concede the point. Technical proficiency isn't just knowing how to use a shovel, its knowing where the bones are buried, and if you are long enough in the tooth like some of us are, knowing how to bury them. Its knowing what will change and how if I use 3857 versus 4326 in the above context (do YOU know what that would do?); what difference getting these results as png, or jpg, or tif would represent. If you have a third grader handy that can address any of the above, DM me because I'll hire them right now.

The morality of these tools are independent from their utility. When you mix the two judgments you muddle them both beyond the point of legibility.

path: 0 15004820 15005064 15005764 15025500 15025727, hotness: undefined, score: 2, children: 1
Rogue 11 points 2 years ago

If you're developing something that has been written a million times before such as a user authentication API then yes you can just let ChatGPT do it for you.

But as soon as you're writing something new or niche any LLM is going to mostly spew useless nonsense.

I've been working with Bevy a lot lately and because it's new and iterating quickly there are a lot of breaking changes between versions. AI simply isn't able to cope with that. It was trained with years old data and is incapable of adapting to the new way of doing things

path: 0 15009595, hotness: undefined, score: 11, children: 0
i_dont_want_to 11 points 2 years ago

Those new developers and their fancy tools. They don't know anything about computers.

That's why I only code in machine code on punch cards. Anything more is just training wheels.

path: 0 15020727, hotness: undefined, score: 11, children: 0
JackbyDev 10 points 2 years ago

Whenever I see someone say "I write my unit tests with AI" I cringe so hard.

path: 0 15022241, hotness: undefined, score: 10, children: 4
UndercoverUlrikHD 2 points 2 years ago

In my defence, I manually verify every test/calculation by hand, but so far copilot is nearly 100% accurate with the tests it generates. Unless it is something particularly complex you're working with, if copilot don't understand what a function does, you've might want to check if the function should be simplified/split up. Specific edge cases I still need to write myself though, as copilot seems mostly focused on happy paths it recognise.

path: 0 15022241 15026940, hotness: undefined, score: 2, children: 3
JackbyDev 2 points 2 years ago

I'm a bit of a TDD person. I'm not as strict about it as some people are, but the idea of just telling AI to look at your code and make unit tests for it really rubs me the wrong way. If you wrote the code wrong, it's gonna assume it's right. And sure, there are probably those golden moments where it realizes you made a mistake and tells you, but that's not something unique to "writing unit tests with AI", you could still get that without AI or even with it just by asking it to review the code.

I'm not dogmatic about test driven development, but seeing those failing tests is super important. Knowing that your test fails without your code but works with your code is huge.

So many unit tests I see are so stupid. I think people just write them to get coverage sometimes. Like I saw a test the other day a coworker wrote for a function to get back a date given a query. The test data was a list with a single date. That's not really testing that it's grabbing the right one at all.

It's just sort of a bigger problem I see with folks misunderstanding and/or undervaluing unit tests.

path: 0 15022241 15026940 15027345, hotness: undefined, score: 2, children: 2
UndercoverUlrikHD 1 point 2 years ago

If you wrote the code wrong, it’s gonna assume it’s right.

Yeah, that might be an issue if copilot base the tests on the code. I only write tests for the core (pure) functions, so it's fairly easy to just say what the inputs and the expected output should be and let copilot have at it. Testing stateful functions is a can of worms it's often better to design around if your toolset supports it.

I obviously don't have any context for what sort of project you're working on and I'm sure it's very different from mine, but I'm currently working on a distributed system with Erlang/Elixir, and often all I want to check is that the happy path gives the expected output. Catching strange edge cases that happens in the shell module due to unexpected state is something I'm happy to just let fail, and have the supervisor clean up and restart to a known state. It's quite freeing to not write defensive code.

What sort of test cases would you want to write for querying a date? Some ISO-8601 verification?

path: 0 15022241 15026940 15027345 15027826, hotness: undefined, score: 1, children: 1
JackbyDev 1 point 2 years ago

Given a list of things (which happened at a date time), give me the one that happened on or most soon after an input date time.

path: 0 15022241 15026940 15027345 15027826 15028496, hotness: undefined, score: 1, children: 0
ExperimentalGuy 8 points 2 years ago

My reason is that I just enjoy computers n shit. It's nice to learn new stuff while programming so I have it in my toolbox for later and I don't just have a cursory idea of what my computer is doing.

path: 0 15005110, hotness: undefined, score: 8, children: 0
crmsnbleyd 6 points 2 years ago

Not a lot of circlejerking happening here but I'm glad y'all are writing long insightful comments.

now stop that

path: 0 15006786, hotness: undefined, score: 6, children: 5
onlinepersona 3 points 2 years ago path: 0 15006786 15008355, hotness: undefined, score: 3, children: 2
Agent641 4 points 2 years ago

You're going to want to bring at least 2 mates.

path: 0 15006786 15008355 15016784, hotness: undefined, score: 4, children: 0
crmsnbleyd 2 points 2 years ago

don't be serious, don't forcefully assert your own opinion (a little bit shrouded in irony is fine), point and laugh at people saying incorrect and implausible things

path: 0 15006786 15008355 15013983, hotness: undefined, score: 2, children: 0
UndercoverUlrikHD 2 points 2 years ago

Honestly thought this was a post on !programmer_humor@programming.dev as that's usually where all the memes/jokes have been posted so far, so didn't even think to check.

path: 0 15006786 15027112, hotness: undefined, score: 2, children: 0
i_dont_want_to 1 point 2 years ago

Missing the joke and programmers: name a more iconic duo

path: 0 15006786 15020728, hotness: undefined, score: 1, children: 0
VaxHacker 2 points 2 years ago

AI is great for looking stuff up but rubbish at figuring stuff out. If you want some code to do X and the AI can find it, you're done. If you want code that does X and Y and smushes them together to get a Z, if nobody's written that exact code then you're out of luck, and the worst case solution that AI far too frequently offers is something that loosely approximates what you asked for instead of just saying it doesn't know.

The mistake too many people make with AI is conflating looking up with working out. AI is most definitely NOT doing the latter. It's a decent search engine, that's all.

I have gone round and round in circles with AI, with a short list of 5-6 items I want the code to do, and it always misses at least one of them out. "OK but you didn't do 5" "Oh, my mistake! Here's some code that does 5" "OK, but now it doesn't do 1." "Oops, here's some code that does 1." "Right, now it doesn't do 3 or 4, and 5 is wrong" "Thanks for the clarification! Here's some code that fixes 3, 4 and 5" "OK but now it doesn't do 2" "My mistake! Here's some code that does 2" "OK but now it doesn't do 5 again". And I was really quite persistent with it, going way beyond this short snapshot of the conversation.

So here's my valid reason for not using AI to write my code. Simple: it can't.

path: 0 15120651, hotness: undefined, score: 2, children: 0
BB_C 0 points 2 years ago

You should ask admins to hide the community.

path: 0 15009553, hotness: undefined, score: 0, children: 8
UndercoverUlrikHD 1 point 2 years ago

Why?

path: 0 15009553 15027068, hotness: undefined, score: 1, children: 7
BB_C 0 points 2 years ago path: 0 15009553 15027068 15029419, hotness: undefined, score: 0, children: 6
UndercoverUlrikHD 1 point 2 years ago

You would more or less freeze the subscriber count at 48 it the community got hidden. New people wouldn't see any content if they got a direct link to the community or to a post, unless they subscribed. And searching for the community also wouldn't work.

path: 0 15009553 15027068 15029419 15034001, hotness: undefined, score: 1, children: 5
BB_C 0 points 2 years ago

I meant hide it from local/all.

path: 0 15009553 15027068 15029419 15034001 15034002, hotness: undefined, score: 0, children: 4
FizzyOrange -2 points 2 years ago

Trite, but it is true that AI gives you an edge. Kind of blows my mind that my current company doesn't just buy all their devs a copilot license. It's an absolute no-brainer.

path: 0 15009378, hotness: undefined, score: -2, children: 3
crmsnbleyd 8 points 2 years ago

Edging is not allowed at work

path: 0 15009378 15013947, hotness: undefined, score: 8, children: 1
ms5K8oWx 3 points 2 years ago

Then I quit!

path: 0 15009378 15013947 15022010, hotness: undefined, score: 3, children: 0
Floey 1 point 2 years ago

Nice try Sam Alt alt.

path: 0 15009378 15035357, hotness: undefined, score: 1, children: 0
programmingcirclejerk
programmingcirclejerk

@programming.dev

login for more options
304
53
1

Community to talk about enlightened programming takes

Rules:

  • read and follow the programming.dev code of conduct
  • no flamewars
  • mark your unjerks
  • only programming related content allowed
  • link to the original source
  • do not mention this community in places like hackernews, lobste.rs, or the general programming communities on Lemmy where we source jerk material from.

go to feed...