2
votes
2answers
123 views

Tag based programming

I don't know if this is a thing but here's a silly idea. Often there are cases when you have to refactor code such that you need to change code pertaining to some particular area. This may involve ...
2
votes
4answers
148 views

Are factories that only return one type of object bad?

Someone in a Stackoverflow post (I didn't bookmark the question unfortunately) commented, that Factories that only return one type of object are a code smell. I find myself writing these kinds of ...
34
votes
8answers
5k views

Why would you store an enum in DB?

I've seen a number of questions, like this, asking for advice on how to store enums in DB. But I wonder why would you do that. So let's say that I have an entity Person with a gender field, and a ...
1
vote
2answers
74 views

How do you represent an object when you need to know which subtype you're working with?

I have some data that I need to represent in a form. As an example, it might look like this (in psuedo-json): [ { "value1" : "int" "value2" : "{1, 2, 3, 4, 5}" "value3" : "...
-2
votes
0answers
33 views

A Role Management System in ASP.NET MVC 5 [on hold]

I want to do a Role Management System step by step with MVC empty. Please anyone can help? I have to do authentication too.
0
votes
1answer
77 views

What is the difference between running two blocks of code on the same thread and running them on two synchronous threads?

Suppose I have two blocks of code, A and B. A is to be executed before B. As I understand, I can do one of two things: 1) Put B in a separate thread that is to be executed after A's thread, or 2) Put ...
1
vote
2answers
129 views

Git - single or multiple branch

I am working on this project of mine where I am the only developer. I have chosen git for the version control for the project. Currently, I work from multiple systems and commit to the master branch ...
0
votes
0answers
23 views

The best implementation for fromJson factory method and json-mappings with inheritance?

I have BaseComponent (with field "type") and it's subclasses TextComponent, ListComponent, etc. Some of them has same fields. I want to create them and init their fields from json. Some of possible ...
-3
votes
0answers
23 views

Laravel with ReactJS

Is it possible to send collected data from a Laravel controller file and have ReactJS display it in the front end? This would be a great discovery for me personally moving forward with web ...
-6
votes
0answers
76 views

Which was a popular open-source application that became closed source? [on hold]

There was a popular freeware utility/small application that was open source but was later changed to closed source as the developer found that many people were taking his code and with minor changes, ...
57
votes
10answers
6k views

Where is the line between unit testing application logic and distrusting language constructs?

Consider a function like this: function savePeople(dataStore, people) { people.forEach(person => dataStore.savePerson(person)); } It might be used like this: myDataStore = new Store('some ...
-2
votes
0answers
47 views

How does one create a PHP page router controller?

I am making a PHP controller that should route pages on my website. It is my first attempt. Can someone revise this code and tell me if this makes sense or not. (never mind the logs array, I use it as ...
1
vote
1answer
204 views

Onion architecture and independence

Trying to understand onion architecture. As I understand it, there is different opinions about the names of the layers. In this post I refer to the layers as: infrastructure -> api -> domain -&...
0
votes
2answers
47 views

How does two-way data binding differ from simple auto-sync?

The AngularJS documentation mentions that it considers one-way data binding to be 'bad' and two-way data bind to be 'good*'. However, on looking over the definitions of two-way data binding used, all ...
0
votes
1answer
132 views

How Common/Acceptable is it for a .NET developer to abstain from WebForms as a rule? [on hold]

I work at a mostly .NET shop. A coworker has more of a background in open-source MVC (think RoR and Spring MVC). She seems to really enjoy .NET MVC, but she practically refuses to work on Web Forms, ...
0
votes
2answers
105 views

Private fields and encapsulation

I'm reading the head first c# book and don't quite understand what this means. "Any class can see private fields in another instances of the same class"
-4
votes
0answers
26 views

Converting Scanner to JOptionPane [on hold]

I have an assignment that is suppose to just simply check whether a list entered by the use is sorted in increasing order or not and display a message that tells them so. So I coded the whole thing ...
2
votes
4answers
442 views

Finding the first subarray that sums to a given total

Due to the failure of comprehension of the last version here is the question. Given and unordered array of positive and negative integers. How can you find the first subarray to sum to a given ...
0
votes
1answer
59 views

Divide java web app into smaller web app

I'm not sure if I should ask here or stackoverflow. Please let me know. I've a web application that consists of 3 main technologies: JSF, jax-rs and websocket. All three are coupled together with the ...
4
votes
2answers
604 views

Use a global variable, a singleton, or something else

Preface: I am working in PHP (Abandon hope all ye who enter here). Background: There exists a large set of global functions in PHP, a number of which are miscellaneous system calls, like sleep (and ...
20
votes
3answers
3k views

Why should I use “functional operations” instead of a for loop?

for (Canvas canvas : list) { } NetBeans suggests me to use "functional operations": list.stream().forEach((canvas) -> { }); But why is this preferred? If anything, it is harder to read and ...
7
votes
3answers
179 views

Why does java.time have methods for creating objects instead of just constructors?

In the new java.time package the core classes are using the factory method of instead of a public constructor. Even though I like the cosmetics of the of method I can't see a good reason to not use a ...
-3
votes
0answers
22 views

How to find which module of a windows service is leaking memory [on hold]

I have a windows service which host about 7 or at sub services. There are lots of periodical work going on. Threads sleep are called from 5 seconds to 3 minutes for different services. Recently what ...
0
votes
0answers
38 views

How to keep user credentials between app updates in Android app built with Xamarin?

I'm building a cross-platform app using Xamarin. When I release a new version of the app to the Play store and users download the new release, they are no longer logged in. How do I solve this issue ...
227
votes
11answers
66k views

How accurate is “Business logic should be in a service, not in a model”?

Situation Earlier this evening I gave an answer to a question on StackOverflow. The question: Editing of an existing object should be done in repository layer or in service? For example ...
0
votes
1answer
36 views

How to deal with automatic binding exceptions with Jersey?

It's really nice to have automatic binding with Jersey-Jackson (well, I believe it's actually MOXy the one who manages the bindings), so object serialization and deserialization is done under the hood....
23
votes
9answers
13k views

Explaining technical things to non-technical people [closed]

I often have to explain technical things and technical decisions to my extremely non technical manager and I'm pretty awful at it. What are good ways to essential dumb things down for the rest of the ...
-2
votes
0answers
38 views

Is it possible get JS function? [on hold]

I think that when JS developer had create JavaScript, they have create some function like log(), write(), alert(). They had do something like function alert() {} and then standard it (I imagine). So, ...
100
votes
9answers
16k views

Is there any “real” reason multiple inheritance is hated?

I've always liked the idea of having multiple inheritance supported in a language. Most often though it's intentionally forgone, and the supposed "replacement" is interfaces. Interfaces simply do ...
1
vote
0answers
13 views

Web API to Windows Service communication via ZeroMQ

I have an ASP.NET Web API 2 web service. This is the interface customers will use to submit data. I have a Windows Service running on an internal server. I will be sending the customer's POST data to ...
48
votes
11answers
7k views

Are magic numbers acceptable in unit tests if the numbers don't mean anything?

In my unit tests, I often throw arbitrary values at my code to see what it does. For example, if I know that foo(1, 2, 3) is supposed to return 17, I might write this: assertEqual(foo(1, 2, 3), 17) ...
-5
votes
0answers
30 views

Lua access to X servers' selection [linux] [on hold]

Is there a simple way of getting the contents of the text selection buffers from a X server session (in Linux)?
-2
votes
2answers
197 views

Is it normal for a graduate to be overwhelmed when looking at other's code? [on hold]

I'm a recent graduate, applying for a junior programming position (.NET). I've spoken with a few companies already, some of which I met through a recruiter. I like one of them a lot, but I'm worried I ...
0
votes
3answers
127 views

What do you call CRUD with soft delete?

I want to be clear when discussing an implementation that we're using soft-deletes (not immediately removing data from the database). What can I call our approach? The best I have is "CRUD with soft ...
1
vote
0answers
77 views
+100

Symfony2 - Best aproach for a plugin system

Symfony2 is handling all its things in bundles in /app or in /vendor. This is fine, if you are handling and managing all by yourself or Ops that handle all needed things. But I haven't found a good ...
2
votes
2answers
115 views

Should I return a 204 or a 404 response when a resource is not found?

I am developing a simple RESTful service for tournaments and schedules. When a tournament is created through a POST request containing a JSON body, the tournament is inserted in a BiMap, declared as ...
-1
votes
1answer
78 views

Uploading large files to web-server even if browser closed

I need to permit users to upload large files to my web-server even if the browser is closed. How can I implement this functionality. I have gone through the feasibility of google drive app but it dose'...
8
votes
5answers
820 views

Techniques for ensuring cross-platform compatibility (C++)?

I was finishing one of my earliest C++ projects which is (according to the framework) supposed to be cross-platform. I developed the project fully in Windows and Visual Studio, thinking that since the ...
-1
votes
1answer
78 views

Controllers and Separation of Concerns: discussing possible strategies

I've been working on a project based off of this tutorial. Unfortunately, the controller classes in this are quite dense and have terrible separation of concerns. I should have realized this ...
0
votes
1answer
32 views

Should we sanitise and clean data or only display it in the expected format?

So my problem is, I have users entering their data(names, address) in a mixed form- some with first letter in caps and some without, some inserting more than necessary spaces and so forth. Also, ...
1
vote
1answer
47 views

Handling Production Seed Data

We have a requirement for a new feature which requires some seed data to be present in the database (basically some default values) for the feature to function correctly. We have this in 2 different ...

15 30 50 per page