Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [coding]

Coding is an alternative way to describe programming.

1
vote
2answers
126 views

Is it better to write the whole feature and then debug or do it incrementally? [closed]

Suppose there is a reasonably sized programming task(500 lines of code). Which is better? 1/Code the whole task from start to finish without running the code and debug later. 2/Code some small ...
23
votes
8answers
4k views

On a once a day user action: 24 Hours Reset vs. Midnight Reset [closed]

When a user is able to perform an action only once a day, for example getting a free ticket for a competition, there are two possibilities I came across in my experience. 1) 24 Hours Reset If he ...
-1
votes
1answer
76 views

Is Dependency Injection A Standard in PHP and Laravel?

Or in actuality, how to tell if a certain technique has became a standard in certain language / framework? As I understood from my readings so far, PHP supports DI in PSR-11 while Laravel uses it out ...
5
votes
7answers
785 views

How can we effectively manage software projects without killing creativity?

I am convinced that software development is essentially a creative process. I also believe that this is the case for all levels, from architecture to coding. What makes me think so? To put it very ...
-2
votes
1answer
145 views

Rotate a matrix in place, moving elements? (How to write a part of flow/logic after understanding the problem?)

Following is a java solution of the classic question of rotating a nxn matrix in place clockwise by 90 degrees. public void rotate(int[][] matrix, int n) { for (int layer = 0; layer < n / 2; ++...
0
votes
2answers
140 views

Combine if blocks with repetitive code

I have this piece of code if (!expr1) { codeblock1; } elseif (expr2) { codeblock2; codeblock1; } It is pissing the hell out of me because I am trying to refactor it in such a way that ...
22
votes
9answers
3k views

Is it normal/acceptable to write down notes, thoughts, algorithms, decisions during coding and maintenance? [closed]

Some people have this problem that they cannot think without words. And writing down their thoughts and decisions is the most effective way to proceed. So - is it normal and acceptable that I write ...
1
vote
1answer
440 views

Coding guidlines for Controller and Dao?

My Controller code: ObjectMapper objectMapper = new ObjectMapper(); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); ObjectReader objectReader = objectMapper.reader(...
1
vote
2answers
399 views

“I'm done with my coding” from Agile perspective

Scenario: I'm working in an Agile environment. The dev environment has not been configured yet, and I'm told to code a piece of an application. I code the module and write appropriate unit tests for ...
2
votes
0answers
449 views

PHP Vertical Columns from 3 SQL Tables

I work at a high needs school in which there are several classes that plan their work through Excel spread sheets grading and tracking student progress. We have come to the conclusion that this ...
0
votes
2answers
157 views

Any benefits of writing coding articles [closed]

I always wonder if there is any benefit of publishing programming/code related articles/tips either on ones own website or coding sites? I think it has a benefit that a programmer can have a record of ...
1
vote
3answers
84 views

Dijkstra function for navigation for disadvantaged

Is there a way we can write a function for Dijkstra to determine which node to enqueue and which to discard. This is for a navigation solution for people with disabilities where path to stairs may be ...
0
votes
2answers
136 views

How to work on a program from any computer that is connected to the internet? [duplicate]

I apologize if this question is a duplicate but I am having trouble phrasing my question. I am a beginner and for the last months I have been working on a Java program. Sometimes I work on the go from ...
0
votes
5answers
889 views

Should I avoid using 'break' during a coding interview? [duplicate]

I have an upcoming internship interview with Microsoft and, although I rarely use break in my own code, it does simplify things a lot of times and bring me to a solution faster when coding on the ...
2
votes
1answer
479 views

Is this synchronization required in service onCreate method?

Below is a sample code i captured from android doc Per service instance onCreate will be called only once. Ref: here and here The synchronization and singleton doesn't make any sense to me in this ...
3
votes
1answer
231 views

Is this caution in Android API documentation an indication of suboptimal design?

The content below is from the Android developer site: According to the phrase it is expecting the developer to store this info in his head. Shouldn't this be simple if they kept only ...
0
votes
3answers
713 views

Eliminate duplicate code in nested IFs without creating a function [duplicate]

Let's say we have two ifs that depend on each other: if var exists { if var is array { //Do stuff with var } else { //Resolve the problem } } else { //Resolve the ...
3
votes
4answers
342 views

Improve coding quality

I have been dealing with programming for several years now (I am still a student but with a lot of internships). Mostly working with C++, Python and MATLAB, I noticed that whenever I download an SDK ...
1
vote
1answer
113 views

Reference wind directions to texture space?

I have a 2D array filled with a simple class: class Tile { boolean N,E,S,W; } I also have a tilesheet representing all possible outcomes except all false (12 + crossroad). Now i need to ...
0
votes
0answers
51 views

Dedupe while or after write

I have a summary tool written in python that reads input files, and writes them into a summary file. I have the following stipulations: No duplicates. If it exists, add a count to it. Is it better ...
2
votes
2answers
1k views

I know the language but still can't code like other peers [closed]

I have moved to a new job and code base (been doing C#, .NET, Windows Forms, etc. for last four years) and I have been on this for three months until today. During these three months I caught up with ...
-1
votes
2answers
113 views

Is it normal to look back on codes when coding? [duplicate]

the title says it all. I'm still a university student studying IT. Whenever I'm doing coding, I will frequently look back on codes that I've done before or looking for codes online or on reference ...
9
votes
7answers
20k views

How important is to initialize a variable

How important is it to initialize variables? Does proper initializing avoid memory leaks or have performance advantages?
5
votes
4answers
2k views

Which methods should be put in an interface and which in abstract classes?

I have seen many frameworks and modules and their standard they follow is like this UserInterface which have some predefined methods AbstractUserClass which implements userInterface Then ...
0
votes
2answers
281 views

Starting point for building an iPhone app [closed]

I have one idea that I want to make an app for iPhone, I have recently bought a mac for the same purpose. I want to make small app and build on it in later versions. I work in in a small company and ...
8
votes
6answers
4k views

how do you cope with long hours of coding? [closed]

I am just a high-school student but for a while now I have been coding for weeks (from early in the morning to late at night). I really enjoy it, however it can be really monotone. I usually listen to ...
-2
votes
4answers
595 views

Am I required to memorize coding in a work space or can I fall onto references to provide me edge to finishing my development? [duplicate]

I would like to know if I am expected to memorize coding in a workspace or am I allow to fall into references whenever I am unsure. In a week of non-stop self learning, I feel I can understand the ...
3
votes
1answer
1k views

Arithmetic coding issue

Since a few days I am fighting my way through implementing arithmetic coding. I found a really great source of information which made me understand how it should work. Long story short, it implements ...
2
votes
3answers
378 views

Implementing a new coding standard to an existing application

Recently we have had some turnaround in the shop I work in, because of this comments in our source code were made hastily and explained very little. We have started working on the departments first ...
1
vote
4answers
2k views

What can I do to strengthen up my pen and pencil coding skills? [closed]

I want to better write code with pen and paper. Whether it'll be in pseudocode or real code, doesn't matter. Could you kindly advise me sources for this?
4
votes
2answers
511 views

Arithmetic Coding vs. Machine Numeric Precision

When subdividing intervals for arithmetic coding, the worst case scenario is that the final interval will have size 2^(1-n), where n is the number of unique symbols you are encoding. This will reach ...
3
votes
2answers
702 views

Arithmetic Coding Questions

I have been reading up on arithmetic coding and, while I understand how it works, all the guides and instructions I've read start with something like: Set up your intervals based upon the frequency ...
-1
votes
2answers
574 views

Where can I learn more about JavaScript and Python? [closed]

Been teaching myself how to code over the past four months or so -- mainly in JavaScript, but just started Python -- and had a revelation today. I can write in JavaScript pretty well, but I don't ...
18
votes
3answers
2k views

How to avoid jumping to a solution when under pressure? [closed]

When under a particularly strict programming deadline (like an hour), if I panic at all, my tendency is to jump into coding without a real plan and hope I figure it out as I go along. Given enough ...
1
vote
5answers
659 views

Which is more effective in coding? Reducing line of code and execution of code? [closed]

I have this doubt many years. I am wring some code to achieve some functionality. For example I am writing 20 lines of code to achieve the functionality and my co worker writing the code for the same ...
18
votes
8answers
2k views

Python Coding standards vs. productivity

I work for a large humanitarian organisation, on a project building software that could help save lives in emergencies by speeding up the distribution of food. Many NGOs desperately need our software ...
2
votes
7answers
2k views

After how much line of code a function should be break down?

While working on existing code base, I usually come across procedures that contain Abusive use of IF and Switch statements. The procedures consist of overwhelming code, which I think require re-...
0
votes
5answers
349 views

Coding guidelines for seamless merging [closed]

I am looking for coding guidelines developers should follow while writing C#/ASPX/SQL code, so that merging into other branches is smooth if not seamless.
60
votes
18answers
22k views

Working on someone else's code [closed]

I have hardly a year's experience in coding. After I started working, most of the time I would be working on someone else's code, either adding new features over the existing ones or modifying the ...
3
votes
5answers
666 views

Is this kind of Design by Contract useless?

I've just started informatics university and I'm attending a programming course about C(++). The programming professor prefers to connect every topic with a type of programming design that is similar ...
6
votes
14answers
4k views

How to minimize typos when you code? [closed]

I make a lot of typing mistakes when I program. I have a good keyboard writing speed but I try to write faster and in the process end up making typos. I want to type faster, but make less errors. Can ...
14
votes
2answers
2k views

What parts of Code Complete haven't stood the test of time? [closed]

I was looking at Code Complete on the shelf, thinking, "Outside of the Mythical Man Month, this may be one of the few mass market Software Engineering books to stand the test of time." For this ...
5
votes
1answer
399 views

Website with test data files for specific algorithms/data structures?

Is there any website, like SPOJ and Project Euler, with the test data files available for specific algorithms/data structures? I know it's a fun challenge to solve those problems on your own, but I ...
10
votes
12answers
9k views

Is it possible to learn maths via programming, or you should learn maths for programming? [closed]

I am not the best in maths, not very horrid either, but lower than the average, I've always been thinking to improve my maths, but schools and books didn't do the job because I get bored too fast. The ...
12
votes
7answers
1k views

After writing code, why do I feel that “I would have written better” after some time? [closed]

I have been working on my hobby project in C++ for more than 2 years. Whenever I write a module/function, I code it with lot of thinking. Now see the problem, do { --> write the code in module '...
13
votes
7answers
3k views

Use of NotImplementedException

Is it considered bad practice to throw NotImplementedException for code you haven't written yet? Possibly TODO comments would be considered safer?
39
votes
15answers
7k views

How Much Logic in Getters

My coworkers tell me there should be as little logic as possible in getters and setters. Yet, I am convinced that a lot of stuff can be hidden in getters and setters to shield users/programmers from ...
25
votes
5answers
3k views

How to choose between Tell don't Ask and Command Query Separation?

The principle Tell Don't Ask says: you should endeavor to tell objects what you want them to do; do not ask them questions about their state, make a decision, and then tell them what to do. ...
10
votes
4answers
14k views

Domain knowledge vs Programming [duplicate]

Possible Duplicate: How important is Domain knowledge vs. Technical knowledge? I often hear from my colleagues and sometimes from interviewers that, "There is nothing so great in having ...
14
votes
3answers
2k views

Tips/advice on how to reduce the use of “manager” classes?

I sometimes hear that having too many "manager" classes in your program's design is code smell and add an unnecessary layer of complexity. To me it makes sense that people want to use manager classes ...