banner



How To Update Forge Pc Card List

Years agone I wrote Forge's starting time deck editor. It didn't exercise anything fancy and you lot couldn't search for anything. Yous really didn't demand to "search" much considering Forge merely had a couple hundred cards. I did work difficult on the deck editor's "sort" feature which let you sort cards past name, blazon (instant, creature, etc…), mana cost, power or toughness. (In my listen "sort" was proficient enough, so a dissever search function wasn't really needed.)

(From the upcoming set Avacyn Restored)

Only there was a problem. As more cards were added, the deck editor's sort function became slower and slower. At first I guessed that information technology was a problem with Java but it wasn't. I thought I was implementing "sort" correctly and that was as fast as information technology could be. (Afterward, I learned the correct way to sort things using Java'south JTable.) This "slow sort" problem plagued Forge for a couple of years until the dainty developers totally revamped the deck editor and now it is crawly. The new deck editor is actually fun to utilise considering it works so well.

The one-time deck editor basically used a "n squared" solution that grows very speedily. For instance, to sort 100 cards it might take two seconds, 200 cards - 10 seconds. Only to sort 300 cards took 15 seconds. As yous tin can see, the sort times grows fast very rapidly. For a funny explanation of the same matter, real Joel Spolsky'southward caption of Shlemiel the painter below.

(Begin Quote)

Shlemiel gets a job as a street painter, painting the dotted lines down the middle of the route. On the first day he takes a can of pigment out to the road and finishes 300 yards of the road. "That's pretty expert!" says his boss, "you're a fast worker!" and pays him a kopeck.

The side by side day Shlemiel only gets 150 yards done. "Well, that'due south not nearly every bit good as yesterday, merely yous're still a fast worker. 150 yards is respectable," and pays him a kopeck.

The side by side mean solar day Shlemiel paints 30 yards of the road. "Only 30!" shouts his boss. "That's unacceptable! On the get-go twenty-four hours you did ten times that much work! What'due south going on?"

"I can't assist it," says Shlemiel. "Every day I get farther and farther abroad from the pigment can!"

(End Quote)

Basically it is hard to know if you accept the "right solution" when you lawmaking. A program can be fine until you add that 1 feature that just breaks everything. Life and computer programming are both comprises. The perfect solution does not exist.

Excelsior,
mtgrares

p.s.
Joel Spolsky is swell and each article has more computer info than my four years in higher studying computers. Read his blog and exist enlightened. For those people who can follow some short code segments in C, Joel talks more about C and Shlemiel here.

Joel Spolsky's book's "Joel on Software" and "More than Joel on Software" are the best things that I have always read. They are more readable (and edited) than his blog.

Joel Spolsky's Blog

Source: http://mtgrares.blogspot.com/

Posted by: mccoolregaserig.blogspot.com

0 Response to "How To Update Forge Pc Card List"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel