7 ms·
I asked ChatGPT to write the code to print "Hello, world " as a junior developer
- ro_bit 3y agoI don't get it. I'm only starting my career but most of the tenured/senior developers I know spend too much time in meetings to write that much boilerplate
- lstamour 3y agoTrue, but varies by org. The problem is that you only get out of GPT what you ask of it. For example, it’s likely that more senior developers would write abstractions because they can simplify unit testing. Others might have dived into writing TypeScript types, e.g. meta-programming or generics. The output ChatGPT actually gave is interesting but not inspiring or relevant. They didn’t even uselessly add Winston for logging. It’s like when you ask GPT for images of “more, even more, work harder, etc.” - you sorta get more of the same, not something new or innovative. You have to ask for what you want, it’s not that creative and doesn’t really understand yet.
- BerislavLopac 3y agoSenior developers don't write code, they copy/paste it.
- spacemadness 3y agoDon’t worry, they’ll hit you on the code reviews and ask you to refactor your working to-the-point code into some sort of factory-like nonsense soon enough.
- kleiba 3y agoThis reads almost too cliche to be believable.
- badgersnake 3y agoThey trained it on the internet, it’s learned every enterprise coding joke off by heart.
- wruza 3y agoIt decided to repeat a well-known joke.
- deleted 3y ago[deleted]
- chii 3y agoThat joke was originally written in java. This means that chatGPT was able to actually extract the idea of this joke, and combine it with the typescript language syntax, to produce this output.
- Toutouxc 3y agoJokes like this were written for all languages ever made and all over the web.
- big_paps 3y agoEven being a freelance programmer, this reminds me a bit of the evolution of my own programming style until i hit burnout several years ago. Now i try to be that junior programmer again. Even if its good to know all these programming patterns its also helpful to know how to write compact and dense style. Pico8 and Dwitter helped me with that.
- feverzsj 3y agoNot sure if it's satire or stereotype.
- mati365 3y agoEven better. It's truth.
- self_awareness 3y agoThis joke is funny until you need to add unit testing to the project. Then you start to realize that everything needs to sit behind some abstraction.
- yen223 3y agoThat moment when you realise all of the complicated nonsense is there only to make unit tests work
- ninetyninenine 3y agoNah. console.log is not really testable. Well from a very pedantic and technical perspective stdout can be tested but overall IO cannot be unit tested. It can be tested via e2e or integration tests meaning you need external factors to verify a side effect occurred.
- reilly3000 3y agoI’m a Principal Cloud Engineer and I practice minimum viable software. Less to grok, less to maintain, less debugging effort during an incident. In the context of a larger system it may make sense to implement a logger for wrapping messages with consistent contextual values because DRY. I’ll give ChatGPT a pass because the prompt was so contrived. I would be curious how it would respond if prompted with a more open-ended problem.
- 93po 3y agoout of curiosity, why do you use the word "grok" instead of "understand" here? I have what I recognize is probably an irrational annoyance with the word grok and i want to better understand what people mean by it to potentially dislike it less
- reilly3000 3y agoI suppose I meant it as to say thoroughly understand a piece of code, why it exists, the context it operates in, and the implications of modifying it. I’ve learned the hard way how making a decision about the need for code or the way it’s implemented can lead to unintended consequences, some of which may be difficult to detect. So I’m using grok to describe a completeness of understanding, which I believe aligns with its dictionary definition.
- whamlastxmas 3y agoI believe the definition is more to intuitively understand something. Like if you had never seen a door before, you could grok that the handle on the door was used to pull it open. Someone doesn’t have to explain it to you since it’s the only pulling option available
- deleted 3y ago[deleted]
- ByQuyzzy 3y agoReally starting to hate AI and thinly veiled ads for AI.
- mo_42 3y agoSeems like it learned the boilerplate from Java and transfered it to TypeScript. I don't know such jokes in JS ecosystem but in Java the one. Tried the same with Haskell and the Fibonacci series because there's a similar joke on the internet. It's similar but not as stereotypical.
- planb 3y ago„Seems like it learned the boilerplate from Java and transfered it to TypeScript. “ - Just like real developers in a large corp… Really, I think ChatGPT is joking here without knowing it. There must be lots of jokes like this in the training material.
- cbluth 3y agoIn the end, we discover that we're laughing at our own jokes, or we're laughing at ourselves, I'm not sure...
- wokwokwok 3y agoNotice the “I asked it to refactor…” … “now how would a…” This is a sequence of prompts in a single context which is “pre biasing” the LLM to respond the way you want it to. Many such “emergent behaviours” are from the asker, not the LLM. When you look in the mirror, you only see yourself. > In the final exercise of this experiment, I challenged ChatGPT to step back, assess the code's objectives, and propose a better solution. The attempt was unsuccessful at first, as it continued to tweak the existing program and preserve the "existing architecture." Only when I instructed it to envision starting from scratch did it offer a new solution, as follows: Surprise. Naive usage.
- Vingdoloras 3y agoI forgot what people were calling it but this is almost exactly the same idea as that trend where you ask ChatGPT to generate pictures, continuously asking for "more" of some aspect of the picture (make this dish more spicy, etc), only hidden by the fact that instead of simply asking it to make the code more complex, they're naming specific (but in the end, arbitrary) steps of what ChatGPT would still interpret as escalation.
- karmakaze 3y agoThat would be awesome if ChatGPT picked up on the prompts as cues to generate a joke. Sounds fine for generation of entertainment content, but less so for anything critical. So to round-out the joke, ask it how a 'galaxy brain' would write it, and we should end up at console.log(message) again.
- 93po 3y agoI assumed the OP was mostly intended to be humor
- mastazi 3y agoThis reminds me of this classic post that was discussed many times here on HN. Maybe newer readers will enjoy it. https://gwern.net/doc/cs/2005-09-30-smith-whyihateframeworks.html https://gwern.net/doc/cs/2005-09-30-smith-whyihateframeworks...
- amanzi 3y agoI guess that was written before the Hammer-as-a-Service craze.
- ffsm8 3y agoIt was as misguided then as it is now. What this post bemoans didn't actually occur, really. What did happen was that the big framework gave you increasingly more entrypoints into how the application was constructed. But there always was a way to just go with defaults if you didn't want to adjust anything (at least in Java-Land, which this one specifically calls out for this behavior) Wherever a framework should give the developers the option to adjust things to such a degree is another question that wasn't raised by this post. It just claims that you needed the increasingly silly factories to construct your application, which isn't true, as they were always optional.
- binary132 3y agoI was kinda thinking maybe the LLM was rooting through its “comical software engineering discussions about enterprise abstraction pathology” networks when it wrote these responses.
- everling 3y agoReminds me of https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- palad1n 3y agoHas anyone ever asked ChatGPT to apply the lessons of the Tao of Programming? Just curious.
- ninetyninenine 3y agoIt understands progressive complexity in code. Keyword: understand. Because there's no underlying training data that a stochastic parrot would need to generate this output the gap by this lack of data is only bridged by something that can be described a high level word: "understanding". chatGPT understood the request and delivered answers to the request. I'm not saying those answers are correct. That doesn't even matter. What matters is chatGPT gave a biased answer to that request that indicates understanding of several concepts including ranking in human social structures and complexity of code. One could say that the answers are incorrect. chatGPT hallucinated those answers because staff engineers don't write code like that. These people don't get it. The act of the hallucination indicates "understanding" regardless.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- yakshaving_jgt 3y agoHow I write a "Hello, World!" program as an expert haskell programmer {-# LANGUAGE ImportQualifiedPost #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Foreign.C.Types import Language.C.Inline qualified as C C.include "<stdio.h>" C.include "<stdlib.h>" main :: IO () main = [C.block| void { system("python -c 'print \"Hello, World!\"'"); } |]
- soneil 3y agoI think it'd be interesting to see the actual prompts that went with this. I followed it through to the accompanying blog post[1] and I found the examples for "we close at 6pm on Friday" interesting because none of them work. They fail the stated problem (they don't test for Friday) and the unstated problem (when do we re-open? the examples re-open at midnight). And of course, without the prompts I can only guess whether the fault was in the answer or the question. If the complex version worked and the simple version was naïve - or vice versa - it'd make for a much more interesting conclusion. [1] https://koenvangilst.nl/blog/keeping-code-complexity-in-check https://koenvangilst.nl/blog/keeping-code-complexity-in-chec...
- edpichler 3y agoIt is because it was fed by Internet information. Lots of memes and jokes.