sea-rob
  • Member for 7 years, 11 months
  • Last seen more than a month ago
Difference between REST and CRUD
22 votes

REST stands for "representational state transfer", which means it's all about communicating and modifying the state of some resource in a system. REST gets quite involved, because the theory behind ...

View answer
What is the best pattern for adding an existing item to a collection in REST API?
Accepted answer
21 votes

POST is the "append" verb, and also the "processing" verb. PUT is the "create/update" verb (for known identifiers), and almost looks like the right choice here, because the full target URI is known. ...

View answer
POST and PUT requests – is it just the convention?
Accepted answer
18 votes

Read the HTTP spec that defines those methods. Seriously. It will clarify a lot of questions for you going forward. http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html In HTTP, PUT is specifically ...

View answer
How important is it to clean up someone else's code when faced with a tight deadline?
16 votes

The short answer is: no. When times are hard, sometimes you just have to put your head down and take the aesthetic bullet. ;) A more pragmatic answer is to time-box it. Budget an hour to run through ...

View answer
Significant amount of the time, I can't think of a reason to have an object instead of a static class. Do objects have more benefits than I think?
15 votes

lol you sound like a team that I used to work on ;) Java (and probably C#) certainly supports that programming style. And I work with people who's first instinct is, "I can make that a static method!"...

View answer
Are null references really a bad thing?
15 votes

(Throwing my hat in the ring for an old question ;) ) The specific problem with null is that it breaks static typing. If I have a Thing t, then the compiler can guarantee I can call t.doSomething(). ...

View answer
When to use a Singleton and when to use a static class
14 votes

Avoid the Gang of Four Singleton pattern, for reasons cited in the other answers. Mainly it is an anti-pattern based on difficulties it creates for testing. Factory and Dependency Injection made ...

View answer
Is a genetic algorithm needed when computation is infinitely fast?
14 votes

Genetic algorithms are basically a guided trial-and-error methodology. The only advantage I can think of for a GA over a exhaustive search is that since GA optimizes a fitness function in steps, you ...

View answer
How do I stop designing and start architecting this project as suggested by my lead?
14 votes

Maybe this will help. I've always seen the seniority of a engineer as a question of how big a problem they can solve on their own. Roughly, to convey the idea: You can give someone new to ...

View answer
How to define "or" logically
13 votes

If you only have and and not, you can use DeMorgan's law to flip around and: if not (arg1 = False and arg2 = False) return True else return False ... or (even more simply) if arg1 = False and ...

View answer
How do searches fit into a RESTful interface?
12 votes

In REST, resource definition is very broad. It's really however you want to bundle some data. It's useful to think of a search resource as a collection resource. The query parameters, sometimes ...

View answer
Questioning one of the arguments for dependency injection frameworks: Why is creating an object graph hard?
12 votes

There is an old, old ongoing debate about the best way to do dependency injection. The original cut of spring instantiated a plain object, and then injected dependencies though setter methods. But ...

View answer
Builder pattern inside interface. Bad design decision?
Accepted answer
12 votes

The main problem is that you've created a circular dependency between Person and PersonImpl... Person shouldn't have any references to implementation classes, but the "new PersonImpl()" call in the ...

View answer
Are there technical limitations or language features that prevent my Python script from being as fast as an equivalent C++ program?
Accepted answer
11 votes

I kind of hit this wall myself when I took a full-time Python programming job a couple years ago. I love Python, I really do, but when I started to do some performance tuning, I had some rude shocks. ...

View answer
Purpose of `return self` from a class method?
11 votes

As @Lie Ryan and @Frank Shearar mention, that's called a "fluent interface" but that pattern has been around for a really long time. The controversial part of that pattern is that in OO, you have ...

View answer
Usage of __ while declaring any variables or class member in python
Accepted answer
11 votes

A lot of people erroneously use double underscores to simulate "private" members, because double underscores invokes code mangling and makes those members harder to reference outside the class. ...

View answer
Which classes should be autowired by Spring (when to use dependency injection)?
9 votes

Agree with @ericW's comment, and just want to add remember you can use initializers to keep your code compact: @Autowired private Converter converter; or private Converter converter = new Converter(...

View answer
REST Service and CQRS
Accepted answer
8 votes

REST works OK with a command model... the commands basically become nouns, or worker resources. So instead of using /blah/blah/SearchByName You'd have a "search" (noun) resource /blah/blah/...

View answer
Efficient way to represent hexagonal board logic for abalone-like games
Accepted answer
7 votes

1) since the board has a fixed-size that you're just going to be feeding into an AI anyway, you could just represent it as a one-dimensional array with the right number of cells, where each cell ...

View answer
Term to describe pre-canned objects for use in testing
Accepted answer
7 votes

Fixtures. The setUp and tearDown methods are for creating or cleaning up your fixtures. If they live in memory, cleanup is easy, but if your fixtures live in the database, then both setting them up ...

View answer
Why aren't there other programming languages that compile to Python bytecode?
7 votes

Another reason is that the JVM is highly optimized, well-evolved, and extremely complete ecosystem. On it's own, it competes extremely well with any of the other compiled languages. (I won't say that ...

View answer
RESTful API: HTTP verbs with shared or specific URLs?
7 votes

(sorry, my first time through I missed the /edit/ and /delete/ in (2)... ) The idea of the URI is that it is an identifier of an addressable resource, rather than a method invocation. So the URI ...

View answer
How to completely avoid business logic in DAL?
Accepted answer
7 votes

BTW Agree with @Robert Harvey. There's a subtle but problematic shift in your question -- the original question is "how to isolate business logic" but then you switch over to isolating "business ...

View answer
What are the problems of bringing C++-like const into a language?
7 votes

I see the drawbacks as: "const poisoning" is a problem when one declaration of const can force a previous or following declaration to use const, and that can cause its previous of following ...

View answer
Viability of a Development Team with no *dedicated* Tester role
7 votes

I don't agree with Developers make bad testers Most of the teams I've worked on in my career have not had any QA support. This includes a couple of large, global corporations involving products ...

View answer
Is there a name for an internal incorrect behaviour that does not manifest itself as a bug?
6 votes

I've always heard them called "latent bugs". On all the teams I've worked on, it's good practice to identify latent bugs and fix them before someone experiences them. In the situation you describe, ...

View answer
Sequence diagrams and the Implementation
6 votes

At a very high level, sequence diagrams can represent high-level interactions between systems or sub-systems at a high level. If they represent interactions between actual classes (or interfaces) they'...

View answer
Given known inputs and outputs, can we generate candidate functions that will map the inputs to outputs?
Accepted answer
6 votes

This is a classic machine learning problem. It's an example of regression. You'd want to split your set of "knowns" into two groups, one to train with, and one to test against. Set up the appropriate ...

View answer
Breaking up classes and methods into smaller units
Accepted answer
6 votes

It's closely tied with the idea behind unit testing ... where "unit" is a hotly contested and poorly defined term. Basically, if you start chunking your code up, at what point do you hit nice little ...

View answer
Can the Jacquard loom be considered stateless?
Accepted answer
6 votes

Well, the loom is stateful in that it knows what the current card is. (So it keeps track of line # according to the analogies from comments.) The program, however, is stateless, because each card just ...

View answer
1
2 3 4 5 6