38
10
u/RandomAnalyticsGuy Jul 08 '19
Was this code offshored?
20
u/andesz Jul 08 '19
no, it was our tech lead...
-5
u/RandomAnalyticsGuy Jul 08 '19
Sounds like there isnβt enough money in the budget to pay a proper tech lead, or you need a new tech lead.
0
Jul 08 '19
[deleted]
11
2
u/RandomAnalyticsGuy Jul 08 '19
Part of me is being facetious but come on.
4
Jul 08 '19
This is what happens when someone is constantly interrupted while trying to do something easy.
4
0
25
30
8
6
9
8
4
2
u/NahroT Jul 08 '19
Just looks like two typos honestly, I bet the author's intention was: GoToUrl(url) driver.url = url
3
1
u/Bourdain179 Jul 08 '19
Why make inline 1 line code when you can refactor it into a function that doesn't do anything (does it refresh the page?)
1
1
1
1
1
u/MyMessageIsNull Jul 08 '19
Just looks like a dumb typo/brainfart to me. I try to catch my such errors before they go to a code review, but I can't say I'm always successful.
1
1
Jul 09 '19
I suspect somebody typed Url with the capitalized 'U', got an undeclared variable error, had 5pm brain and didn't look, and took either a weird IDE autocorrect suggestion are "fixed" it by prepending the Class name (5pm brain let's you get away with this crap). Or most likely he/she reversed the assignment and forgot to change the RH side.
0
Jul 08 '19
[deleted]
8
59
u/botle Jul 08 '19
As someone that doesn't do C#, I find that completely terrifying.
36
11
7
u/Tyfyter2002 Jul 08 '19
Properties in C# are basically a midpoint between fields and methods (with a few added benefits from what I've heard) so you can just use them for the intended purpose, or use them to replace any method with one of the following (as long as you don't intend to use it as a delegate): a void return type (set, probably with an array of objects), no arguments (get, also probably the intended purpose), or multiple arguments and a non-void return type (set, although it functions more similarly to using reference arguments).
3
21
u/shrekthethird2 Jul 08 '19
True, but if that is so, the function's "url" argument is pointless and confusing as hell. It could be that this signature was forced upon the implementer, but then I'd expect a clarifying (and apologetic) comment. All in all, it's either stupid or evil, or both.
2
1
Jul 08 '19
[removed] β view removed comment
1
u/AutoModerator Jul 08 '19
Hello jdlyga,
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not not have universal support for this syntax and your comment will render as broken gibberish on old reddit and some mobile apps.
Please edit the comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
You can find some examples in the reddit help documentation.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
116
u/campbellm Jul 08 '19
I'm almost tempted to ask what the unit test looks like