@ceejbot I thinkered a little about my previous comment and I realized I have not checked how efficient and "well written" is the code produced by #VibeCoding. According to https://search.brave.com/search?q=vibecoding+produce+efficient+code%3F&summary=1&conversation=08d518070c52f18a7ed34de823520c1eb9f2 it's fast but flawed, fragile, or low maintainability with hidden bugs, poor performance, and security vulnerabilities:
- Sloppy or undocumented code,
- input validation, authentication are frequently missing.
Therefore #DesignByContract and testing are still required.
Vibe coding produce efficient code?

Vibe coding can produce code quickly, but it is not inherently efficient or reliable for production use. While vibe coding excels in speed & efficiency—enabling developers to build working prototypes in hours instead of weeks—it often generates code that is fast but flawed, fragile, or low maintainability. The AI prioritizes rapid output over optimal structure, leading to issues like hidden bugs,…

Brave Search

I've been thinking about #programming languages and types this morning.

Especially about the fallacy of trusting languages like #typescript on the actual shape of the data. I mean all your type annotations and etc still leave you very vulnerable to malformed data / errors during runtime and you end up having to add runtime validation anyways. My current conclusion is that #DesignByContract might be a better avenue for adding input / output verification to a dynamic language like #python or js.

I wonder where we'd be if all the money and time that has gone into typescript had gone into making contracts a viable tool in #javascript

Wikipedia has more info on design-by-contract: https://en.wikipedia.org/wiki/Design_by_contract

Including links to some projects that aim to add contracts to javascript.

Design by contract - Wikipedia

@screwtape The solution is #DesignByContract.

If the function changes, probably so do the precondition & postcondition checks, so the test will fail very quickly.

@mfowler And not incidentally, #DesignByContract is a real thing in #SoftwareEngineering

https://en.wikipedia.org/wiki/Design_by_contract

Not only Bruce Schneier, but also Bertrand Meyer got that right.

#DBC

Design by contract - Wikipedia

@dekkzz76 @AmenZwa It's important to note that the majority of the problem is due to profit incentive and little else.

A low-regulation engineering field where for-profit actors have incentives to cut costs at every single corner they can. It's hard to imagine it ending any other way.

Also you can use unit tests to exercise a full #DesignByContract implementation too. #StaticVerification is not the only way to ensure a system is behaving correctly (and physical interference suggests it can't).

@serizawa Object-Oriented Software Construction by Bertrand Meyer. For a limited time free here:
https://bertrandmeyer.com/OOSC2/
The standard work on #DesignByContract #DbC
OOSC2 - Bertrand Meyer's technology+ blog

A full online version of Object-Oriented Software Construction, 2nd edition (1997)     To read the second edition, you will find the full PDF (11 MB) here. The second edition of Object-Oriented Software Construction was published in 1997, considerably augmented from the 1988 first edition. For more about the book, see the Wikipedia entry about …

Bertrand Meyer's technology+ blog
#DesignByContract literally saved my butt during my final PhD phase. Simulation results (for a waveguide) were not as expected for our novel method. I was pretty sure my code was correct because of #DbC. Dug deeper and found a relatively obscure theorem on integral representations I needed to apply. Applied the new math, and presto. Without confidence in my code, I would have probably abandoned the method and possibly the whole project.

If you're serious about #objectOriented programming, try to use #DesignByContract to the fullest extent your language supports it. Your future debugging self will thank you. At the very least, liberally use #assertions throughout your code to state what should be true at any given point in your code.

https://en.wikipedia.org/wiki/Design_by_contract

#dbc #SoftwareEngineering

Design by contract - Wikipedia

@xphentom Well, for one, you're missing regression tests. But more importantly, all of these, especially integration and unit tests will be greatly enhanced using #DesignByContract

https://en.wikipedia.org/wiki/Design_by_contract

#SoftwareEngineering #DesignByContract

Design by contract - Wikipedia

@DeveloperMemes
Turn to #eiffel. No #curlybraces or indentation. Just do end. Or if then else end. Or from until (variant invariant) loop end. Plus you gain #DesignByContract in the best ad purest breed 😜