Tag Info

New answers tagged

5

A question about the word "meaning" should not be discussed in meaningless terms like CFoo. Lets make a better example: #ifdef _WIN32 class MyUsbDriver { /* ... a public API to access a special USB devcice.. */ /* ... internal implementation: Windows sepecific.. */ }; #elif _LINUX class MyUsbDriver { /* ... exactly the ...


0

Find a pen and a paper and start modelling your system. You will find that you probably need a domain entity called PERSON. Since both STUDENTS and TEACHER "is-a" PERSON, you could create an abstract entity called PERSON with generic attributes like firstname, lastname etc. A TEACHER -> is-a -> Person. Now you can try to find characteristics for a TEACHER ...


0

Comparing complexity of processing two different types makes no sense until it is not representing same data in these types.


8

Executive Summary Excluding Big-Integers, Strings that are more than one character long are inherently more complicated than numbers because they: are represented as a list (or shallow tree) of multiple numbers can be alphabetized have case sensitivity have punctuation, accents, characters, and whitespace, which all need to be treated differently have ...


1

Its down to memory - an integer variable, for example, will occupy a set number of bytes and will never grow or shrink. A 4 byte variable remains like that and is copied around the system as-is, This means passing one into a function copies the value directly. Strings however, occupy a variable number of bytes and this makes them fundamentally different to ...


1

In my opinion, we use numbers, don't process them. If you are doing some kind of numerical analysis (which I do often) in any language, you'll use the numbers as input for formulas, for example. This is of course not necessarily always true, but usually true. Strings are "processed" more. For example, you don't make a script to put numbers to lower case, ...


4

I think there are two aspects to this, and your question was not entirely clear which direction you want to take. String operations from the perspective of the programmer can be easy depending on the language. Perl, for example, has regular expressions and other string operations baked into the language. It is trivial to transform or search strings. Other ...


1

This depends clearly on the programming language. For example, when using a language focused on numeric processing (like Fortran), or when using a language like C where "String" is not an inbuild data type, or at least not implemented as seemlessly and without a concat operator like "+" or "&" and garbage collection (like in Pascal), then string ...


1

They are trying to establish a correspondence between the terminology related to interlocked operations and the terminology related to acquiring/releasing a guarded resource, which is not an unreasonable thing to do, since the former are usually performed in order to accomplish the latter. When performing an interlocked operation for the purpose of ...


2

The reference is to some resource that fundamentally cannot be held by two agents simultaneously. The classical example is a lock, mutex, semaphore or similar construct, and the canonical use case is making a money transfer. If you acquire an unsharable resource before subtracting and adding the amount from the two accounts, and don't release it until ...


1

From here: The easy way to remember the difference between Acquire and Release is that Acquire is typically used when you are acquiring a resource (for example, taking a lock), whereas Release is typically used when you are releasing the resource.


2

What you apparently failed to do is what any large project needs: project management, documentation, planning, etc. etc. Yes, it's paperwork, it's not fun like coding, but it needs to be done. Make sub projects, modules, split things up according to functionality, define interfaces between those sub projects, document everything, have some diagrams (UML ...


4

Two things: Split software into manageable pieces, each of which is simple and intuitive on its own. Most software that actually works is already like this to some degree, and usually you only need to work in one part at a time, so it's a lot more doable than it might seem at first. When something really is too hard to understand, that doesn't mean you ...


0

You should architect the API around resources, not around roles, e.g.: /rest/students should be accessible to anyone with a role that allows them to see students. Internally, you are implementing role-based security. How you go about that depends on the details of your application, but let's say you have a role table, each person has one or more roles, ...


12

Your concerns are extremely valid. Especially the first two points about Team A not having the time to add features or fix bugs that impact Team B. I've seen this happen at my own job quite a few times. This might be a good idea if: It is known that Team A will be working on the projects that require new features in the database, while Team B's goal is ...


1

I don't know if it's a best practice but I like to have a development environment as complete as possible. Including application server, database and external applications that are invoked during execution if possible. This allows me to develop independent from others. I can redeploy and restart servers when I need. I can fill my database with my test data, ...


1

Very valid question and my team was in a similar situation - which is why sticking to the core specification of the API in use is so much more important to avoid vendor lock-ins. My answer is assuming you are on a Java stack but you can juxtapose for other language stacks. So yes get local setups for your team but you may not be able to get WebSphere so ...


0

I pretty much agree with what @radarbob answer states. For some time I wondered as well, about how one would implement such a design pattern in "real life". It's fine when reading about it to understand the design pattern theoretically, but actually applying it is different. If you have access to Pluralsight I would highly recommend the following video ...


2

You may need to consider some re-factoring. So it looks like we have [Client] -message-> [Server] and Message (and all derivatives of) are stored in the [Common] package. In your comment you explain that the Message contains a function which gets called by either the Server or the Client depending on which received the message, which in turn calls a ...


4

In C++, the pre-increment operator may be written to return a reference to the incremented object. The post-increment operator has to return a copy (because the return value is the value before the increment operation). So, if you're using increment and don't care about the return value (such as in a loop increment), then you want to prefer pre-increment as ...


3

IMHO Lazy loading is a pattern in your list of design choices. There is no "always" or "never" .. more the question: when should I and when shouldn't I. Way back when I used to always have lazy loading for most things, these days I rarely use it, preferring instead to load "a good amount" (more formally known as a "bounded context") of several objects and ...


2

Framework has come to mean something like angular.js or .NET, so it would perhaps be misleading to use that word. (Only because of current trends in programming culture, though; it's perfectly reasonable usage otherwise.) You could refer to your initial set of files as a scaffolding, or as mock-ups if they only exist to show an initial visual design.


1

What Ixrec said. I would like to add that I would call it a site map, because that's what a sitemap basically is. The site map may have a public part, which you might want to include in an actual "site map page" presented to the visitors, and a private part, which might contain things like administration pages etc. the existence of which you probably ...


2

As with any naming question it's hard to say that anything is incorrect, but it would definitely be misleading and/or confusing to use the term "framework" for this. The term "framework" normally refers to something like ASP.NET which provides necessary features like session management, but doesn't impose any particular page hierarchy. Using "skeleton" seems ...


1

Although it's probably too heavy in the form that's written about in the standard texts (1, 2, 3), you may be interested in the ideas behind the Personal Software Process (PSP). At the most basic level, you capture size of an artifact (pages, diagrams, lines of code), effort (time to complete a task), quality (defects in an artifact), and schedule (progress ...


1

Is your question essentially a project management for software projects question, i.e. what tools and processes should I consider for single-man programming project management? If so, I would think about your challenge as planning for yourself and planning for a potential future beyond yourself. As far as programmers notebooks go, I have made it a habit to ...


4

There's an additional thing you may want to take into account besides the sheer speed factor. The code itself. And it's maintainability. Does this kind of lazy loading make the code slower to write, or harder to understand and change? Does it make the architecture more complex that it needs to be? Some examples follow. if (_AllCustomers == null) { ...


1

In C# there isn't much difference. The difference lies in what you can call on the reference you created. This code ICustomer customer = new Customer(); creates an interface reference named customer to the instance created by the new Customer(); call. This code Customer customer = new Customer(); creates an object reference name customer to the ...


-6

This question goes to the very heart of what Object-Orientation means. Simply put, in a language like Java, C# or Visual Basic.NET, classes (and structs) define Abstract Data Types and interfaces define Objects. As soon as you have a class or struct as a type (i.e. the type of a local variable, field, property or a method parameter, a method return type, a ...


10

As long as your code looks as simple like this void ExampleFunc() { ICustomer oCustomer = new Customer(); oCustomer.Method1OfICustomer(); oCustomer.Method2OfICustomer(); // ... } there is no semantic difference - you can exchange "ICustomer" by "Customer", and the behaviour will stay identical. In this example, however, it could fulfill ...


2

How you create it is not better or worse in any way. Let's think about it: You either set objects or get objects (i.e. passing them into a constructor, method or returning them from a method). In either case as long as you are providing an interface for setting and getting you can new up your object in any way you want because either way you will be able ...


17

There is one, very important distinction that I think that you're overlooking. The code you provided is for three things: the declaration of a variable, the instantiation of an object, and initializing that variable with that object. There is no interface implementation here. Customer needs to implement ICustomer (or do one or two other tricks) for that ...


0

A good example: man sa-update (spamassassin) EXIT CODES An exit code of 0 means an update was available, and was downloaded and installed successfully if --checkonly was not specified. An exit code of 1 means no fresh updates were available. An exit code of 2 means ... In this case, exit 1 is simply an informative code. However, if I would have written ...


1

It looks like you are using your observer as both a publisher and a subscriber, while the Provider is only a publisher. Or is it both too? This seems a bit confused. Maybe you should make some kind of Bus or Queue that you can both Publish and Subscribe to. There are so many complexities in messaging that you really should make a distinct component be ...


0

Are there any drawbacks to modifying the Subject Observer design pattern this way? Well, yeah. What I see is backwards, inside-out; an incorrect implementation The observer (ObserverClass) should not be the notifier - the notifier is your ProviderClass. The notifier notifies, the observer observes. Having the ObserverClass calling the providers ...


1

or just another regular class with private methods and own fields along with action methods? Yes. It's just a class, i.e. keep methods small and refactor as needed into private sub-methods (or delegate to other classes, if appropriate). Personally, 20 lines is a good upper limit, but I try for less. Occasionally, e.g. for complex algorithms with lots ...



Top 50 recent answers are included