by naveed125 on 6/14/25, 5:43 AM with 28 comments
by xg15 on 6/14/25, 11:14 AM
Me reading this article: yup, yup, yup, yup, wait a minute!
This part feels a bit snuck in, in a "leading and pacing" kind of way: All the other points are long-established no brainers, but this one is still controversially discussed and I'd say - in the general form it's presented here - wrong.
The author is still right that it's wrong to categorically dismiss AI tools when coding. But you'd have to apply a lot more caution to this point than to the others.
I hope sneaking this in wasn't the real motivation of the article.
by Zeppelin1492 on 6/14/25, 11:10 AM
Example
somethingService = ...
somethingService = somethingService.Do()
Really fun to debug.by seanhunter on 6/14/25, 10:02 AM
Weird. You almost never need to do string eval in python, and whenever there is something where you think you need eval there is a better and safer way to achieve the same result.
Also, I was bending my brain but I couldn’t really figure out what this eval was for until I wrote out some scratch code myself to figure it out.
Turns out this 5 lines or so was constructing a string to do dict lookup and then evalling that. So say you have a dict d = {‘foo’: ‘bar’} and you have a variable i=foo and want to look up d[i], instead of just doing that it was doing something like
eval(‘d[‘+i+’]’)
Just no.So I rejected the change and they came back with “but we’ve always done it that way”. I grep the codebase and yes. There were about 200+ uses of eval, all of which were constructing a string to look something up in a dictionary and then evaling the result. Some person who clearly didn’t program in python had found this twisted way to look things up in a dictionary and then this team had dutifully copied and pasted it throughout the codebase.
[1] ie I wasn’t there from the start of the project
by ck45 on 6/14/25, 11:38 AM
by antisol on 6/15/25, 3:32 AM
by photios on 6/14/25, 9:39 AM
by RadiozRadioz on 6/14/25, 9:42 AM
So, stable packages?
by in12parsecs on 6/14/25, 10:38 AM
by sim7c00 on 6/14/25, 10:31 AM