Hacker News new | past | comments | ask | show | jobs | submit | Tomer's comments login

may i ask where do you get the resources like buttons/templates, which language framework tools do you use? what made you able to create such an app in such a short time? thanks


The template is the Bootstrap template from Twitter. I mentioned in another comment that I would not have even started this project if it weren't for that. It made development so much easier.

It's built in PHP using a custom framework that I've developed over the years for fast development.


i'm working on legacy huge spagetty code with no option to write effective integration tests, testing that my method retuns some correct string/int etc will do me nothing, the whole system is huge with many integration points and no infra for writing integration tests and no time to do it. what should i do? (I love TDD, tests in general).


I've been in a similar situation in the past. The approach I took was to work gradually and try to clean the most heavily-used mess bit-by-bit, under the radar if necessary.

For instance, take the particular long, messy function that you happen to be working with right now, then write a bunch of tests for that function. Test that invariants are maintained, bad arguments or pre-conditions are handled, post-conditions are honoured and so on. You don't even have to know whether what you are testing is correct behaviour at this point. Just get as much test coverage as you practically are able to.

Then you can start TDDing smaller functions that are made up of bits and pieces from the big, ugly beast-function. You can develop and test these in complete isolation from the running code.

Finally you start replacing bits of the ugly beast with calls to your new clean functions, ensuring that you don't break any of those tests you wrote at the start. Over a period of time, you will gradually build up a set of unit tests for the most important parts of the system and you will hopefully gain enough confidence to refactor it into something more maintainable. At least, that's the theory, anyway. :)

I would also strongly recommend reading Michael Feathers' excellent book, Working Effectively With Legacy Code (ISBN: 978-0-13-117705-5). It is the bible for this kind of work.


This is actually the type of system (especially if it's very rough code quality wise in many places) I think regression tests are very useful (tests to make sure the system doesn't change function).

A book called "Working effectively with legacy code" by Feathers is great for instrumenting and regression testing old code bases then changing them without breaking them.

Non-aff link http://www.amazon.com/Working-Effectively-Legacy-Michael-Fea...


You start. That's all. Just... start.

Is one unit test doing anything? Yes. Absolutely. It's giving you 1 more unit test then you had to begin with.

Once you have a test, you can write another test. You can refactor a method (And write tests). You can then refactor the calling methods. And so on.

"It will be a mammoth task" is only a good reason not to do something when it's either discardable in the near future (And not "When we start on V2!"), or if it's the canonical 9-woman-1-baby situation. If partial improvements give value, do them.


You can make things better if you are prepared to make the effort, the politics can sometimes be harder than the technical work.

It might be worth seeking out a copy of Working Effectively with Legacy Code by Michael C Feathers.


thanks!!


Interesting...


So how come many "big" companies are using solaris with much success?


Many "big" companies are using Solaris (and other UNIXes) because they have been for a long time, and there is a cost to switching.

Upgrades to the kind of systems Solaris is being used (core systems and databases) tend to stay in the same course, not only because there is a lower risk in staying on the same OS/architecture combo, but also because most of those systems are old and tied to Solaris/SPARC. Unless there is a sufficiently strong reason to switch, most "big" companies prefer to pay the premium (in SW and HW) than assume the risk.

Solaris on commodity funcions is dying rapidly, if one can't already consider it dead.

The notion that Linux is less advanced is bogus. In some aspects Solaris is more advanced, in others Linux has the lead. What matters is what's the best choice for a each task given constraints of cost, reliability and availability of skilled technicians.


Legacy and inertia.


Historical reasons. Solaris was the definitive platform circa the late nineties. I used Linux back then, but it was definitely not ready for prime time yet. Many enterprises were built around Solaris. Today, Linux is a better alternative today for most use cases, but only marginally better. Until a year ago, it was not worth the cost of a switch.

Why a year ago? Oracle bought Sun. Sun was very good at creating open, useful platforms, but was very bad at making money off of them. Sun was bought by Oracle. Oracle isn't very good at building software, but is extremely good at selling it and maximizing profit from it. Oracle needs to make back the 7+ billion dollars it made on Sun somehow. How? We have part of the answer in the Google suit: by milking Sun's customer base.

Java has 10 million developers. To make 10 billion (there's a fair bit of risk in buying Sun -- if Oracle wants a 3x return, that's 10 billion each for Java, hardware, and Solaris), it needs to make $1000 per developer. How? I don't know how, but I'll run one possible scenario.

Step 1: Cut off competing JVM implementations with patent and copyright suits. This is already starting to happen.

Step 2: Release new versions of Java in two versions. The first is a free Java Express, which is okay for student use, but has no JVM, and omits many of the more enterprise-centric libraries. The second is a full-fledged version, and costs $1000 a pop. Developers would, of course, free to use the old, bit rotting version as well.

Most Java developers cannot switch platforms -- most are working on enterprise systems with hundreds of thousands or millions of dollars of sunk costs. Java immediately becomes a legacy platform, but even if only 50% of developers buy into it (even if only during the transition period), Oracle makes a cool $5 billion, almost paying for the rest of Sun.

Where does this leave Solaris? I don't know, but I suspect similar things are afoot. Oracle will want to make more money, and Oracle's customers will end up paying more. Oracle is already beginning to move in this direction with the death of OpenSolaris.

Aside from that, Oracle is incapable of attracting good developers. Former Sun employees are leaving as quickly as they can find new jobs. Will Solaris continue to have a technological advantage in the long term without Sun's brainpower? I seriously doubt it.

I know this is a lot of FUD, but with good reason. I am afraid, uncertain, and doubtful about the future of Java and Solaris. While I'm certain that Oracle will continue to develop Solaris so long as it continues to make them money, I don't know what they'll charge for it, or how well they'll develop it. I really wouldn't want to base my business around it.

(A secondary, technological answer is that Solaris advantages are much better suited to the climate of the nineties than of the teens. In the nineties, we tend to rely more on big computers with many CPUs, massive amount of memory, and many hard drives. In the teens, the trend is much more towards big arrays of cheap, unreliable, redundant boxes. Solaris' advantages are much more pronounced for the former than the latter.)


Why not CentOS? what would you recommend then?

I saw that oracle are really emphasizing how their OS has much higher performance than linux I wondered if its correct or if their benchmarks are good: http://www.oracle.com/us/solutions/performance-scalability/b... http://jp.sun.com/solutions/infra/eda/pdf/solaris-linux.pdf

So I wondered if i'm missing some tens of percents in performance by not choosing Sun Solaris...


CentOS is binary compatible with RedHat, so it's for people who need the enterprise-ness of RedHat, but can't/won't run RedHat. An example I've heard is running RedHat in production for the support, but CentOS for devs and stating. The reason to run RedHat is usually something like needing to run Oracle or a number of other very complex software suites (the keyword is complex, not better or faster) that are only supported on specific platforms.

If you're running Oracle on Sun hardware, go for Solaris, sure, if for no other reason the support. If you're running "regular" open source software on generic hardware, just use Linux/BSD. There's nothing in Solaris that'd make Postgres faster than Linux or BSD on the same hardware.


What distribution do you recommend? (which is stable enough...) I wanted to choose CentOS because I know RedHat are saying they do lot of tests to their distribution before they release... so I wanted something that is fully tested and reliable.


It's been a while since I've had any responsibility over servers, but Debian has always treated me well.


Ubuntu which is derived from Debian is a good choice for servers, especially the LTS editions.


I'd be inclined to give it a try (I use and love Ubuntu on the desktop), but my impression is that Ubuntu is Debian packaged for the desktop... which isn't really relevant on a server. Debian is, OTOH, geared almost entirely for the server, already before Ubuntu came along.


Hi, It's with reference to this post: http://news.ycombinator.com/item?id=1033433 and to this web site: dontbreakthechain.com


how about large groups? how do you start talking when you are in a large group? I find that very difficult.


Hi read some reviews of this book in amazon and I saw this:

WIN PEOPLE TO YOUR WAY OF THINKING

? Don't argue! Give in! Agree that the other person is right; often they are and if they aren't, you'll never convince them of it by arguing.

and I ask what?! don't argue with people? that is exactly my problem, if i don't stand to my points and argue with people they won't respect me for having my own views! I don't think that is a good quality at all! people should be heard! what do you think?


Its all about optimizing. Arguing with people is affective at times, but Dale's methods are effective much more often and to a greater degree.

It's like trying functional programming. At first it is counter intuitive and you maybe think it sucks. You think to your self this is the opposite of my goals. But quickly your realize "I love this, this is a much better way to live, people actually want to listen to me, I don't have to argue with them."

--------------------

The method is really about using risk to get a big pay off. (Hmm, its kind of like a start up).

-------------------

Here is an example:

James L. Thomas, a former student of mine: Six customers of a certain automobile company refused to pay their bills for servicing. None of the customers protested the entire bill, but each claimed that some one charge was wrong. In each case, the customer had signed for the work done, so the company knew it was right - and said so. That was the first mistake.

Here are the steps the men in the credit department took to collect these overdue bills. Do you suppose they succeeded?

1. They called on each customer and told him bluntly that they had come to collect a bill that was long past due.

2. They made it very plain that the company was absolutely and unconditionally right; therefore he, the customer, was absolutely and unconditionally wrong.

3. They intimated that they, the company, knew more about automobiles than he could ever hope to know. So what was the argument about?

4. Result: They argued. Did any of these methods reconcile the customer and settle the account? You can answer that one yourself.

At this stage of affairs, the credit manager was about to open fire with a battery of legal talent, when fortunately the matter came to the attention of the general manager. The manager investigated these defaulting clients and discovered that they all had the reputation of paying their bills promptly, Something was wrong here - something was drastically wrong about the method of collection. So he called in James L. Thomas and told him to collect these "uncollectible" accounts.

Here, in his words, are the steps Mr. Thrrmas took:<p> 1. My visit to each customer was likewise to collect a bill long past due - a bill that we knew was absolutely right. But I didn't say a word about that. I explained I had called to find out what it was the company had done, or failed to do.

2. I made it clear that, until I had heard the customer's story, I had no opinion to offer. I told him the company made no claims to being infallible.

3. I told him I was interested only in his car, and that he knew more about his car than anyone else in the world; that he was the authority on the subject.

4. I let him talk, and I listened to him with all the interest and sympathy that he wanted - and had expected.

5. Finally, when the customer was in a reasonable mood, I put the whole thing up to his sense of fair play. I appealed to the nobler motives. "First," I said, "I want you to know I also feel this matter has been badly mishandled. You've been inconvenienced and annoyed and irritated by one of our representatives. That should never have happened. I'm sorry and, as a representative of the company, I apologize. As I sat here and listened to your side of the story, I could not help being impressed by your fairness and patience. And now, because you are fair - minded and patient, I am going to ask you to do something for me. It's something that you can do better than anyone else, something you know more about than anyone else. Here is your bill; I know it is safe for me to ask you to adjust it, just as you would do if you were the president of my company. I am going to leave it all up to you. Whatever you say goes." [Risk]

Did he adjust the bill?

He certainly did, and got quite a kick out of it, The bills ranged from $150 to $400 - but did the customer give himself the best of it? Yes, one of them did! One of them refused to pay a penny of the disputed charge; but the other five all gave the company the best of it! And here's the cream of the whole thing: we delivered new cars to all six of these customers within the next two years!

[HUGE pay off for taking a risk]

"Experience has taught me," says Mr. Thomas, "that when no information can be secured about the customer, the only sound basis on which to proceed is to assume that he or she is sincere, honest, truthful and willing and anxious to pay the charges, once convinced they are correct. To put it differently and perhaps mare clearly, people are honest and want to discharge their obligations. The exceptions to that rule are comparatively few, and I am convinced that the individuals who are inclined to chisel will in most cases react favorably if you make them feel that you consider them honest, upright and fair."


oops!, I just realize I didn't reference the book. The example from above is not mine. It is a direct Quote from the book: "How to Win Friends and Influence People" by Dale Carnegie


before you start the project create a couple of items mentioning tests that would test that the project is done. Then when you want to leave/mark project as completed while its not, run these tests (manual) if you dont pass the tests you didn't complete, complete it!


Hi, I have a question for you, lets say I want to study linear algebra, or finance, so if i want to do it your way, where do i start??


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: