Tag Info

Hot answers tagged

87

Get to know your domain Every application is meant to solve a certain issue. This issue belongs to a domain, be it finance, transportation, human resources,... When your users talk about the application, they talk in terms of that domain. So when you think about your application, try to think in terms of that domain using the wording your users also use. ...


22

In the simplest of terms, your mentor is asking you to discuss the "WHAT" of a project, rather than the "HOW". "WHAT" does not focus on the composition of the project, but rather what it allows a human to do (some call this an object's affordance). "HOW" is the underlying tools used to provide this ability. Here are a few examples. Google WHAT: A search ...


19

Very broad question, but my quick tips would be: Use a writing pad and a pen for designing your solution. Or a whiteboard. But not Notepad, the app. Seriously - just leave the keyboard. This by itself puts you into a different mindset already, and this different mindset is what you need. Our brains are wired to think in a certain way as long as our palms ...


16

Learn more languages When you only know one language/paradigm (well), you only really have one language to describe what you want to be doing. That is only exacerbated by C++, which punishes you if you don't look after the minutiae of what is going on (memory management, undefined behavior, lack of tooling help when writing code). By learning different ...


12

I too had this problem. I realized that my brain would drift to implementation concerns whenever a discussion started. The problem with that is it limited my ability to be creative. Creativity requires that you consider ideas that may not work. Once you have an interesting / creative idea, you can then shift into a more critical "implementation" state of ...


8

Your manager has his head in functional specifications and domain-specific terms, just as much as you have your head in code (where you think a few hours per day of "classes, function calls, variables, types, modules, threads and network connections", he thinks of "transactions", "customer-facing activity logs", "more responsive interface" and so on). ...


4

Stop thinking/talking in terms of code. Think about abstraction and simplicity, talk as if you are explaining your design to some client or a developer who doesnt even understand what our code does. How do I foster this habit? I think something that hasn't been mentioned yet or focused on is the language you are speaking. While it sounds ...


4

Consider an analogy using the layered structure of programming: At the lowest layer is the machine code, binary command sequences for pushing bits to perform arithmetic, load and unload registers, communicate with hardware, etc. To make machine code friendlier to humans, we have assembly languages which ascribe recognizeable character sequences and ...


2

It basically boils down to manipulating a black box function. Learn what output he must give (to his boss, etc.) Decide what output you want from him to you. Factor other things affecting him. Modify the input you give him so you help him satisfy the goals he must meet while encouraging the proper return value to you. understand what he wants to get from ...


2

I posted a question here that was brought about by the same problem: trying to both take advantage of the convenience of referring to objects by their base class, while at the same time using additional properties that their subclasses may contain. The solution that was most useful to me was to use the visitor pattern. In your Point base class, you define ...


2

I would think you would need both. Domain specialists would be needed to help the developers build the abstractions that are required, they would also be needed to verify the application is indeed useful and does what is needed. The software developers and engineers are needed to write the code, make sure it is efficient etc. runs on the target platforms ...


2

Consider two options. Validate everything on the server, at all times. Suppose you pay for 2 extra weeks of developer time (e.g. $10k), and e.g. $100/mo extra for more computing power. Nothing interesting happens. Do not validate input and save the money and time. Then someone mischievous steals a secret, finds out that the server side allows to do ...


2

I'd say no, its not. The reason is that anyone can sniff the network traffic to see what your calls are, and if you're not validating, you're opening up security risks as well as data corruption risks. The performance rationalization doesn't hold water; are there performance issues on the client running the rules? If not, then there should not be ...


2

In most respects the std::unique_ptr was made to be drop in (but safer) replacement for std::auto_ptr, so there should be very few (if any) code changes required other than (as you ask) directing the code to use either unique_ptr or auto_ptr. There a few ways to do this (and each comes with its own list tradeoffs) below. Given the code sample provided, I ...


1

There are already so many answers, and I have to admit, great ones too. So it is hard to come up with something, which hasn't already been said. I am trying to do this in two parts: Part One - Analyzing, what is being said. Stop thinking/talking in terms of code. Think about abstraction and simplicity, talk as if you are explaining your design to ...


1

Get into the habit of using pictures. This could be UML diagrams, flow charts, state diagrame or whatever best fits the application. This gets you away from actual code into thinking about: What the code does. How the code is structured. These diagrams can then form part of the documentation for future maintainers, as well as for explaing to other ...


1

I will answer the title's question and then your specific question. The problem is that many programers are used to one way of thinking and that is making a big problem smaller to a degree they can tackle. Sometimes you need to think just the opposite. So ask yourself, "How can I stop thinking?" Meditation might help for that. It will make you a better ...


1

There are a bunch of things you can do to help yourself develop the habit of effective communication w.r.t. your code, your designs and what they all do. Take your time, it takes practice Listen to your peers; do they do it, how do they do it? Learn from those that you respect Learn and understand the core/classic patterns (aka GoF), understand these ...


1

Using strategy objects in the described way is a good start to simplify your PointBase class, I would not hesitate to introduce them even if they do not solve your problem with the BreakEven property. For allowing custom properties, you could provide some kind "extension mechanism" in your PointBase class (which I would rename to Point after the redesign). ...


1

I'd implement a BanCommand class, which takes care of this. Domain models don't necessarily have to have state; sometimes they represent actions that take data and do something. That's pretty normal OO too; objects are behavior + state, but sometimes the objects don't really need any state to do something useful. That's why I always list behavior before ...


1

I would call one object's method from the other, to avoid code replication. I would find a way to do this like that : class BanService() { public function __construct(IUserRepo $userRepo) { $this->userRepo = $userRepo; } public function banUser($userId) { $this->userRepo->getUser($userId)->ban() } } or ...



Only top voted, non community-wiki answers of a minimum length are eligible