Most Popular
1500 questions
70
votes
3 answers
Role vs Permission Based Access Control
I'm trying to understand the inherent tradeoff between roles and permissions when it comes to access control (authorization).
Let's start with a given: in our system, a Permission will be a fine-grained unit of access ("Edit resource X", "Access the…
smeeb
- 4,870
70
votes
6 answers
What's the best way to return an array as a response in a RESTful API?
Assume we have resources like this,
book:
type: object
properties:
author: {type: string}
isbn: {type: string}
title: {type: string}
books:
type: array
items: book
So, when someone makes a GET on the books…
borncrusader
- 801
70
votes
22 answers
Naming conventions: camelCase versus underscore_case ? what are your thoughts about it?
I've been using underscore_case for about 2 years and I recently switched to camelCase because of the new job (been using the later one for about 2 months and I still think underscore_case is better suited for large projects where there are alot of…
poelinca
- 353
70
votes
1 answer
How does semantic versioning apply to programs without API?
In http://semver.org/ — which in my perception seems to be the most widely used convention in versioning — it is recommended to increase the major version number when a change that breaks/modify the API is introduced.
There are two related scenarios…
user148056
70
votes
12 answers
"Everything is a Map", am I doing this right?
I watched Stuart Sierra's talk "Thinking In Data" and took one of the ideas from it as a design principle in this game I'm making. The difference is he's working in Clojure and I'm working in JavaScript. I see some major differences between our…
Daniel Kaplan
- 6,794
70
votes
10 answers
When would using a scripting language within a larger program be useful?
I have heard of several situations of people using say, JavaScript or Python (or something), inside a program written in C#. When would using a language like JavaScript to do something in a C# program be better then just doing it in C#?
Toby Person
- 681
- 5
- 4
70
votes
9 answers
Why don't languages include implication as a logical operator?
It might be a strange question, but why there is no implication as a logical operator in many languages (Java, C, C++, Python Haskell - although as last one have user defined operators its trivial to add it)? I find logical implication much clearer…
Maja Piechotka
- 2,475
70
votes
19 answers
Review before or after code commit, which is better?
Traditionally we performed code review before commit, I had an argument with my colleague today, who preferred code review after commit.
First, here's some background,
We have some experienced developers and we also have new hires with almost…
fifth
- 669
70
votes
7 answers
How to deal with static utility classes when designing for testability
We are trying to design our system to be testable and in most parts developed using TDD. Currently we are trying to solve the following problem:
In various places it is necessary for us to use static helper methods like ImageIO and URLEncoder (both…
Benedikt
- 891
- 1
- 6
- 5
70
votes
16 answers
Recommendations for teaching junior programmers good coding style
I am a big fan of good coding style, producing clean, clear code that runs well and is easy to use and integrate into larger systems. I believe that we programmers are essentially craftspeople who should take pride in our work, every line. I am not…
Randall Cook
- 2,480
70
votes
16 answers
Is it a waste of time to free resources before I exit a process?
Let's consider a fictional program that builds a linked list in the heap, and at the end of the program there is a loop that frees all the nodes, and then exits. For this case let's say the linked list is just 500K of memory, and no special space…
Ramzi Kahil
- 1,089
70
votes
17 answers
Why Use !boolean_variable Over boolean_variable == false
A comment on this question: Checking if a method returns false: assign result to temporary variable, or put method invocation directly in conditional? says that you should use !boolean instead of boolean == false when testing conditions. Why? To me…
ell
- 966
70
votes
11 answers
Best Practices for Handing over Legacy Code
In a couple of months a colleague will be moving on to a new project and I will be inheriting one of his projects. To prepare, I have already ordered Michael Feathers' Working Effectively with Legacy Code.
But this books as well as most questions on…
PersonalNexus
- 3,019
69
votes
22 answers
How do you define elegant code?
Possible Duplicate:
What does it mean to write “good code”?
In a discussion on coding quality, and how you identify it, I came across a discussion on testing people's coding ability by getting them to show how they would swap two values using a…
temptar
- 2,756
69
votes
13 answers
What happened to Borland Delphi?
I have the impression that Delphi isn't very popular anymore. But now at work I had to make some changes to an old Delphi program that we are still using. I used Borland Developer Studio 2006 and it was very pleasant and intuitive to work with, even…
Lucas
- 643