|
I know a lot of developers who do already, and a lot who don't.
*shrug*
|
|
|
|
|
Considerable efforts have been invested by many different organizations in the past on the development of coding standards for the C programming language. The intent of this standard is not to duplicate the earlier work but to collect the best available insights in a
form that can help us improve the safety and reliability of our code. By conforming to a single institutional standard, rather than maintaining a multitude of project and mission specific standards, we can achieve greater consistency of code quality at JPL. Want to write code for spaceships? Start here.
|
|
|
|
|
Rule 16 (use of assertions)
Assertions shall be used to perform basic sanity checks throughout the code. All functions of more than 10 lines should have at least one assertion.
|
|
|
|
|
For what their doing, it's probably better to crash the program than to use incorrect values in and crash the hardware...literally.
|
|
|
|
|
oh sure.
but what if you can't find something to assert on in those ten lines?
|
|
|
|
|
That's why it says "should" not "shall".
|
|
|
|
|
right. but you should have one in there. so you'll be searching for a place to put one.
seems like a distraction.
|
|
|
|
|
Chris Losinger wrote:
but what if you can't find something to assert on in those ten lines?
You split the function. Especially in C, ten lines is about as long as a function should be. Anything longer already looks like a bug nursery.
OTOH, I'm not so sure about assertions in production code in C. Occasionally a function might not be able to do its work, but some function up the call stack might be able to recover sanely - and this might be desirable.
Therefore I prefer a different approach: always check your input, always return an int error code, to let the caller know whether the call completed successfully, and return computation results in a preallocated buffer. This is in fact the way most C code is written. And enforce a rule that return values should always be checked.
|
|
|
|
|
"Do not use goto , setjmp or longjmp ."
Bah. You're no fun anymore.
/ravi
|
|
|
|
|
Now that Visual Studio 2012 is done, we’re busy figuring out what we should do next. For Web optimization, there are a few key scenarios that we know we want to support moving forward. There are also a whole bunch of other scenarios that we’ve either heard from different people or come up with during brainstorming. Here are some of our ideas. What do you want to see in ASP.NET Web Optimization?
|
|
|
|
|
Six years ago, I wrote an article about validation in WPF on Code Project. I also wrote a custom error provider that supported IDataErrorInfo, since, would you believe, WPF in version 3.0 didn't support IDataErrorInfo. Later, I worked on a bunch of open source projects around WPF like Bindable LINQ and Magellan. I was even in the MVVM-hyping, Code Project-link sharing club known as the WPF Disciples for a while. As I look back at WPF, I see a technology that had some good fundamentals, but has been really let down by poor implementation and, more importantly, by a lack of investment. I'm glad those days are behind me.
|
|
|
|
|
Technologies that come from Microsoft's "devdiv" division tend to be short-lived. If you want to invest in a technology that MS takes seriously, look what they use for Windows and Office. That is not going away any time soon.
modified 7-Aug-12 11:45am.
|
|
|
|
|
did they use Winform for Office? or is it Win32/MFC?
dev
|
|
|
|
|
Win32. It predates MFC.
Anna
Tech Blog | Visual Lint
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
|
|
|
|
|
Anna-Jayne Metcalfe wrote: Win32
That is correct for Office client, although there is also a lot of ATL/WTL there. No MFC as far as I know.
Office Server (SharePoint) nowdays uses C# with ASP.NET Web Forms.
|
|
|
|
|
I'm sure some ATL/WTL sneaked in later in parts. With MFC it tends to be harder to do that as it's so monolithic.
Anna
Tech Blog | Visual Lint
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
|
|
|
|
|
what about recent versions of office? Office 2010?
dev
|
|
|
|
|
Couldn't say - all I know is what's been published on the subject (which is not that much, really).
I'd be very surprised if there was any MFC in the core products though - it just isn't suited to retrofitting in that way.
Anna
Tech Blog | Visual Lint
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
|
|
|
|
|
I wonder, what's done with WPF ... I've done couple projects using WPF, feels like a waste of time if M$ eventually decides to can it
dev
|
|
|
|
|
I've no idea.
Anna
Tech Blog | Visual Lint
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
|
|
|
|
|
One wonderful thing about do-it-yourself, as a movement, is that it is a powerful way of creating more skilled technicians, lowering the cost of a repair. Also, because it’s fun, you’re realizing value that is difficult to capture in an economic analysis – conservation, thrift, self-reliance, and, if you’re doing a project with other people, community and social interaction. In this case, the repair was easily justified by the value of my time (low), and this is true in many other cases, too. But these reasons are why do-it-yourself is important culturally, not just from a purely monetary standpoint. Fixing things saves money... and teaches you how things work.
|
|
|
|
|
During the early and mid 1960s – about a half a century ago – computers were physically very big. Only big companies, universities and governments had computers, storing them in special air-conditioned rooms. And they were expensive. On IBM’s flagship mainframe computer, the IBM 7094, the memory unit – what you would now call the RAM – held one megabit, i.e. about 128KB, and cost about one million dollars in the early 1960s. That’s about five million dollars in today’s terms. Each computer was also the center of its own universe. There were a few experiments and special projects to connect computers together, but nothing common or easy. Here’s how the government changed all of that. Steve Crocker explains how the internet came to be.
|
|
|
|
|
In 1970, a Zambia-based nun named Sister Mary Jucunda wrote to Dr. Ernst Stuhlinger, then-associate director of science at NASA's Marshall Space Flight Center, in response to his ongoing research into a piloted mission to Mars. Specifically, she asked how he could suggest spending billions of dollars on such a project at a time when so many children were starving on Earth. Stuhlinger soon sent the following letter of explanation to Sister Jucunda, along with a copy of "Earthrise," the iconic photograph of Earth taken in 1968 by astronaut William Anders, from the Moon (also embedded in the transcript). His thoughtful reply was later published by NASA, and titled, "Why Explore Space?" ...the technologies, the challenge, the motivation, and even with the optimism to attack these tasks with confidence.
|
|
|
|
|
Team members at NASA's Jet Propulsion Laboratory share the challenges of the Curiosity Mars rover's final minutes to landing on the surface of Mars. From entry to sky crane to landing, here are the details and the perils of mission. An amazing explanation of how Curiosity landed itself.
|
|
|
|
|
The Curiosity Rover Nuclear Battery is one of the best feature of the latest Mars Rover. It is a huge and necessary upgrade compared the previous generation of Mars Exploration Rovers Spirit and Opportunity. It contains about 5kg (10 pounds) of plutonium-238 (non explosive), and can power the rover for at least 14 years. This motor will supply energy to the Mars Science Laboratory night and day for as long as it can move. Can I get one of these for my laptop?
|
|
|
|