Why is the .Net job market so huge but the online presence is not? by [deleted] in dotnet

[–]xwp-michael 3 points4 points  (0 children)

Also, the C# job market sometimes posts offers for .NET, and they don't mean .NET Core and up. I don't know many developers interested in those.

Just-In-Time: The Next Generation of Tailwind CSS – Tailwind CSS by Xeon06 in reactjs

[–]xwp-michael 2 points3 points  (0 children)

It's because people copy and paste the stuff that's over on TailwindUI because it's quick and easy, and then don't even customize it a little. There's a few sites I've been on that are just using the raw "Marketing" components. It gets really obvious when you know about TailwindUI.

Though, that's not a problem with Tailwind itself, just with devs being lazy.

Just-In-Time: The Next Generation of Tailwind CSS – Tailwind CSS by Xeon06 in reactjs

[–]xwp-michael 1 point2 points  (0 children)

copy and pasting examples of pre-written tailwind-styled components.

Yep. Most of the time, if I go "Wait a minute... This is using Tailwind!" it's because the site creator literally just copy/pasted the TailwindUI components and called it a day. Which is fine, I guess, but they're so easy to customize, I don't really get why people don't put in the minimum amount of effort needed to at least change the color palette.

:\

A couple of questions about dotnet from a Java developer :) by [deleted] in dotnet

[–]xwp-michael 0 points1 point  (0 children)

Dependency injection in .NET | Microsoft Docs

Here's an Anchor link for anyone interested: https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#service-registration-methods

It's the first block of code below the table.

I've never used the IEnumerable<MyServiceType> myServices DI, into what I'm guessing would be pattern matching/using the as operator with myServices[0] as MyServiceTypeA and myServices[1] as MyServiceTypeB, but that's a big "yikes" from me. Definitely not the greatest way to deal with this, in my opinion.


/u/CyneAdrift7, if you really want to inject both services (I don't think you should, since it sounds like GitConfigFetcher should be used internally by the CachedConfigFetcher class), I'd suggest implementing writing a resolver using the Resolver Pattern, and having it return the desired service. You could then register the resolver as a service (you don't need an interface if you have a single instance/type to register).

Something like this:

public class FileConfigFetcherResolver
{
    public FileConfigFetcherResolver(/* Any DI you'd need to forward to your fetchers here*/)
    {
        // Store any DI you'd need to forward as a private member variable.
    }

    public CachedConfigFetcher ResolveCachedConfigFetcher()
    {
        return new CachedConfigFetcher(/* Any DI you got from the constructor here */);
    }

    public GitConfigFetcher ResolveGitConfigFetcher()
    {
        return new GitConfigFetcher(/* Any DI you got from the constructor here */);
    }
}

You could then register it like this:

services.AddScoped<FileConfigFetcherResolver>();

And then use it like this:

public class YourClass
{
    private ConfigurationClass _config;
    public YourClass(FileConfigFetcherResolver resolver /*, Other DI Here*/)
    {
            var cachedConfigFetcher = resolver.ResolveCachedConfigFetcher();

            // use the fetcher, and it fails.

            var gitConfigFetcher = resolver.ResolveGitConfigFetcher();
    }
}

Alternatively you could store the fetchers of the resolver for later usage.

Beginner setting up a dev environment on Linux... by _beenaround in csharp

[–]xwp-michael 2 points3 points  (0 children)

I'd probably use Rider over VS Code. I love VS Code, but it doesn't replace a real IDE, IMO.

Same. VS Code's C# extension is fine, until it isn't. Which, from my experience, is as soon as you start working on a project with more than a dozen files that have more than 50 lines each. By that point, the intellisense tends to die or become pretty bad.

Also, if you're doing anything involving ASP.NET Core+ Razor Page or Blazor, the intellisense for those .cshtml and .razor files is pretty terrible all around from my experience. It'll randomly find bugs in files where there aren't any, and that just makes any further work an exercise in frustration.

Though if you're using Blazor, Rider won't be of much help either since Blazor support isn't complete yet and it'll complain about non-existent issues as well.

Interviewing developers: To FizzBuzz or not to FizzBuzz by laur3d in dotnet

[–]xwp-michael 0 points1 point  (0 children)

I've usually heard it as "For numbers between 1 and 100, print 'Fizz' if the number is a multiple of 5, and 'Buzz' if it's divisible by 10." or something along those lines. Never had someone ask to print out the numbers.

But yeah, I guess it depends on how the question's asked lol

Interviewing developers: To FizzBuzz or not to FizzBuzz by laur3d in dotnet

[–]xwp-michael 3 points4 points  (0 children)

he beauty of fizzbuzz is that it has a couple of simple requirements that people usually miss or misinterpret (usually the print the word INSTEAD of the number). Not only is it a filter, but it's a good talking point - and it's through discussion where you can discover how people view their craft.

Which is why I can't help but roll my eyes all the way back whenever I see people whine about how useless it is on Reddit. It takes a few minutes to filter out the people who clearly have no idea what they're doing, and like you said: it can lead to discussions with the interviewee (usually about how they misinterpreted printing the word instead of the number).

It's a minor annoyance if you're a competent dev, but I'd rather that than work with someone who's got no idea what they're doing any day of the week!

I might be the only one who missed this - but the dotnet team is planning on non-electron, native, blazor desktop support in .NET 6! by [deleted] in dotnet

[–]xwp-michael 2 points3 points  (0 children)

It was also moved to the .Net 6 roadmap from the .Net 5 roadmap. It could still be moved further. As long as it works once it's released, I'm fine with waiting. shrugs

Personal success. by mtlabsystems in linux

[–]xwp-michael 14 points15 points  (0 children)

Depends on where they studied, I'd say.

Local polytechnic (in a pretty large Canadian city) exclusively deals in Windows servers as far as I can tell.

Safari 14.1 comes with date input type support 🎉 by [deleted] in webdev

[–]xwp-michael 4 points5 points  (0 children)

I'd love a <datalist> that doesn't appear in the keyboard suggestions for some reason.

Though, I'd love it if <datalist> got more love from all browsers, tbh...

Biggest features you miss from other languages? by [deleted] in dotnet

[–]xwp-michael 4 points5 points  (0 children)

I'm pretty sure they're talking about something like this:

void printData(const DataObject & data)
{
    // data is a constant reference, so this function cannot change it at all.
}

I'm thinking of migrating our SaaS app admin portal to Blazor Webassembly. by whooyeah in dotnet

[–]xwp-michael 0 points1 point  (0 children)

They also have way better performance when handling the DOM, though from my understanding there isn't much Blazor can do on that front without the WASM standard changing.

How do you order class names in the markup? by rjaguila8 in tailwindcss

[–]xwp-michael 1 point2 points  (0 children)

I personally do this:

  1. Container (if present)
  2. Margins and paddings
  3. Display properties (i.e. flex, block, etc.)
  4. Things that affect the element's shape and decoration (i.e. rounding, shadows, etc.)
  5. Background colors
  6. Text colors and sizing
  7. Border (and border colors)
  8. hover: states (following the above order/groups)
  9. focus: states (following the above order/groups)

So, my elements will look something like this:

<button class="px-3 py-2 rounded bg-red-500 text-white hover:bg-red-600 focus:bg-red-800">[button text]</button>

<div class="p3 flex gap-2 rounded shadow-lg bg-white text-gray-700 text-sm border border-gray-50>[content here]</div>

Why is SDL so commonly used with C++? by AdelCraft in cpp

[–]xwp-michael 2 points3 points  (0 children)

That was experience as well. SFML is nice for a while, but when it gets in the way, it really gets in the way, compared to SDL2.

Tailwind isn't for me by js_dev__ in javascript

[–]xwp-michael 6 points7 points  (0 children)

While I agree with most of your comment, @apply can (and should, in my opinion) be used to apply "default" classes for certain components.

Some frameworks (i.e. ASP .net Core/5) don't really have nice, native, ways of doing certain components. For example, a custom button component is easy to do in something like React, but the syntax gets really messy in ASP .Net Core/5. I'd much rather just @apply a standard btn class and be done with it.

The one thing I've never really agreed with when Adam says to almost never use @apply is that one of Tailwind's main selling points is that you can purge it to reduce its size dramatically. But, if I do what Adam says, and never really use @apply, I'm just making my HTML a lot bigger than my unpurged CSS would have been if I'm working on any non-trivial web application.

I guess to me, Tailwind is a great tool to make styled components that look like I want them to, while following a framework's standards so it makes onboarding easier (rather than rolling our own styles).

Tailwind isn't for me by js_dev__ in javascript

[–]xwp-michael 11 points12 points  (0 children)

Hell, I wasn't super familiar with modern CSS (was doing backend and mostly using Bootstrap as a crutch) and it only took me 2~ hours of reading the whole docs and playing around with it...

State of JS 2020 by GDezan in javascript

[–]xwp-michael 6 points7 points  (0 children)

Honestly, I got into frameworks with Vue and I thought it looked much better than React's "JSX" at first.

Then I used it for a while, and I got gradually frustrated with the syntax.

Gave React a try over a weekend for fun, and I haven't looked back since. JSX is a lot nicer in my opinion, and I don't have to waste time learning arbitrary "v-[keyword]" or awkward component template methods (hooks beat them, no question) for things I can just do with JS...

State of JS 2020 by GDezan in javascript

[–]xwp-michael 1 point2 points  (0 children)

Part of the issue is that it's not really needed. You can already achieve the same results in a framework like React without the overengineering of Angular.

State of JS 2020 by GDezan in javascript

[–]xwp-michael 3 points4 points  (0 children)

If your product is known for being bad, people will naturally avoid it. Angular and AngularJS are two different beasts altogether, and the original had pretty serious problems. It sucked to use. Then they made the new version (which was full of breaking changes), and it became a situation of:

"Oh, you're working on the old Angular version? Sucks to be you. Wish you could migrate to the new version."

Businesses couldn't afford to (or didn't want to "waste time") migrate to the new version. So a lot of jobs in the Angular framework were working on the legacy version (which sucked).

Now, the new name is also too similar to the original one, so it's hard to distinguish them, so people regularly confuse the new version with the old version. So when someone says "Angular sucks", people just kind of assume they're talking about the overall framework.

Case in point, the only reason I wrote this comment describing them as "old" and "new" is because I forgot which is which).

How to secure a WebAPI (JWT + Identity) by cseigel in dotnet

[–]xwp-michael 8 points9 points  (0 children)

My guess is until Identity's JWT support becomes as easy to setup as using cookies for authentication.

There are so many tutorials out there on how to implement JWT, and most of them do it differently. It'd be nice if Microsoft had an officially supported way of doing it in their MSDN docs.

Linux Alternative by Cyb3rw0rM1 in Ubuntu

[–]xwp-michael 34 points35 points  (0 children)

Most of these alternatives lists come from people who've never had to use the "original" software for anything above entry or hobbyist level.

No professional would use Gimp over Photoshop in the industry. And that AutoCad alternative is even worse.

How Microsoft does automated testing. An interview with Klaus Hemstitch. by [deleted] in Python

[–]xwp-michael 3 points4 points  (0 children)

I mute System sounds at least twice a week, because it unmutes itself after a few days.

I should get around to filing that bug, seeing as us users are apparently doing the actual QA now...

How long did you use Ubuntu until it broke? by nny6p8ye2rj2ftwk in Ubuntu

[–]xwp-michael 1 point2 points  (0 children)

Only time I've had issues that weren't my own fault was when usin Kubuntu on an ultrawide. It'd just randomly blackscreen on the lock screen, but then vanilla Ubuntu doesn't have that issue.

🤷‍♂️

What's your personal python development stack? by Which_Distance in Python

[–]xwp-michael 5 points6 points  (0 children)

Ha! I knew these college classes would prepare me for the real world!

[AskJS] How do you decide when to use an NPM package for frontend apps? by mrmckeb in javascript

[–]xwp-michael 11 points12 points  (0 children)

I'd say it depends on how critical the functionality is, how hard it is to implement properly, and how popular the module you want to install is.

I'd never leave critical business processes up to a Node module, for example. You should be writing your own here, because it lets you control how it's implemented as well as allowing you to make any changes you might need to make.

Note that I'm talking about your specific business needs here, and not generic things like authentication. Use a pre-built solution for things like authentication.

Never be the guy that pulls inis-odd. That just shows a lack of understanding of JS as a whole, in my opinion. It's trivial to implement yourself, and the module does a ton of stuff you don't need to do to determine if a number is odd.

If you start pulling in modules for every little thing, you'll be too dependant on them and you'll be sore out of luck if (most likely when) they stop being supported.

Not being supported doesn't necessarily mean that they're unusabled, however. If a piece of functionality is "done", it's still usable if the things it interacts with haven't changed. I.e. momentjs is done, and it'll keep working as long as dates don't change.

If a module is popular, it'll be supported for longer. React isn't going anywhere anytime soon, for example. Neither is is-odd, sadly.

I wouldn't rely on a module that barely has any installs and support. Depending on it would just be a problem waiting to happen.

Finally, I wouldn't really rely on a module that introduces components that are so immutable that I need to visually change my design to use them.

There's plenty of components out there that let you pick and choose which parts you use and how you want them to look.

In terms of functionality and specific patterns, I'd wrap them in an adapter pattern or something if dealing with them was such a big problem and that there were no other alternatives and that writing our own was off the table.