Reputation
1,530
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
7 14
Newest
 Yearling
Impact
~40k people reached

  • 0 posts edited
  • 0 helpful flags
  • 15 votes cast
Feb
4
comment How to decide what instance variables to have in a class?
@nocomprende: I'm really not following your reasoning at all here, or how it relates to the original question. If you're suggesting that, in any Turing-like system of input/calculation/output that the output can always be inferred from the input then, yes, that is true. There are 0 scenarios in the universe where that logic doesn't stand. That doesn't invalidate the need for calculation, though. The point of the computer is to perform that calculation. But this theoretical discussion seems really broad compared to the original question.
Feb
4
comment How to decide what instance variables to have in a class?
@nocomprende: I'm not sure how you leapt from "don't repeat information" to "don't use a computer at all"... I'm simply suggesting that one maintains a single source of truth in any given context for any given piece of information. The proposed alternative, manually keeping different sources of truth synchronized, is highly error-prone and overly-complex.
Jan
21
comment How to decide what instance variables to have in a class?
@nocomprende: It would still be a line or two of additional unnecessary code in that case. It's a very small example of the concept, of course. But it illustrates the point. You'd be storing the same value in multiple places. As the complexity of the system grows, the potential for bugs grows faster. Anybody working in that code needs to manually remember to keep all of the values synchronized, and humans aren't good at doing that. Exceptions can be made for very expensive calculations, but those are rare.
Jun
18
comment Correct approach for creating api contract
@AshutoshPandey: If the new added field is required, it is a change to the published API regardless of how it's implemented. If it's not required, then either approach would work the same to any external observer. There really isn't much of a difference at the published API level.
Jun
18
comment Correct approach for creating api contract
In the first approach, will the server-side code be peeking into the dictionaries and making assumptions/requirements about what they contain? If so, other than losing all compile-time type safety, what's the benefit over the second approach?
May
22
comment Should the design take longer than code development?
This reminds me of one of my favorite quotes: "The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time." - Tom Cargill
Apr
5
comment Programming Test
Maybe have the candidates fix the system you're using? Or have them develop a new one?
Jan
20
comment Should I intentionally break the build when a bug is found in production?
@JohnBuchanan: What are the tests meant to validate, if not that the software is doing what it is supposed to do? (That is, that it meets the requirements.) There are, as you state, other forms of tests outside of unit tests. But I fail to see the value in unit tests which don't validate that that software meets the needs of the business.
Dec
15
comment How can I learn practical applications of software engineering principles?
@justausr: The best resources I've found for personal growth in the trade (second only to experience on a good team) are books. I linked to one, jgauffin linked to another. These books will internally reference more books, and so on. Martin Fowler, Bob Martin, Kent Beck, etc. There's no shortage of great books from great authors. Don't just read them, apply them. Read a little, think about it, blog about it, write code to demonstrate it, read more, rinse, repeat.
Aug
8
comment Keeping an MVC model loosely coupled from the DB?
@Industrial: Keep in mind also that the repository methods don't have to just be CRUD. Lots of intelligence can be baked into that code. A lot of the more complex ones can have a lot of internal code which transforms data from the database. Or, if the complex ones involve many trips to the database, then for performance gains you can put the logic in a stored procedure and the DAL method just passes through to that procedure and translates the results into models.
Aug
8
comment Keeping an MVC model loosely coupled from the DB?
@Industrial: For example, if you use an ORM, then that ORM would be referenced by your DAL (which is isolated from the domain models) and would transform your models into data access accordingly. Or if you do direct database access with manual SQL, you'd do that in your DAL's repository methods and translate the results of the SQL queries into domain models before returning them.
Aug
8
comment Keeping an MVC model loosely coupled from the DB?
@Industrial: There are a number of ways to connect models to persistence, but so far the only method I've found which truly satisfies my desire to separate concerns is to have repository interfaces in the domain which are externally implemented by a DAL. The repository methods accept and return domain models, and internally converts between those and any generated database entities. (To be honest, I haven't done this much in PHP.) So you can use a DAL framework to auto-generate all your DB CRUD, etc. and then write your repositories as an interface between that stuff and your models.
Jun
24
comment Is there an agile project management technique for developing innovative software systems?
"The development is innovative since we don't know how to develop it" - Best definition of "innovative" I've ever heard. Our marketing department is going to love that one.
Mar
15
comment Advice: How to convince my newly annointed team lead against writing the code base from scratch
@Mark Canlas: Absolutely. And that's where a lot of developers (even very experienced ones in many cases) lose their grip on the overall business. It has to have actual tangible value for the business, and very often the existing product has that value. Though one argument I always hate from the business is "we already spent money on this, so we need to use this." Sometimes, as in the case of my last job, a decision like that drives them into the ground. It's neither "always re-write" nor "never re-write." As you said... balance.
Mar
15
comment Advice: How to convince my newly annointed team lead against writing the code base from scratch
@Mark Canlas: It's kind of funny actually, because I'm often a proponent of re-writing. I hate legacy code :) But I also understand that if I can't demonstrate added value to the business, the re-write shouldn't happen. My opinion needs to be backed by numbers.
Feb
18
comment When should I use—and not use—design patterns?
@user374980: Agreed. The patterns themselves are essentially language-agnostic, but different languages will have different details on the best way to implement them. Simply porting an implementation from C# to, say, Ruby may be ill-advised. Attempting the same to Lisp is downright silly :)
Nov
14
comment What is the definition of “technical debt”?
To expand on this a bit... The idea is that we can "pay a little now" to design it properly, or "pay more later" to retro-actively fix it (since changing code is generally easier in the design phase than in the support phase). Thus, much like credit debt, it does accrue interest. In the end, more is paid to get something done quickly (like buying something before one can afford it with credit.)