Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Twice as fast... (Score 1) 226

>>Being bitter is drinking poison and hoping someone else will die

>I like that. Is it original?

Unfortunately not. Friend had it in his mail signature, he saw it (or something like it) somewhere on the net, couldn't remember where.

Comment Re:Ok Time for Top Quality (Score 3, Interesting) 50

I agree. I actually defended Spore here on Slashdot when it was the Great DRM Debate, I thought it was fun. But I got really fed up with it surprisingly quick. Designing creatures remained fun, but the core gameplay was just too...shallow.

I think it really deserved the "most overhyped game" awards it won.

Security

Journal SPAM: E-Voting Undermines Public Confidence In Elections 5

Techdirt columnist, Timothy Lee, hit the metaphoric nail on the head, claiming that e-Voting undermines the public perception of election fairness - even when there is no evidence of wrong doing. "In a well-designed voting system, voters shouldn't have to take anyone's actions on faith. The entire process should be simple and transparent, so that anyone can observe it and verify that it was carried out correctly. The complexit

Programming

Submission + - Refactoring: Improving the Design of Existing Code

kabz writes: "Refactoring: Improving the Design of Existing Code
Martin Fowler with Kent Beck, John Brant, William Opdyke and Don Roberts.
In the Addison-Wesley Object Technology Series.

Refactoring (as I'll refer to the book from here on in) is a heavy and beautifully produced 418 page hardback book. Martin Fowler is a UK-based independent consultant who has worked on many large systems and is the author of several other books including UML-Distilled.

Refactoring is a self-help book in the tradition of Code Complete by Steve McConnell. It defines its audience clearly as working programmers and provides a set of problems, a practical and easily followed set of remedies and a rationale for applying those techniques.

Code refactoring is the process of restructuringing code in a controlled way to improve the structure and clarity of code, whilst maintaining the meaning of the code being restructured. Many maintenance problems stem from poorly written code that has become overly complex, where objects are overly familiar with each other, and where solutions implemented expeditiously contribute to the software being hard to understand and hard to add features to.

Typically refactorings are applied over a testable or local scope, with existing behavior being preserved. Refactoring as defined in this book is not about fixing bad designs, but instead should be applied at lower levels.

Testing a la Extreme Programming is emphasized as a control for ensuring that program meaning is not changed by refactoring. It is not over emphasized, and this is not a book about testing, but it is often mentioned and stays in the background through the book.

The refactorings presented in the book are not intended as a comprehensive solution for all problems, but they do offer a means to regain control of software that has been implemented poorly, or where maintenance has been shown to simply replace old bugs with newer ones.

The book is divided into two main sections, introductory material that introduces and discusses refactorings, and a lengthy taxonomy of refactorings that includes both examples and further discussion. The introductory material consists of a long worked example through simple Java code that implements printing a statement for a video store. Despite the simplicity of the code, Fowler shows in clear detail where improvements can be made, and how those improvements make the code both impressively easy to understand, and easy to maintain and add features.

Several key refactorings are demonstrated in the opening chapter including Extract Method, Move Method and Replace Conditional with Polymorphism. This is a book about programming in the object oriented paradigm, so as you might expect, the first two refactorings refer to extracting and moving object methods either into new methods, or between objects. The third example provides a means to replace special cased behavior in a single object type by deriving a sub type of the object and moving type specific code to the sub types. This is a fundamental technique in object oriented programming, and is discussed here in practical terms.

Now that several actual refactorings have been introduced, Fowler provides a solid and well thought-out discussion of the why's, when's and when not's of refactoring. For example, code can decay as features are added, and programmers special-case, or bodge additional functionality into existing objects. Fowler argues that the bitrot and decay makes software more unreliable, leads to bugs and can accelarate as the problem gets worse. Faced with these problems, refactoring should be used to improve local design and clean up and improve code, leading to better software, that is easier to maintain, easier to debug, and easier to improve with new features as requirements change.

However, there is a caveat, in that since software functionality should remain unchanged during refactoring, the process of refactoring consumes resources, but provides no easily measureable value. Fowler confronts this issue in a section that discusses how to communicate with managers, that you are performing refactoring work. He denies being subversive, but his conclusion is that refactoring should essentially be folded in with normal work as it improves the overall result.

This is a bit like goofing off on the basis that you'll think better after 20 minutes of fooseball. I'd definitely subscribe to that theory, but many others may not.

Kent Beck guests in Chapter Three for a review of the issues in typical software that suggest a refactoring may be needed. This chapter is entitled Bad Smells in Code, and most of the smells presented will be familiar to any reasonably experienced programmer, and they will be a great learning experience for less experienced programmers. I got the same feeling reading this chapter as I did when I first read Code Complete. Here was someone writing down names and describing problems that I had a vague unease about, but was too inexperienced to really articulate or do something about. Typically the refactorings address the same kind of issues that a code review with a skilled experienced programmer would address. Long parameter lists, too long methods, objects delving about in each others private variables, case statements, related code spread across different objects etc. None of these problems are debiliting in themselves, but added up, they lead to software that can be prone to error and difficult to maintain.

Most of the remaining substance of the book, 209 pages, is given over to a taxonomy of refactorings. These 72 refactorings are covered in detail with comprehensive simple examples presented in Java. Each refactorings is given a clear name, a number and a line or two of descriptive text. The motivation for the refactoring is then discussed, often including caveats and cautions. The mechanics of implementing the refactoring are then listed, with 1 or more (and often more) examples of implementing the refactoring. Refactorings range from the very simple to more complex examples such as Convert Procedural Design to Objects.

Due to the difficulties of reproducing large and complex sections of code, Fowler sticks with relatively simple examples. These seem to grate on him more than the reader, and he can come across as somewhat embarrassed when we look at the employee, programmer, manager pay example for the tenth time. I certainly didn't have a problem with it though.

Conclusion

This is a very well written and fun to read book. I personally feel that much of the material is implied by from Code Complete, but Fowler does a fantastic job of expanding and formalizing the idea of applying explicit refactorings. Much like Code Complete gave a motivation for keeping code well commented and laid out, this book presents the case for care and feeding of how to structure software. To fight bitrot and technical debt, poorly structured and unclear code should be targetted and refactored to improve structure and clarity. This gives a very real payback in terms of less required maintenance, and ease in adding features later on down the line.

Despite the fact that all the examples are in Java, the ideas are easily transferable to C++ or any procedural object oriented language.

Highly recommended."
Biotech

Submission + - Gene Study Supports Single Bering Strait Migration (eurekalert.org)

Invisible Pink Unicorn writes: "One of the most comprehensive analyses of genetic variation ever undertaken supports the theory that the ancestors of modern native peoples throughout the Americas came from a single source in East Asia across a northwest land bridge some 12,000 years ago. One particular discovery is of a 'unique genetic variant widespread in natives across both continents — suggesting that the first humans in the Americas came in a single migration or multiple waves from a single source, not in waves of migrations from different sources. The variant, which is not part of a gene and has no biological function, has not been found in genetic studies of people anywhere else except eastern Siberia. The researchers say the variant likely occurred shortly prior to migration to the Americas, or immediately afterwards.' The full article is available online from PLoS."
OS X

Submission + - Java 6 available on OSX thanks to port of OpenJDK (bikemonkey.org)

LarsWestergren writes: Many Mac users have been upset that Apple has not made Java 6 available on the platform. Landon Fuller posts that there is a developer preview release available of Java JDK6 on Mac OSX, Tiger and Leopard. It is based on the BSD port of Sun's Java 6 and is made available under the Java Research License. Charles Nutter posts about impressive JRuby performance gains using Java 6 on his Mac.
PC Games (Games)

Submission + - Status report from the free games community

qubodup writes: " Free Gamer , the leading blog when it comes to open source gaming, has recently become the center of open source artists, developers and gamers. In it's forums, the GPU-hungry Classical Java RPG and the Neverball-killer irrlamb have found their second home. So did sub-communities like extremist free gamers, who insist on games not only be free software but also to contain free content and want to build a knowledge base of existing free games, and free content artists, which address an old problem of open source games and want to supply graphics and sound for projects in need of game media."
Data Storage

Submission + - USB 3 optical connection in 2008-10 times as fast

psychicsword writes:
"Intel and others plan to release a new version of the ubiquitous Universal Serial Bus technology in the first half of 2008, a revamp the chipmaker said will make data transfer rates more than 10 times as fast by adding fiber-optic links alongside the traditional copper wires."
"The current USB 2.0 version has a top data-transfer rate of 480 megabits per second, so a tenfold increase would be 4.8 gigabits per second."
This should make USB hard drives easier and faster to use. The article can be seen here http://www.news.com/8301-10784_3-9780794-7.html
Space

Submission + - Japan launches lunar orbiter mission Friday

Sooner Boomer writes: "Japan launched its first lunar probe on Friday, nicknamed Kaguya after a fairy-tale princess, in the latest move in a new race with China, India and the United States to explore the moon. The rocket carrying the three-metric ton orbiter took off into blue skies, leaving a huge trail of vapor over the tiny island of Tanegashima, about 1,000 km (620 miles) south of Tokyo, at 10:31 a.m. (9:31 p.m. EDT) as it headed out over the Pacific Ocean. The mission consists of a main orbiter and two baby satellites equipped with 14 observation instruments designed to examine surface terrain, gravity and other features for clues on the origin and evolution of the moon. Read the article or see Japanese Space Agency home page (in English) China has plans to launch an orbiter later this year, with unmaanned rover lander mission scheduled for 2010. India and the US also have orbiter missions scheduled for next year."
Censorship

Submission + - Parental Controls 10

Orange Crush writes: .
As the resident computer geek in an office full of accountants, my boss recently asked me how she could reasonably keep her teenage son from using the family computer to "access inappropriate sites." I of course responded "Give up now. There's nothing in this world that can keep a determined teenager from acquiring porn." Sadly, she was dissatisfied with this answer. I mentioned that there was in fact software available for this purpose, but that all of it was trivially easy to bypass for a clever young mind. (Beyond: watch him constantly or just deal with it like the adult you intend to raise him to be.)

I really can't think of another answer. She could password protect the BIOS to prevent booting a different OS, but that's easily defeated with a screwdriver at most. The only solutions I can think of involve upstream firewalls/proxies/etc to which I gleefully redirected her to her ISPs tech support number.

As much as I disagree with her reasoning — and ignoring the obvious "go to a friend's house" loophole — is there really any other way (on a home budget) to netnanny a household computer? (she does sign my paychecks...)
Announcements

Submission + - 'Lifesaver bottle' filters out viruses (telegraph.co.uk)

gihan_ripper writes: "British inventor Michael Pritchard has developed a small self-contained filter system that instantly cleans water, removing all particles larger than 15nm. Speaking to the Telegraph, he said that he was inspired after seeing the effects of Hurricane Katrina and the Boxing Day tsunami in 2004; people had to wait for many days to get fresh water and many died from drinking contaminated water. The filter is so effective that it can purify dirty river water and even faecal matter. His bottle will shortly be available for sale from Lifesaver Systems at an expected cost of £190 (approx. $385)."

Slashdot Top Deals

Their idea of an offer you can't refuse is an offer... and you'd better not refuse.

Working...