asyncrosaurus

joined 2 years ago
[–] [email protected] 3 points 2 years ago

Don’t use ~~exceptions in~~ C++ anymore

~~/s~~

[–] [email protected] 7 points 2 years ago

It's a form of Black-Box Testing, essentially you want to validate expected behavior. Implementation can change, but your outcome should remain the same.

This is a big target for Test Driven Development, since your first step is to write the test with the expected outcome, then you write the most basic implementation, and when you can verify the behavior, then you are free to re-factor to improve implementation knowing your test will tell you if the behavior changes with each internal change.

[–] [email protected] 14 points 2 years ago* (last edited 2 years ago)

Update: https://github.com/moq/moq/issues/1374#issuecomment-1671166436

Dev is still defending his action and apparently believes he's done nothing wrong. Harvesting developers email and extorting them by sabotaging builds is no big deal.

Absolute clown. OSS needs a better solution to funding devs hard work, but it is not a vehicle for an egomaniac to get rich.

I'm still pro-not mocking. Maybe this is a good opportunity to stop using so many mocks in our tests, and write validation on the actual behavior of your code.

[–] [email protected] 17 points 2 years ago (2 children)

I was there for the first wave of SPAs, I even learned angularJs and Knockout. It did feel like a major atep forward, being able to make highly interactive applications. However, things quickly went off the rails when the tools stopped being about managing heavy client state, and became the default for everything, even when it ment using JavaScript to build extremely basic functionally browsers did natively with html, but extremely worse(e.g. navigation). The modern Web really is a victim of hype and trends.

Unless your app needs to work offline, or you have to manage dozens of constantly changing client side data points concurrently, your site doesn't need to be a big heavy js framework. My rule is if it looks like Google Maps, you need a SPA. if it looks like Gmail you need REST/HATEOS. and if it looks like google's mainpage, you need a server side rendering.

At some point you might see the light, and go back to making your websites simpler, but Im not hopeful. Until then I'm building the majority of things with HTMX and alpineJs.

[–] [email protected] 3 points 2 years ago (5 children)

You couldn't pay me enough dollars to cover the therapy caused by having to maintain the "flexible" code that added complexity and abstraction for a single use case that was never expanded to handle more.

[–] [email protected] 6 points 2 years ago

Ignore the weird tribalism over the languages other people prefer to use.

Just one thing to keep in mind about VB.Net, Microsoft considers it "done". Active development is done, yhe language won't receive any new enhancements anymore, so all the cool new C# features (like pattern matching) will not be back ported to VB.Net.

[–] [email protected] 4 points 2 years ago

The sad truth is Twitter actually DDoSing itself.

[–] [email protected] 6 points 2 years ago* (last edited 2 years ago)

Having watched the video, I can confirm it is a terrible summary. The point of the Fireship 'Code Reports' is to be a light hearted summation of the news.

The video is hilarious, with tonal and visual gags that are simply lost in translation to text. You might as well just scan the home page to get the acctual news.

[–] [email protected] 11 points 2 years ago* (last edited 2 years ago)

6First off, Inheritance is not "dead". We all just learned to favour interface inheritance over class inheritance.

Secondly, class inheritance is not bad or useless, it's just poorly taught and wildly overused. The fact that the article still uses the bullshit Animal kingdom example is indicative of that. There's no value in trying to model cats and dogs in OOP.

Inheritance is pretty useful in niche scenarios, mostly involving polymorphism and probably in the context of Library or Framework code. Trying to re-use code between classes with inheritance is always the incorrect approach. Two classes that are unrelated but have similar properties don't actually need a common base class, they can each have their own version of the data.

The big, big, big problem outside the education system comes back to the top down, design-first approach. There's still this strange practice of trying to model class hierarchies and abstract classes in neat little diagrams before you've actually started writing code. No UML type document has ever survived contact with the real world. If you need any form of inheritance, it will become obvious as you build out your system.

[–] [email protected] 15 points 2 years ago* (last edited 2 years ago) (1 children)

Everyone freaking out that bad AI content is going to ruin the internet, when the internet was already ruined long ago by terrible human generated content.

[–] [email protected] 21 points 2 years ago* (last edited 2 years ago)

Not testing is crazy. Once you realize you can actually refactor without ever having the fear you've broken something, there's actually opportunity to make rapid improvments in structure and performance. Taking 2 minutes to write the test can save your hours of debugging. Unless you're building a throwaway prototype, not unit testing is always the wrong choice.

[–] [email protected] 10 points 2 years ago* (last edited 2 years ago) (1 children)

People expect the web to work like a desktop app (no page reloads).

Do users expect it, or do product owners expect it? Because from my experience, typical users dgaf if a site is a SPA or is SSR as long as it's functional and loads quickly. When we did user surveys, the legacy Wordpress version scored just as well as the fancy schmancy React re-write. Only time SPA outscored a traditional web page is (obviously) heavily interactive components (e.g. chat, scheduling calendar)

view more: ‹ prev next ›