News for hackers. Stuff that matters.
Re:SeleniumBase: Python APIs for web automation and bypassin... by mdaniel on Tuesday December 17, 2024 @05:21PM (#42446025)
rather than point-by-point rebuttal as the sibling requests, I think this sums up the coding style pretty well: https://github.com/seleniumbase/SeleniumBase/blob/v4.33.11/s...
Re:SeleniumBase: Python APIs for web automation and bypassin... by seleniumbase on Tuesday December 17, 2024 @05:39PM (#42446205)
That method came from code that I accepted in a PR from December 31, 2019: https://github.com/seleniumbase/SeleniumBase/pull/459 Not a true representation of most of the code today.
Re:SeleniumBase: Python APIs for web automation and bypassin... by parineum on Tuesday December 17, 2024 @07:53PM (#42447117)
The code is in the code base. Presumably, it still gets run. It doesn't make a difference if new code doesn't look like that.
Re:SeleniumBase: Python APIs for web automation and bypassin... by seleniumbase on Tuesday December 17, 2024 @08:26PM (#42447290)
Call it "legacy code" if you'd like. That specific part is from a less common feature for setting options when running on a Selenium Grid. The new CDP Mode isn't compatible with The Grid (since CDP Mode makes direct CDP API calls without making Selenium API calls).
Re:SeleniumBase: Python APIs for web automation and bypassin... by MstWntd on Tuesday December 17, 2024 @08:48PM (#42447393)
it's always easier for people today to look at the work of other people in the past and draw stupid conclusions.. don't mind them..
Re:SeleniumBase: Python APIs for web automation and bypassin... by wisty on Tuesday December 17, 2024 @09:50PM (#42447695)
Bad old code has been battle tested. Bad new code has not, and is more likely to have the show stopper bugs you want to avoid.
Re:SeleniumBase: Python APIs for web automation and bypassin... by seleniumbase on Tuesday December 17, 2024 @10:10PM (#42447787)
There's actually a lot of examples being used for testing (https://github.com/seleniumbase/SeleniumBase/tree/master/exa...), which are run regularly (locally and in GitHub Actions). Plus, a lot of major companies are using SeleniumBase: https://github.com/seleniumbase/SeleniumBase/blob/master/hel... (if something breaks, I find out quickly)
Re:SeleniumBase: Python APIs for web automation and bypassin... by the_real_cher on Wednesday December 18, 2024 @08:21PM (#42457357)
It's not really bad thought.

It's clear, it's intuitive, it's easy to understand on first glance, it's a single purpose function, it's easy to step through.

you don't have anything to defend here.

Re:SeleniumBase: Python APIs for web automation and bypassin... by harrall on Wednesday December 18, 2024 @01:57AM (#42448618)
That's not amazing code but that's not that bad. In the grand scheme of things, that's not code debt that would ever seriously make my life any harder.
Re:SeleniumBase: Python APIs for web automation and bypassin... by TeMPOraL on Wednesday December 18, 2024 @03:30AM (#42448938)
Yup. At least it's self-contained and easy to step through and modify if something breaks or needs to be changed.

And, a my previous PM would point out, even the copy-pasting and verifying no mistakes were made was a solution that took a fraction of the time a modern "clean" approach would. She had a point; as much as I'm against writing this simple code in the general case, plenty of devs tend to err towards overcomplicating solutions when given a chance.

I mean, the modern, proper, Clean Code™ solution would have this split into multiple files (not counting tests), and across two or three abstraction levels. I've seen this happen enough that I can tell I'd much prefer working with code like this capabilities parser (and hell, it can be beaten into near-perfection in an hour or three).

Re:SeleniumBase: Python APIs for web automation and bypassin... by the_real_cher on Wednesday December 18, 2024 @08:19PM (#42457343)
Amen!

I think the more experienced you get in coding the more you appreciate straight forward code you can immediately look at and understand.