Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> learn it

Waste of time. Have some "AI" write it for you



Learning is almost never a waste of time even if it may not be the most optimal use of time.


This is an excellent way to put it and worth being quoted far and wide.


If you stop learning the basics, you will never know when the sycophantic AI happily lures you down a dark alley because it was the only way you discovered on your own. You’ll forever be limited to a rehashing of the bland code slop the majority of the training material contained. Like a carpenter who’s limited to drilling Torx screws.

If that’s your goal in life, don’t let me bother you.


[flagged]


That's not entirely fair. It's relatively easy to learn the basics of regular expressions. But it's also relatively easy, with that knowledge, to write regular expressions that

- don't work the way you want them to (miss edge cases, etc)

- fail catastrophically (ie, catastrophic backtracking, etc) which can lead to vulnerabilities

- are hard to read/maintain

I love regular expressions, but they're very easy to use poorly.


Using the AI to write them for you is going to lead to the same problems but worse because you don’t have the knowledge to do anything about it


If they don't work the way you want, you just keep refining it. This is easy if you actually test your regex in real data.

Fail catastrophically.. I had that happen once on an unexpectedly large input. That was a fun lesson. Ironically, the solution was to (*FAIL)

In any case, I learned a lot and delegating that to an LLM and learning nothing would not have put me in a better position.


> If they don't work the way you want, you just keep refining it. This is easy if you actually test your regex in real data.

There can be edge cases in both your data and in the regular expression itself. It's not as easy as "write your code correctly and test it". Although that's true of programming in general, regular expressions tend to add an extra "layer" to it.

I don't know if you meant it to be that way, but your comment sounds a lot like "it's easy to program without bugs if you test your code". It's pretty much a given that that's not the case.


I didn’t get the “it’s easy to program without bugs” vibe at all, and OP even mentioned an edge case that took their parser down (BUG!)

Neither the human nor the AI will catch every edge case, especially if the data can be irregular. I think the point they were making is more along the lines of “when you do it yourself, you can understand and refine and fix it more easily.”

If an LLM had done my regular expressions early in my career, I’d have only !maybe! have learned just what I saw and needed to know. I’m almost certain the first time I saw (?:…) I’d have given up and leaned into the AI heavily.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: