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

(I'm talking about HTML / CSS code (not programming languages) but I think we also face the same issue as with programmers.) I am the senior front-end designer in a team and I often have to re-work my juniors' output in tight deadlines. I am faced with 2 problems:   1. Their coding style is a bit of a mess.    2. The aesthetics are not good. Their coding style, I find, is a mixed bag with no proper convention / standard. I am torn between cleaning up the code or just dealing with their code (even copying how they do things). I do find it frustrating to follow their coding style as I feel I might learn bad habits. But then, that is the fastest way of meeting the deadline. For those with much more experience, which is more effective? Should I save the clean-up for later? Or clean-up along the way as I make the changes? (I don't want to sound arrogant though but such is the reality. It will take them more years to write better code. I know, I wrote messy code when I was starting.)


How to include incomplete math grad program on entry-level programming resume

I am creating a resume so that I can start applying for entry-level programming positions. How can I include my time spent as a graduate student of pure mathematics since I did not complete my degree and am not currently enrolled? Should I attempt to include this? I have been given conflicting advice on this. Also, without this information I have a huge gap in finishing my BS and today. About me: I have a BS in Mathematics and Computer Science. As an undergraduate, I became more interested in pure mathematics than computer science. After graduating, I became a graduate student in mathematics. However, I was forced to drop out mainly due to the university cutting my GA position due to lack of funding (I am from Illinois). It has been nearly three years since I left my graduate program. Since then I have bounced around a bit in dead-end jobs while trying to figure out what sort of career would fit me best. I studied actuarial science, tried to create an internet start-up and spent time trying to figure out how I was qualified to be an industrial engineer.


What is this programming style? "Monoid-ic"?

In a moderately old blog post, Conal Elliot makes an interesting (if less than serious) argument that C is a purely functional language, by drawing a parallel between the combination of the C preprocessor and C itself, and that of Haskell's pure expression language and its impure IO action values. It's observed further down that the phase separation between C's components actually makes what `cpp` does quite different from Haskell, though, so `cpp+C` is not monadic after all. In real programming projects, C programmers prefer to minimize their use of `cpp` as far as possible. The macro language may be capable of amazing things, but it's a fairly hostile programming environment. So as far as I can tell this concept is mostly unexplored from a C perspective. However, building on the example of C, we could envisage a language where the primary way of programming is for the developer to write a purely functional program which _builds a fixed sequence_ of action values and strings them together into a finished program. Distinct from Haskell's model in that the functional program only exists at "compile time", with a clear separation between the two stages of evaluation and execution; distinct from C's model (or Lisp's) mainly in the emphasis on the "macro" stage as the _primary_ programming tool (and with a macro stage that isn't.. y'know, horrible - rather, it looks and runs like the full-fledged language), with the end program consisting of a fixed sequence of "action" building-blocks that the developer is discouraged (or even prevented) from authoring directly.   * Does this programming paradigm exist? If so, what is it called and what are existing examples of it? Is there any literature on this topic? ("Metaprogramming" is the obvious answer, but that seems too broad and off- target: `cpp` or C++ templates as they're currently lightly-used also fall under that, while Haskell IO doesn't.)


Is there a mature, easy-to-use CQRS framework that is not Azure-specific, not outdated, or not well adopted?

I've been doing research on .net implementations with CQRS. Either everything I've seen so far is do-it-yourself, azure-specific, outdated (i think), or not well adopted Problems:   * Scritchy - is not well adopted   * NCQRS - appears to be a bit older? it also requires a DIY-ish setup - meaning, you need to create several projects yourself (not all that terrible though).   * https://github.com/gregoryyoung/m-r \- more of a theoretical demo than a production framework   * LOKAD.CQRS - mostly azure specific   * https://github.com/MarkNijhof/Fohjin \- again, more of a demo than framework I'm working on a new project. It will be hosted in AppHarbor. I would like to use a CQRS approach. I would prefer to use an awesome framework rather than write/copy it myself.


Microsoft's Software Development Engineer in Test position

I was curious about MS's Software Development Engineer in Test (SDET) position. I've heard a lot of people speak negatively and positively about this position. I was wondering if any current or previous SDETs could comment on a couple of issues. 1) Is career development in any way hurt by this position within and outside of MS? 1.5) Is it harder to get hired as a developer at another company after being an SDET? 2) Within MS culture, how is the SDET position viewed with respect to PM or SDE? Is it respected or looked down upon? 3) If you worked as an SDET, did you like it?


Should I add MSDN notes or Stack Overflow links to source code?

> **Possible Duplicate:**   >  Is it OK to put a link to Q&A sites in a program's comments? I'm creating a powershell / C# host and want to add the following comment               // This method cannot be called multiple times on a given pipeline. The state of the      // pipeline must be NotStarted when Invoke is called. When this method is called, it     // changes the state of the pipeline to Running.      // see http://msdn.microsoft.com/en-us/library/windows/desktop/ms569128(v=vs.85).aspx     if (pipeline.PipelineStateInfo.State == PipelineState.NotStarted)     {         Collection<PSObject> results = pipeline.Invoke();     }      Is this an appropriate comment? What would you improve about it?


Besides polymorphism, what's compelling about OOP?

When I first came to OOP (at first in Java, and then C++) after years of working in C and VB, it was amazing. The idea of extending existing behaviour and operating generically over things of related types was very appealing, and I almost immidiately saw why it was that I wanted this. That is, my motivation for OOP was subtyping polymorphism and inheritance. Fast forward to today, and I regularly get to use ad-hoc polymorphism solutions (typeclasses and duck typing) which solve the problems subtyping originally appealed to me for in very elegant ways. I have access to parametric polymorphism in most of my environments. Programming generically with these different sorts of polymorphism gives me all the extensabiltiy and re-use inheritance ever did, and more. So, my question is: why should I still care about OOP? What uses of OOP have you found that are really great besides inheritance and subtyping? Also, "because it's popular and you will have to use it" does not count. I already am quite familiar with OOP, and use it in my day job because the code base uses it. For a new project, or for myself, that's what I'm asking about.


Upgrading in java web development

I'm a java web developer for nearly 3 years. Always trying to learn more and be better but still I feel that the amount of knowledge is not that good as I want. The knowledge in some places still seems to be non-systematic and don't provide a very strong base to solve the problems as good as I want to do it. The example I have is my senior developer, whose solutions are always more efficient and beautiful. So, the question is rather simple and hard the same time. What is the right way to get my knowlege be more systematic and therefore improve it's quality. I understand that there is no practically good answer for the all java programming, so let's focus on the modern java web or nearly web technologies:   1. JSF 2.0   2. JPA2 and Hibernate as persistence provider   3. Web services   4. and Java SE as a core. What methodologies or books or learning technics lead to the strong knowledge base within the given knowledge area?


WinRT: How usable will it be?

WinRT: is it really about calling WIN32 (wrapped in COM (exposed as .NET)) via _a proprietary extension_ of C++? That looks like a lot of wrappers and layers between the developer and the actual functionality. Does anyone trying to go with it stand a chance at profoundly understanding the ecosystem (if his last name isn't "Petzold")?


Why do certain sites prevent spaces in passwords?

It seems less common with newer websites, but many websites I need an account on (like for paying bills, etc.) prevent me from creating a password with spaces in it. This only makes things more difficult to remember, and I am aware of no database or programming restrictions on spaces in passwords, encrypted or (heaven forbid) otherwise. Why, then, is the spacebar so commonly discriminated against when it comes to signing up for a site?


Code to simulate a users actions, such as logging in

I've recently begun working on a PHP application, replacing another developer. I believed the application was using an API to communicate with a remote service but when I looked through the code I found that it was using a set of functions to actually log in, fill out forms and submit them as a user might do in a browser. My intention is to replace this code, to use the services API instead. I've considered leaving the code as is and not replace it. It makes me wonder though is this a common practice in the software industry? To have a programme simulate a users actions in a browser to perform a set of actions? It feels to me that this is clever but poor programming, Have any other developers seen this? Edit: Sorry, should have added this in the first place, the code I describe isn't part of a testing suite, its live code.


Advice for an ambitious student on building your own kernel

I'm a very ambitious university student who wishes to learn pretty much everything there is to know about computers (bash me if you want, I love learning). Recently I thought it would be a fun project (albeit a lengthy one) to design and build my own kernel. I got some basic info and I've gathered that I need to master Assembly and C/C++ to really make this work. While I'm working on those, I'd like to learn HOW a kernel actually works from a programming perspective. I've spent hours browsing the linux kernel's code but that can only take you so far. What are the basic steps in building a kernel? Things you need to address? Order or doing things? I know I'm biting off a lot but I'm determined enough to handle it.


What functionality does WebStorm contain which RubyMine does not?

I am looking at buying Rubymine as I am doing a small amount of ruby, but a large amount of html5/javascript. I was going to get Webstorm as I do have a lot of pure html5/js based frameworks/apps that I am working on, however I then read that WebStorm/PhpStorm/Rubymine etc are all based on their IDEA framework, and made out like each framework contained the functionality of WebStorm anyway, other than a few features which were not there out of the box but could be added through plugins. The main features that interest me about WebStorm are:   * JS Unit testing from IDE   * JS Lint/Hint coverage within UI   * DOM/JS Refactoring/Intellisense   * Coffeescript support   * SVN/Git integration   * FTP and remote sync (although not as important as the rest) So given the above, would Rubymine provide the above functionality too? as I would rather have 1 IDE which I can do both in, than having 2 IDEs which have a lot of overlapping functionality. Is there any specific functionality which is ONLY within Webstorm but not in any of the other IDEs?


Return Types from Service Interfaces in Service Layer: Mapper required for UI Layer objects?

I am designing a component based system using JSF2 on top of Spring's IoC Container. It is to employ a service layer between a controller and the domain/business layer (I anticipate the controller is nothing more than the JSF Servlet binding in the web.xml file). The rationale for the service layer (which conforms to an interface for each service) is to allow for the services to be changeable. It has occurred to me that the return types of the objects from the service layer objects are likely to be business objects from the business layer, which would then be used in the backing beans for the JSF view to populate the UI components on the pages. _Ideas:_   * Is it acceptable as a standard practice for these business layers,   say a Customer() object coming back from a FindCustomerService, to   just be passed back to a Presentation Layer backing bean? Can the Presentation Layer know about the Business Objects or are these not a part of the Service/defined for use in the Service Interface and therefore part of the contract for a Service implementation?   * Alternatively, should I be thinking about representing components on   the UI using a generic set of UI classes within the backing beans, which are then mapped to the return types coming back from the Service Layer in another layer between the   Controller and the Service Layer? (This would likely require re-engineering if a Service was changed?)   * Perhaps it is a standard practice to return using standard language scalars and object return times from the service layer to avoid the need for a translation layer? First SOA project. Figured this would make a nice question for archive and links to appropriate patterns would be greatly appreciated.


When do you use new technology and complicated design principals in an LOB app (using WPF)?

I'm building an LOB app for a very big and serious client, the app itself is not big but my client is so I have to get it right. I'm generally tempted to always use the latest stuff out there and learn as I go, sometimes this ends up in good productivity. Like when I wrote most of with WCF Data Services over asmx services, and then I used Silverlight over ajax/asp.net, these turned out to be a good decisions although there was initial pain in getting off the ground. Specifically I'm thinking of using WPF over win forms, I've never used WPF, but would the learning curve out-weigh the benefit? Also generally would this kinda thing be a bad move when we're really tight on time? **Second:** When it comes to design principals like for **example** using MVVM in my case. Would that again be an over kill for a small app? (4000 lines as a bad estimate?) Sure my code won't be testable but would I even need such a small app to be testable? Overall I'm trying to keep my base code neat and my UI layer thin. **My question is:** Just generally, I want to know, how many serious devs/small companies out there, move to newer technologies or hard core design patterns, practices, frameworks (Prism, CAB) or models (MVVM) for smaller apps? How do make a call for >> complexity + learning curve _vs_ benefit **Edit** * * *   1. I'm I have about 1-2 months tops, a lot of base code and almost all planning & design is done.    2. Its a fixed fee I'm billing which sucks, but they are starting to have a few plans to build more functionality on top.    3. I (sole dev) will be maintaining it.   4. Partly I want to choose WPF to provide a better more professional look too, to get them to buy more updates/upgrades on functionality from me.   5. I actually tried writing my own crazy MVC framework in win forms, it was a mess, I have a "feeling" my code will be better in WPF?   6. Any thoughts on using MVVM Light?


Does pair programming ever turn into lengthy unproductive discussion?

I was just thinking about pair programming and one thought just crossed my mind that surely at some time two coders are not going to agree and it would kind of turn into a lengthy (maybe heated) discussion about an implementation of a paradigm or algorithm, etc. I expect these might be 'religious' wars over stuff? Does this happen? Having never 'pair programmed' ever, is this something that occurs? Are there processes to stop lengthy discussions?


MVC : Fully populated models or Partially Filled Models?

This one has haunted me for so long. When doing MVC programming what do you think is the better programming practice? Should one use fully populated models or the partially filled ones, especially when I know that for this particular task I am going to need only 2 fields from the model object which has 5 others? Sometimes it just seems criminal to fill a list of 20 model objects with all values from database when you know that you are going to need only a few of them. Of course partial model means that you will have to write one more method in your DAO apart from the one which fetches everything. Which mean more code to maintain? On the other hand pulling everything from DB with fully populated models means one method serves all but this is obviously going to give you some performance overhead. I can see ORM (such as Hibernate or ActiveRecord of Rails) favoring trends in MVC programming and databases like Google’s BigTable full models is accepted trend. But what if you are still using good old JDBC? Hardware is cheap, development is costly. Is that really true even when the app needs to scale to few hundred thousand requests per hour?


Inheritance from the objects themselves

Making new inheritance hierarchy with the help of C++ I think about: > Why there is no inheritance from the class objects? Abstract example (on > abstract C++): >   >   >     struct Foo { int v; Foo(int a) : v(a) {} }; >     struct Buz : public Foo(2) { ... } >   > > So, the `Buz` is inherited only from instance of `Foo` \- `Foo(2)`. Can such idea be useful? Is there any possible implementations or related ideas?


Is Language-Oriented Programming practical?

I read this article on Language-Oriented Programming. He points out some weaknesses in the modern procedural/OOP approaches to programming, and suggests a new programming paradigm that will solve them I am all for small, loosely coupled program parts: It is much better to learn a lot of small things, all of which you will use, than a couple of big things, that you only use bits and pieces of. Reading the article, I got the impression that the author was promoting one of two things:   * A multitude of easily creatable scripting languages   * A single, easily extensible language that can rewrite itself to meet the programmer's needs If he is suggesting the second, I would reply with "Already been done!" and give Lisp as an example. As Paul Graham suggests, languages seem to be continually moving toward this anyway. As far as the first is concerned, I think this is a good idea, if there is an underlying language that ties them all together. That seems to me to be the weak spot: communication between the languages. Would you use calls, which is a procedural concept or message-passing, which reminds me of interprocess communication? I would welcome the opportunity to work with small domain specific languages, if it's easy to use them all at the same time. Would this approach (LOP) be practical?


Parallel Class/Interface Hierarchy with the Facade Design Pattern?

About a third of my code is wrapped inside a Facade class. Note that this isn't a "God" class, but actually represents a single thing (called a `Line`). Naturally, it delegates responsibilities to the subsystem behind it. What ends up happening is that two of the subsystem classes (`Output` and `Timeline`) have all of their methods duplicated in the `Line` class, which effectively makes `Line` both an `Output` and a `Timeline`. It seems to make sense to make `Output` and `Timeline` interfaces, so that the `Line` class can implement them both. At the same time, I'm worried about creating parallel class and interface structures. You see, there are different types of lines `AudioLine`, `VideoLine`, which all use the same type of `Timeline`, but different types of `Output` (`AudioOutput` and `VideoOutput`, respectively). So that would mean that I'd have to create an `AudioOutputInterface` and `VideoOutputInterface` as well. So not only would I have to have parallel class hierarchy, but there would be a parallel interface hierarchy as well. Is there any solution to this design flaw? Here's an image of the basic structure (minus the Timeline class, though know that each Line has-a Timeline): ![enter image description here](http://i.stack.imgur.com/JEwCv.png) NOTE: I just realized that the word 'line' in `Timeline` might make is sound like is does a similar function as the `Line` class. They don't, just to clarify.


How do you unit test a User Interface?

I use JavaScript with JQuery for a Rails application. I have some dynamic behaviour in this one. As a Ruby developper, I like TDD/BDD, specialy with RSpec. For the moment, I test my JavaScript manualy. It's not the best way because a change, somewhere, can break the code somewhere else. The is a lot of avantages of using TDD. Testing in javascript seems to be complicated because it should test a lot of user interaction. I can test the behaviour in complete integration, with Capybara for example, but my tests will be very slow. For example, I have a form with dynamic behaviour. In this form, I have 5 or 6 dynamic fields which change if I select an option, choose a radio button or check a checkbox. In some cases, there is ajax calls. For this form, I think I can make about 20 tests just for a form. Is it really usefull to have this tests? So, what's your rules for a standard web application?


What is the proper aproach of Subversion when using DLL

**Background:**   Our team develops a solution and it includes a number of projects. Most of the projects are built as DLLs and those DLLs are used by the rest of the projects. Currently we uses Subversion for our code management and I ask others to remove DLLs from Subversion because we do not need to keep the history of the DLLs. So I ask my team to update their source every morning from Subversion and build each project to get DLL with yesterday submitted changes. **Issue:**   This procedure was very good in the beginning f the project. but now each project of the solution getting bigger and bigger.Also gets more time to compile. now each developer waste around 20 mins each morning for build solution in their local computer. Now I'm thinking again to ask each developer to submit their built DLLs to Subversion at end of the day and the next morning the rest of the users can download these DLLs directly from Subversion. But I feel something is wrong with this procedure. Because Subversion waste space keeping the history records of each DLLs. Now I'm searching for a better solution. Do you guys have any idea over your experience?


Automatic generate code: "derived work"?

For example, I've GPL software. I'm the author of this GPL software. This GPL software has, between its code, Doxygen comments. These Doxygen comments are written to generate a CC-BY-SA html page, in order to upload this generated documentation in my project website under CC-BY-SA license. But, the Doxygen documentation output is a "derivate work"? After all, this documentation is based on my GPL source code. In this case, the documentation must be GPL. But, I want the documentation is CC-BY-SA, because it is documentation. GFDL doesn't help. GPL code can't become GFDL (the opposite yes). If this output is really a derivate work, I think, creates a strange situation, because, if I distribute my work, the recipient users can't legally distribute the generated documentation: while with my work I can do I want, the users don't, thus, they have to distribute any derivated work with the same license I offer them. What is the solution?


Why is the code section called a text section?

The section of an executable that contains code is sometimes called the `.text` section. In segmented memory architectures, a segment mapped as code is sometimes called a text segment. The unix error message “text file busy” (`ETXTBSY`) means “this file is a program that is being executed”. How did _text_ come to mean _executable (machine) code_? An ideal answer would: explain the connection between the word and its meaning; provide a citation for the origin or at least the history of the term; give some idea of which communities use it.


How to network effectively to get a job

I have been working for 5 years at the same company now. I want to go and find a new job. Finding jobs or getting interview calls has been difficult, there are have far and few. And to compound the problem I need work permit(H1b) to work. My question is how do network with other programmers and increase my chances of getting a job/interview. And secondly how to increase my network?? thanks


NP hard/complete

I have never been very clear on this concept. Please help: At the end of the day, we should want to identify useful problems for which we don't have polynomial solution so far and only have exponential solutions.We want to keep finding if we can find a polynomial solution to these problems and the use of reductions is only to be able to identify new only exponential solvable problems with help of existing known exponential problems.?? Why is concept of determinism and non determinism brought into this whole concept of exponential and polynomial solvable problems?? How is this notion useful? What do we call the problems for which we have only exponential solution so far, but we haven't been able to find reduction to a known NP - hard/complete problems..?? Thanks,


Why Use Scala over Java

I am totally into Scala as a language ... and still I struggle with why any company should switch from Java to Scala. Is Scala just syntatic sugar on top of the JVM or are there fundamental improvements in Scala over Java that would improve real world applications?


Declarative UML

I'm looking for something along the lines of WebSequenceDiagram for other kinds of UML diagram types -- use cases and class diagrams in particular. For example, the service would accept plain text input such as:               user = Actor();     admin = Actor();     register = UseCase(user);     post = UseCase(user, admin);     post_poll = UseCase(user, admin).extend(post);      ...and get the corresponding image output, without having me worry about laying out the result.


Object behaviour or separate class?

When it comes to OO database access you see two common approaches - the first is to provide a class (say "Customer") with methods such as Retrieve(), Update(), Delete(), etc. The other is to keep the Customer class fairly lightweight (essentially just properties) and perform the database access elsewhere, e.g. using a repository. This choice of approaches doesn't just apply to database access, it can crop up in many different OOD scenarios. So I was wondering if one way is preferable over the other (although I suspect the answer will be "it depends")! Another dev on our team argues that to be truly OO the class should be "self- contained", i.e. providing all the methods necessary to manipulate and interact with that object. I personally prefer the repository approach - I don't like bloating the Customer class with all that functionality, and I feel it results in cleaner code having it elsewhere, but I can't help thinking I'm seriously violating core OO concepts! And what about memory implications? If I retrieve thousands of Customer objects I'm assuming those with the data access methods will take up a lot more memory than the property-only objects?


What license is HTML released under?

All products seem to be released with a license, I'm curious to know how one would go about finding out the license of technologies like HTML, CSS and JavaScript?


Encapsulation in Domain Driven Design models?

I am using EF Code First and I had a model like below.               public class Account     {         [Required]         public string AccountNo { get; set; }         [Required]         public decimal Balance { get; set; }     }      I used a Service class to withdraw and deposit amount to Account. Then I came across this and realised that Account is Anemic. So I happily added Withdraw and Deposit methods to Account.               public class Account     {         [Required]         public string AccountNo { get; set; }         [Required]         public decimal Balance { get; set; }         public void Withdraw(decimal amount)         {             // TODO: Check if enough balance is available             Balance -= amount;          }         public void Deposit(decimal amount)         {             Balance += amount;          }      } I was very happy with this until I realised that this does not implement encapsulation correctly. You should not be able to modify the Balance directly - you should use Withdraw and Deposit methods. But in my solution you can modify the Balance directly. But I cannot make Balance a readonly property as I am using EF code first approach and readonly properties won't result in the column being created in the database table. I thought of leaving Account as anemic and create a higher level Account class which implements encapsulation and Withdraw/Deposit methods. But in that case the higher level class would not have validation data annotations and I won't get the free functionality provided by the framework. What is the solution?


Java solution for mutual authentication with smart card

I need to develop a Java solution for mutual authentication between Tomcat 6 (server) and SmartCard "IDGo 300" (client). In order to do this I thought of the following scheme: 1.Tomcat (server) send to SmartCard (client) the request of his digital certificate (signed by CA). 2.Client enters PIN and selects an available certificate on the smart card, then the Applet sends his certificate (signed by CA) to Tomcat. Tomcat verifies the digital certificate and, if it is correct, sends the certificate back. 3.The applet verifies the certificate of the server, and, if the certificate is correct, sends a confirm to server. The server gives full access to the client to use the web application. I have some questions: 1.Is this scheme feasible? 2.I would like to manage everything through my applet and when the client disconnects the smart card, he loses access to the server.


Standard practices for access control (design pattern)

I'm looking at my interface design and I am struggling to decide which is the most "correct" way to implement role-based access control, given a `user` and a `subject` that the `user` would like to access. * * * As far as I can see I have three core options (with a fourth being a bastardisation of the first three and a fifth being a tweak of the fourth):   1. Query the `subject` with a list of permissions that the `user` has - `subject.allowAccess(user.getPermissionSet)`   2. Query the `user` with a list of permissions that the `subject` requires - `user.hasPermissionTo(subject.getRequiredPermissions())`   3. Query a third-party to locate the intersections of permissions - `accessController.doPermissionSetsIntersect(subject.permissionSet, user.getPermissionSet())`   4. _Query either the`subject`/`user`, while delegating the "decision" to a third-party class_   5. Have the `user` attempt to access the `subject` and throw an error if access is not permitted * * * I am leaning toward option four - Have the `subject` contain an `accessController` field, where calls to `subject.userMayAccess(User user)` delegate the operation a la:               class Subject {         public function display(user) {             if(!accessController.doPermissionSetsIntersect(this.permissionSet, user.getPermissionSet())) {                 display403(); //Or other.. eg, throw an error..             }         }     }      .. but then this raises further questions:   * should the `accessController` be a field vs a static class..?    * Should a `subject` _know_ what permissions are required to be able to view it?   * where does the principle of least knowledge come into play here, with respect to calling `subject.display()`? Should callers of `subject.display()` ever know that access control is in effect? (where `subject.display()` is a final "template method")   * have `subject.display()` manage access control, throwing an exception where the user does not have the required permission? * * * What would be considered "best practice" in this situation? Where should responsibility for performing the checks actually occur? As this is somewhat both an academic excercise which will then progress into implementation, references to design patterns would be appreciated.


When should I pass value as class variable and when as a method argument?

Is there a general rule of thumb, when we should pass a value as as class variable and when as a method argument? Or is it just a choice of the developer? For example -- are there any reasons, why following (PHP code):               class SomeClass     {         public function __construct()         {             $this->id = $_GET['id'];             $this->showMessage();         }              public function showMessage()         {             echo 'The ID is '.$this->id;         }     }      is better (or worse?) than this:               class SomeClass     {         public function __construct()         {             $this->showMessage($_GET['id']);         }              public function showMessage($id)         {             echo 'The ID is '.$id;         }     }      Note, that I'm only asking about differences between passing value as class variable vs. passing as method argument. Please, don't point out, that I should never operate directly on superglobals in PHP. I know, that this is wrong. I used it here, to simplify the example.


Where or when to start to write your own PHP framework?

First of all, I know that reinvent the wheel is, _usually_ , a bad idea, but I want to write a PHP framework **to learn OOP in PHP and to understand MVC** in my free time. Said that, I have to do two webs with few and simple database interactions, the basic funcionality of the webs is to show information. I want to use my own framework in those webs, but I don't know where or when to start. Should I start doing the framework first and then the webs? or should I start doing one web, then the framework and then the other web?


Why are dark color schemes in editors so popular?

Nowadays, almost everybody is using a dark color scheme in their code editor - dark background with light text. Even most web based editors (e.g on Github) feature dark color schemes. I honestly don't see the benefits. The human eye is much better at reading dark text on a bright background. Also, black on white color schemes work much better when you're in a brightly lit environment. I'm currently sitting in an office with the sun shining through the window. I can read the text in my editor (gVim with dark text on white background) just fine, but on the linux console it's much harder. Editing text in console vim is almost impossible for me. The whole thing seems a bit like a strange hype to me, started by the default settings in certain IDEs/editors. But maybe I'm just weird.. ;) Anyway, so why is everybody using these?


Martin Fowler's Refactoring book: switch statement is using other object's data, why is that bad ? A deeper explanation is sought for.

In the code sample below the Rental object is using Movie's fields to do a switch statement. Martin says : this is a bad idea but he does not give any deeper explanation as to why ? Of course, you can say that this means a lot of coupling between Movie and Rental, or that Movie is badly encapsulated but those are just (almost meaningless) words, again, they don't explain the why? They don't go to the root of the question, so to say. They don't provide much understanding. What I would like to know if there is a deeper, more general design principle why having a switch on Rental is a bad idea ? In other words, how does Martin knows that the switch statement is on the wrong object ? Where does he get this insight from ? What is his thought process ? ![enter image description here](http://i.stack.imgur.com/ZRfY8.png)


Login using email or username?

Is registration login using email a better idea than username to identify the user?


How to draw a spiral using segments of varying circles?

I have an old plotter that can't handle printing true spirals. I need help with developing an algorithm to approximate a spiral. Here's a LISP sub-script that I have written which uses semicircles of varying radii to draw a spiral:               (setq inner_radius 1e3)  ; The spiral grows from inner radius to outer radius     (setq coil_thickness 35) ; This is the half-pitch of the spiral, pitch is 70     (setq outer_radius (+ 2.4e3 (* 2 coil_thickness)))     (while (< inner_radius outer_radius)             (setq P1 (list 0 inner_radius))             (setq P2 (list inner_radius 0))             (setq P3 (list 0 (* -1 inner_radius)))             (setq P4 (list (- (- inner_radius) coil_thickness) coil_thickness))             (setq P5 (list 0 (+ inner_radius (* coil_thickness 2))))             (command "ARC" P1 P2 P3) ; Draws a 3 point arc through P1, P2 and P3             (command "ARC" P3 P4 P5) ; Draws a 3 point arc through P3, P4 and P5             (setq inner_radius (+ inner_radius (* coil_thickness 2)))     )      I am using `AutoCAD` to implement the script. The code here is a cop-out - I can implement a true spiral in `AutoCAD` but the plotter, which will plot this, is dated and is not able to handle a true spiral. It can handle just circle arcs and line segments. I am seeking a method which can implement a better approximation of the spiral. For instance, I tried thinking about quartcircles (instead of the semicircles I have used in the above sub-script) but couldn't come up with a viable scheme.


AlienTiles optimistic heuristic function

Hello I am trying to use the alienTile problem described at www.alientiles.com using the A* algorithm but I cannot find any good heuristic function so far. In alien tiles you have a board with NxN tiles, all colored red. By clicking on a tile, all tiles in the same row and column advance by a color, the color order being red->green->blue->purple, resetting to red after purple. The goal is to change all tiles to the specified colors. The simplest goal state is all the tiles going from red to green, blue or purple. The board doesn't have to be 7x7 as the site suggests. Is there any good point to start because I am completely frustrated about how I am supposed to handle the problem


Should I create Use Cases or create Class Diagrams first?

So I'm designing an Education Management System(more info)and I'm wondering if I should be creating the Use Cases or the Class Diagrams first?


Java's advantage in shopping cart platform

Open source PHP shopping carts platform/framework occupy most top list. They are hot, and we want start quick. So, we are going to make decision between Magento and Opencart, PHP programmers would be happy to this end. While my Java programming colleges feel not so happy, they were selling Broadleaf commerce or JadaSite. But more online reading and discussion pushing us to this way. PHP shopping carts get more use and so tested more and they get support multiple shops and multiple vendors. What will be Java's advantage in this open source field? Or should we believe Java can give decent infrastructure in long run?


How to refresh/keep up to date content in the browser without overloading the server

I am not very educated on this topic of programming so I am seeking any advice/knowledge. I am coding a web app in PHP, and this particular task requires updating the display after the server has new information available. So, one seemingly-bad solution is to have a repeating AJAX request that spams the server on an interval, and updates when it gets new data. This puts a lot of stress on the server, so it seems unviable to me. We attempted to use Ratchet (http://socketo.me/) but could not really figure it out. Is this overcomplicating this, or is there another way we can solve this problem while still keeping server load as "practically" minimal as possible. There are websites like Facebook/most social media that dynamically show new data as it's available -- I assume they also use something that minimizes requests to the server? Or is this assumption incorrect?


Help with Seminar on Software Testing

All, I need to give a small seminar(about 20mins duration) to a class on Software Testing. Given the time constraint, I wanted to seek opinion from everyone as to what primary topics should I cover in this seminar. Also, if any references to software testing documents/videos would be helpful.


Are monads a viable (maybe preferable) alternative to inheritance hierarchies?

I'm going to use a language-agnostic _description_ of monads like this, first describing monoids: > A **monoid** is (roughly) a set of functions that take some type as a > parameter and return the same type. > > A **monad** is (roughly) a set of functions that take a _wrapper_ type as a > parameter and returns the same wrapper type. _Note those are descriptions, not definitions. Feel free to attack that description!_ So in an OO language, a monad permits operation compositions like: > `Flier<Duck> m = new Flier<Duck>(duck).takeOff().flyAround().land()` Note that the monad defines and controls the semantics of those operations, rather than the contained class. Traditionally, in an OO language we'd use a class hierarchy & inheritance to provide those semantics. So we'd have a `Bird` class with methods `takeOff()`, `flyAround()` and `land()`, and Duck would inherit those. But then we get into trouble with flightless birds, because `penguin.takeOff()` fails. We have to resort to Exception throwing and handling. Also, once we say that Penguin is a `Bird`, we run into problems with multiple inheritance, for example if we also have a hierarchy of `Swimmer`. Essentially we're trying to put classes into categories (with apologies to the Category Theory guys), and define semantics by category rather than in individual classes. But monads seem like a much clearer mechanism for doing that than hierarchies. So in this case, we'd have a `Flier<T>` monad like the example above: > `Flier<Duck> m = new Flier<Duck>(duck).takeOff().flyAround().land()` ...and we would never instantiate a `Flier<Penguin>`. We could even use static typing to prevent that from happening, maybe with a marker interface. Or runtime capability-checking to bail out. But really, a programmer should never put a Penguin into Flier, in the same sense they should never divide by zero. Also, it's more generally applicable. A flier doesn't have to be a Bird. For example `Flier<Pterodactyl>`, or `Flier<Squirrel>`, without changing the semantics of those individual types. Once we classify semantics by composable functions on a container -- instead of with type hierarchies -- it resolves the old problems with classes that "kind of do, kind of don't" fit into a particular hierarchy. It also easily & clearly allows multiple semantics for a class, like `Flier<Duck>` as well as `Swimmer<Duck>`. It seems like we've been struggling with a impedance mismatch by classifying behavior with class hierarchies. Monads handle it elegantly. So my question is, in the same way that we've come to favor composition over inheritance, does it also make sense to favor monads over inheritance? (BTW I wasn't sure if this should be here or in Comp Sci, but this seems more like a practical modelling problem. But maybe it's better over there.)


How do you report "startup experience" on your resume?

Say you've spent a significant amount of time (5 years) serially starting up companies, with enough success to keep going for 5 years, but not enough to retire rich. And now, with a mortgage and a serious relationship, burned out, you're trying to dust off your resume and get a regular, 9-5 job. How would you record/report on your work experience at the startups? Making a list of technologies sounds silly (it'll get out of hand on account of size), and very incomplete (with very small, early stage startups, there is a _lot_ more work to go around than just hacking away at code). A regular programming job also seems like a waste (with all of the mix of experience that comes from working at a startup, giving up on the additional skills learned along the way doesn't feel quite right) so reporting on the experience as one would on a regular programmers' resume might not be the correct thing.


Titles: Programmer Level I, II, and III

> **Possible Duplicate:**   >  What personal milestones can you use to measure growth in your programming > abilities? I am looking for the criteria of what makes a programmer a level I, II, and III? What are topics that you would expect to be known/understood/mastered at each level?


What is the job title hierarchy amongst software engineers?

> **Possible Duplicate:**   >  What does the suffix after software engineer/developer job titles mean? > (i.e. Software Developer III)   >  work advancement titles I've been struggling to understand job hierarchy in software engineering. The system is further complicated because of the lack of consistent naming conventions when assigning roles: for example, some companies just have a "senior software developer" position while others have Software Engineer I, Software Engineer II, Software Engineer III, and so on. Even in the top level positions, we have things like "Principal Software Engineer" vs. "Staff Software Engineer". What is the standard hierarchy for software engineers? Is there a generally accepted pecking order?


work advancement titles

After some googling I was unable to find out hierarchy of different titles in career development. Especially the connection between Senior Engineer and Software Specialist is unclear to me. Which one is higher? Most of all I would like to see links pointing to some career development paths from the trainee to the highest boss, and what kind of different routes there are including technical and managerial paths.


How to access an encrypted INI file from C on an embedded system with little RAM

I want to encrypt an INI file using a Delphi program on a Windows PC. Then I need to decrypt & access it in C on an embedded system with little RAM. I will do that once & fetch all info; I will not be consutinuously accessing the INI file whenever my program needs data from the file. Any advice as to which encryption to use? Nothing too heavyweight, just good enough for "Security through obscurity" and FOSS for both Delphi & C. And how can I decrypt, get all the info from the INI file - using as little RAM as possible, and then free any allocated RAM? **[Update]** I am currently using an Atmel UC3, although I am not sure if that will be the final case. It has 512kB falsh & 128kB RAM. For an INI file, I am talking of max 8 sections, with a total of max 256 entries, each max 8 chars. I chose INI (but am not married to it), because i have had major problems in the past when the format of a data fiel changes, no matter whether binary, or text. For tex, I prefer the free format of INI (on PC), but suppose I could switch to `line_1=data_1, line_2=data_2` and accept that if I add new fields in future software erleases they must come at the end, even if it is not pretty when read directly by humans. I suppose if I choose a fixed format text file then I never need get more than one line into RAM at a time ... **[Verdict]** I will go with either TEA or AES (tbd). I will split the functionality into two parts: 1) decrypt into a plain text file, 2) parse that as an INI file and if I hit memory problems then change to a `line_1=data_1, line_2=data_2` format. Thanks for your help.


patented algorithm

What does it mean when an algorithm is patented? Am I allowed to use it as long as I am not making money out of it? I am asking because I am working on a project and I happened to discover a feature detection algorithm that I want to implement, but then it is patented by someone. Can I use the algorithm? It is for a school project


If I wanted to build a search engine, how would I start?

Can somebody point me into the right direction? I really don't have experience writing code but I'm a fast learner. I'm not trying to say it will be easy but I hope somebody can help me...


What are the pros and cons of HTML5, native and hybrid mobile app approaches?

I want to develop a mobile application .. I read lately an article on Telerik Forum : it compares among three types of mobile application and I don't know which one should I select to begin with .. [FROM Telerik] ![enter image description here](http://i.stack.imgur.com/YA81J.jpg) To make the choice which one I should select, I need to better understands the pros and cons of each architecture choice listed in the above diagram. What are the pros and cons of each architecture approach?


Which algorithms and data structures should a developer absolutely know?

I want to be a successful enterprise Java developer. With what algorithms and data structures should I be well versed? What books would you recommend to me? To be a successful Java developer, do I need to know all the advanced algorithms such as those given in CLRS? Can you suggest a list of the topics that I should learn in the descending order of their priority? Must I know:   * Searching?   * Sorting?    * Graphs/Trees? etc?


How to manage pair- programming code check in user identification?

How do you identify users when a programming pair checks in code? I heard a complaint that, often a junior dev will be at the keyboard, using his/her account, but is not going to be the best person to ask questions about the code being checked in (the more senior dev is likely to have the best answer). Is this really a problem? Seems like a programming team could think of some way to identify pairs and get the necessary information in their version control software. I also think they're not benefiting from this process if both programmers don't know what their code does.


Single quotes vs double quotes

I just started a job where I'm writing Python after coming from a Java background, and I'm noticing that other developers tend to quote strings using single quotes (`''`) instead of double quotes (`""`). For example:               line1 = 'This is how strings typically look.'     line2 = "Not like this."      Is there a particular reason for this other than personal preference? Is this the proper way to be quoting strings? Specifically, what I want to know is if there is some type of standard or accepted best practice that drives this style of coding.


Best practices / Design patterns for code generation

I'm working on a ground up code generator project, but I feel I might be reinventing the wheel. Does anyone know where I can find some best practices guidelines or design patterns for code generation?


Tool to visualize values from variables during the execution of a program in C

I just need to see what is stored, in realtime, in some particular variables and struct used by an application written in C. I need something like the stack tracer that comes with the ADT plugins for Eclipse as part of the Android sdk.


Work Item type for refactoring duplicate methods (i.e. turning them into 1)

Given that you have two identical methods (signatures, body, input/output) that you wanted to refactor into just one, what type of Work Item from the MS Agile template would be most appropriate? Task, Bug, Quality of Service, Risk? Why?


Importance of theoretical knowledge alongside hands-on ability

I am obsessed with good code practices, clean code and most of all secure. I often find myself searching for the best way to do something, constantly asking for code review and looking for ways to improve my code. In practice I can manage (been doing PHP for a couple of months) but the theoretical part is my weak spot. I know what most of the concepts mean, I understand them but if someone would ask me to explain something I often find it difficult. This means that if I were to look for a job and the interviewer would ask me questions, they would immediately think I don't know much about the subject. Is this going to be a big disadvantage for me? Should I seriously start to learn the theoretical part more?


Can I provide a GPL app, with different licenced logo?

I want to provide my app under GNU GPL v3, but I would be glad if people couldn't change its name or its logo. Can I provide my app under the GNU GPL v3 licence, while the app's name and logo are under another type of licence like CC BY-NC-ND 3.0? (The logo and name is used in the app source and design.)


Take dynamic PHP array, package up as separate files inside a single zip file

I have this dynamic data in PHP, but for each array record, I want to allow a downloadable option to save a zip archive of all records (each as a separate file). These are actually DNS zone records that are housed in a database. It wouldn't make much sense if they're in a single text file, so I'm looking to somehow have the data exported as separate files inside the zip. I could save them to disk, but know there's a way in PHP to use the headers to force a download of data as a certain filetype. What I don't know is how to zip that data on the fly. Maybe I can't, and will have to save each to a temp folder, then zip the contents of that folder, then delete the contents after downloaded. Thought maybe the community might have an idea of where to start. Thanks!


when is it necessary or when should a controller be async

When is it absolutely necessary for a controller to be async? Should all controllers be async or is it bad practice to make all of them async unless it is necessary. Just looking for some general guidelines.


What language has integrated "list insertion" as part of code *syntax*?

Many programming languages permit natural manipulation of strings, and some languages permit the manipulations of lists too. More often then not (always?), these operations are done as _procedure_ calls, or as _member_ functions. Many programming languages do implement in syntax the fairly typical set _{prepend, replace, append}_ on **lists** (and/or _strings_ ). I would like to know if there as/was a programming language that has a syntax that minimises/rationalises/orthogonalises the **insertion** syntax of items into a **list** by syntax design? Python - as a simple example - has only: http://stackoverflow.com/questions/18033339/python-insert-operation-on-list               mylist.insert(10,'5')      Note: In python _list_ **insertion** is implemented as a _member_ function. **But:** Python **does** have some syntactic sugar for _removing_ elements from a **_list_** : e.g.               del mylist[4:7]      I like to know of any languages actually try to **integrate** (or have **strategy** ) for list **insertion** as part of the **syntax**? **An example of insertion by construction:** Here is some code from a fairly typical "Brand X" language, demonstrating typical prepend/replace/append operations {or operators, vis-à-vis syntatic sugar}, notice there is no obvious syntax for {in place} inserting (or removing) from the middle of a list. {It has to be done "by construction", or by calling a procedure}               # Demonstration of prefix, replace and append operations to a string {or list} #     string s := "23XX78";     "1"    +=: s;    # Prefix a char "1" to the string "in place" #     s[4:5] := "46";  # In place replace a char at pos 2 in a string #     s      +:= "9!"; # Append a string "9!" char to the string #         #        Although inserting into a list is intuitive,        * it is by construction (hence prone to typos/index-flips)       * it is not "in place"       e.g. ...     #     s:=s[:4]+"5"+s[5:];          print(s)      Output: "123456789!" Another example for strings:               s[:4]+="5"


Short function names for often used function or general concept

I am a bit in a dilemma: Let's suppose I have a very general function and a specialization of it for convenience reasons. Let's also assume that the specialized function is used 90 per cent of the time, hence being "the common case". Should I use a shorter function name for the general case (e.g. `do`) and a longer one for the special (`do_something_special`) or the other way around (e.g. `do_something_general` and `do`)? When applying Larry Wall's words (make simple things easy and hard ones possible), I'd use a shorter form for the more often used case. EDIT: Just to make this a bit more clear: in this example, `do` is just a placeholder for a short, descriptive name. Of course it could be longer, e.g. `run_task` or `process_file`. What I want to know is, if I have a function called `run_task_in_specific_way` that is used most of time should actually be called `run_task` (although being more specific) or the general abstraction. EDIT 2: To clarify once more: The functions I am talking about are neither providing more than one functionality nor should they be replaced by a class- based design. The reason is: they _are_ abstract in the same sense as qsort, e.g. taking callable from users to fulfill a specific action. Wrapping them into some auxiliary class does not make much sense.


Sleeping Barber Problem (with multiple barbers)

The Sleeping Barber Problem is a classical synchronization problem that many of you may be familiar with or at least heard of. It's based on the premise that a barber (a thread) sleeps when there are no customers (each customer is a thread) in the waiting room (which is a semaphore). If there is someone, he cuts his hair (symbolizing some processing) and the costumer leaves. If, then, there is no one in the waiting room, the barber goes to sleep. When another customer arrives, he then must wake up the barber. I have made a implementation of this using the following basic-idea (pseudo- code, only using `sem_wait` and `sem_post`1 for smooth reading)               Semaphore Customers = 0;     Semaphore Barber = 0;     Mutex accessSeats = 1;     int NumberOfFreeSeats = N;           Barber {         while(1) {             sem_wait(Customers) // waits for a customer (sleeps)             sem_wait(accessSeats) // mutex to protect the number of available seats             NumberOfFreeSeats++ // a chair gets free             sem_post(Barber) // bring customer for haircut             sem_post(accessSeats) // release the mutex on the chair             // barber is cutting hair         }     }          Customer {         while(1) {             sem_wait(accessSeats) // protects seats so only 1 thread tries to sit in a chair if that's the case             if(NumberOfFreeSeats > 0) {                 NumberOfFreeSeats-- // sitting down                 sem_post(Customers) // notify the barber                 sem_post(accessSeats) // release the lock                 sem_wait(Barber) // wait in the waiting room if barber is busy                 // customer is having hair cut             } else {                 sem_post(accessSeats) // release the lock                 // customer leaves             }        }     }      However, now that I'll implement this problem with multiple barbers, my head got stuck. I went on Wikipedia to see if I could find something about it, but the only thing that I found there was this > _A multiple sleeping barbers problem has the additional complexity of > coordinating several barbers among the waiting customers._ and I couldn't figure this out by myself. In which case I'd have this complexity? By several barbers going to the waiting room to see if there is anyone there and then taking (more than one barber) a single customer? Would I need an extra semaphore here? 1sem_wait() locks the semaphore. sem_post() unlocks it


What's the most effective way to share code between .NET applications?

In our work, we have several different .net applications that share a lot of base functionality. We've built these applications using a clean n-tier architecture, but we've hit that moment where we realize that we've re- implemented the same functions several different times. Obviously this violates DRY, and we would like to correct that. We're already using Nuget to some success for common glue code (wiring up IoC, logging, settings), but we also would like to share our data and business layers between all our applications. The idea is that the UI would only deal with the parts of the business layer it actually needs. This seems like a straight-forward problem at first, but ongoing development could provide some pitfalls and we're not sure how to proceed. Let's say we make our One Business Layer to Rule Them All. For brevity, I'll call it "Foundation." We port our applications to use the Foundation, and everything is runnding great. The Foundation is distributed to light UI layers via nuget, and we're looking good. But then we start adding features to our applications, and we run into trouble. Let's say we're working on Project A and we add a new feature that requires changes to Foundation. We make the changes to foundation (Foundation-A) and push them out to the nuget feed as an unstable package. Project A gets the latest nuget package, and all is good. Meanwhile, another developer is working on Project B. He gets the latest Foundation from source control, but takes it from a stable branch, so that it doesn't have Project A changes in it. He makes changes and created Foundation-B. And all is good. But then we discover that Foundation-A and Foundation-B implementation functionality that could actually share code, so we combine them. Meanwhile Foundation-C is floating out there with it's own changes. Eventually, Foundation-B is ready for production, so we push it out. But then we need to update Production A, B, & C with the new foundation, so we update the nuget packages and deploy (as long as nothing breaks). This seems like it could work, but we're worried about working with different database schemas and keeping everything synchronized between the various branches of the Foundation repository as well as the Project A, B, and C repositories. It seems like it will probably take a lot of manual work, which opens up the possibility for errors. I would like this as automated as possible. Here's the stack we're using: C#, TFS with Continuous Integration, Nuget. Our applications are all various types of ASP.NET applications. We're willing to look at different SCM's if it will make things easier. I'm looking for ways to keep Nuget sane with our different source code branches. We don't want to accidentally push development code into production because we reference the wrong Nuget Package.


Are there any ultra high level languages out there?

Historically a HLL is something like C, Fortran or Pascal and a VHLL is something like Ruby or Python. I am familiar with the terms 4GL, 5GL, DSL and LOP, and those who aren't should read Wikipedia for the definitions. I'm looking for UHLLs. My question is: are there any computer languages out there which are another order of magnitude more productive, and is anyone working on them? More productive means less authored code and less programmer time to achieve a result, less bugs and less debugging, closer conceptual link between code and requirements, less effort to modify and maintain. The main domain that interests me is general-purpose business and consumer applications, with a GUI or browser front end, data persistence and connections to other systems such as printing and email. Other people might well focus elsewhere. I recognise that some of those languages might be domain-specific, and that they might be little more than the configuration capability of a large and capable application. Excel spreadsheets fall into this category. I recognise that some of those languages might appear general, but might still be narrow in scope and unsuited to many problems. For example, Matlab might not be a good choice for a program that deals mainly with user interaction and textual data. I know some of the features that might be in a UHLL, by analogy with VHLL. I would expect to find one or more of the following (and feel free to add to the list):   * A drawing of a GUI form IS the program for a GUI form   * A table containing rows, columns and headers IS the program for a table in a database   * Declarative logic says what should be done and when, with no IF statements   * Operations on sets of data, with no FOR loops   * Non-sequential execution eg data driven, pattern matching, tree walking The motivation for the question is that I am increasingly fed up with the sheer hard work of translating relatively simple business requirements into large quantities of code to cater for what the computer wants or needs. The question is really about finding others out there who share my pain and are working on raising the level of languages and getting the computer to do more of the hard work. This was a major focus in the 1970s-80s, but is it still happening? These are some suggested answers to my question, provided here to to summarise or enumerate languages I know about, and which in my view fall short. There are many languages that are HLL or VHLL and contain individual features that belong to a higher level. I've used most of them (often badly). They include   * Lisp, with its macros and ability to self-modify   * Haskell, with data dependency and pattern matching   * SQL, which deals in rows and tables   * Rebol, which seems clever but I don't really get it   * APL (and J), with its multi-dimensional arrays and ultra-compact operators   * C# with LINQ   * AWK/Perl/Python/Ruby with wonderful collections and regexes built in These languages have too many low level features to be UHLL. The programmer still has to write many low level constructs for any useful program. There are RAD/4GL packages. I've used some:   * dBase/Foxpro   * Dataflex/Powerflex (my product)   * Access   * PowerBuilder And lots more I haven't used. Mostly the language is HLL at best but the package contains a framework and privileged connections between language and package so that applications can be built fast. I'm not sure why this approach ran out of steam, but in any case UHLL this is not. There are raw frameworks/libraries. I've used a few:   * Rails   * Java awt and swing   * .NET Windows Forms, WPF and ASP.NET. These are currently the state of the art. They leave the programmer firmly trapped in the mire of the implementation language, dealing with complexity at every turn. This is not UHLL, but a UHLL might conceivably be built on top of one of these. There are design tools, like UML and Rational's toolset, which I don't know well. As far as I can see they help articulate business requirements but can never replace the programming step. I don't want to eliminate programmers, just get more done per unit of time and effort. So having eliminated all contenders I can think, I hope someone else can provide a better candidate. Late Edit: I think I have an answer: Wolfram Language. http://www.wolfram.com/wolfram-language/


Why is it a good idea for "lower" application layers not to be aware of "higher" ones?

In a typical (well-designed) MVC web app, the database is not aware of the model code, the model code is not aware of the controller code, and the controller code is not aware of the view code. (I imagine you could even start as far down as the hardware, or perhaps even further, and the pattern might be the same.) Going the other direction, you can go just one layer down. The view can be aware of the controller but not the model; the controller can be aware of the model but not the database; the model can be aware of the database but not the OS. (Anything deeper is probably irrelevant.) I can intuitively grasp why this is a good idea but I can't articulate it. **Why is this unidirectional style of layering a good idea?**


What layers reference each other in a multi layer design?

I'm creating a project and I'm having difficulty and contrasting opinions on how to do things when it comes down to separating layers. I'm not fully sure what layers should reference each other. I have read in certain blogs/posts that the flow should be   * the view references the business layer   * the business layer references the data layer   * the data layer only knows about it self On the other hand I have also seen the following   * the view references the business layer   * the business layer knows only about itself   * the data layer references the business layer Using the second method I have been using the business layer using IOC but im reluctant to progress without more knowledge. I have read a number of posts but the answers seem many and varied. Any clarification would be great. Thanks


Is it bad practice to call a controller action from a view that was rendered by another controller?

Let's say I have an `OrderController` which handles orders. The user adds products to it through the view, and then the final price gets calculated through an AJAX call to a controller action. The price calculation logic is implemented in a seperate class and used in a controller action. What happens is that I have many views from different controllers that need to use that particular action. I'd like to have some kind of a `PriceController` that I could call an action on. But then the view would have to know about that PriceController and call an action on it. Is it bad practice for a view to call an action on a different controller from which it was rendered?


How to integrate and Program Avatar customization in HTML(5)?

I am making a Game in HTML5. In one part of it, I want the users to be able to customize the avatar they get by default. For sample, let me share a screenshot from Zombie Lane on Facebook (now this game may not be in HTML5 but that's not the point): ![enter image description here](http://i.stack.imgur.com/RXseK.png) My question is as to how do I include the images in the HTML5 page and in which format? Whenever a clothing is different shirt is selected, the change is applied immediately. Is it a whole new photo that we see, or is the photo changed somehow by programming? How is it done?


What does "automating a use case" mean and  what are the tools to do it?

What does 'automating a use case 'means and how does the tools that automate helps with that? whats makes automation good to do and does it holds any significance for web developement.


Syncing client and server CRUD operations using json and php

I'm working on some code to sync the state of models between client (being a javascript application) and server. Often I end up writing redundant code to track the client and server objects so I can map the client supplied data to the server models. Below is some code I am thinking about implementing to help. What I don't like about the below code is that this method won't handle nested relationships very well, I would have to create multiple object trackers. One work around is for each server model after creating or loading, simply do `$model->clientId = $clientId;` IMO this is a nasty hack and I want to avoid it. Adding a setClientId method to all my model objects would be another way to make it less hacky, but this seems like overkill to me. Really clientIds are only good for inserting/updating data in some scenarios. I could go with a decorator pattern, but auto generating a proxy class seems a bit involved. I could use a generic proxy class that uses a __call function to allow for original object data to be accessed, but this seems wrong too. Any thoughts or comments?               $clientData = '[{name: "Bob", action: "update", id: 1, clientId: 200}, {name:"Susan", action:"create", clientId: 131} ]';     $jsonObjs = json_decode($clientData);               $objectTracker = new ObjectTracker();     $objectTracker->trackClientObjs($jsonObjs);               $query = $this->em->createQuery("SELECT x FROM Application_Model_User x WHERE x.id IN (:ids)");     $query->setParameters("ids",$objectTracker->getClientSpecifiedServerIds());     $models = $query->getResults();          //Apply client data to server model     foreach ($models as $model) {         $clientModel = $objectTracker->getClientJsonObj($model->getId());                   ...      }               //Create new models and persist     foreach($objectTracker->getNewClientObjs() as $newClientObj) {         $model = new Application_Model_User();         ....         $em->persist($model);         $objectTracker->trackNewServerObj($newClientObj['clientId'],$model);     }     $em->flush();          $resourceResponse = $objectTracker->createResourceResponse();          //Id mappings will be an associtave array representing server id resources with client side     // id.     //This method Dosen't seem to flexible if we want to return additional data with each resource...     //Would have to modify the returned data structure, seems like tight coupling...     //Ex return value:     //[{clientId: 200, id:1} , {clientId: 131, id: 33}];


what would be the best data structure for my situation

I have a list of **unique string**. I don't want to destroy this string i need it.I only need to find out weather an given string S exist in this unique list.What would be the best data structure for this purpose.


Relationship DAO, Servlet, JSP and POJO

I want to implement a `JSP`, `POJO`, `DAO` and `Servlet` in my `J2EE` program. However, I don't fully understand how the relationship between these elements should be. Is the following (MVC) setup the right way to do it?   * Main class creates servlet(controller)   * Servlet has a `DAO` defined in its class   * `DAO` has a `POJO` defined in its class   * `Servlet` communicates with the view (JSP page) Please give your feedback.


How can you get constructive criticism for your code?

My team rarely does code review, mainly because we don't have enough time and people lack the energy and will to do so. But I would really like to know what people think about my code when they read it. This way, I have a better understanding how other people think and tailor my code accordingly so it's easier to read. So my question is, how can I get constructive criticism for my code? My intent is to understand how people think so I can write more readable code.


Capture portions of a number using mathematical operations

Is there a mathematical way to get the following: For the the number 777,888,999 so 777 million and etc etc getMillions(777888999) should return 777 only getThousands(777888999) should return 888 only getHundreds(777888999) should return 999 only This should be done **without using regex and without text processing** but should be achieved using **only mathematical operations**. I'm trying to solve a problem that may be familiar to some which is converting a number expressed in digits to words so 1 -> one, 10 -> ten, 100 -> one hundred etc My thinking is that if I can convert a number up to 999 then the problem is pretty much solved as the rest will only append the words millions and/or thousands so 777888999 will covert to the words: 777 million and 888 thousands and 999 hundred of course the above numbers will expressed in words. This originally was given to me as part of a job interview process about a year ago. I am absolutely not using the solution here for a job application. But the above question is about number manipulation which I'm very interested in.


What do you call a tree that grows in both directions?

![tree representation](http://i.stack.imgur.com/mHAbK.jpg)What would be the technical term for a tree that grows in both the directions, starting from the root in the middle? The central idea being that new elements can be added to the tree (Now, I am not sure if it is even okay to call it one) in both the directions. But, when used for traversal purposes, you need to follow the directed links.


Negative test cases confusion

In the Software testing book from Koirala, Sheihk, they say: > A positive test is when you put in a valid input and expect some action to > be completed in accordance with the specification.   >  A negative test is when you put in an invalid input and receive errors. Part of my question: Let's say there is a requirement: If the customer name=="James Bond", do something. Is `name<>"James Bond"` negative or still positive test, verifying the requirement? Or a login function:   Is correct login positive test case and incorrect negative?   Or Login failed is just confirmation of requirement that a password must be correct ->confirming invalid pass will not work. > For example, if the program is supposed to give an error when the person > types in "101" on a field that should be between 1 and 100, then that is > positive then if an error shows up. If, however, the application does not > give an error when user types 101, then you have a negative test.


Why should form inheritance be avoided?

I remember learning VB4 and dragging a button onto a form, double-clicking on that button, and typing code into that event handler I had just been magically blessed with. Coming from QBASIC I was thrilled with the "V" in "VB", the visual designer was literally the best thing since sliced bread. Of course you could do all that programmatically but the magic of the "V" was so appealing you just couldn't help but drag that button. We were encouraged to take that route. But then a few years ago I started learning about C# and the .net framework and was fascinated by the way everything I thought I knew had just gone out the window. There's a lot of _magic_ going on in VB6 that's completely unveiled in .net: take constructors and the `InitializeComponents` method for example. In the latter you'd find all the control instances you've dragged from the toolbox, all the events you've registered and the properties you've set in the designer. And that's fine... I guess. It's just, I feel like I don't "own" what's going on, this code that I can only modify via the designer annoys the heck out of me. Every time you copy a button that says "Ok" from one form to another (sometimes along with its brother "Cancel"), you are actually duplicating code, and that's a _sin_ isn't it? DRY, don't repeat yourself, says the _Pope_. Religions and schools of thought aside, in all objectivity, shouldn't we derive forms from base forms instead, and have the "Ok" button (and all of its friends) live on the base form? Something like a `FormBase` from which derives a `DialogFormBase`; all classes created in no time... by typing code. The buttons are created depending on how the class is instanciated (i.e. a constructor enum argument determines which buttons are to be created), controls are laid out inside an arrangement of split panels and flow layout panels, injected into the form as `Content` that fits into the main content panel. Isn't this what ASP.net does with master pages and content placeholders? I'd derive a form when I need a new "master page", but this new "master page" still derives from a base form class so the visuals are consistent across the entire application. To me that's _much_ more code reuse than anything else I've ever done with the designer in WinForms, and it wasn't even hard, and code isn't cluttered with a 200-lines method that I have no control over, I can put comments where I like, they won't get overwritten by a designer. I guess it's just a matter of patterns and architecture, which is what brought me to this link: Best design for Windows forms that will share common functionality, where I realized I was spot on, except **the answer there, suggests exactly what I'm doing, but it's advising _against_ form inheritance _because_ of designer considerations. That's the part I don't get**. I would rather advise _against_ using the designer _because_ of code structure considerations, especially in regards with form and control inheritance, which I see no reason to avoid other than _well it breaks the designer_. We can't all be just lazy, so what part am I missing?


"Never do in code what you can get the SQL server to do well for you" - Is this a recipe for a bad design?

It's an idea I've heard repeated in a handful of places. Some more or less acknowledging that once trying to solve a problem purely in SQL exceeds a certain level of complexity you should indeed be handling it in code. The logic behind the idea is that for the large majority of cases, the database engine will do a better job at finding the most efficient way of completing your task than you could in code. Especially when it comes to things like making the results conditional on operations performed on the data. Arguably with modern engines effectively JIT'ing + caching the compiled version of your query it'd make sense on the surface. The question is whether or not leveraging your database engine in this way is inherently bad design practice (and why). The lines become blurred further when all the logic exists inside the database and you're just hitting it via an ORM.


How to research a company to work at

I have been made an offer at a company. How do I research it to find if its somewhere I would like to work, besides asking them questions? Google search gives little results.


When people work in different countries and need to work together how to keep code in correct language

I'm a member of a small new team and with one of our latest builds I noted that, VS2010 code files don't contain language formatting. So for example when I write down a Euro symbol in my code or use a "." or "," in numbers or use Pounds, Euro or Dollar symbols, those look ok in my code, but for a coder in Russia they don't. I wonder how other people tackle these kind of problems?


How to encapsulate 'global' variables in C#? /best practice

In C# what is the best practice for encapsulating variables I need to use in multiple methods? Is it OK to simply declare them at the top of my class above the two methods? Also if I am using app settings from my config file should I use a getter? like this...               private string mySetting{ get { return WebConfigurationManager.AppSettings["mySetting"]; } }      What best practice is?


Documentation: What is "appropriate" when expressing a valid range for a parameter?

What is the appropriate method to describe a valid range of a parameter in the documentation of code? Obviously long-form documentation (white papers, API documents, etc) can be more verbose than the actual code but this is really to address issues in the actual code than in the distributed documentation (that every user should read to begin with!) Examples:   * <argument name> where { <argument name> | 0 <= <argument name> <= 255 }   * <argument name> range: [0,255]   * <argument name> is valid between zero and 255 inclusive.


What does a good "definition of done" for a mature team look like?

When looking at examples of definitions of done in various sources, they usually include points like   * code completed   * unit tests run   * code peer-reviewed or paired   * code checked in   * documentation updated   * … In our team, we have a similar list, but nobody ever looks at it because those points seem so blatantly obvious that it wouldn't occur to anyone to skip any of these steps. So we were wondering whether that's mainly a tool for teams transitioning to an agile process and whether we shouldn't just get rid of it. On the other hand, lots of literature claims that all high-performing teams have a strong definition of done. This kind of hints that we might miss an opportunity to improve here. So what are examples of strong definitions of done of a mature team? What kind of points do they include typically?


What are the usual difficulties in concurrent programming and tuning of concurrent programs (shared-memory model)?

I can list part of the problems that will show up when writing a moderately- sized concurrent application with shared memory:   * Locking granularity   * Choice of synchronization primitive   * Number of threads   * Method for decomposing into threads (data parallelism; task parallelism; how threads are organized, etc) What are other similar problems?


Using a parser to locate faulty code

Lately I've been working a lot in PHP and have run into an abnormally large number of parsing errors. I realize these are my own fault and a result of sloppy initial coding on my part, but it's getting to the point that I'm spending more time resolving tags than developing. In the interest of not slamming my productivity, are there any tricks to locating the problem in the code? What I'd really be looking for would be a line to put in the code which would output the entire faulty tag in the parsing error, or something similar. Purely for reference sake, my current error is Parse error: syntax error, unexpected '}' in /home/content/80/9480880/html/cache/tpl_prosilver_viewtopic_body.html.php on line 50 (which refers to this):

<?php if ($_poll_option_val['POLL_OPTION_RESULT'] == 0) {  echo ((isset($this->_rootref['L_NO_VOTES'])) ? $this->_rootref['L_NO_VOTES'] : ((isset($user->lang['NO_VOTES'])) ? $user->lang['NO_VOTES'] : '{ NO_VOTES }')); } else { echo $_poll_option_val['POLL_OPTION_PERCENT']; } ?>

 <?php }} if ($this->_rootref['S_DISPLAY_RESULTS']) {  ?>

<?php echo ((isset($this->_rootref['L_TOTAL_VOTES'])) ? $this->_rootref['L_TOTAL_VOTES'] : ((isset($user->lang['TOTAL_VOTES'])) ? $user->lang['TOTAL_VOTES'] : '{ TOTAL_VOTES }')); ?> : <?php echo (isset($this->_rootref['TOTAL_VOTES'])) ? $this->_rootref['TOTAL_VOTES'] : ''; ?>

 <?php } if ($this->_rootref['S_CAN_VOTE']) {  ?>

<input type="submit" name="update" value="<?php echo ((isset($this->_rootref['L_SUBMIT_VOTE'])) ? $this->_rootref['L_SUBMIT_VOTE'] : ((isset($user->lang['SUBMIT_VOTE'])) ? $user->lang['SUBMIT_VOTE'] : '{ SUBMIT_VOTE }')); ?>" class="button1" />

 <?php } if (! $this->_rootref['S_DISPLAY_RESULTS']) {  ?>

<a href="<?php echo (isset($this->_rootref['U_VIEW_RESULTS'])) ? $this->_rootref['U_VIEW_RESULTS'] : ''; ?>"><?php echo ((isset($this->_rootref['L_VIEW_RESULTS'])) ? $this->_rootref['L_VIEW_RESULTS'] : ((isset($user->lang['VIEW_RESULTS'])) ? $user->lang['VIEW_RESULTS'] : '{ VIEW_RESULTS }')); ?>

 <?php } ?> </fieldset>


In rails, what defines unit testing as opposed to other kinds of testing

Initially I thought this was simple: unit testing for models with other testing such as integration for controller and browser testing for views. But more recently I've seen a lot of references to unit testing that doesn't seem to exactly follow this format. Is it possible to have a unit test of a controller? Does that mean that just one method is called? What's the distinction? What does unit testing _really_ means in my rails world?


Should I use one database per application or share a single database amongst multiple applications

I have multiple applications some that use data from the same sources. Is it best practice (or what are the pros/cons) to:   * leave the data in databases shared by multiple applications     1. saves space as only one database is needed     2. complicates indexing as different applications have different querying needs   * import data daily into per-app databases     1. uses more space as duplicated data exists in per-app databases     2. easier indexing as each app can focus on its individual needs I may have left out other advantages/disadvantages, please list if any, also how is this done at your workplace?


What is the meaning of driven ? (test-driven , data-driven, event-driven and etc)

I was reading a paper that makes a comparison between ASP.NET Web Forms and ASP.NET MVC. While reading it, such as data-driven, event-driven, test-driven are the terms that I see a lot. So what are they used for? when we can call them for a programming language or framework? What do they need to have?


Why are effect-less functions executed?

All the languages I know of would execute something like:               i = 0     while i < 100000000         i += 1      ..and you can see it take a noticeable amount of time to execute. Why though, do languages do this? The only effect this code will have is taking time. edit: I mean inside a function which is called               function main(){         useless()     }     function useless(){         i = 0         while i < 100000000             i += 1     }


Is it bad practice for a module to contain more information than it needs?

I just wanted to ask for your opinion on a situation that occurs sometimes and which I don't know what would be the most elegant way to solve it. Here it goes: We have module A which reads an entry from a database and sends a request to module B containing ONLY the information from the entry module B would need to accomplish it's job (to keep modularity I just give it the information it needs -> module B has nothing to do with the rest of the information from the read DB entry). Now after finishing it's job, module B has to reply to a module C if it succeeded or failed. To do this module B replies with the information it has gotten from module A and some variable meaning success or fail. Now here comes the problem: module C needs to find that entry again BUT the information it has gotten from module B is not enough to uniquely find the exact same entry again. I don't think that module A giving more information to module B which it doesn't need to do it's job but which it could then give back to module C would be a good practice because this would mean giving some module information it doesn't really need. What do you think?


Software updating solution for both Linux/Windows platform

Are you guys aware of any commercial (non-commercial?) online automatic updater that can be integrated with one's software? After quick research I found zillions of them but for Windows only and again only few got C/C++ API. Do this kind of solutions have any update management/statistics features?


Do you care if the person you're interviewing owns or contributes to Open Source projects?

Do you care if the person you're interviewing has created or contributed to Open Source projects? From the pool of people we've interview over the years at my workplace, I haven't found one person who contributes to an open-source project. In fact I'm the only person in the office that is really interested in the (.NET) OSS scene, but I don't believe that makes me any more competent, and it possibly reflects on my social life more than anything. Does OSS participation make your ears prick up if you see it on a CV/Resume? Or are you apathetic towards it? _(This is what made me think of the question)_


How do I learn Concurrency in Ruby?

Yesterday I read this great article about Concurrency in JRuby from EngineYard and I realise I need to leverage my skills about concurrency in Ruby, by mentioning Ruby here I mean it could be **all** implementations of Ruby : JRuby, Ruby MRI, Rubinius, Ruby on Parrot / Cardinal except IronRuby, I don't code in Windows Environment. What I learned from Haskell world, especially from Simon Peyton-Jones, he said on his video that OOP is all about state. Note: I'm very very inexperienced when I mention Haskell, I only watched some good videos about Haskell, solved very few (less than 10) euler project in Haskell, read some good Haskell books and tutorials, I've never coded in Haskell professionally, I just read some source codes in Haskell, ex. pugs, Darcs, and some other Haskell codes I don't remember the source. I might want to use Jaskell to trick concurrency as long as I use jruby, but that's for my long term learning plan, I want to maximise my concurrency skill in ruby first, **do you have any suggestions for me to learn concurrency in ruby?** I wish there were a kind of Head First book for me to learn Concurrency in Ruby. Things like strategies / how to tackle concurrency problem in ruby, inspired from EngineYard article and Haskell. Maybe some good downloadable videos that explain step by step to strengthen my fundamental about concurrency generally and then move to concurrency in ruby specifically. Advice? Thank you.


What's the difference between robustness and fault-tolerance?

Systems / programs / distributed algorithms / ... are often described with the predicate **robust** or **fault-tolerant**. What is the difference? * * * Details: When I google for +robust +"fault-tolerant", I only get two hits, both unhelpful. When I googlescholar for the terms, I find a lot of papers that have both terms in their title. Unfortunately, they do not precisely define the terms :( But since they use both terms, it seems that neither implies the other.


I'm having trouble learning

I'm only 13 but i'm genuinely interested in CS and would really like it if I could actually accomplish it. I've read books on C++ and C#, but ALL of them are the same!! They all say "Ok so since you have no prior knowledge in this what so ever, write a snippet that will do this and then make a GUI and then throw it into the Priafdhsu hfad then add the program and then program your own compiler to do some stuff". It's really getting annoying. I've payed near $40 (via Paypal) on ebooks that supposedly taught people to program with no prior knowledge. ALL OF THEM EXPECT ME TO ALREADY KNOW THE LANGUAGE. Is there something that I'm missing or am I suppose to be born with the property of CS? I would very much appreciate it if someone could explain this to me or possibly refer me to a tutorial on Programming Theory that starts from below ground zero as I have know knowledge in CS at all.


Delphi 7 using RAM for database

I have an existing database app written in D7 with apollo databases. The client has given me a fast desktop with 24gb ram Can I somehow load the database files into ram to speed up processing? With millions of records some procedures take 1/2 hour or more, mostly due to disk read/write


Record management system java web framework

We're currently reconsidering technologies and frameworks to get more agile with "simple" RMS CRUD-based projects. In short, short-living things like this Right now we have a custom extension on top of SmartGWT but after some time it has proven not to be flexible enough. I also personally dislike the java-js compilation process and the whole GWT codebase. Not only is the design ugly, it also makes certain low-level js things very complicated if not completely impossible. So what I'm looking for is:   * closest to **web** as possible, like JSF or possibly Tapestry, it is very important to be able get "low" and weave framework if necessary. Happens more often than we thought.   * datagrid capable - Ext.js & PrimeFaces looks pretty good, Vaadin does too.   * db-schema generators (optional, no matter in which way) If it were only on me, I'd probably stick to Ext.js + custom rest-based java solution, possibly generated from database schema (not sure about concrete tooling yet). I only have experience with vanilla Ext.js, vanilla GWT and JSF 2.0 / Seam, so it hard for me to judge or even propose other frameworks. **Whats your experience?** **What are the downsides you've faced?**


How to unit test a web client?

I am having a lot of trouble understanding how to unit test my web client. I have just finished a project using TDD for the first time - this project hd no external dependencies such as API calls or databases, it was pure C# code. I definitely saw the benefits of using TDD and I would like to continue practising it. My next project involves writing a SOAP client. I'm struggling to get past the first test which is using a simple IClient that logs in to the API successfully. Here is the IClient interface:               public interface IClient     {         bool IsLoggedIn { get; }         bool Login(out string error);     }      I have no idea how I would go about testing this. I'm thinking the unit test method would be something like `Login_WithValidCredentials_ReturnsTrue`, but I'm not sure how I could do this without actually simulating every possible response from the API. Is this code actually unit testable, or should this be left to an integration test. If anyone could give me an example of a simple unit test then I would be very grateful (I am using Moq).


Are there examples of non CRUD approaches?

I'm a programmer but also have worked as an archivist. As archivist it's a lot about keeping data. I often get into arguments with colleagues when it comes to operations on data. I don't like the U and the D in CRUD too much. Rather then update a record I prefer to add a new one and have a reference to the old record. That way you build a history of changes. I also don't like deleting records but rather mark them as inactive. Is there a term for this? Basically only creating and reading data? Are there examples of this approach?


New to Data Warehouses/ERP

The organisation I work for is very application rich i.e. there are lots of SQL and Oracle databases. We are thinking about a data warehouse. I believe there is a difference between an Enterprise Resource Planning system and a Data Warehouse. An ERP would involve integrating all the systems together and having one database schema for everything. A Data Warehouse would involve creating a copy database (or copy databases) for analysis reasons. The Data Warehouse could extract information from the original repositories or the ERP system. Have I understood this correctly? Are there Data Warehouse products that are available to but or to you have to use Microsoft tools/Oracle tools e.g. SSIS, SSAS etc to write your own?


Website as an API client vs using the API only when needed?

I'm developing a website (using **Django** ) which will depend on an API for it's main functionality which is create/update/delete objects. But the API also provides:   * User sign up and login   * User relations to their objects   * User groups and permissions This is great but I'm conserned about fully depending on the API for everything even user sign up and login, so I have 2 choices: **Using the API for everything** : Advantages:   * User authentication, objects, relations, permissions are already managed   * My job is only to query the API and display the results Disadvantages:   * Lots of HTTP requests to the API   * The website will break if the API goes down   * The website rendering time will be slower (will use ajax) **Using the API when needed** : Advantages:   * Fewer HTTP requests   * The website will be a little faster   * If the API goes down, not all the functions of the website will stop Disadvantages:   * I'll have to manage user authentication, permissions and relations to his objects in the API   * Duplicate user data in my database and the API (I'll have a copy of the user objects)   * Worried about the data sync (I'll update the database only on create/update/delete requests to the API) Which one is a better choice and why ? what design is usually used for such cases ?