Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
The Military

Tiny, Morphing, Electricity-Stealing Spy Planes Developed 163

tkohler writes "The Air Force Research Lab is developing an Electric Motor-powered Micro Air Vehicle (MAV) that can 'harvest' energy when needed by attaching itself to a power line. It can also temporarily change its shape to look more like innocuous piece of trash hanging from the cable. For domestic spying, maybe it will morph into a pair of sneakers?"
Handhelds

Submission + - Nanowires boost laptop battery life to 20 hours

brianmed writes: Stanford researchers have found a way to use silicon nanowires to reinvent the rechargeable lithium-ion batteries that power laptops, cell phones, MP3 players and other portable devices. The new version, developed through research led by Yi Cui, assistant professor of materials science and engineering, produces up to 10 times the amount of electricity of existing lithium-ion batteries.
Education

Submission + - OLPC XO Review (bioslevel.com) 1

BIOS_LEVEL writes: "The XO is the laptop produced by the One Laptop Per Child program (OLPC) headed by Mr. Nicholas Negroponte. The goal of OLPC is to provide every child a laptop which they can use to experience technology and the Internet. Through the Give One Get One program (G1G1), residents of North America are able donate $400 to the OLPC foundation, $200 of which finances a laptop for a child, and $200 of which pays for the cost of delivering one to the donor. Colin Dean was one of the first to participate in G1G1, and this is his review of it."

Microsoft Disses Windows to Sell More Windows 407

mjasay writes "I stumbled across this fascinating Microsoft tutorial entitled "How to Justify a Desktop Upgrade." It's an attempt to coach IT professionals on how to sell Windows desktop upgrades internally. Apparently the value of Vista is not readily apparent, requiring detailed instructions on how to connive and cajole into an upgrade from XP. The most intriguing thing about the tutorial is its implicit rejection of Microsoft's older technology. Just a few years ago Microsoft was pitching the world on how secure and cool XP was. Now it's telling us largely the opposite, implying that XP is a security threat, costs too much to run, and so on. With Microsoft marketing against itself, perhaps the Mac and Linux camps can simply wait for Microsoft to self-destruct?"
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."
Programming

Submission + - Are you proud of your code? 6

An anonymous reader writes: I have a problem and I am hoping /. group therapy is the cure, so get on with the +5 comments, post haste! I am downright embarrassed by the quality of my work; specifically, my code. It is buggy, slow, fragile, and a nightmare to maintain. Documentation, requirements, automated tests? Does not exist. Do you feel the same way? If so, then what is holding you back from realizing your full potential? More importantly, what if anything are you planning to do about it? This picture, which many of you have already seen, captures several project failure modes. It would be humorous if it weren't so depressingly true. I enjoy programming and have from a young age (cut my teeth on BASIC on an Apple IIe). I have worked for companies large and small in a variety of languages and platforms. Sadly the one constant in my career is that I am assigned to projects that drift, seemingly aimlessly, from inception to a point where the client runs out of funding and the project is abandoned. Like many young and idealistic university graduates I hoped to spend my life programming passionately, but ten years later I look in the mirror and see a whore. I'm just doing it for the money. Have any developers here successfully lobbied their company to stop or cut back on 'cowboy coding' and adopt best practices? I'm not talking about the methodology-of-the-week, I'm referring to good old fashioned advice like keeping SQL out of the UI layer. For the big prize: has anyone convinced their superiors that the customer isn't always right and saying no once in awhile is the best course of action? Thanks in advance for your helpful advice.
Book Reviews

Head First SQL 210

Anita Kuno writes "On a Sunday, a fellow user-group member suggested I learn SQL. The next day, an opportunity to review Head First SQL arrived in my email. Who was I to question? Prior to opening the couriered package, I had no knowledge of SQL, I knew databases were important, and I had seen the Head First website once or twice. Now, I can design and create databases, use mySQL databases, and understand questions and accompanying code posted to forums. The credit goes to Head First SQL's style, which introduces small bits of information, supported through multiple channels (such as photos with humorous dialogue, stick-men and stick-women, and input from critical personalities whose photos and input pop up throughout the book) regular tests and exercises so the new bit of data can find a home and settle into your memory. The regularly tested pieces of information are now in my brain so I don't have to look up the basic stuff." Read below for the rest of Anita's review.
Security

Multiple FLAC Vulnerabilities Affect Every OS 360

Enon writes "eEye Digital Security has discovered 14 vulnerabilities in the FLAC file format that affect a huge range of media players on every supported operating system (Windows, Mac OS, Linux, Unix, BSD, Solaris, and even some hardware players are vulnerable). Heise points out a number of vulnerable apps that use the open source libavcodec audio codec library, which in turn relies on the flawed libFLAC library. These vulnerabilities could allow a person of ill will to trojanize FLAC files that could compromise your computer if they are played on a vulnerable media player. eEye worked with US-CERT to notify vulnerable vendors."
Wireless Networking

EarthLink Says No Future for Municipal Wi-Fi 126

Glenn Fleishman writes "EarthLink dropped its final bombshell on city-wide Wi-Fi, saying that it wouldn't put more money in and was talking to their current deployed cities about the future. The company had won bids in dozens of cities, and then backed out of the majority of them before building or finalizing contracts a few months ago. The remaining towns they were building out, like New Orleans, Anaheim, and Philadelphia, will ostensibly be turned off unless local officials come up with scratch or a plan of their own. EarthLink pioneered the model of free-for-fee networks, where there would be no cost or upfront commitment from cities, and EarthLink would charge for network access. Apparently, you can't make money that way."
Role Playing (Games)

EVE Online's Linux/Mac Client Goes Live Tuesday 205

The official EVE Online site has details of upcoming patch 'Revelations 2.3'. Along with a number of bug-fixes to the PvP-focused Massively Multiplayer Online Game, this game fix will offer up compatibility with Mac OS X and Linux. Though the Mac client is a native port, Linux will require the used of Cedega. The post suggests that if you'd like a preview of what the game will be like on your rig, you can download the client and tool around the test server. System requirements are also listed, as are the distributions of Linux they are specifically supporting: Ubuntu 7+, Suse 10+, and Linspire 6. Update: 11/04 14:32 GMT by Z : Fixed implication of native Linux client.
The Almighty Buck

Techie Pay Approaches All-time High 361

Stony Stevenson sent in this ITNews story which opens, "Techies were paid nearly record-high hourly wages in the third quarter, according to a new report released Thursday by staffing firm Yoh. Based on data compiled from 75 Yoh field offices and 5,000 technology professionals contracted in short and long-term projects, pay increased an average of more than 5.5 percent for the quarter ended Sept. 30, compared to the same period last year."
Toys

Germany To Build New Maglev Railway 297

EWAdams writes "According to the BBC, the Bavarian state government has announced that it has signed an agreement with Deutsche Bahn, the German state railway system, and the Transrapid consortium, to provide a maglev railway between central Munich and its airport. The only other maglev in full operation at the moment is in Shanghai, again as a city-to-airport service. The cost of the system is estimated at $2.6 billion. No completion date has been announced."

Slashdot Top Deals

A morsel of genuine history is a thing so rare as to be always valuable. -- Thomas Jefferson

Working...