All Questions
6,351
questions
3
votes
4
answers
4k
views
Is having some logic in source code in order to perform some tests a good practice?
The question is not about changing the method/function visibility or extract local variable into instance variable in order to perform unit tests.
There are cases where we could include some logic ...
3
votes
1
answer
468
views
UML "direct substate" vs "transitively nested substate"
I am reading through Wikipedia's page on UML state machines. I don't understand where it says:
A nested state is called a direct substate when it is not contained by
any other state; otherwise, ...
3
votes
2
answers
7k
views
Design pattern for data privileges
I'm designing a financial system that should grant access to data based on roles and privileges. For example, a manager can see the financial transaction of users under his domain but not information ...
3
votes
2
answers
390
views
Has anyone nailed dependency management? [closed]
I've used various dependency management tools for installing software: homebrew, cabal, rubygems, etc. Invariably, despite someone's simple instructions for installing their package, there are times ...
3
votes
4
answers
4k
views
How do you decide what code to put into a function?
I started out with a script that was a few hundred lines. Later, I realized I wanted another script that would require much of the same code. I decided to wrap certain areas of the original script ...
3
votes
1
answer
622
views
Scrum in combination with ad hoc bug fixes [duplicate]
I worked in a company where they tried to use Scrum but in practice it was hard to create a solid sprint backlog because they had a very active userbase, that used the software 8 hours a day, and ...
3
votes
1
answer
1k
views
Distributing my Application inside a Debian Virtual Machine Image-- How to meet GPL obligations?
I have a Linux application I've developed, and I have created a standalone VMWare Image that people can download to try out the application without needing to install and configure a Linux Server. I ...
3
votes
1
answer
6k
views
Object in Business layer same as DTO with logic?
Let's say I have a Spring MVC project, in which I'm using DTO to get data from a database and to pass data to the UI. Let's suppose that I have a UserDTO and in my business layer I have to do ...
3
votes
2
answers
1k
views
Do I need to provide the source code for GPL dependencies?
Let's say there is a software that is build on basis of a GPL v2 licensed software. This software is being distributed in binary form. GPL requires that the source code and build instructions are made ...
3
votes
1
answer
3k
views
Using prototype/non-Spring managed beans in Spring Web application
I have been working on few web applications/REST web services recently (Spring IoC/MVC/Data JPA etc) and they usually follow the same pattern: Controller classes --> Service classes (which have number ...
3
votes
1
answer
946
views
MVVM: Strictness of Views Referencing Models
A coworker and I have differing views on how strictly we should adhere to the MVVM concepts. I try to follow it as closely as possible where he takes shortcuts almost every chance he gets. One of my ...
3
votes
4
answers
762
views
Giving a class many constructors and assigning via them as many properties as possible
I have written a class which represents a SQLite Trigger.
public SQLiteTrigger(string Name,
string On,
TriggerStartType StartType,
...
3
votes
2
answers
376
views
How to handle product rebranding in code in a short time frame [closed]
We've all been there - a product feature is called "gold", and then a week before launch they decide it is to be called "platinum". Luckily, you had some nous about you so the UI code is easy to ...
3
votes
1
answer
475
views
The most effective arguments in favor of improving code quality, for a manager [closed]
My employer's legacy system started off (in 1997) as very structured procedural code (with a smidgeon of OO), and it was luckily one of the 10% of software projects that was successful. It may look a ...
3
votes
2
answers
358
views
Is there a name for being able to quickly find the relevant code? [closed]
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
3
answers
2k
views
Is checking return values always required? [duplicate]
We know that checking return values prevent our software from unexpected states. (You can see CWE definition.)
But, we are sometimes sure about the return value. For example:
bool ...
3
votes
2
answers
3k
views
What do you suggest for cross platform apps, including web
I have always preferred cross platform development over most other concepts as long as I can remember. Which is one of the reason I never got into .Net. Currently, I use php/javascript/python as my ...
3
votes
1
answer
1k
views
How to Implement Restricted Access to Application Features
I'm currently developing a web application, that provides some 'service' to the user. The user will have to select a 'plan' according to which she/he will be allowed to perform application specific ...
3
votes
1
answer
912
views
Asynchronous socket.io for lots of concurrent messages
We have a web application which currently operates like this on a typical view/page:
the front has to display 100+ "previews" (in the form of base64 images)
each of this preview is built on-demand by ...
3
votes
2
answers
4k
views
how safe/sane is it to use git for deployment on my webapp production server?
I started with sftp, then switched to WebDAV and I'm currently using rsync through ssh to deploy any updates/upgrades from my development server into my production server.
I'm still not very happy ...
3
votes
2
answers
2k
views
Why does assigning a variable to false return false?
Why does:
something = false
always return false?
Since it is an assignment and not a comparison, it seems it would make more sense to return the result (success/failure) of the assignment (like ...
3
votes
2
answers
215
views
Domain driven design - Entity is updateable in certain circumstances
Here is my business rule:
Anyone (anonymous users) can make an Application (as in to apply for something). Applications can be updated until they are reviewed and approved by an officer. Approved ...
3
votes
2
answers
184
views
Can >8bit per channel colours be seen as intended in the browser?
For, say, a subtle background gradient to a web page, what are the advantages and disadvantages of saving it as a 16bit/channel png?
Are the colours represented by >8bits displayed in the intended ...
3
votes
3
answers
7k
views
Avoid malicious code while dynamically loading classes with ClassLoader
Background
One of the advantages of decoupled components in systems is that you can extend the system without having to touch the existing code.
Sometimes you don't even have to recompile the old ...
3
votes
2
answers
771
views
Improving exception handling? [duplicate]
I am a newbie programmer and I recently started learning about exception handling in Java.
I know what try, catch and finally blocks do, but I really need to understand how to use them well and where ...
3
votes
0
answers
1k
views
Realizing pagination for merged array from multiple data sources (APIs)
I'm improving a WordPress theme with PHP. The theme contains a gallery section which loads data from the Flickr API.
Now the client wants to display Flickr galleries as well as "local" galleries ...
3
votes
2
answers
1k
views
Managing Similar Code On Multiple Platforms (GIT)
My team and I have developed a Chrome extension which we are now porting into Firefox. The two versions share enough of a code base that it would be redundant to manage to separate depos. In fact ...
3
votes
4
answers
949
views
How to refactor my project to have less mutable objects? [duplicate]
There seems to be a trend towards immutable objects, and functional programming. I recently got aware about the benefits of immutability. However, I am not very familiar with this style of programming....
3
votes
4
answers
364
views
Creating a library in two languages simultaneously
I'm planning on writing an open source HTML parsing library in .Net so that I have a project out in the wild when I start looking for developer jobs. Now, in my Masters program I started learning Java ...
3
votes
1
answer
8k
views
Convert procedural code to object oriented
I have a PHP application (a web service). It consists of files grouped in directories by theme like :
/customer
/search.php
with this example content :
Auth::authenticate($options);
$...
3
votes
3
answers
860
views
When dealing with tens of billions of rows in a web app table, would a NoSQL database be noticeably faster than a relational one? [closed]
I'm currently designing a conceptual web app, where users can submit posts, comments, and "like"/"dislike" both of those. However, I am not sure of how to store the (dis)likes, because of how many ...
3
votes
1
answer
2k
views
Saving mobile application data when no service?
Say I have a mobile application that allows users to enter information which is then uploaded to a central location. I had planned on building this using only HTML5 and javascript (non-native app), ...
3
votes
8
answers
950
views
What is "The Cloud"? What do I say when people ask if my web service is "on the cloud"? [duplicate]
Possible Duplicate:
What is “the Cloud” and how does it relate to development?
First some context: I don't understand what people are asking when they ask "It it on the cloud?" Here ...
3
votes
2
answers
3k
views
Should I use a single repo when multiple parts of the same project are running on the same server? [duplicate]
I'm planning a project that consists of the following parts:
REST API in Lumen
Web client in Laravel
Product website in Jekyll
These separate products are going to be running on the same server.
I'...
3
votes
1
answer
533
views
Trying to understand some async/await behavior
I was working on a bit of code for a personal project, when I came upon the need to generate checksums on large amounts of files. First off let me say I already solved this problem ideally using ...
3
votes
1
answer
575
views
Single Responsibility Principle : Proxy Pattern for refactoring
However, in cases where the tests did not force the separation, and the smells of Rigidity and Fragility become strong, the design should be refactored using
the Facade or Proxy patterns to separate ...
3
votes
2
answers
557
views
Ubiquitous language and maturity level in REST API?
According to Richardson Maturity Model there are several levels of maturity in REST approach. http://martinfowler.com/articles/richardsonMaturityModel.html
Since DDD uses ubiquitous language, I am ...
3
votes
1
answer
2k
views
How to deal with relative paths in out of source build?
An out of source build is a build which can be in any directory other than the source directory
I have a project which contains relative paths to some resource files, needed at runtime, which are ...
3
votes
1
answer
79
views
Importing large data sets into a database over the web
I need to import 100,000 products from one database to another using the results from a RESTful API. But I can only do this overnight. So if I can't get the job done in one day, I need to spread it ...
3
votes
3
answers
4k
views
Do application-level caches belong inside web servers?
A coworker and I have a disagreement about where the cache for a webserver should go. We currently have it implemented as a global (static) in-process cache, which I don't agree with. I think the ...
3
votes
1
answer
4k
views
A manual and automated CSV file upload solution for a website
Problem
I run a website which has a requirement for a new feature - to enable users to upload CSV files into the website. The users will only ever need to upload 1 CSV file at a time, and only 1 or 2 ...
3
votes
1
answer
1k
views
Help understanding modeling in domain-driven design
I've been trying to learn domain-driven design (and similarly Onion Architecture) the last week or so. I think I've got an understanding of it, but like math, I suck at extracting all of the details......
3
votes
1
answer
296
views
Marking specific pieces of drastically changed open source code
I have taken a small chunk of open-source code, around a hundred lines, and found that for whatever reason, I have modified it so drastically that my end result has essentially no resemblance to the ...
3
votes
5
answers
616
views
Testing From A Developer's Perspective [closed]
I have a book which mentions:
"There are many types of testing, including unit testing, integration testing, functional testing, system testing, performance testing, and acceptance testing".
It is ...
3
votes
3
answers
2k
views
Programming by Intention, Depth-First or Breadth-First?
Say I have the following graph of dependencies between procedures/functions/methods:
o
/ \
v e
/ \ / \
r f l w
That is, function o first calls function v, and then ...
3
votes
1
answer
4k
views
How to serialize and deserialize lambda expression in F#?
I serialized lambda expressions in C# before. Now I wanna use F# instead of C# for serialization and deserialization.
I heard F# is better in this area. Is it true?
How can I do that with F#?
I’d ...
3
votes
9
answers
3k
views
C vs C++ for a Java (and possibly python) Programmer [closed]
I am a Hobbyist Java programmer and I would like to further my programming skills by learning C or C++ and Python.
I have read many C vs C++ articles but none of them contain the information I'm ...
3
votes
2
answers
2k
views
Product classifying algorithm - text classification - C# - algorithm suggestions
Alright people. Finally with the help of stackoverflow community i have gathered 20 commercial product selling websites product pages with the following features
Product URL
Product Price
Product ...
3
votes
5
answers
542
views
How do you manage project estimation and managing your teams time
I'm thinking of things like:
designating a developer having say 6 hours out of their normal 7.5 hour day dedicated to the project, the rest for other work/company related activity (meetings, emails, ...
3
votes
3
answers
3k
views
Is functional language without runtime written in C possible? [closed]
Every functional language that compiles to native code relies on quite big runtime written in C programming language (well at least ones that I know of, for example Haskell, OCaml, Gambit/Chicken ...