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

5
votes
5answers
3k views

How important is it to pick the best IDE for your programming language of choice?

As I learned some basic programming languages I came across tens of IDEs, and tens of compilers. Most people you ask will tell you "Go with that IDE or go with the best" etc, however they do not ...
8
votes
3answers
311 views

Is there a drawback in defining multiple small DRY classes, instead of bigger more repetitive classes? [duplicate]

I read some articles and it seems that using multiple classes in CSS is encouraged. I am curious to find out if there is a maximum number of classes an element can have before this multiple class ...
6
votes
2answers
310 views

Is there a certain number of lines of code to be followed /maintain?

I am developing a software system (Patient Administration System) and I have noticed it already had 451 lines of code(in one namespace). Is this bad? Or does the number of lines of code not matter ...
2
votes
2answers
219 views

Methods of ordering function definitions in code

When I work on some programming project (usually command line application in Python with many switches), I'm usually creating about 30 and more functions. Most of the functions are in one file (except ...
4
votes
3answers
1k views

Should a method do one thing and be good at it? [duplicate]

"Extract Till You Drop" is someting I've read in Uncle Bob's blog, meaning that a method should do one thing alone be good at it. What is that one thing? When should you stop extracting methods? ...
0
votes
4answers
528 views

How does using #define for loop and condition bounds in C increase security?

My program uses the following define statements: #define LOWEST_PATIENT_ID 10000 #define HIGHEST_PATIENT_ID 99999 #define LOWEST_CRITICAL_STATUS 1 #define HIGHEST_CRITICAL_STATUS 100 used in this ...
3
votes
5answers
556 views

What is considered best practice for printing usage / help (--help)?

When writing tools for the CLI of UNIX, how should I make the program print out help and/or usage? I usually use fprintf(stderr, "help text here");, but there are several issues with that. First, ...
10
votes
3answers
493 views

Programming *into* a language vs. writing C code in Ruby

Code Complete states that you should aways code into a language as opposed to code in it. By that, they mean Don't limit your programming thinking only to the concepts that are supported ...
9
votes
7answers
1k views

Checking if a method returns false: assign result to temporary variable, or put method invocation directly in conditional?

Is it a good practice to call a method that returns true or false values in an if statement? Something like this: private void VerifyAccount() { if (!ValidateCredentials(txtUser.Text, ...
74
votes
12answers
6k views

Does programming in general become easier to read, write and understand as you gain experience?

I'm a beginner in programming and I've been reading books, studying, reading articles, and whatnot. I'm getting great results since I've started learning programming, and when I was a beginner I used ...
27
votes
17answers
3k views

Is it a good practice to name the returned variable “result”? [closed]

Is it a good practice to call the variable a method returns with a variable name result? For instance: public Zorglub calculate() { Zorglub result = [...] [...] return result; } Or ...
122
votes
22answers
14k views

Why are shortcuts like x += y considered good practice?

I have no idea what these are actually called, but I see them all the time. The Python implementation is something like: x += 5 as a shorthand notation for x = x + 5. But why is this considered good ...
35
votes
14answers
6k views

Is programming or computer science in general, all about algorithms?

As a grad student, I find it more and more common for prestigious companies (like Google, Facebook, Microsoft,...) to put algorithm questions in their test and interviews. A few startups I applied to ...
27
votes
8answers
11k views

Private variable vs property?

When setting a value to a variable inside of a class most of the time we are presented with two options: private string myValue; public string MyValue { get { return myValue; } set { myValue = ...
21
votes
11answers
6k views

typedefs and #defines

We all have definitely used typedefs and #defines one time or the other. Today while working with them, I started pondering on a thing. Consider the below 2 situations to use int data type with ...
1
vote
5answers
157 views

Automatic sorting of class/module members and its possible impact on productivity and code quality

Recently I saw some possibilities of some IDEs (via plugins) to sort members of their classes/modules based on some criteria, sou you could have everything sorted automaticaly no matter where you ...
2
votes
3answers
544 views

Is it important/essential to learn software development methodologies for beginners?

I'm a student and I've been programming for not very long. Particularly, I'm learning CodeIgniter framework - The book I'm reading is "Professional CodeIgniter". In the book, the author mentioned ...
8
votes
7answers
709 views

As a programmer, what am I supposed to know like the back of my hand? [closed]

I am talking of stuff related to programming only and not system or network administration. I am about to finish college and get a programming job, so I am interested to know about this. Although ...
7
votes
5answers
8k views

How to handle large numbers?

Well, I've just started doing puzzles and it's so annoying to see puzzles which are easy to do but also need to handle very large numbers. That's the problem. Say I have to deal with numbers like 10 ...
2
votes
6answers
582 views

How to make code writing more accurate? [duplicate]

I am trying to practice writing code for a long period of time before compiling and write unit test (if possible) for what I wrote (the language is C++). Of course, I got the IDE support (Emacs or ...
-2
votes
1answer
2k views

Why is BASIC bad? [duplicate]

Possible Duplicate: Do you think that exposure to BASIC can mutilate your mind? BASIC, and related dialects, have long been branded "bad". I've seen it said by some of the best programmers ...
20
votes
10answers
2k views

Struggling as a programmer. Need some advice [closed]

I've been a developer now for a number of years. I'm pretty good at what I do and can "get the job done". But, there is a difference between "getting the job done" and "doing the job properly". Let's ...
55
votes
5answers
34k views

Two HTML elements with same id attribute: How bad is it really?

Just browsing the google maps source code. In their header, they have 2 divs with id="search" one contains the other, and also has jstrack="1" attribute. There is a form separating them like so: ...
34
votes
7answers
2k views

How to convert a copy/paste/spaghetti programmer to see the light?

This question was inspired by this one. While that other question was deemed localized, I believe the underlying problem is something that is extremely common in our industry. I know there are some ...
9
votes
2answers
707 views

What does a “bodyshop” (in context of a programming job /environment) mean

I've kept on coming across the term "bodyshop" in terms of a programming job/environment but despite googling I can't find out what exactly this is referring to? Can someone please enlighten me?
4
votes
3answers
543 views

Separating the UI from its event handlers and database queries

Is it a good practice to separate the handlers and database queries in different classes? There will be a separate class containing all the necessary event handlers, and there would also be another ...
2
votes
7answers
238 views

What's a good way to prepare for this course titled “Programming Language Security”?

I have a course with the following description: The purpose of this course is the study of programming language security features and languages designed to support it explicitly. Static and ...
0
votes
2answers
528 views

Session Variables and Proper Implementation

Is there any other reason for using session variables besides keeping the values longer than the current request? For instance, is it advisable to use session data when storing information in a file ...
3
votes
1answer
90 views

Linking a modular option to a program without creating a dependence

I would like to make my programs much less of a hassle to extend or create, I am imagining a scenario where the end user has a variety of check box options that affect how the program interacts. ...
13
votes
7answers
635 views

Building a complete program?

Reading books, watching videos, and reviewing tutorials is all very easy. Taking notes and actually learning the material may be slightly harder, but even then, anyone with a decent brain and a fair ...
9
votes
8answers
11k views

What are some common examples of a Hash Table? [closed]

I was just wondering if there were some "standard" examples that everyone uses as a basis for explaining the nature of a problem that requires the use of a Hash table. What are some well-known ...
5
votes
4answers
231 views

Is reference to bug/issue in commit message considered good practice?

I'm working on a project where we have the source control set up to automatically write notes in the bug tracker. We simply write the bug issue ID in the commit message and the commit message is added ...
7
votes
7answers
954 views

Do you start writing GUI class first or reverse?

I want to write my first Java program, for example Phonebook, and I wonder what to do first. My question is should I write GUI classes first or util classes first? I am database developer and want to ...
0
votes
2answers
393 views

How to concentrate on one project at a time. Divide and Conquer doesn't work for me [duplicate]

Possible Duplicate: Tips for staying focused and motivated on a project I have serious issues on concentrating on one project at a time. I cant even follow the Divide and Conquer Approach. ...
46
votes
14answers
6k views

Differences between programming in school vs programming in industry? [closed]

A lot of students when they graduate and get their first job, feel like they don't really know how to program even though they may have been good programmers in college. What are some of the ...
2
votes
2answers
166 views

Sports Programming [closed]

Other than programming, I'm addicted to sports. I'd like to integrate the two together. What are different programming languages that companies like ESPN use to work with stats? What techniques are ...
2
votes
3answers
652 views

How to deal with the programmer's block? [duplicate]

Possible Duplicate: Dealing with frustration when things don't work Something I find myself coding something difficult and after hours of struggle my mind goes blank and I don't know ...
17
votes
3answers
3k views

What are combinators and how are they applied to programming projects? (practical explanation)

What are combinators? I'm looking for: a practical explanation examples of how they are used examples of how combinators improve the quality/generality of code I'm not looking for: explanations ...
5
votes
8answers
1k views

Why has the rate of programming language popularization slowed down in recent decades? [closed]

If I understand correctly, there was a huge birth of programming languages during the early decades of computing, but then things have stabilized. Basically, why are many universities and industries ...
18
votes
9answers
2k views

Definition of a Software bug. Blizzard Entertainment insists that my “bug” is not a bug at all. Are they right? [closed]

According to Wikipepdia, A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected ...
9
votes
4answers
655 views

Forgetting basic language functions due to use of IDE, over reliance? [duplicate]

Possible Duplicate: Should newbies use IDE autocomplete (Intellisense)? Is it wrong or bad to use autocomplete? Having used an IDE for the last 3-4 years, the other day a few of my ...
35
votes
11answers
2k views

Is it a good practice to code in English? [duplicate]

Possible Duplicate: Do people in non-English-speaking countries code in English? I have a development comming that is intended to be sold across Latin America (Spanish speakers), but I've ...
2
votes
3answers
236 views

Does a mobile app need to poll external data sources or can it receive data in other ways?

I'm beginning the design stages of a mobile application. I'm looking for knowledge about common practices for user notifications. I understand that the SDK for the device will expose methods which ...
6
votes
3answers
186 views

Is it bad practice to define/use “Preset” functions

Lets say I have an extremely robust and versatile function: void DoAnything(action, target, context) In my program, 90% of the time I call this function, it's with the same parameters: ...
19
votes
3answers
13k views

Which is a better practice - helper methods as instance or static?

This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, ...
4
votes
4answers
951 views

Should I learn design patterns or algorithms to improve my logical thinking skills? [duplicate]

Possible Duplicate: How can I improve my problem-solving ability? When starting a programming task, I have trouble breaking it up into steps and figuring out how to go about solving it. I ...
4
votes
3answers
236 views

Getting started with repositories: are they what I need, or are there any alternatives?

I'm a solo iOS developer - mostly self taught, but have made several successful apps so far and potentially starting some slightly bigger projects. What I want to do: As I'm working on some bigger ...
26
votes
8answers
2k views

Writing robust code vs. overengineering

How do you guys know that you are writing the most robust code possible without overengineering? I find myself thinking too much about every possible path that my code can take, and it feels like a ...
13
votes
14answers
2k views

Can a candidate be judged by asking to write a complex program on “paper”?

Sometime back in an interview, I was asked to write following program: In a keypad of a mobile phone, there is a mapping between number and characters. e.g. 0 & 1 corresponds to nothing; 2 ...
4
votes
2answers
395 views

Multithreaded Programming? [closed]

Recently I've finished learning about multithreaded programming on single shared objects, but was curious about how different things would be in order to successfully program on multiple shared ...