atheken

joined 1 year ago
[–] atheken@programming.dev 1 points 7 months ago

Douglas Crockford, author of “JavaScript: The Good Parts” has said:

“JavaScript is the only language in the world that people think they write without learning it first.”

I think this is a true statement (well, that and bash).

[–] atheken@programming.dev 1 points 7 months ago

Programming and Software Engineering are related, but distinct fields. Programming is relatively easy, Software Engineering is a bit harder and requires more discipline in my opinion.

[–] atheken@programming.dev 1 points 7 months ago* (last edited 7 months ago)

Not that I would recommend it, but you can also try something like extension methods on Func.

public static RunAndLog(this Func f) {
 LogStart(f);
var x = f();
LogEnd(f);
return x;
}

I think you may have enough diagnostic info with reflection to write something meaningful, and you can add overloads with generic parameters for the func params, and/or Action.

You may also create an IDisposable that logs a start and end statement around a function call:

using var _ = CallLogger(“func name”) {
f();
}

Personally, I wouldn’t do either of these. This level of logging produces an enormous amount of noise, making finding signal very difficult. I would focus more energy on writing unique and helpful messages where they are important, and using git grep to find the related source code when they show up in production logs (assuming you don’t log a stack trace). This level of call logging can be temporarily useful while debugging or reasoning through an app, but rarely belongs in production.

[–] atheken@programming.dev 2 points 8 months ago* (last edited 8 months ago)

Writing fast unit tests will require some refactoring that could end up being pretty extensive.

For example, you mentioned “cloud storage” - if this is not already behind an interface one ticket could be to define an interface for accessing “cloud storage” and make it so that it can be mocked for most tests and the concrete implementation can be tested directly to confirm the integration works. Try to hone down that interface so that it’s as few methods as possible, only allow the parameters you’re actually using to be exposed and used in the interface. You can add more later if it’s absolutely necessary.

Do this for anything that does I/O and/or is CPU intensive.

So, to do tickets, I’d basically say, one per refactoring.

Going forward, writing “unit tests” should not be separate tickets, it should be factored into the estimates for the original stories, and nothing should go out without appropriate tests. The operational burden will decrease over time.

QA should have their own unit for how they want to test the application. Usually this is a suite per section of the app. If your app has an API, that is probably going to have a nice logical breakdown of the different areas that could each have their own ticket for adding QA-level test suites. The tests that developers write should only be additive and reduce the workload of QA. What you want to be sure of is that change sets are getting reviewed and through the entire pipeline without getting logjammed in any stage. Ideally, individual PRs are getting started and deployed in less than a week.

If you’re interested in more techniques, check out the book “Working effectively with legacy code.” It has a lot of patterns for adding tests to existing codebases.

[–] atheken@programming.dev 3 points 8 months ago

You should probably report this as an issue on the dotnet runtime GitHub repo: https://github.com/dotnet/runtime

I would also suggest you include information on the hardware you’re using for this (architecture, ram, cpu, etc).

[–] atheken@programming.dev 1 points 8 months ago* (last edited 8 months ago) (1 children)

Considering the implications of relying on an external company as the registry, I don’t think custom domains are really “vanity” as much as reserving agency to move the code if it becomes necessary. I’m perfectly happy with GitHub, but would rather my modules didn’t break if they implement a policy change at some future date. I also don’t like the implication that “GitHub owns” my repo due to the import path stuff.

That being said, I wonder if this same thing could be achieved with a simple reverse proxy/CDN with a few rewrite rules? Ideally, the only cost to a typical maintainer would be the domain name, and the rest could be hosted on free infrastructure (cloudflare would seem like a reasonable choice).

[–] atheken@programming.dev 1 points 8 months ago

If these systems could only reorganize and regurgitate 1000 creative works, we would not be having this conversation. It’s literally because of the scale that this is even relevant. The scope of consumption by these systems, and the relative ease of accessibility to these systems is what makes the infringement/ownership question relevant.

We literally went through this exercise with fair use as it pertains to CD/DVD piracy in the 90’s, and Napster in the early 2000’s. Individuals making copies was still robbing creative artists of royalties before those technologies existed, but the scale, ubiquity, and fidelity of those systems enabled large-scale infringement in a way that individuals copying/reproducing them previously could not.

I’m not saying these are identical examples, but the magnitude is a massive factor in why this issue needs to be regulated/litigated.

[–] atheken@programming.dev 1 points 8 months ago (2 children)

I think the “learning” process could be similar, but the issue is the scale.

No human artist could integrate the amount of material at the speed that these systems can. The systems are also by definition nothing but derivative. I think the process is similar, but there is important nuance that supports a different conclusion.

[–] atheken@programming.dev 2 points 8 months ago

I don’t know if it’s “most people,” but I agree, there is no excuse for frameworks producing sloppy output - that being said, XHTML is a bit more chatty than HTML(5), so there is some minor benefit to not using the less verbose standard.

[–] atheken@programming.dev 5 points 8 months ago (2 children)

As an end result, maybe. But it also means that you get specific feedback on how to properly author it correctly and fix it before pushing it live.

IDK, I lived through that whole era, and I’d attribute it more to the fact that HTML is easy enough to author in any text editor by complete novices. XHTML demands a hell of a lot more knowledge of how XML works, and what is valid (and, more keystrokes). The barrier to entry for XHTML is much, much, higher.

[–] atheken@programming.dev 3 points 9 months ago

I generally find that writing code that requires a lot of “accounting” is very prone to mistakes that are easier to avoid with recursion. What I mean by this is stuff where you’re tracking multiple counters and sets on each iteration. It’s very easy to produce off by one errors in these types of algos.

Recursion, once you get the hang of it, can make certain kinds of problems “trivial,” and with tail-call recursion being implemented in many languages, the related memory costs have also been somewhat mitigated.

Loops are simpler for beginners to understand, but I don’t think recursion is all that hard to learn with a bit of practice, and can really clean up some otherwise very complicated code.

My general opinion is that we are all beginners for a short part of our journey, but our aim shouldn’t be to make everything simple enough that beginners never need to advance their skills. We spend most of our careers as journeymen, and that’s the level of understanding we should be aiming for/expecting for most code. Recursion in that context is absolutely ok from a “readability/complexity” perspective.

[–] atheken@programming.dev 2 points 9 months ago

I don’t have “heroes” per say, but Anders Hejlsberg is up there.

Generations of programmers have benefited from his work. His focus on ergonomics in C# made the language a total powerhouse.

view more: next ›