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.

learn more… | top users | synonyms

1
vote
2answers
413 views

How can I work on multiple programming languages at same time [duplicate]

It always happen to me that if I leave the stuff for 1-2 months I forget the stuff. 5 months back I had symfony project and I did that. At that time I was very much confident that I can do any ...
-6
votes
2answers
447 views

What are the benefits of being proficient in multiple programming languages? [duplicate]

I have a friend who refuses to learn any other language than Perl. How do I convince him that he can not go through his entire life with only 1 language? What are some arguments to open his mind up to ...
3
votes
5answers
245 views

Premature optimization in deciding how to optimize?

We have a class that has been properly identified for optimization. We've done the profiling and testing, and it's a problem. Now we have two possible approaches for optimizing this class: There is ...
1
vote
2answers
248 views

How your team manage shared password/key [duplicate]

It maybe a shared SSH private key, it maybe be a online password to some web site. In term of security & convenient, and support fine grained permission settings, e.g. developers role, testers ...
2
votes
3answers
291 views

Good Practice : Storing variables and classes names in database for direct call

I would like to know if this is a good practice to store variables and classes names in database to use let users accessing them. For instance users may create entries in database's table in which ...
26
votes
15answers
2k views

Does heavy library and code snippet usage make you a bad programmer?

Overall I'm in programming for about 8 years now and it seems to me that I'm relying more and more on open source libraries and snippets (damn you GitHub!) to "get the job done". I know that in time I ...
3
votes
5answers
596 views

Does relying on intellisense and documentation a lot while coding makes you a bad programmer? [duplicate]

Is a programmer required to learn and memorize all syntax, or is it ok to keep handy some documentation? Would it affect the way that managers look at coders? What are the downside of depending on ...
23
votes
3answers
980 views

Is it considered a bad practice to add logic in a property setter?

I jumped in to a project and I see that the other developers are adding a lot of logic in the setters of synthesized properties. I understand how this works, but I think that it makes it hard to ...
24
votes
10answers
12k views

How many lines per class is too many in Java? [closed]

In your experience, what is a useful rule of thumb for how many lines of code are too many for one class in Java? To be clear, I know that number of lines is not even close to the real standard to ...
8
votes
5answers
6k views

What are the pros and cons of HTML5, native and hybrid mobile app approaches?

I want to develop a mobile application .. I read lately an article on Telerik Forum : it compares among three types of mobile application and I don't know which one should I select to begin with .. ...
0
votes
4answers
209 views

Choosing between performance vs readable/cleaner code? [closed]

If you have to pay the price of performance to make code more readable would you prefer that or you would always prefer performance over it?
19
votes
3answers
2k views

Must I think about compiled machine code when I write my code?

For example I've got following code: auto z = [](int x) -> int { if (x > 0) { switch (x) { case 2: return 5; case 3: return 6; default: return 1; ...
6
votes
3answers
571 views

Must-have tools and practices for an agile start-up

I've been working in the software industry for a few years now. I've seen Waterfall in practice, and I've seen several projects attempt Agile with varying degrees of success... which got me thinking. ...
3
votes
5answers
307 views

Need thoughts on a course curriculum for an entry-level programmer [closed]

Would love to know your thoughts on a curriculum that will be developed for people that want to get started in the programming field. The goal of the course is to help it's students to ensure that ...
0
votes
2answers
534 views

High Schooler learning to program (Objective C) on my own — What are the essential things I need to learn? [closed]

About a year and a half ago I became interested in learning to program (specifically, iOS). Since my school currently lacks computer science classes (well next year they say they might have one using ...
5
votes
5answers
2k views

Trailing forward slash in directory names - good programming practice?

I want to ask the user of my bash script to pass a directory path as argument. Which one of the following is a good programming practice - to require that the user enter a trailing / (forward slash) ...
1
vote
1answer
249 views

Is the “jQuery programming style” a kind of Reactive programming?

jQuery is a Javascript library and framework, but when we are programming with jQuery into DOM problems/solutions, we can practice a style quite different of programming... We can read about jQuery ...
5
votes
2answers
641 views

Is sticking to one language on a particular project a good practice?

I'm developing a pipeline for processing text that will go into production. The question I keep asking myself is: should I stick to one language for the project when I'm looking for a tool to do a ...
-1
votes
3answers
170 views

programming practices starting [closed]

I have taken my major as computer science and Engineering and I am really confused at this moment. My first course was about learning C and C++ and I learned the basics of those. Now I am really ...
65
votes
13answers
12k views

Why do most of us use 'i' as a loop counter variable?

Has anyone thought about why so many of us repeat this same pattern using the same variable names? for (int i = 0; i < foo; i++) { // ... } It seems most code I've ever looked at uses i, j, ...
35
votes
4answers
2k views

Can too much abstraction be bad?

As programmers I feel that our goal is to provide good abstractions on the given domain model and business logic. But where should this abstraction stop? How to make the trade-off between abstraction ...
0
votes
4answers
137 views

Naming: objectAction or actionObject?

The question, Stored procedure Naming conventions?, and Joel's excellent Making Wrong Code Look Wrong article come closest to addressing my question, but I'm looking for a more general set of criteria ...
3
votes
5answers
643 views

Am I doing wrong in my programming learning journey? [closed]

Well, I always liked programming, but I've never been committed or tied to any real project. I learned some autoit, some c#, some html and css. Now I've been hired as apprentice as programmer by an IT ...
4
votes
2answers
337 views

Writing Large Portions Of Code Then Debugging?

Lately I have been writing a game engine, and I have been writing a lot of "foundation stuff" (standard interfaces, modules, a message system ect.), but I have noticed a pattern, a lot of the stuff is ...
1
vote
1answer
289 views

Make a flowchart to demonstrate closure behavior

I saw below test question the other day in which the authors used a flowchart to represent the logic of loops, and I got to thinking it would be interesting to do this with some more complex logic. ...
5
votes
8answers
755 views

Why is (position < size) such a prevalent pattern in conditionals?

In a condition statement (IF) everyone use (position < size), but why? Only convention or there is a good reason for that? Example: if (pos < array.lengh) { // do some with array[pos]; } ...
18
votes
5answers
1k views

How to overcome programming by coincidence?

In the book The Pragmatic Programmer, the writers mention the programming by coincidence concept. It explains what it is, why it is caused, what are the dangers you may encounter and it compares with ...
2
votes
3answers
161 views

Do I go by ID or by Label while programming?

Suppose I have a table "Progress" with two columns. One column is ID which is identity. Another column is Progress_Label ID Progress_Label 1 Submitted 2 Approved by user 3 ...
6
votes
4answers
232 views

What should I include in my repositiory from IDE projects

I want to add a project which in this case is created in Netbeans but this question is general for most IDE's. It's simply, what should I include in my repository. For example Netbeans creates a ...
2
votes
5answers
889 views

Effective way to gain practical knowledge

I am currently nearing the end of my first year of my CS degree and have been disappointed with the lack of coding I have been asked to do (one unit). I am basically looking for an effective way to ...
3
votes
3answers
489 views

Guid collisions

I have a product that lets game developers create games. Inside of their games they are required to give all the elements of their games GUIDs. I've told them that they need to generate their guids ...
2
votes
1answer
269 views

Is this really necessary for solving this problem?

I came across the following article which presents the problem: A group of people walk into a restaurant and want to spend exactly $15.05 on appetizers. They also want them as fast as possible. ...
2
votes
1answer
113 views

When inheriting from a base class, should you retest constructor arguments?

Say I have something like this: public class BaseClass { public BaseClass(string someString) { if(someString == null) throw new ArgumentException(); } } public class ...
8
votes
7answers
691 views

How to write good code with new stuff? [closed]

I always try to write easily readable code that is well structured. I face a particular problem when I am messing around with something new. I keep changing the code, structure and so many other ...
19
votes
12answers
2k views

How to teach Exception Handling for New Programmers?

How do you go about teaching Exception Handling to Programmers. All other things are taught easily - Data Structures, ASP.NET, WinForms, WPF, WCF - you name it, everything can be taught easily. With ...
17
votes
3answers
2k views

Break on default case in switch

I am a bit puzzled on whenever or not to include break after the last case, often default. switch (type) { case 'product': // Do behavior break; default: // Do ...
6
votes
5answers
419 views

Why would a developer create a public class that has all static properties?

A previous developer has a couple public classes that do not inherit from any other classes but are filled with static properties. Is this another way of creating a struct or enum? Is this an older or ...
5
votes
5answers
1k views

Programming as fast as you can touch-type… How to get to that stage? [duplicate]

I took a test recently and found that I could touch type comfortably at around 100 wpm... and if given some sort of autocorrect/intellisense then that would be even faster (who knows maybe 150 ...
3
votes
3answers
894 views

articles in variable names and hard-coding strings

re-edited by author: no this is not 2 questions. This is one question about code review questions containing two separate points. Please do not edit my question. For naming variables, the two sides ...
1
vote
2answers
204 views

if i have many calls of single method that returns field value, is it better to make a local variable?

In a method, i have calls of single method of another object that returns field value, like foo.value(), which is defined like Field value() {return this.value;} Is it better to make a local variable, ...
2
votes
1answer
143 views

.c FIle Dedicated to Data

Is it completely unheard of to have a .c file dedicated to just data? In my case, I'd be using it for global variables that are shared across two other .c files. Here's specifically how I'm using it. ...
3
votes
3answers
907 views

When should I use or not BooleanUtils.isTrue(…) and BooleanUtils.isFalse(…)? [closed]

About this function: org.apache.commons.lang3.BooleanUtils.isFalse(Boolean bool) and the similar isTrue, my co-work (less experienced) use it for every boolean in the code. I am trying to convince him ...
2
votes
1answer
113 views

Testing MVC models when using SQL referential constraints

I have an MVC web app that's wired against PostgreSQL. The DB uses the full gamut of various referential constraints to ensure referential integrity, as opposed to say the Rails approach, where you ...
0
votes
2answers
78 views

Where should the processing to structured XML be done?

I have been given the task of redeveloping an "in house" solution to make it expandable and easier to maintain and administer. The original solution had been hashed together over time using PHP as ...
1
vote
2answers
196 views

Is it worthwhile to create a knowledge map for software?

Basically, the objective is to create a visual representation of the software specification document. This visual representation would capture various scenarios involved in the software. Benefits: ...
0
votes
2answers
89 views

Making subclass more type-specific with accessors

I have a super class: TriggerManager with a subclass TimedTriggerManager. NOTE: I'm working in java TimedTriggerManager only deals with TimedTrigger s, a subclass of Trigger. TriggerManager ...
3
votes
1answer
76 views

Should I write a wrapper within a manager object?

I have three classes that work together to do one function (from the perspective of the rest of my program). There is a little bit of set up between them, so, to make it easier for the rest of my ...
0
votes
2answers
158 views

Code formatting for variable declarations [closed]

Is it looked down upon or bad to write multiple variable declarations on the same line? As in: boolean playMoreGames = true; int length; boolean win; int ...
11
votes
8answers
978 views

Is writing software easier than reading and understanding it from scratch? [closed]

Me and a friend of mine were discussing yesterday about differences between writing a large C++ software and understanding it as a new recruit. Is it possible that since a software gets done one line ...
4
votes
2answers
214 views

How to delete an object when other things reference it (and not making the code full of inter-dependencies)

The situation: In my program, there are a list of cues. To call a cue at a certain time, there are objects called Triggers. Cues have many public methods that allow them, among other things, to be ...