Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 10 months ago.
Improve this question
i've tried to watch many videos about redux saga and rtk query but still can't choose,so please can any body help me with that, like when better use saga and rtk query,and which one is the best now?
They are not even doing the same thing.
RTK Query is a single-purpose tool to manage api caching logic for you.
Redux Saga is an orchestration tool that allows you to do pretty much anything - but you have to write it yourself. And that might mean a lot of code to write.
So the base question is "do I need something to trigger an api" or "do I want to write code myself to do something". After that you get the question is Redux Saga is a good idea at all - and most of the time, it isn't. Redux Saga is a power tool with a lot of functionality - that also adds a lot of complexity. The recommendation from the Redux Style Guide is to use the most simple tool for every job: Use Redux Thunk for async logic. If you are one of the 10% apps that needs "reactive logic", use the RTK listener middleware (only for those things, stay with thunks for the simple stuff!). Only if you belong to those 1% of apps that needs something that is actually not possible with those two much more simple tools, use saga. And even then, mix it with thunks.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm new to Symfony and I was really surprised when I saw that very important parts of program logic are "hidden" in the annotations. Or actually in PHP comments. I understand, these annotations are used by the libraries, but is not it a bad solution overall - couldn't it be made differently? What is the logic behind that? From my prospective they make the code hard to understand, they are not processed by atom (or can I install some plugin for this?..), and it's overall strange idea. No?)
All That configuration can be stored in php/xml/yml files.
From my experience the idea of annotation is very convenient.
For example, you look at controller , and you see route (link to call controller action), data passed ( Parameter Converter).
If it is done right, you have all the important data in one place, just above your code.
Processing annotation by IDE it's a different story.
Check if there is any atom plugin for this , or change IDE that can handle this.
Personally, i'm using phpstrom , and i don't have any issue with annotations
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have a small project involving some simple financial time-series data with some real-time components on the front end. I was hoping to use the Firebase infrastructure since it offers a lot of things without having to set up much infrastructure, but upon investigating it doesn't seem to be a good choice for storing time series data.
Admittedly, I have more experience with relational databases so it's possible I am asking an extremely basic question. If I were to use Firestore to store time-series data, could someone provide an example of how one might structure it for efficient querying?
Am I better served using something like Postgres?
Probably best bet would be to use a time-series database. Looks like Warp 10 has already been mentioned (https://www.warp10.io).
The benefit of something like warp is the ability to query on the time component of your database. I believe firebase only has simple greater/lesser than queries available for time.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am using ASMX web services.
I have two functions so, should I create two functions in a single ASMX or should I create separate ASMX for each function?
Does that impact performance? Which choice will have the highest performance?
With all things performance you need to profile it before making changes to increase performance otherwise you could end up optimizing the wrong thing.
Most of the times the Pareto principle applies, a small portion of code or a few modules in the entire application are responsible for most of the execution time. Making optimizations there will have the greatest impact on performance.
Have you optimized everything that could be optimized and drawn the conclusion that the service endpoint can cause performance issues?
You should write the code how it's easier to maintain. Do those two functions belong together or are they completely unrelated? Does it make sense to have them exposed through one ASMX or two? That should be your criteria for how to define your endpoints.
My guess is that both choices will have similar performance but if you absolutely need to know build them both ways, profile them, and see which one performs better.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Currently I am doing a restructuring project mainly on the Oracle PL/SQL packages in our company. It involves working on many of the core packages of our company. We never had documentation for the back end work done so far and the intention of this project is to create a new set of APIs based on the current logic in a structured way along with avoiding all unwanted logic that currently exists in the system.
We are also making a new module currently for the main business of the organization that would work based on these newly created back-end APIs.
As I started of this project, I found out that most of the wrapper APIs had around more than 8000 lines of code. I managed to covert this code into many single APIs and invoked them from the wrapper API.
This activity in itself has been a time-consuming process but I was able to cut down the number of lines of code to just 900 in the wrapper API by calling independent APIs for each business functionality.
I would like to know from you experts if this mode of modularizing the code is good and worth the time invested in it as I am not sure if it would have many performance benefits.
But from a code readability perspective, this is definitely helping and now I am able to understand the 8000 lines of code much better after restructuring and I am sure the other developers in my organization too will understand.
Requesting you to let me know if I am doing the right thing and if its having its advantages apart from readability please do mention them. Sorry for the long explanation.
And is it okay having more than 1000 lines of code in a wrapper API.
Easy to debug
Easy to update
Easy to Modify/maintain
Less change proneness due to low coupling.
Increases reuse if the modules are made generic
Can identify unused code easily
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have been asked to design a website for a client as a "side job". I am trying to write up a statement of work for the project. In the past, I have done similar work, and often run into a situation where I believe the work is "done", but the client wants endless tweaks and changes. (As you know, websites are perpetually "under construction").
When you have requirements such as "Design a Home page, design a Contact Us page" how you define a page as "done"?
Don't put anything live, until they accept your work is complete. This should be enough of an incentive for them not to string you along, and allows them to have the quality website they require.
Ask the client to set up a requirements specification for version 1. When you met the requirements contained in this document is your job completed. Everything else belongs to the next version.
In the same situations, I tell my client "you want A, B, C and D. OK, sign here, and we are agreed that the end of application is A-D. Now if you wanted something more in future, it is not a part of our contract, so we'll deal with that in future and of course it has it's own price." This way you make them think before signing and lot's of things become clearer, and lots of needs show up suddenly, but in future they'll either pay more for more needs or won't talk any more :)