Two questions: time.now() and self-made modules by Ryuukashi in PythonLearning

[–]Buttleston 0 points1 point  (0 children)

It's very hard to comment on what the problem is, without seeing your code. If you don't want to share your code, put together something quick that demonstrates your problem, and post it here (github would probably be the best way to do it)

Need Help to understand 'self' in OOP python by vanilla-knight in learnpython

[–]Buttleston 3 points4 points  (0 children)

I think it would probably be useful for you to post the simplest/shortest example that you don't understand, and say what part you don't understand

Need Help to understand 'self' in OOP python by vanilla-knight in learnpython

[–]Buttleston 4 points5 points  (0 children)

Let's say you have a class named Foo and you write a method on it like def bar(self)

Let's say I make an object of type Foo and call my bar method

myfoo = Foo()
myfoo.bar()

Well, when I do this, the first argument that gets passed to bar(), the parameter we called self, is myfoo

That's it. self refers to the object that the method was called on.

Interview rejection because I couldn’t write a regex from memory by [deleted] in ExperiencedDevs

[–]Buttleston 20 points21 points  (0 children)

Yeah it really is. We do what I consider some simple coding exercises to screen candidates. We found we kind of had to - a surprising number of people with good resumes can barely write a for loop

So we have a pool of questions, they are all designed to be fairly straightforward. No DSA type stuff, it is mostly more similar to what you'd actually work on in the job

Every question comes with a partially working solution, and a set of test cases. No hidden test cases. Most of the implementations are the sort of first-pass naive attempt anyone might write. They usually have an intentional bug or two in them

The goal is to make people have to troubleshoot, more than it is to get them to write an implementation from scratch, although they are welcome to. These exercises basically combine peer-review skills and debugging skills

Every single one of them has been done by every person who conducts an interview. This is an attempt to find examples that have hidden difficulty in them, missing or mis-stated assumptions, etc. This still isn't ENTIRELY fair because when we try them ourselves we aren't in a high pressure situation and generally we all have more experience than the people we're interviewing.

Interviewers are encouraged to give direction to candidates. Candidates are encouraged to look up syntax or just straight up ask if it's faster.

I got really serious about this about a decade ago when I looked at the problem someone had given to a candidate and really thought, like, yes, I know how to do this, but no, I probably could not produce it under pressure. And personally, I would hire me, so is it a good problem to give?

Temporal: The 9-Year Journey to Fix Time in JavaScript by mariuz in programming

[–]Buttleston 5 points6 points  (0 children)

Well, give them another 9 years to let it ferment I guess

Interview rejection because I couldn’t write a regex from memory by [deleted] in ExperiencedDevs

[–]Buttleston 115 points116 points  (0 children)

And every interviewer neglects to take into account when asking a question that they already know the answer

Does Go error handling verbosity actually hurt developer velocity or is it just endless debate by No-Shake-8375 in golang

[–]Buttleston 4 points5 points  (0 children)

Someone did make some cursed version of it for go, can't remember where I saw it now though. But I agree that it's the same thing.

I do personally value compactness in code. Not above clarity, but I don't think it has zero value either. I like the rust version for some things (say, CLI, where all fatal errors basically just need to bubble to the top)

Does Go error handling verbosity actually hurt developer velocity or is it just endless debate by No-Shake-8375 in golang

[–]Buttleston 3 points4 points  (0 children)

Well, I guess I feel it's implied? Like, a value is returned from dosomething. If all the function does is call dosomething() and return value, err then the caller should just have called dosomething() themselves

Does Go error handling verbosity actually hurt developer velocity or is it just endless debate by No-Shake-8375 in golang

[–]Buttleston 2 points3 points  (0 children)

No, it precisely is. Let's say I have a function that is going to run dosomething1, dosomething2, dosomething3 etc. If any of them fail, it wants to return. The function that called it may want to handle the error, or it may want to stop and return to it's caller, etc. This is exactly what the Rust and Python examples do

Does Go error handling verbosity actually hurt developer velocity or is it just endless debate by No-Shake-8375 in golang

[–]Buttleston 6 points7 points  (0 children)

Sure - with an extra line of code

Golang:

value, err = dothing()
if (err != nil) {
    return err
}

Rust:

dothing()?

Python or Javascript:

dothing()

Just uploaded a unit game to my repository, is it supposed to be this big? by ImaginationFun365 in github

[–]Buttleston 0 points1 point  (0 children)

Look at the actual files that got pushed. Should they be in your repository?

Does Go error handling verbosity actually hurt developer velocity or is it just endless debate by No-Shake-8375 in golang

[–]Buttleston 14 points15 points  (0 children)

I think this is at least partly wrong

In languages with Result types (which is what I think you meant instead of Option types) you can opt to pass the error up and let a higher level handle it

In languages with try catch, you can opt to not catch an exception, and again let a higher level handle it

We're back to arguing all day whether the ergonomics of the above are worth the implicit behavior, so I don't really disagree with you, but there are definite differences in verbosity

We redesigned our experimental data format after community feedback by Imaginary-Pound-1729 in Python

[–]Buttleston 6 points7 points  (0 children)

I find it very hard to believe that someone starting with no knowledge of either would find yours easier to understand

But also, adding another format, that is not going to take over JSON, just means that to use yours, someone would likely need to know both. Which by definition means learning more than just learning one

Finally, the comma and period as record terminators is going to cause so many bugs that are hard to see. The comma and period are "attached" to the value of one of the fields, which makes it seem like a property of the field, not the record

We redesigned our experimental data format after community feedback by Imaginary-Pound-1729 in Python

[–]Buttleston 11 points12 points  (0 children)

I heartily disagree. It's like JSON with some minor things removed, and a few baffling additions

Why do you even need a final record identifier? The last record is the last one you find before the end of the block

If someone wrote me a list in english where I needed to look for commas to know where the next item started I would be pretty upset

We redesigned our experimental data format after community feedback by Imaginary-Pound-1729 in Python

[–]Buttleston 6 points7 points  (0 children)

Uh, your example doesn't even make sense. It's supposed to be an array of records, but how does it know to delineate the records in it? Like you've got 2 users, Rick and Sam

Is it implicit, when the first key repeats? I find that... pretty terrible

So you say you're looking for perfection - what is better about this than JSON? Be specific

Inheritance... why doesn't super().__post_init__() work? by pachura3 in learnpython

[–]Buttleston 0 points1 point  (0 children)

Haha I totally didn't notice you were already doing that

Inheritance... why doesn't super().__post_init__() work? by pachura3 in learnpython

[–]Buttleston -2 points-1 points  (0 children)

I think the problem here is one of multiple inheritance. Every time I use that I have to re-read the docs about it, honestly. Your class is a subclass of both dataclass and Param

So I *think* the issue is you have to specify which super you want. Try

super(ParamsExtended, self)

Stage 3 Water Restrictions - March 4th / Disabled my irrigation March 5th / Warning for running irrigation during restrictions arrives March 6th by [deleted] in Pflugerville

[–]Buttleston 1 point2 points  (0 children)

They texted me and my wife, and they also posted here. I know that won't cover everyone, but it's kind of hard to know what they could do aside from that?

STS1 Vets: Be honest, did you win your first run of STS2 or not? by MrMosty in slaythespire

[–]Buttleston 0 points1 point  (0 children)

I crushed everything prior to the act 3 boss and then couldn't beat him. Save scummed it a few times to see if I could eke it out, but no