Reputation
10,299
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
4 36 50
Newest
 Enlightened
Impact
~241k people reached

Feb
3
comment What's the benefit of GIT for solo programmer?
Every five minutes: Well, I don't do it that often, but basically it's a backup, so if my local machine crashes I get the work back. Why branches: because then I can work on something new and still fix bugs on master. A branch may take days or even weeks.
Jan
28
comment Creating variables in methods/functions
@Bas there are really lots of cases where variables make sense even if only used once. Think of very long and complex calculations or string concatenations for example when you generate html or sql strings (in many cases there may be better options than string concatenation to do this but if you have to having subsections with clear names may make such things much more readable)
Jan
28
comment Creating variables in methods/functions
Basically all of this as needed. You can use variables for the sole purpose of increasing readability (though you don't have to always do this, just use where it makes sense). In some cases you may even split a function in several sub functions for readability, even if those new functions are only called once. Your second example may not be too great, but if there is some deep nesting it may become more interesting. Also when you have rather complex calculations that become difficult to read you may split them into smaller steps that way.
Jan
28
comment Application with really dynamic data structure
Without knowing what exactly changed and what types of query run on this data this is quite difficult to say (also other information like data volume etc). Maybe some kind of schema less store (nosql document store like Elasticsearch) would be easier to use.
Jan
26
comment What's the best practice for adding a lot of attributes to a Rails model?
Maybe you would be better off serializing the data and doing the search with something like Elasticsearch. It's easy enough, adds lots of bonus features (full text search one of it) and if the project grows you will use it anyway.
Jan
23
comment If-else in C++ Programming Language
Look, with "no sense" I just meant that the if works differently and part of this is ignored, and that it only compiles for some details of how C++ works (as basically npinti explains in his answer). Yep, you learned something important here (C++ can make a true/false value out of a lot of things). This is actually the source for many errors (like by accident assigning a value with x=0 instead of comparing x==0). You are totally right to try out such things, even if they look weird. But that is why I asked what you did expect it to do.
Jan
23
comment If-else in C++ Programming Language
Just because it compiles doesn't mean it makes sense. Also the compiler actually gives you a warning about this: warning: left operand of comma operator has no effect
Jan
23
comment If-else in C++ Programming Language
My C++ is a bit old now, but this (a,b,x,y) doesn't make much sense here. It may only evaluate the last item y which is 0 and therefore falsy. What did you expect this to do?
Jan
21
awarded  Yearling
Jan
21
comment What should be the structure of a person to person store database?
Hmm, there are many options to handle this. While it would not be uncommon to do it like you propose the obvious disadvantage here is the amount of tables you would need to create. Also only products with existing tables could be added. One alternative would be using a NoSQL database with a document model where you could add various types of additional information independent from product type. You would only have to define possible tags in your code. But you don't provide enough information to make a good decision, for example it would be important to know how you search this data.
Jan
20
comment How to make significant technical decisions given very little time
In addition to what's already said you could maybe gain some time by starting with "invariants" of the project, maybe implement parts that are less prone to change later. Though given two days for something that important, complex and risky makes your seniors look very bad.
Dec
30
comment Relatively large data on client side in web application
@Ali depends what exactly you want to post back. You wouldn't want to post that amount of data anyway. So you can use the same approach and send only what actually changed and is needed by the server to know how to update the database. For the data I mentioned we use we have an admin interface that allows to edit the whole structure (though we don't display it as a tree but in columns, trees are a pain once they are too large). Feel free to update your question with additional information and I will try to add some details to my answer. (or we can talk about it in the Whiteboard chat room)
Dec
30
comment Simultaneous purchase in online shop bypassing limited offer
@gnat, thank you :)
Dec
30
answered Relatively large data on client side in web application
Dec
17
comment In a REST based system should a request for a sub-resource include the parent
Only the orders.
Dec
17
comment How does Yahoo's Smush.It work and why doesn't everyone use it?
Because we have about 20.000 images for our website and need to use automated tools. Also they only use rather common tools for compression. If your images were reduced by 90% you did something wrong to begin with. It's a nice tool for people who only need to process small amounts of images and don't want to learn how to use professional tools. So it is quite popular to do compression, just not every website is built professionally.
Dec
7
comment PHP MVC as backend for iOS app
If you only need JSON and nothing else I guess you can mostly skip the view part. You would still have models and controllers. The models obviously for database interaction and business logic (if needed) and the controller to handle the requests. This assuming that (like with Rails) there is an easy way in PHP to generate JSON directly from the data structures, if not you may want a simple view layer to generate JSON.
Nov
30
comment I have two applications… use NoSQL or RDBMS?
Your assumptions are basically right. You could do all of this with a RDMBS (both projects) and at least for project 1 the RDBMS would likely be the better option. Also it is very common to use several database systems for several tasks, so merging the travel data into a document oriented system for some optimized search (like Solr or Elasticsearch). Though you see pure NoSQL projects more and more. Go with combinations until you gain some experience with some of those newer options.
Nov
26
comment How do big companies maintain their products' source code without it falling into wrong hands?
They make contracts and sue if those contracts are broken. Also they make contracts only with people/companies they think they can trust (have a good reputation, can show they have done similar projects in the past, are recommended by other people with good standing...). And no, not everybody at facebook has full access to all the code.
Nov
9
comment Creating a user-customizable web api
Possible duplicate: stackoverflow.com/questions/22907/…