Programming Practices are the commonly or not so commonly used practices in development of software. These can include things like Agile Development, Kanban, Coding shortcuts, etc.
1
vote
5answers
160 views
Is it a good practice to write a method that gets something and checks the value? [duplicate]
Occassinally I have to write methods like this:
string GetReportOutputDirectoryAndMakeSureExist()
{
string path = Path.Combine ( ... ) //whatever logic
if(!Directory.Exists(path)) ...
1
vote
1answer
106 views
How do you sell the use of third-party libraries to your organisations? [closed]
I've never really had a problem integrating popular third-party libraries into my projects at work until quite recently.
I was moved onto a project team who had historically written code for embedded ...
-3
votes
0answers
55 views
Programming related sites/blogs to follow [duplicate]
Thought this question was conceptual/pre-implementation enough for Programmers Exchange.
What Programming/er related sites / blogs / newsletters / forums do you regularly follow?
For example...
...
0
votes
1answer
93 views
ViewController in programming
ViewController is a term for classes that handle views in a framework. This is especially used in MVC frameworks. I go through various projects, written by various programmers, who implement MVC in ...
-2
votes
0answers
115 views
How do you avoid careless mistakes when programming? [closed]
As a programmer, how do you avoid careless mistakes in your code?
I'm aware and have been practicing Unit Testing, Continuous Integration, Clean Code, Simple Design, Refactoring, Peer Code Review ...
3
votes
3answers
178 views
Programming task organization
My friend and I decided to create a large programming project together. Before that, I have never worked in a pair (I had quite many projects on my own and at work the boss defined the task for me). ...
-5
votes
0answers
58 views
Replacement for Hello World [closed]
If it was not "Hello World" what would have been the string that introduced everyone to Programming..
Graham Bell said "Hello", what would a programmer have said.. lets say D.Ritchie. what would have ...
-1
votes
1answer
44 views
Using third party/ open source controls [closed]
I usually feel reluctant to use any third party or open source controls while coding in Objective-C iPhone due to following reasons.
Open source controls are developed in incremental manner. So once ...
1
vote
4answers
362 views
Creating a coding standards document
I work in a control systems company, where the primary work is SCADA and PLC, along with other control systems stuff.
Softwre development is not really something the company does, apart from little ...
1
vote
5answers
319 views
How to maintain a steady pace at development? [duplicate]
This is something that happens to almost every project I am involved in as a developer. At first when I am presented with the problem I am very motivated to find a solution for it. And I develop on a ...
1
vote
2answers
172 views
Are error codes wrong in SQL queries too?
I have an SQL query which does several things at once¹: it does multiple checks and then, if the checks pass, updates some data. Without entering in the domain-specific details, here's an imaginary ...
1
vote
2answers
133 views
How to fix quickly, dummy errors? [duplicate]
The problem is that I am not that experienced programmer and I am doing silly mistakes on coding. But the even bigger problem is that I may spend unexpectably much time to find them.
Lets say I ...
0
votes
1answer
109 views
C# Object reference not set to an instance of an object [closed]
I'm making a simple Contact Manager as a practice project based on a XML file everything is working just fine except for two problems
Every time I click on the white blank space on ListBox, I get ...
3
votes
3answers
255 views
Working alone on a project
So I am working on a small Project at my company, I am a mere trainee engineer (halfway through a Software Engineering degree), where we are developing an intranet - based project management and ...
7
votes
5answers
379 views
Will I learn more from changing other people's code?
I am currently trying to break through the intermediate coder stage to advanced and needless to say it's been tough.
I have been working through several books with example code. I have felt lately ...
3
votes
4answers
250 views
Is it a good practice to create a ClassCollection of another Class?
Lets says I have a Carclass:
public class Car
{
public string Engine { get; set; }
public string Seat { get; set; }
public string Tires { get; set; }
}
Lets say we're making a system ...
7
votes
9answers
2k views
Why do we need “callback functions”?
I am reading the book programming in Lua. It said that
Closures provide a valuable tool in many contexts. As we have seen, they are
useful as arguments to higher-order functions such as sort. ...
-2
votes
0answers
61 views
This code doesnot follow OCP, then what's the right way to make it follow OCP?
W.r.t : http://www.codeproject.com/Articles/36872/Is-Code-Complete
What's the right way to write the following code so that it follows OCP :
/// DrawImages function violates OCP principle.
/// ...
1
vote
10answers
1k views
Is it possible to reach absolute zero bug state for large scale software? [closed]
I am talking about 20-30+ millions lines of code, software at the scale and complexity of Autodesk Maya for example.
If you freeze the development as long as it needs to be, can you actually fix all ...
4
votes
2answers
289 views
Is there a name for being able to quickly find the relevant code?
I notice that a property of codebases that I like hacking on is that it's quick to find the relevant code for some feature, without knowing much about the code base at all. For example, searching for ...
3
votes
4answers
388 views
How to encapsulate 'global' variables in C#? /best practice
In C# what is the best practice for encapsulating variables I need to use in multiple methods? Is it OK to simply declare them at the top of my class above the two methods?
Also if I am using app ...
1
vote
1answer
147 views
Which practice is the best for database connection? (PHP, etc)
Leave a open database connection throughout the execution of the aplication, or for each time a operation will be executed a new connection will be created?
Open throughout the execution:
Open ...
2
votes
3answers
160 views
Implicit optimization versus explicit optimization
To explain what I mean, let me start with an example.
Consider a deque that supports O(logn) concatenation with another deque and O(n) addition of n elements at one end. This dequeimplements a ...
0
votes
1answer
134 views
Coping with test code becoming too complex [duplicate]
Our test automation team writes tons of automation tests for our WEB application, but it seems to me that their code is becoming way too complex and warrants that someone will test it as well.
Is ...
2
votes
2answers
60 views
Deleting Lookup Item
I was wonder what people do in this situation.
You have an admin area of a system where you let users define a list of values they want to see in a dropdowns across the system.
What do you do in ...
2
votes
3answers
533 views
How can I get over programming laziness? [closed]
I'm having this problem a lot more lately in the past year. I'm still relatively new to programming, and I try my best to actively learn new things, or to program in my spare time, but I can't.
No ...
1
vote
2answers
270 views
Why should I use List<T> over IEnumerable<T>?
In my ASP.net MVC4 web application I use IEnumerables, trying to follow the mantra to program to the interface, not the implementation.
Return IEnumerable(Of Student)
vs
Return New List(Of ...
5
votes
2answers
253 views
Cyclomatic Complexity Ranges
What are the categories of cyclomatic complexity? For example:
1-5: easy to maintain
6-10: difficult
11-15: very difficult
20+: approaching impossible
For years now, I've gone with the assumption ...
2
votes
1answer
117 views
Approaches to reduce cyclomatic complexity
I was running our code through JSHint, and decided to switch checks against cyclomatic complexity, and then went on long refactoring sprint. One place though baffled me, here is a code snippet:
var ...
2
votes
2answers
122 views
When to (enforce) linting in a software project
I'm heading a new team of developers working on a software project that makes use of continuous integration (circleci) w/ a pretty fleshed out suite of busterjs unit/integration/acceptance tests. Our ...
4
votes
2answers
566 views
Is it a bad habit to (over)use reflection?
Is it a good practice to use reflection if greatly reduces the quantity of boilerplate code?
Basically there is a trade-off between performance and maybe readability on one side and ...
3
votes
1answer
187 views
How do the Application and Database Interface Layers interact at their boundary?
I was watching one of Uncle Bob's videos and he brought up the Database Interface Layer. He had this diagram showing it:
These arrows show that the DB Interface Layer is aware of and calls the ...
0
votes
1answer
123 views
How to begin with web development in PHP [duplicate]
As I am the New Learner in the PHP Web Development and I want to become a good web developer who can at least make a good and dynamic web site quickly.
Currently I have learnt the following things:
...
14
votes
4answers
530 views
Is the “Gets or sets ..” necessary in XML documentation of properties?
I am looking for a recommendation of a best practice for XML comments in C#. When you create a property, it seems like that the expected XML documentation has the following form:
/// <summary>
...
2
votes
5answers
318 views
Is it bad to reuse other programmer's code libraries that can perform generic tasks? [duplicate]
Reusing large amount of helpful codes made by other programmers is very tempting for me. I specifically refer to codes that can perform generic tasks, such as Data Access Layer (DAL) codes.
I am ...
4
votes
2answers
266 views
How to effectively put code live
What are the general strategies to employ when attempting to ensure that a module of code will function correctly on the live system? A common problem we have at our software house is that we ...
2
votes
2answers
296 views
Programming methodology - best way to level up? [closed]
Ok, so I'm at a point where I think I have my basics down. I'd like to think I'm just starting to become an intermediate dev. So, how do I level up here?
It feels like I have reached my threshold, ...
1
vote
2answers
221 views
Choosing between words with different spellings for function names
A question has been bothering me for a while: when developing international projects, it is common sense to use English as the reference language since it is the language that the most people ...
5
votes
3answers
467 views
Might starting variables/members with an underscore puzzle the compiler?
I've been taught since high school that defining variables like this:
int _a;
or
int __a;
should be consider bad practice because this would eventually puzzle compilers that use variables starting ...
1
vote
2answers
93 views
Wrapping specific checked exception in domain unchecked ones? [duplicate]
Uncle Bob says in Clean Code book that Unchecked Exceptions should be used. Now JDK has some checked exceptions: IOException, IllegalAccessException etc. which cannot be avoided.
In my application ...
40
votes
10answers
2k views
Is it a good idea to schedule regular time to clean up code? [closed]
I'm managing a small team of developers. Every so often we decide we're going to spend a day or two to clean up our code.
Would it be a good idea to schedule regular time, say 1 week every 2 months, ...
3
votes
2answers
239 views
What is the difference between a principle and a best practice?
I recently read http://simpleprogrammer.com/2013/02/17/principles-are-timeless-best-practices-are-fads/ and it resonated with me. I find the more experienced programmers/architects go against current ...
1
vote
0answers
105 views
Educating Teams - Software Craftsmanship and Best Practices [closed]
I'm part of a team that's responsible for trying to spread better coding practices to other teams. These ideas are things like software craftsmanship, professionalism, learning new technology, ...
0
votes
1answer
1k views
Why are Wordpress sites so easily hacked? [closed]
I have found that hacker can easily hack wordpress site.
I have found this posts related to wordpress site hacking.
1) http://wordpress.org/support/topic/website-hacked-3
2) ...
2
votes
2answers
303 views
What is Delegation and why is it important in iOS programming?
At the moment I am teaching myself iOS programming, and one concept I find really hard to wrap my head around is delegation. What is it? Why and how is it used? What is the advantage? The technical ...
4
votes
4answers
263 views
In which order should I do comparisons? [duplicate]
I'm a strong proponent of writing if statements like this:
variable == constant
Because to me it just makes sense, it is more readable than the inverted:
constant == variable
Which seems to be ...
-2
votes
1answer
126 views
What is the best practice for method parameter validation in a library?
I develop a game library in javascript, containing many classes. I hesitate on the behavior that I should follow concerning method parameter validation:
Should I check the validity of parameters ...
5
votes
1answer
146 views
What recent studies point to the possible improvement a programmer can make as a result of personal character traits?
In Chapter 33, Personal Character of Code Complete (Second ed.) McConnell cites some studies such as those listed below in support of the assertion that 10-1 improvement is possible from efforts in ...
-2
votes
1answer
39 views
Methodology for software facing internet connections? [closed]
Is there a known methodology stronger than TDD to prevent accepting invalid input and performing undesired behaviour for software that is going to be open to the internet at large (e.g., HTTP ...
0
votes
0answers
112 views
Facing “crunch time” for work project, need advice [closed]
So the discussion came up from management that we need product development to "accelerate" Some of us have done ridiculous crunches and so we know about diminished returns.
Fortunately management is ...






