Live data from Hacker News

A coder considers the waning days of the craft

newyorker.com

181–190 of 1001 posts

Re: A coder considers the waning days of the craft

#181

> At one point, we wanted a command that would print a hundred random lines from a dictionary file. I thought about the problem for a few minutes, and, when thinking failed, tried Googling. I made some false starts using what I could gather, and while I did my thing—programming—Ben told GPT-4 what he wanted and got code that ran perfectly. I mean ... IDK, if you can't write that on your own without research, I don't…

He didn't say he couldn't do it. He said that while he was getting into the task, Ben had already fixed it.

Re: A coder considers the waning days of the craft

#182

> At one point, we wanted a command that would print a hundred random lines from a dictionary file. I thought about the problem for a few minutes, and, when thinking failed, tried Googling. I made some false starts using what I could gather, and while I did my thing—programming—Ben told GPT-4 what he wanted and got code that ran perfectly. I mean ... IDK, if you can't write that on your own without research, I don't…

Yeah, when I read that I also tried the first thing that popped into my mind - extremely crude/slow but works in bash and only took like 20 seconds without looking anything up:

  cat /usr/share/dict/words | while read LINE; do echo "$RANDOM $LINE"; done | sort -h | head -n 100 | awk '{ print $2 }'

Re: A coder considers the waning days of the craft

#183
post #152

Earlier quoted context omitted.

Yeah it’s not a challenging problem, but the specific code example isn’t the point. Replace his example with “at one point, we wanted a command that would convert a PNG to a JPG….” most of us couldn’t do that without Google.

$ cat /usr/share/dict/words | shuf | head -n 10 $ convert foo.png foo.jpg Took me almost literally two seconds to come up with that, unless your point is that at one point I had to learn it which, yeah, sure. What am I missing?

Bravo - for these simple things, typing in a GPT prompt or search query is more work than the command.

Even things like "what flags to use with ffmpeg" are a shell reverse-history search away, assuming one has ever used them in the past.

Re: A coder considers the waning days of the craft

#184
Whats the workflow for writing code like the app mentioned with chat? My experience was like the authors, its a massive environment set up, plus even small projects have 10s of files. How does the model keep all that in context plus changes. How do you start a new session? I checked some small cpp project and the code alone is 168,000 words, so thats already larger then the gpt4 context, that doesn't even include iteration and chat history. IDK where you would even get started.

Also, dont really see the comparison between programming and chess. In chess you can still compete to be the best human chess player. Coding or working in corporate america doesnt really have that.

Re: A coder considers the waning days of the craft

#185

> At one point, we wanted a command that would print a hundred random lines from a dictionary file. I thought about the problem for a few minutes, and, when thinking failed, tried Googling. I made some false starts using what I could gather, and while I did my thing—programming—Ben told GPT-4 what he wanted and got code that ran perfectly. I mean ... IDK, if you can't write that on your own without research, I don't…

To be really fair, there are levels of programming. The easiest level is traditionally vulnerable to automation. There's a lot of "accidental complexity" ( https://wikipedia.org/wiki/No_Silver_Bullet ), e.g. ffmpeg, git; even in recalling syntax and idiom of an infrequently used tool, e.g. bash, jq. Once upon a time, developers had to pore over manpages, paper textbooks, or memorize it. Then came google. Next, stacke…

I’ve been coding for 20 years commercially now, and I’ve come to define good coders - and indeed intelligence itself as … adaptability.

Not fluid intelligence, not creative velocity, not creative originality, not oodles of domain knowledge … adaptability.

A new tool comes along? Adapt. A new idea breaks a long established paradigm? Adapt. A new skill is required? Adapt. As I get older adapting gets easier, because I treat ideas like objects - useful until they are not. No part of me cannot change, and my certainty in myself comes not from a bank of sanctified ideals I worship but in the knowledge that whatever comes, I will adapt and thrive. Fat client, thin client, centralised, edge, micro services, monolithic, ideas, tech, frameworks, everything is fluid and that’s what keeps things fun.

Same goes with the arrival of GPT, I embraced it, learnt it’s strengths and weaknesses and now I estimate I’m maybe 2x more productive because of it, that means more time of fun things that interest me.

Adapt, adapt, adapt

Re: A coder considers the waning days of the craft

#186
post #77

The article came to a romantic end that doesn't satisfy how I feel about the workplace now. I have to admit a dirty truth, that I joined this field because of the pay and job stability, not simply for a love of programming. Because of this I feel distressed for its future. No longer can someone walk into a job slightly under qualified and grow with time. Companies will opt for smaller teams of 10xers that with the co…

> Companies will opt for smaller teams of 10xers that with the companionship of AI can pump out 10x10 more code then the rest of us

This is how I see it as well - but we're at the point where you can decide what side of the fence you want to be on.

Keep playing with ChatGPT, but Level up around Systems Design and basic coding principles.

Someone has to oversee the work that the AI's do, why not be one of those people?

Re: A coder considers the waning days of the craft

#187
post #177
post #162

Earlier quoted context omitted.

I guess the point is that there are different levels of coders. For coders who can't write code that print a hundred random lines from a dictionary file, GPT-4 is already a significant threat. On the other hand, even if you can write it, does it mean you should write it? How much time does it cost you to write it? How much money your company is paying you in that amount of time? Is it more economical for GPT-4 to do…

Not bad, but suppose the dictionary is too big to load into memory - could AI suggest an online (reservoir sampling) algorithm as an alternative?

Sure: https://chat.openai.com/share/0a3e52c6-1db8-422a-a98c-cb3500...

I laid out the constraints, but I did not mention reservoir sampling at all. The script seems to work as expected when I run it against a dictionary file.

Re: A coder considers the waning days of the craft

#188

Do people have problems with Leetcode stuff or something? Aside from generating code I already know how to write before hand quickly, I find AI super useless for coding. It's never been able to solve a single problem I have worked on - mostly involving infrastructure deployment and config.

I find it's incredibly useful for programming once you've learned how to effectively prompt it - which takes quite extensive experimentation.

Re: A coder considers the waning days of the craft

#189
post #177
post #162

Earlier quoted context omitted.

I guess the point is that there are different levels of coders. For coders who can't write code that print a hundred random lines from a dictionary file, GPT-4 is already a significant threat. On the other hand, even if you can write it, does it mean you should write it? How much time does it cost you to write it? How much money your company is paying you in that amount of time? Is it more economical for GPT-4 to do…

Not bad, but suppose the dictionary is too big to load into memory - could AI suggest an online (reservoir sampling) algorithm as an alternative?

ChatGPT 4

> Use reservoir sampling to get 100 random lines from a dictionary that doesn’t fit into memory. Give me an implementation in Python.

> Reservoir sampling is a great choice for randomly selecting a fixed number of items from a stream of unknown size, especially when the entire dataset cannot fit into memory. Here's a Python implementation for selecting 100 random lines from a large file, like a dictionary, using reservoir sampling:

  ```python
  import random

  def reservoir_sampling(file_name, k):
      reservoir = []
      with open(file_name, 'r') as file:
          for i, line in enumerate(file):
              if i 
> This script opens a file and reads through it line by line. For the first 100 lines, it adds them directly to the reservoir. For each subsequent line, it randomly decides whether to replace an existing line in the reservoir with the new line. The probability of replacing decreases as it progresses through the file, ensuring each line has an equal chance of being included in the final sample.

Re: A coder considers the waning days of the craft

#190
my understanding of history is the Catholic church wielded great power over the populace by having both literacy, but and also in Latin (a less accessible language). With 99 theses and a German bible people could easily get their religion on without the priestly class. This feels like a metaphor for what has happened in computing.
Post reply on HN