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
4 years ago, I've built a webapp which is still used by some friends. the problem with that app, is that now it has a huge database, and it loads very slow. I know that is just my fault, mysql queries are mixted all over the places(even in the layout generation time).
ATM I know some about OO. I'll like to use this knowledge in my old app, but I don't know how to do it without rewriting all the from the beginning. Using MVC for my app, is very difficult at this moment.
If you were in my place, or if you will had the task to improve the speed of my old app, how you will do it? Do you have any tips for me? Any working scenarios?
It all depends on context. The best would be to change the entire application, introducing best practices and standards at once. But perhaps would be better to adopt an evolutionary approach:
1- Identify the major bottlenecks in the application using a profiling tool or load test.
2 - Estimate the effort required to refactoring each item.
3 - Identify the pages for which performance is more sensitive to the end user.
4 - Based on the information identified create a task list and set the priority of each item.
Attack one prolem at a time, making small increments. Always trying to spend 80% of your time solving the 20% more critical problems.
Hard to give specific advice without a specific question, but here are some general optimization/organization techniques:
Profile to find hot spots in your code
you mention mysql queries being slow to load, try to optimize them
possibly move data base access to stored procedures to help modularize your code
look for repeated code and try to move it to objects one piece at a time
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 6 years ago.
Improve this question
I'm working in company with a big system with a messy code structure. I want to work with the right standards like polymorphism and design patterns.
But the code is such a mess and needs to be heavily refactored to do that. Also my current company gives me tasks, and if I have would heavily refactor, that will open many bugs in the system as it's not unit tested, of course.
What do you think? Should I work on the tasks on this bad structure to finish the work? Or tell them that we need rebuild many things (also they won't find a difference as the features already work now).
I think you need to start off with some unit tests.
Whilst doing the tasks you have been assigned, you could write some tests to test the code you are about to change, then you can refactor it.
Now you can start to write the code for your task, test-first.
If the code that is already there works, then refactoring is the best option. If it doesn't work, then a rewrite becomes possible.
Well...you need to work on multiple aspects.
First, learn best practices to write clean code (if you haven't yet) and request your team members the same. There are many useful books and online resources available for the same.
Second, do not expect that the situation will change overnight. Adopt "Boy scout rule" - it will gradually improve the code quality.
Third, start building your corpus of unit tests. Slowly, testable code will emerge out of the sea of untestable monolith.
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 7 years ago.
Improve this question
I have 5 apps that I want to make right now, but creating them one by one seems inefficient. It seems like a better idea to make them all at approximately the same time in order to share segments of code where applicable. What are your thoughts on the most productive way to create a long list of moderately complex apps? For comparison, let's put them all on the difficulty level of a familiar & simple app - SnapChat.
Even though it sounds more efficient this sounds like a surefire way to either at best waste time or at worst (and most likely) get a lot of half written apps that never get to production. Unless this is a white label app where instead of 5 separate apps there is one app with 5 different skins you will likely never finish one of them let alone five. A 'simple app' like Snapchat still requires a lot of development time and testing, user adoption studies, and most of all focus of your effort.
Based on your question you have a good deal to learn about the development process. That is fine, you can do it, but focus on the best idea and put all your effort into that. It will take a lot more time and work than you expect and you will be happy you aren't worried about four other projects.
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 9 years ago.
Improve this question
Knowing all the advantages TDD offers. It is possible to apply strictly and all the time in all kind of projects (large projects)? Or is it nothing more than an exaggeration?
One has to consider both advantages and disadvantages, the main disadvantage being the time cost. You typically need to write 1 line of unit testing for every line of code. TDD makes no sense if your functionality is very likely to change a lot in the future, because you will have to rewrite all tests all the time. For example a case of an early prototype, where you mostly want to just test some idea rather than making a super stable application.
Another case is if you want to support the change in your application. Then TDD will give you benefits in the long term. Is it possible to apply strictly? Certainly it is possible, but not easy, as it is typical that business people try to reduce short-term costs and disallow using TDD fully. TDD creates short-term costs (writing the tests) in hope to reduce long-term costs (loosing quality due to sudden bugs or extensive manual tests).
Sometimes it is not possible to use TDD.
For example, when writing classes in c++ to display GUI components, it makes no sense to unit test everything. If using MVP design pattern, models in MVP trio should be unit tested, but not the views.
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 3 years ago.
Improve this question
Hi
When i wanna start a new project, I have enough details to just start it. And as all programmer needs, I need to analyse that project to understand how to write codes and classes and relations between them...
Normally, I do it on so many papers and its really annoying and also I can't consentrate so good (in huge projects).
I wanna know, what is the best way (or tool) to write implementation and designing steps to analyse, break down and follow project progress?
Thanks
I strongly recommend PowerDesigner from Sybase.
You can build requirements documents and link each requirement to classes. You can generate a physical data model straight from your class model. It supports a wide variety of RDBMS's. There's a 15 day fully functional trial at the link above.
If the project is huge, there's plenty of budget for this tool. It's a lifesaver. The ROI is self-evident.
i suggest VS 2008 > Class Designer, a handy tool, it writes clases behind class diagram and also has tools to help analyze archtecture.
This is incredibly easy. Use yellow sticky notes on a white board or large sheet of white cardboard.
Treat each sticky note as a seperate process. For decisions trun the sticky note so it looks like a diamond. This way you can move them around until it's right.
You can also split a complicated sticky not into two or three sticky notes. If you know that something needs to get done but don't know what that something is simply write "Process goes here ask (Marketing or Compliance)"
I've used this many, many times and it's very cost effective.
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 4 years ago.
Improve this question
As a project manager, you are required to organize time so that the project meets a deadline.
Is there some sort of equations to use for estimating how long the development will take?
let's say the database
time = sql storedprocedures * tables manipulated or something similar
Or are you just stuck having to get the experience to get adequate estimations?
As project manager you have to remember that the best you will ever we be able to do on your own is give your best guess as to how long a given project will take. How accurate you are. depends on your experience and the scope of the project.
The only way I know of to get a reasonably accurate estimate that is it to break the project into individual tasks and get the developer who will be doing the actual work to put an estimate on each task. You can then use an evidence based algorithm that takes the estimation accuracy of each developer into account to give you the probability of hitting a given deadline.
If the probability is too low, you have two choices: remove features or move the deadline.
Further reading:
http://www.joelonsoftware.com/items/2007/10/26.html
http://www.wordyard.com/2007/10/11/evidence-based-scheduling/
http://en.wikipedia.org/wiki/Monte_Carlo_method
There's no set formula out there that I've seen that would really work. Fogbugz has its monte carlo simulator which has somewhat of a concept for this, but really, experience is going to be your best point of reference. Every developer and every project will be different!
There will be such a formula as soon as computers can start generating all code themselves. Until then you are stuck with human developers who all have different levels of skill and development speed.