Better HN
topnewbestaskshowjobs
Log inSign up

ducharmdev

893 karma · joined Oct 2, 2020 (6y ago) · 241 submissions

Submissions

comment 4y ago · link · parent

Never been to Wick's but Danny Mac's is heaven

comment 4y ago · link · parent

Can I work with you?

Joking aside, documenting as a habit alongside coding is like a superpower. I find that writing can act as validation against my understanding of a problem; if I struggle to write about it, then it's likely that I don't understand the problem as well as I thought.

comment 4y ago · link · parent

I went with Hugo too. I used Gatsby in the past, but it was slower and it felt a bit odd using GraphQL in the way it does. Maybe that'd make more sense if I was using an API to deliver content, but for simple markdown pages, it seemed unnecessary.

comment 4y ago · link · parent

Be vigilant about scope creep; this requires some self-awareness, as it can be easy to let your excitement take you down interesting but tangential paths.

Your priority should be to get the core functionality of your project working as soon as possible, even if it's buggy and lacking in features. This proves that you can solve the problem you set out to solve, and allows you to say you've "finished" the project to some degree.

Too often people get caught up in doing things the 'right' way, making sure the code is the cleanest they've ever written, etc. None of this matters if it doesn't result in a working product.

Now I don't mean to say that additional features, bug fixes, and refactoring aren't important. My point is that focus, motivation, and time are limited resources, and these improvements should come after you've established your core functionality and proven that it's viable.

comment 4y ago · link · parent

When you say performance, are we talking about the tooling, running the app itself, or both? Also were you using Blazor Server, WASM or Hybrid?

Personally I've not run into any big issues like that; although my work laptop is pretty beefy, I did my side project on an old laptop that can't handle really large .NET solutions (e.g. crashes every 10-30 seconds simply navigating the Roslyn codebase...), but it did okay with Maui + Blazor Hybrid.

Alternatively, I think it's possible to use vscode if you're friendly with the dotnet cli, but I had trouble getting the workloads to work correctly and didn't wanna fuss with it at the time.

comment 4y ago · link · parent

As a .NET developer that's focused mostly on web development (e.g. APIs + SPAs), I've not been very eager to wade into the pool of XAML that is .NET desktop/mobile frameworks.

But I'm becoming more optimistic with the introduction of Blazor Hybrid. Whether you're using MAUI for mobile & desktop, or WPF/WinForms for just desktop, Blazor Hybrid provides you a web view that enables usage of Razor components made of C#, HTML & CSS. These components run natively, not in the browser.

After using Maui + Blazor with Tailwind for styling in a recent side project, I can see this becoming a viable alternative to Electron.

comment 4y ago · link · parent

I feel like I'm about to get to this point myself. It's absolutely insane that any decently popular video will cut to ads so often, without any regard for continuity. Much worse than cable ever was.

comment 4y ago · link · parent

Re: web apps - is yew production ready? Searching about it gives some ambiguous results.

comment 4y ago · link · parent

Of course - there's something appealing about the mindset of someone that isn't afraid to get their hands dirty. Especially when so many people turn their noses at a job, saying "I would never work with X framework/language!".

I'd love to be a fly on the wall in a consultation like that - I'd be curious what your strategy is when approaching particularly gnarly projects.

comment 4y ago · link · parent

Now that's a nice pitch.

comment 4y ago · link · parent

This reminds me of a section towards the end of Plato's Apology:

> ...there is great reason to hope that death is a good, for one of two things: - either death is a state of nothingness and utter unconsciousness, or, as men say, there is a change and migration of the soul from this world to another. Now if you suppose that there is no consciousness, but a sleep like the sleep of him who is undisturbed even by the sight of dreams, death will be an unspeakable gain. For if a person were to select the night in which his sleep was undisturbed even by dreams, and were to compare with this the other days and nights of his life, and then were to tell us how many days and nights he had passed in the course of his life better and more pleasantly than this one, I think that any man, I will not say a private man, but even the great king, will not find many such days or nights, when compared with the others. Now if death is like this, I say that to die is gain; for eternity is then only a single night.

comment 4y ago · link · parent

I'm not sure I'd agree that having one language would be 'optimized' for the human mind. People often create DSLs due to the limitations of general-purpose languages that are constrained by the large number of use-cases they must support; sometimes a DSL actually makes things less ambiguous, and therefore easier on our minds.

To give a more concrete example: in Xamarin apps, you can technically do all UI in nothing but C#, just writing in the code-behind rather than in XAML. But as any Xamarin developer will tell you, this is a nightmare to work with. It becomes less clear what code is responsible for structure vs logic, and can be a real pain to test.

Now that's not to say I completely disagree. For example, I think Tailwind gives you a sense of what it would be like if HTML & CSS were one and the same; keeping structure and style together makes a lot of sense to me. But I'd be wary of a one language to rule them all.

comment 4y ago · link · parent

grug is the peak of SWE wisdom to me

comment 4y ago · link · parent

The problem with using HTML in this way is that it couples the view with your data. What happens when non-browser clients (e.g. mobile, other servers) need to easily consume the same API?

I know some projects plan to only ever use browser clients, so this may seem irrelevant for them. But I'd rather not try to predict how a business will want to use it's data in the future, and would prefer to design a backend that can be adapted to many scenarios without being bound to a particular client.

comment 4y ago · link · parent

I think many people write off empathy as being about warm and fuzzy feelings, and don't realize that it's a very useful skill that can be improved with practice.

The more effectively you can imagine perspectives other than your own, the more easily you can come up with creative solutions, communicate well, and overall just be a more pleasant person to be around.

comment 4y ago · link · parent

Thanks for the thoughtful reply - I don't have a stats background, but it didn't quite sit right with me. The movie example you give here really puts it in perspective.

comment 4y ago · link · parent

That's really cool, thanks for sharing! I particularly appreciate the SQL snippet.

comment 4y ago · link · parent

I've always had mixed feelings about this graph. If you look at the actual number of responses for Julia, it's only 786 loved, 298 dreaded. Compare this to Python, which is 22,999 loved, 11,156 dreaded - is this really an accurate presentation of the data?

Sure, taking the Julia responses alone, you could argue that a high proportion of language's users love it. But when placed alongside other languages, it leads some to conclude that Julia is loved more than Python; if 22,999 people love Python and 786 love Julia, is that really true?

comment 4y ago · link · parent

While I like the functional aspects of Rust, not sure I would call it a functional language - still very much worth learning though.

Maybe a slightly unconventional answer, but F# is quite nice.

https://fsharpforfunandprofit.com/

comment 4y ago · link · parent

I feel like I've been hearing about WASM GC support for years, but do we have any idea when it will become a reality?

comment 4y ago · link · parent

I'd recommend you give Vite a try, imo it's a painless replacement for webpack.

comment 4y ago · link · parent

For a single-player game like this, instead of having it always running, I wonder if you could simply design the game in a way that the next state is deterministically calculated based on the time. So the next time you start the game, it loads the previous state + current datetime in order to produce the next state.

This would be prone to manipulation, if someone were to change their PC's datetime, but would give the illusion that it's always running without actually doing so.

comment 4y ago · link · parent

I wonder what that'll look like performance-wise. VS 2022 regularly crashes on my work laptop, which is one of the better ThinkPads and has 32gb ram. And this is after the hyped-up move to 64 bit...

comment 4y ago · link · parent

My favorite one lately has been, what if supply chains collapse and grocery stores are empty for weeks/month, causing most people to starve? Or similarly, what if the electrical grid just stops working for some reason, causing the majority of jobs to evaporate overnight (as well as the aforementioned supply chain problems, and a whole host of cascading effects).

As a SWE, I recognize that although this career is one of the most valued in our current economy, we're highly dependent on modern infrastructure. Take away certain services, and all our years of coding experience are rendered useless.

comment 4y ago · link · parent

Having started in modern frontend js, and now doing mostly .Net 6 API dev with a Xamarin client, I don't quite understand the obsession with MVVM. MVU seems clearer and more intuitive by far, but that could just be my web background talking.

Edit: to give an example of what I'm talking about, see this article's visualization of the unidirectional data flow you get with MVU. This feature in particular makes MVU much less ambiguous than MVVM (IMO at least)

https://thomasbandt.com/model-view-update

comment 4y ago · link · parent

You're right, I think Yet-Another-Schema-Solution (YASS)™ would be much more compelling!

(Please forgive me)

comment 4y ago · link · parent

Although it's more manual, you could set up a mic to record into Audacity, cut the sections with no sound, and the length of the clip should give you your answer.

Or if the piano supports midi, maybe record using some kind of DAW (e.g. FL Studio), that way you won't be fooled by someone making noise into the mic to keep the timer going.

comment 4y ago · link · parent

Haha yep, that just about describes how it went for me. No way would I do all that without automated testing too - the immediate feedback is crucial for broad changes like this, that way if you do find you've made a wrong judgment in your approach, you find out immediately and correct your course.

One thing specific to .Net DI that made it easier was an extension method provided by our architecture team that does a "warmup" of all dependencies registered in your service collection. In practice all this means is, on app startup, it attempts to instantiate every registered service; if a dependency is missing, you'll get an exception for the service that failed to be created with the dep it failed on. Very helpful for chasing down issues related to missing service registrations!

comment 4y ago · link · parent

Yup, all one repo fortunately. The majority of changes were in 3 class library projects, each of which is referenced by web portal, API, and nightly jobs projects. I'd imagine it could be quite painful if scattered in various repos!

comment 4y ago · link · parent

At work, we have a .Net 6 codebase that had some odd design decisions made in the past couple years. Roughly ~115 classes using Unity for dependency injection instead of ASP.NET Core DI, and this horrible Unity-based service locator pattern used all over the place. Since nothing was using constructor injection and instead just grabbed deps from calls to a global static locator willy-nilly, it was very difficult to tell how many dependencies a given class had. The worst classes were injecting 30-40 dependencies, but you couldn't tell this in looking at them.

Anyway - I was tasked with removing Unity and refactoring the service locator usage, since Unity was going to be unsupported soon. Doing this gave me a real sense of agency in our otherwise boring enterprise app; it was one of the rare chances where I could make a significant, wide-scale improvement that would make future development easier for everyone.

12345
9