-
Rule of least surprise
Rule of Least Surprise says: anything ( some it system in our case) should behave in the way that causes the least surprise to people, users, us. We all love suprises we feel good about… not the biggest fans abotu those bad or negative experiences. Surprise creates confusion, bugs, and lost trust. Prefer predictability over cleverness. Think about it… when you call a function, you expect it to do what it says, not sneak in extra behavior. Silent mutations are a classic trap. Side effects are unknown to the user. Trust me, the user will NOT FIGURE IT OUT. Passing an object and having it changed behind your back. Magic…
-
Another clean code bullet points to remember
Some thoughts after reading a lot of stuff lately and working on totally diferent things. It is just another clean code bullet points compilation to remember or recall every know and then. I know that nobody is capable to remember about all of it all the time. God knows it cannot implemented anyways. I love how people dance cause inventing 3 layers of abstraction to avoid simplicity 🙂 Let us remember the most noble truth of them all… Common sense… Like a brain, remember to use it.
-
How to test Vue JS teleport and portal component
We all had this teleport issue where vue js component just renders beyond the DOM in the shadow realm and we ned to look for it all around. May or may not have an id that is more or less random. Very problematic. This is a short pos on how to use the options to test vue js teleport and portal features. How test teleport in vue js ? Example code below to enable testing What stubbing of teleport does ? This works rather for integration test when we need to check components made from other components. Otherwise we can just run unit tests but we still need to check…
-
Why bother with Vue composables – 6 reasons to do
Why bother with Vue composables ? So it will make our lifes easier, more straightforward coding and simplified testing to say the least. Composables in Vue.js are functions that encapsulate business logic and allow it to be reused across different components. Your regular dependency inversion, composition or what ever You want to call it. Designed to make it all simple and pleasurable. Why Use Composables? Reusability Composables encapsulate logic that can be reused in multiple components. One ring to rule them all. One place to change them and in a component bind them. Something like pinia store. For example, if geospatial filtering logic is needed in more than one place,…
-
MarkItDown: convert 20+ file types to markdown for AI & LLM Ingestion
MarkItDown can convert different file types into AI / LLmeme friendly markdowns. Tool by Microsoft (microslop? to be less sloppy ? 😉 ). Library provides multiple converters for various files like PDFs, Word docs, spreadsheets, presentations and so on into a clean Markdown format. Aim is to make messy documents readable and structured so the input provided will be of higher quality. MarkItDown is a LLM powered library Traditional converters often fail on complex or scanned documents due to rigid rules and have problems handling edge cases that, simply, weren`t taken into consideration. MarkItDown uses machine learning for semantic parsing (hallucinations ? ) therefore achieving higher accuracy (that is of…
-
Typescript perfect sync – 3 tricks to keep it tight
Typescript perfect sync can be kept using couple of strategies. Most of us start with simple union types, like this: const ScenarioStatus = 'success' | 'fail' | 'error' | 'other'; So far so good. That works great… until you need to iterate over those values for rendering, validation, or other logic. And now You are stuck with two separate definitions: one array for logic, and one string union for the type. Sooner or later, they’ll fall out of sync and provide headaches to people. You could go for en enum…. Below behold the three TypeScript tricks to make your code tight, hard to break, cleaner, safer, DRYer and resistant to…
-
Statics VS AI code analysis ~13 tools
Statics VS AI code analysis works best using the pros from both words. Go hybrid ! Static tools understand the syntext, hardcoded parameters and are very strict. On the other hand AI understands context, can figure out business logic, adapt the codebase. Logic flaws or performance bottlenecks rule-based scanners might miss, AI will put more effort into that. Static analysis limits Static tools scan for syntax errors, style violations, and basic security patterns using fixed rules. Always consistenst, very fast but might generate false positives, ignore business logic, and require manual rule overrides. How often did You use @typescript-error 🙂 Do You code for the linter to pass, logic to…
-
Law of Demeter in programming
Law of Demeter in programming You could in short paraphrase as “Don’t talk to strangers!” or “Keep Your hands in your pockets”. A class needing data from a deep chain of objects like – user.getAddress().getStreet().getNumber().It is visible very often in OOP, less in functional approachess ! The Law of Demeter states that method only knows its closest dependencies: itself, passed parameters, created objects, and own fields. Should not be used with dot chains ( they were so fancy when we started Java 8 back in the day). What to Remember? Where Law of Demeter comes from ? Why Demeter ? The Law of Demeter in progamming takes its name from…
-
How to delete code – the story of interface
How to Delete Code: The Interface Story How to delete code, safely of course, is usually a major problem. Difficult and You always second guess every decision because You don’t know what You don’t know. It is not just hitting the “delete” button. You need to make a smart decision and second guess your solution. How to remove unnecessary code with a focus ? Refactor the code, use interfaces and then test it twice remembering about user experience. TL; DR 😉 Define one interface. Create two implementations – legacy, modern and any other. Unify! Use it in already existing services or create such services by refactoring code. Switch between them…
-
First make it work then make it better
First make it work then make it better can sound pretty straight forward and fun. You get to fast prototype something that just “works”. Glue together some pieces and see the rapid progress towards Your goal. Sounds awesome and full and dopamine. In any kind of creative endevour a common trap is waiting for perfect results before launching anything. “First make it work then make it better” isn’t just practical advice, it’s achange in mindset that leads to real results and progress. Whether you’re an entrepreneur, developer or just a creative person. Showing up everyday, consistently, even for a bit, beats talent. If You have trouble with that read about…

























