-
GraphQL approach to APIs
GraphQL is a query language and runtime for APIs that has transformed the way developers approach data retrieval and manipulation. Developed by Facebook in 2012 and open-sourced in 2015, GraphQL offers a more efficient and flexible alternative to traditional REST APIs. Its core principle is to allow clients to request precisely the data they need, no more and no less, which significantly reduces over-fetching and under-fetching of information. GraphQL provides a single endpoint where clients can send complex queries to fetch data from multiple sources in a single API call. One of its key strengths lies in its use of a strongly-typed schema that defines the structure of available data,…
-
AppSync in AWS cloud. Pros, cons and key considerations
AppSync in AWS cloud is a managed service that simplifies application development by providing a flexible API to securely access and combine data from various AWS (not only) sources. As businesses increasingly adopt cloud-based solutions, understanding the advantages and drawbacks of using AppSync in the AWS ecosystem can be helpfull. Follow up at GraphQL post. Pros and Cons of Using AppSync in AWS Cloud Pros Cons Realtime updates and synchronization Steep learning curve for developers new to AWS Built-in security features Potentially higher costs compared to alternatives Automatic scalability Limited plugins and ready-made solutions Integration with other AWS services Single-region solution (requires additional components for multi-region) Offline support Less control…
-
How to write code – part 1
How to write code ? Writing Code for Future Comprehension. How to write code In the „fast-paced” world of software development is a very tricky question… The ability to „write code so in one year you or anyone else will be able to easily understand what it is about” can be a crucial skill. This practice not only enhances the longevity of your projects but also significantly improves team collaboration and code maintenance. Gives a lot less headaches also. Let’s explore why this approach is essential and how you can implement it in your coding practices. As always.. take a grain of salt with a dose of common sense… The…
-
How to judge code – part I
How to judge code is a tricky question. With all the clean code rules, KISS, DRY, YAGNI, SOLDI and so on and so forth one can go crazy and question ones sanity in the end. What i wanted to throw out there is to judge the code be a very simple rule the encompasses multiple different one, is not straightforward and is very flexible. How to judge code ? Judge the code by how easy it is to debug We all know that one person at a company that knows all the quirks and secret sauce of a language, pipes, default interfaces and so on…. that person also knows the…
-
Literate programming by Donald Knuth
Literate programming is a programming style introduced by Donald Knuth in 1984. The focus is on explaining the logic and reasoning behind a computer program (comments) to human readers, rather than just providing instructions for the computer ( plain source code ). The key ideas are: Definition Literate programming is a programming paradigm where a computer program is explained in natural language interspersed with snippets of macros and traditional source code. Purpose Used for reproducible research and open access in scientific computing and data science. Approach Literate programming by Donald Knuth Gives programmers templates to develop programs in the order demanded by the logic and flow of their thoughts. Moving…
-
Informed captain decision making in team
Informed captain decision making in team is another idea, from netlifx, to make everything in a company better, decentralized and so on and so forth. Fater, better harder stronger 😉 The generic idea is about „empowering teams and individuals” but here are the key points about this concept. Short story : Informed captain listens to everyone than is trusted to take the best decision to move forward. Informed Captain Responsibilities The captain owns the team’s mission, mandate, and metrics, and has full decision-making authority within their scope. Decision-Making Process Decisions are not made by consensus or committee votes. The captain has the final say after considering different viewpoints. Kinda like…
-
Computed vs ref properties in Vue
Computed vs ref properties in Vue are used to manage reactive data. There are very similar but they serve different purposes and have distinct characteristics. Here’s a detailed comparison of computed and ref. Ref To obtain a reference using Composition API, You need to provide a ref attribute with a name that matches the template ref attribute’s value: <template> <input ref=”input” /> </template>. You will be able to use the methods of the component directly in the script part of the code. Computed In-template expressions / references are very convenient, but they are meant for simple operations. Front should usually READ data, backend should do computing. Too much logic in…
-
Vitest not rendering vue component
Vitest not rendering vue component might be many, hugely depends on the config but what i discovered is that…. You have to UNMOUNT the component at the end of the test. Otherwise mounting it again in the next test will just not render it, like it uses some old obsolete version of the object. Best part is that the pinia store is changing as it should. The component is not rendering the html. Code example First test will always pass, second one will pass when running it alone, solo. When running both the second one will fail due to bad managment of components. I would imagine that mounting will always…
-
Typescript default parameters in constructor for GA
Typescript default parameters are the same as in scala. While working on multple google analytics projects it is good to now we can hardcode part of the object and then just use the simple, single object in a constructor, without having to pass the default values. However !! Typescript default parameters should be the last on the parameter list in constructor That said the not optional, required and demanded parameters need to be first. Otherwise intellij or what ever other ide You use might complain and will NOT TELL YOU THAT. I love that small little things You assume would be obvious but then You spend a lot of time…
-
Script setup Vue 3 – ❮Script lang=”ts” setup❯
Script setup <Script lang=”ts” setup> is something i really appreciate after migrating from vue 2. It is a part of the new Script Setup feature introduced in Vue 3. It replaces the traditional <script> block and provides a more concise and focused way to write components. The purpose of <script setup> is to simplify component code by removing unnecessary boilerplate and reducing redundancy. What Does It Do? The code inside <script setup> is compiled as the content of the component’s setup() function. You can remember it from vue 2 for both, composition and options api.Unlike the normal <script> block, which executed only once when the component is first imported, code…