4 ms·
This is neat, but, as with all projects in this vein, I fail to see the real value add. We've had ML-powered code generation for several years now (Copilot rele
by dvt 3y ago
This is neat, but, as with all projects in this vein, I fail to see the real value add. We've had ML-powered code generation for several years now (Copilot released publicly in late 2021), and apart from a cute novelty, there's no real use case I've found. (Maybe except for generating tests, but when dealing with a novel code base, the models really can't figure out dependency injection, mocks, weird edge cases I'd care about, etc.)
This might be a bit contrarian, but I don't really think there's product market fit here, at least for engineers. And if given in the hands of non-engineers, you'll need to have an engineer at least look over the code anyway. I haven't seen or heard of anyone that seriously uses ChatGPT to generate code and uses it in prod (apart from engagement-farming Twitter posts).
> Understanding someone else’s code for large internal engineering teams is often a challenge
Without proper context, this will fail miserably. Have you ever seen a corporate codebase before? It can be the definition of "wtf?" even for a seasoned developer that's been working there for years.
This AI-generated code trend reminds me of the "no-code" fad of the past decade.
- frankgrecojr 3y ago> I haven't seen or heard of anyone that seriously uses ChatGPT to generate code and uses it in prod I would agree with this in general. The main goal here is to optimize the "editor experience". When I personally code, I'll have ChatGPT pulled up on the side in case I need to reference it for speed. Some examples of how I might use it are: - add some tests for me to review - take an existing piece of code and modify it in some way - help me think of ways in which I can write some code if I'm lazy that day. This would generate code that after I iterate on it would need to be reviewed which speaks to your point, "you'll need to have an engineer at least look over the code anyway" which I agree with. The main goal is to have it there as a resource to pair program with rather than trusting it without review/input.
- H8crilA 3y agoYou're telling me you've never once pressed "TAB" to auto-fill the line or even several lines with Copilot? Because about half of the letters in my source code is now Copilot generated. The value added is that you don't send your source code to OpenAI and/or their parent org Microsoft.
- frankgrecojr 3y agoI do it all of the time (with GitHub copilot). It's getting much better. If I retro my interactions with it, I think I'll usually give it a "once over" to see if what it's doing makes sense. Sometimes I'll add a comment to my PR saying what AI did/didn't write to give the reviewer a heads up.
- vorticalbox 3y agoI mostly use it for the generation of doc strings in python and js doc in typescript. Recently I've been using git diff and asking 3.5 to write the PR description for me and so far it is doing quite well. The 16k tokens means I can feed even more into it.
- derwiki 3y agoThis would be a great pre-commit hook! Generate commit message and fill .commit_msg for review/further editing.
- vorticalbox 3y agoMicrosoft has owned GitHub since 2018.
- ghughes 3y agoI think the GP meant the value added by Superblocks?
- bitlad 3y agoI think this is just a marketing ploy jumping on the Generative AI bandwagon. In real world, this will not work as the actual output might really confuse the end user.
- padolsey 3y ago> I haven't seen or heard of anyone that seriously uses ChatGPT to generate code and uses it in prod I have. And I'm sure others have too. I dare say there are many who probably _shouldn't_ be using it because of privacy/IP concerns and so you won't hear about them. > cute novelty [...] I thought the same not so long ago. But gpt4 for me was a game changer. It's helped me debug and fix some legitimately complex code, and has been awesome at wholesale refactoring modules to fulfil a new purpose. E.g. today I wanted help reconciling between runtime and persistent LRU cache stuff. And it understood what I wanted and assisted. After a few nudges it gave me a refactored module with comments and a few tests. It's like having a very capable junior dev in one's pocket :P Ps. Trust me: it's not long before we have ai coding bots that grab open tickets and hammer together PRs with full testing suites. I imagine it's already happening.
- deleted 3y ago[deleted]
- ghughes 3y ago> I imagine it's already happening. Not quite, that I know of, but some of us are working on it :) I have a feeling that while the glorious future you describe can probably be realized using LLMs as a foundational technology, the software engineering effort needed to get there is on par with other AI moonshot projects e.g. autonomous vehicles. If you or others reading this are interested in this topic, see this post for some interesting discussion and links to projects in development (and in the comments there's a link to a Discord server that was set up for further discussion): https://news.ycombinator.com/item?id=36422730 https://news.ycombinator.com/item?id=36422730
- FractalHQ 3y agoCan you not please? I enjoy coding and I don’t want to have to change careers again. Can you just automate something else like Congress or the people running the Taco Bell drive through?
- deleted 3y ago[deleted]
- danielbln 3y agoI feel like I live in an alternate universe to this comment. Every engineer I know (devops, software, hell even datascience) is using GPT-4 or Copilot (especially Copilot with the new chat interface) and people, myself included, use it every day. Refactor this code for me, add a function that does X, why is Y failing, align this code with a different coding pattern, I cobbled together this React app, clean it up and refactor it and factor Z functionality into a node backend, help me understand this bit of obtuse Python code, and the list goes on and on and on. I've seen tremendous value, and its not without fault mind you, LLM hallucination is a real problem, but I would be very sad and annoyed if tomorrow they'd take LLMs out of my daily engineering flow.
- jiggywiggy 3y agoIt's not better then me. But I use it when I'm lazy, tired or at times drinking. And then it's really nice. At times it costs me too much time solving it's mistakes. But then it nails something perfectly and I'm impressed again.
- danielbln 3y agoI often work with new (to me) tech or build prototypes/PoCs, it's pretty great for that. It's useful to recognize when a dialog is a dead-end, otherwise it's easy to enter a rabbit hole that the llm can't get out of. Best to poke at it from another angle and/or within a new dialog, then.
- addisonl 3y ago> It's not better then me. Where did anyone say it was?
- dvt 3y agoForgive the long reply, but I'm going to go ahead and "press X to doubt," because I have been trying to use both ChatGPT and Copilot, and the results are abysmal apart from anything but "write me a linked list" or "give me some React boilerplate." If you have examples of it working for you, please share them. Here's a very salient example of it not working for me: I spent about 1-2 days figuring this out, so it's definitely non-trivial, but it's not something insane either. I'm working on a new project/startup idea and this is part of it (verbatim prompt I just used on chatGPT): hi, can you write me a function in rust that, if running on windows: 1. figures out if the topmost window is a windows explorer window 2. if it's a windows explorer window, it returns the path (as a string) that the windows explorer window is actively viewing 3. if it's not a windows explorer window, it returns a blank string This is a deceptively difficult task, as it requires all kinds of COM finagling, and ChatGPT gets it royally wrong: #[cfg(windows)] fn get_active_explorer_path() -> String { use std::ptr; use winapi::um::winuser::{EnumWindows, GetWindowTextW, IsWindowVisible}; use winapi::shared::windef::HWND; use std::os::raw::c_int; use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; let mut path = String::new(); let mut active_explorer = None; unsafe extern "system" fn enum_windows_callback(hwnd: HWND, lparam: LPARAM) -> c_int { let active_explorer = &mut *(lparam as *mut Option<HWND>); let mut buffer: [u16; 512] = [0; 512]; if IsWindowVisible(hwnd) != 0 && GetWindowTextW(hwnd, buffer.as_mut_ptr(), 512) != 0 { let window_title = OsString::from_wide(&buffer[..]).to_string_lossy(); if window_title == "File Explorer" { *active_explorer = Some(hwnd); return 0; // Stop enumeration } } 1 // Continue enumeration } unsafe { EnumWindows(Some(enum_windows_callback), &mut active_explorer as *mut _ as LPARAM); } if let Some(hwnd) = active_explorer { let mut buffer: [u16; 512] = [0; 512]; if GetWindowTextW(hwnd, buffer.as_mut_ptr(), 512) != 0 { let window_title = OsString::from_wide(&buffer[..]).to_string_lossy(); if window_title == "File Explorer" { let shell32 = winapi::um::shellapi::GetShellWindow(); if shell32 != hwnd { let mut path_buffer: [u16; 512] = [0; 512]; if winapi::um::shellapi::SHGetPathFromIDListW(ptr::null_mut(), path_buffer.as_mut_ptr()) != 0 { let path_str = OsString::from_wide(&path_buffer[..]).to_string_lossy(); path = path_str.into_owned(); } } } } } path } I'm actually on my Mac right now, and I don't even need to test it, because the first red flag is `"window_title == "File Explorer"`. File Explorer will change its window titlebar to the currently viewed folder (so the conditional will always fail). There's also other comical mistakes, including passing a null pointer to `SHGetPathFromIDListW`, using `GetShellWindow` which returns the desktop, and not taking into account that Explorer windows can have multiple tabs. Okay, let's see if we fare better on MacOS. #[cfg(target_os = "macos")] fn get_active_finder_path() -> String { use std::ptr; use objc::runtime::{Class, Object}; use objc::{class, msg_send, sel, sel_impl}; use objc_id::Id; let mut path = String::new(); unsafe { let workspace: Id<Object> = msg_send![class!(NSWorkspace), sharedWorkspace]; let front_window: Id<Object> = msg_send![workspace, frontmostApplication]; let front_window_pid: u32 = msg_send![front_window, processIdentifier]; let running_apps: Id<Object> = msg_send![workspace, runningApplications]; let app_count: usize = msg_send![running_apps, count]; for i in 0..app_count { let app: Id<Object> = msg_send![running_apps, objectAtIndex: i]; let app_pid: u32 = msg_send![app, processIdentifier]; if app_pid == front_window_pid { let bundle_url: Id<Object> = msg_send![app, bundleURL]; let bundle_path: *const Object = msg_send![bundle_url, path]; let path_str: *const i8 = msg_send![bundle_path, UTF8String]; if !path_str.is_null() { let c_str = std::ffi::CStr::from_ptr(path_str); path = c_str.to_string_lossy().to_string(); } break; } } } path } #[cfg(not(target_os = "macos"))] fn get_active_finder_path() -> String { String::new() } fn main() { let active_finder_path = get_active_finder_path(); println!("Active Finder Path: {}", active_finder_path); } Doesn't look like it: this is what I got, which doesn't even compile. I'm not as familiar with MacOS systems programming, so I'm not even sure what's wrong with it, frankly. My solution involved using osascript on MacOS (which is the first Google hit, though I'll have to port it, as some folks may not have it on their systems). So what is ML code generation useful for? Apart from helping on the Nth CRUD app someone's building, I just don't see it.
- alexp7 3y agoAI code generation is not yet ready for a full-blown apps, but it works well on smaller well-defined functions. For example, Nekton.ai asks the user to split the workflow into smaller steps, and automates it one by one.