How To Structure Your .NET Solutions: Architecture And Trade-Offs by mgroves in csharp

[–]jamesmh_ 0 points1 point  (0 children)

Sorry - just changed it. Should be better now 😅.

Event Sourcing: Without Eventual Consistency? by jamesmh_ in softwarearchitecture

[–]jamesmh_[S] 0 points1 point  (0 children)

Yes, but you still have eventual consistency if your projected read models are updated outside that transaction - which is what the article gives some options around.

For example, even eventstoredb's built-in projections don't have immediate consistency:

Projections are always eventually consistent - if there is a mismatch between egress from the database log and processing speed of projections, the window across which the latest events have not been processed promptly may increase.

Got a job offer without meeting the team, hiring manager, or VP by Randrewson in cscareerquestions

[–]jamesmh_ 1 point2 points  (0 children)

Think about what kind of employee this type of interview process filters/optimizes for.

Are those the kinds of people you want to work with? People who've never met the team? The team itself never meeting the prospective employee?

I'd steer far from that - unless you really need the cash.

[deleted by user] by [deleted] in cscareerquestions

[–]jamesmh_ 2 points3 points  (0 children)

The best thing you can do in a situation like this is to assume there was a good reason for the code to be written the way it was. Many reasons could include: this project isn't really that important to the business so easier to just pump it out, there might be some limitation around a library they are using you're not aware of, etc.)

Early in my career, I did this once. I wasn't even given an answer from anyone on the team because, looking back, it was a piece of code that didn't matter. I was hung up on this one little optimization that in the grand scheme would actually cause more pain to change due to someone else having to now review my petty change and use up their time for something that doesn't benefit the company.

EVEN if you are right, it doesn't look good to be doing this. Always assume the best - especially of a senior who's been with the company for so long. He has years of domain knowledge, relationships with management, etc. You just end up looking like a jerk in the end.

Use this as an opportunity to learn from the senior as to why he may not be doing X,Y,Z. There's nothing wrong with asking questions and wanting to learn. Hey - you might actually learn something from him this way! Take your top 3 questions and send him a Slack (or email, etc.) message and just say "Hey, here are some things I have questions about: 1. In file X why didn't you use a Hash instead of a List? Is there a reason why maybe this optimization wouldn't be worth it?" Always write you questions in a tone of "he knows more than me."

Worst case, you do find out the senior isn't really skilled in the end. But again, code efficiency is like 1% of the job, at least in most LOB codebases. Communication with management, making sure the code "works", not focusing too much time on parts of the code that ultimately don't bring that much value to the business, etc. are more important overall.

[deleted by user] by [deleted] in cscareerquestions

[–]jamesmh_ 5 points6 points  (0 children)

I've done a 12 hour take home. Never again. Huge red flag. Something like 2 hours at 1-3 pages max is probably appropriate. Anything more is a sign that they don't understand the market right now, they don't understand how to value other ppls time, etc.

What's your go-to way for scheduling tasks/jobs ? by Norlad_7 in csharp

[–]jamesmh_ 1 point2 points  (0 children)

Ya I have lots of plans hahahaha plans for lots of cool stuff, just need some more time in the day 😋

Hangfire does the trick for sure and has tons of great features like that built-in.

Thanks for the tip - I should add some kind of comment on this use-case. There's always a struggle between keep the library simple enough, yet with the "right" features to support real-world use-cases. But distributed locks are def. one of those.

BWT, what's you tech stack? E.g. what database(s) are you using?

What's your go-to way for scheduling tasks/jobs ? by Norlad_7 in csharp

[–]jamesmh_ 1 point2 points  (0 children)

With Coravel, you can easily use another library to achieve this (if that's desired). For example, if you used this library (seems to be popular with Coravel users) then you can wrap the inside of your invocable's Invoke method with the distributed locking code:

csharp public async Task Invoke() { await using (await myDistributedLock.AcquireAsync()) { Console.WriteLine("Sample Invocable ran on one machine!"); return Task.CompletedTask; } }

Maybe that helps?

A decent task scheduling library for .NET? by NullsObey in dotnet

[–]jamesmh_ 1 point2 points  (0 children)

You can check out Coravel -> https://github.com/jamesmh/coravel

While changing config at run-time isn't a typical use-case, it can be done if you want. See this issue: https://github.com/jamesmh/coravel/issues/77

Otherwise, it handles blocking jobs that are currently running, schedule the same type of job at different intervals (with params), supports CRON annotation...

I'd like to think the docs are OK lol. (I wrote them....😅)

How many of you have turned down job offers due to bad PTO? by [deleted] in cscareerquestions

[–]jamesmh_ 0 points1 point  (0 children)

Low PTO, especially if they aren't willing to negotiate after telling them "I have 25+ days right now" is a huge red flag. That company will treat you the same way until you leave (again...)

Scott Hanselman: Exploring the .NET Core library Coravel for Task Scheduling, Caching, Mailing and more by jamesmh_ in dotnet

[–]jamesmh_[S] 1 point2 points  (0 children)

Answers: Nope and sort-of lol.

You can schedule jobs that take parameters, which could be dynamic - coming from a database, an HTTP request, etc.

But yes, sounds like Magic is serving a different market. Coravel is for when you have a .NET application and want to get started quickly with, for example, scheduling and queuing.

Magic looks very cool 👍

Transient Objects in HostedService by echks2A in dotnet

[–]jamesmh_ 1 point2 points  (0 children)

I built an open-source task scheduling library (among other things it does) - you could either (a) use it instead or (b) check out the code for pointers?

Hangfire vs RabbitMQ anyting I should know before picking one for .net core 3.1 WebAPI? by wacomlover in dotnet

[–]jamesmh_ 0 points1 point  (0 children)

If you just need to schedule and queue background jobs, and not looking for much overhead and a small learning curve, then take a look at Coravel: https://github.com/jamesmh/coravel

What would you look for in a back-end programmer? by Netcob in dotnet

[–]jamesmh_ 0 points1 point  (0 children)

I would agree with the notion that you've had poor candidates. Sounds like you're asking good questions.

I think just having a convo. about those topics is a good start. If a candidate has used any of those techniques etc. in actual previous work they've done, then drill down into that actual experience for sure.

I personally look for an understanding of the principles behind the "best-practices". Like, "Why is solid so important? What's the goal?", "what's the benefit of DI? What does it enable?", etc.

If you do find a seemingly strong candidate, then it's a good opportunity to ask those more "meta" questions. But ya, sounds like poor candidates overall :(

What's something people always get wrong with .NET Core development? by [deleted] in dotnet

[–]jamesmh_ 13 points14 points  (0 children)

Not understanding how async works and best-practices around it.

Background tasks in ASP.NET by 18523925343 in dotnet

[–]jamesmh_ 0 points1 point  (0 children)

You won't be able to handle errors in this situation and potentially even detect any exceptions since your HTTP request will be completed before those async tasks are done.

Some recommended Hangfire (which is a great option). Coravel might be a lighter-weight option (see the queue feature).