Staying up-to-date is essential in the programming world as new technologies / methods etc.. are so quick to arrive (and depart). So how much time do you spend doing this? Does your employer allow you to do this on their time? Or do they expect that as a professional it is up to you to keep your skills up?
On a related subject, how much...
Do you know a tool that automatically refactors a method with a single loop into a recursive method, preferably in Java?
This is for teaching purposes.
...
What successful conversion/rewrite have you done of software you were involved with? What where the languages and framework involved in the process? How large was the software in question? Finally what is the top one or two thing you learned from being involved with the process.
This is related to this question
...
What conversion/rewrite have you been involved with that failed? What where the languages and framework involved in the process? How large was the software in question? Finally what is the top one or two thing you learned from being involved with the process.
This is related to this question.
...
I have a source code of about 500 files in about 10 directories. I need to refactor the directory structure - this includes changing the directory hierarchy or renaming some directories.
I am using svn version control. There are two ways to refactor: one preserving svn history (using svn move command) and the other without preserving. ...
I have a semi big Java application. It's written quite poorly and I suspect there are quite a lot of simple things I can do that will clean things up a bit and improve performance.
For example I recently found the
String.matches(regex)
function used quite a lot in loops with the same regex. So I've replaced that with precompiled Patt...
I am trying to read a lot of c/perl code through vim which contain many single letter variable names.
It would be nice to have some command which could help me change the name of a variable to something more meaningful while I'm in the process of reading the code so that I could read the rest of it faster.
Is there some command in vim...
I would like to hear opinions on small amounts of code replication within methods that
check for the same condition
e.g.
While(condition){
...... do x
}
Normally if there was any of this kind of replication I would refactor the code as it can make versioning a nightmare, what if the condition changes for example you have to change e...
I have recently joined a project that is usiing multiple different projects. A lot of these projects are depending on each other, using JAR files of the other project included in a library, so anytime you change one project, you have to then know which other projest use it and update them too. I would like to make this much easier, and w...
Its prudent to break a long function into a chief function and helper functions.
I know that the outside the module only chief function will be called, but its long length may prove to be intimidating.
Textbooks put a limit on the number of lines, but I feel that this is too rigid.
P.S. I am programming in Python and need to process i...
I often find that the headers section of a file get larger and larger all the time but it never gets smaller. Throughout the life of a source file classes may have moved and been refactored and it's very possible that there are quite a few #includes that don't need to be there and anymore. Leaving them there only prolong the compile time...
I have a v-large number of hierarchical structures (or DTO's) that are shared across different business logic, application tiers, web service and WCF contracts. I want to refactor all of my code to split the structures into discreet business domain areas.
Two questions:
Are there any tools that can help me do this (given that I want c...
Say you have a program that currently functions the way it is supposed to. The application has very poor code behind it, eats up a lot of memory, is unscalable and would take major rewriting to implement any changes in functionality.
At what point does refactoring become less logical then a total rebuild?
...
I built this class to work with PDO, to make SQL queries 'easier' and less to worry about.
Here are my thoughts
Should it be more like class DB extends PDO?
Is the query method too big? Should it be split into private methods which are called.. is this what is known as loose coupling?
Is my way for detecting a SELECT query too ugly f...
How do YOU factor your Domain (namespaces), in Domain Driven Design?
I have been moving to the following concept:
Project.Entity
Project.Entity.Abstracts
Project.Entity.Entities
Project.Entity.Extensions
Project.Entity.Immutables
Project.Entity.Interfaces
Project.Entity.Repositories
For example, I have an entity in a CMS ...
I have this code:
public IEnumerable<int> Iterator {
get { if (false) yield return -1; }
}
It is fairly ugly, but when you try to refactor it to:
public IEnumerable<int> Iterator {
get { return null; }
}
The following code breaks:
foreach (var item in obj.Iterator) {
}
How would you go about cl...
Let's say we have a web app out there that is supposed to have a user fill out a form, and then it creates a ticket in the backend workflow engine. This form is going to continue to be the portal for the customer to view what's going on. Some forms go straight to ticket creation; others have to get approved by someone else before generat...
I've got a method which currently takes an IList as a parameter, where UserBO is similar to the following:
public class UserBO {
public string Username { get; set; }
public string Password { get; set; }
public string Pin { get; set; }
}
public class SomeClass {
// An example method giving the basic idea of what I need t...
Please help me to refactore this Javascript code.
There is big form for scheduled message sending(send date, reccurence type, end by date/qauntity, credits system - need to count total cost of scheduled sending plan in runtime).
I'm writing Javascript validator for this form.
There is an validation algorithm
1) check if send date time i...
Please help me to implement Factory design pattern for the task.
I working on scheduled message sending web application.
User can specify his own scheduled sending plan, and messages will be delivered when it have to.
User can choose only one of 3 reccuring types: monthly, weekly, daily.
For this 3 reccuring types algorithm is similar:
...