Reputation
2,158
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
1 11 21
Impact
~269k people reached

  • 0 posts edited
  • 1 helpful flag
  • 143 votes cast
May
12
comment What do I need to do to NOT steal “Hello World” code with a GPL license?
Also, it's obvious that my code isn't a copy because it uses a greater than instead of a less than!
May
12
comment What do I need to do to NOT steal “Hello World” code with a GPL license?
You're not. But if you used my code you can claim you used it in good faith.
May
12
answered What do I need to do to NOT steal “Hello World” code with a GPL license?
May
11
awarded  Guru
May
11
awarded  Mortarboard
May
11
awarded  Good Answer
May
11
comment Why is Global State so Evil?
@frankc See my comment to briddums
May
11
comment Why is Global State so Evil?
@briddums in that case you'd use constants! :) And that is still problematic because the code becomes dependant on the constant. Even non-mutable global state is best avoided. Like I said, my answer isn't by any means exhaustive.
May
10
awarded  Enlightened
May
10
awarded  Nice Answer
May
10
revised Why is Global State so Evil?
added 1752 characters in body
May
10
comment Why is Global State so Evil?
@Truth I got the impression you were asking why global state was bad. You might want to update your question to make it clearer you're asking about alternative approaches as well. Am going to make an edit to the answer, but usually dependency injection is favoured these days.
May
10
revised Why is Global State so Evil?
added 1482 characters in body
May
10
answered Why is Global State so Evil?
Apr
30
comment Separation of concerns in an RMR framework
I don't think that's going to be much of an issue, the outputting (representation or view) is separate from the business logic (model or resource) in both systems. The problems I'm running into have to do with things I would have put in the controller before should go now.
Apr
30
comment Separation of concerns in an RMR framework
@JamesAnderson No it doesn't, the view just needs to iterate over the array of results the model returns, that's the same regardless of whether you're using RMR or MVC or anything else. Besides, this has pretty much nothing to do with the question I asked.
Apr
30
comment Separation of concerns in an RMR framework
Are you talking about pagination? That would work the same way as it does in MVC. The input includes a 'page' variable that's sent to the model/representation. The model/representation returns an array that an external view/template/presentation/whatever formats into markup/JSON/XML/etc. Model/representation doesn't need to know anything about the presentation (that's the Response's problem)
Apr
30
asked Separation of concerns in an RMR framework
Mar
15
awarded  Critic
Feb
25
comment Adding conditional toggles into methods for running tests
PHPUnit allows you to create a mock from a real implementation, so mocking shouldn't be that difficult in most cases unless the protocol of your class is in a very unstable state and keeps changing all the time. If that's the case then it's usually a sign that you need to do a bit of design work before actually sitting down to code anything. Mocks are a far better solution than introducing code into your implementation that exists purely for testing and debugging.