Popular shared stories on NewsBlur.
1437 stories
·
30526 followers

#1147; In which a Lock is needed

3 Comments and 10 Shares

The lock is for a time capsule containing everything else in the garage.

Read the whole story
popular
1 day ago
reply
etiberius
1 day ago
reply
ÜT: 33.997032,-86.035736
Share this story
Delete
3 public comments
Courtney
1 day ago
reply
This is me in our house (except we donated our moving lock the week after we moved cause why)
Boston, MA
mburch42
2 days ago
reply
@Mary
pharmermary
1 day ago
LOL!
jlvanderzwan
2 days ago
reply
Time to tweak the IRL cache settings

Doing Terrible Things To Your Code

6 Comments and 21 Shares

In 1992, I thought I was the best programmer in the world. In my defense, I had just graduated from college, this was pre-Internet, and I lived in Boulder, Colorado working in small business jobs where I was lucky to even hear about other programmers much less meet them.

I eventually fell in with a guy named Bill O'Neil, who hired me to do contract programming. He formed a company with the regrettably generic name of Computer Research & Technologies, and we proceeded to work on various gigs together, building line of business CRUD apps in Visual Basic or FoxPro running on Windows 3.1 (and sometimes DOS, though we had a sense by then that this new-fangled GUI thing was here to stay).

Bill was the first professional programmer I had ever worked with. Heck, for that matter, he was the first programmer I ever worked with. He'd spec out some work with me, I'd build it in Visual Basic, and then I'd hand it over to him for review. He'd then calmly proceed to utterly demolish my code:

  • Tab order? Wrong.
  • Entering a number instead of a string? Crash.
  • Entering a date in the past? Crash.
  • Entering too many characters? Crash.
  • UI element alignment? Off.
  • Does it work with unusual characters in names like, say, O'Neil? Nope.

One thing that surprised me was that the code itself was rarely the problem. He occasionally had some comments about the way I wrote or structured the code, but what I clearly had no idea about is testing my code.

I dreaded handing my work over to him for inspection. I slowly, painfully learned that the truly difficult part of coding is dealing with the thousands of ways things can go wrong with your application at any given time – most of them user related.

That was my first experience with the buddy system, and thanks to Bill, I came out of that relationship with a deep respect for software craftsmanship. I have no idea what Bill is up to these days, but I tip my hat to him, wherever he is. I didn't always enjoy it, but learning to develop discipline around testing (and breaking) my own stuff unquestionably made me a better programmer.

It's tempting to lay all this responsibility at the feet of the mythical QA engineer.

If you are ever lucky enough to work with one, you should have a very, very healthy fear of professional testers. They are terrifying. Just scan this "Did I remember to test" list and you'll be having the worst kind of flashbacks in no time. Did I mention that's the abbreviated version of his list?

I believe a key turning point in every professional programmer's working life is when you realize you are your own worst enemy, and the only way to mitigate that threat is to embrace it. Act like your own worst enemy. Break your UI. Break your code. Do terrible things to your software.

This means programmers need a good working knowledge of at least the common mistakes, the frequent cases that average programmers tend to miss, to work against. You are tester zero. This is your responsibility.

Let's start with Patrick McKenzie's classic Falsehoods Programmers Believe about Names:

  1. People have exactly one canonical full name.
  2. People have exactly one full name which they go by.
  3. People have, at this point in time, exactly one canonical full name.
  4. People have, at this point in time, one full name which they go by.
  5. People have exactly N names, for any value of N.
  6. People’s names fit within a certain defined amount of space.
  7. People’s names do not change.
  8. People’s names change, but only at a certain enumerated set of events.
  9. People’s names are written in ASCII.
  10. People’s names are written in any single character set.

That's just the first 10. There are thirty more. Plus a lot in the comments if you're in the mood for extra credit. Or, how does Falsehoods Programmers Believe About Time grab you?

  1. There are always 24 hours in a day.
  2. Months have either 30 or 31 days.
  3. Years have 365 days.
  4. February is always 28 days long.
  5. Any 24-hour period will always begin and end in the same day (or week, or month).
  6. A week always begins and ends in the same month.
  7. A week (or a month) always begins and ends in the same year.
  8. The machine that a program runs on will always be in the GMT time zone.
  9. Ok, that’s not true. But at least the time zone in which a program has to run will never change.
  10. Well, surely there will never be a change to the time zone in which a program has to run in production.
  11. The system clock will always be set to the correct local time.
  12. The system clock will always be set to a time that is not wildly different from the correct local time.
  13. If the system clock is incorrect, it will at least always be off by a consistent number of seconds.
  14. The server clock and the client clock will always be set to the same time.
  15. The server clock and the client clock will always be set to around the same time.

Are there more? Of course there are! There's even a whole additional list of stuff he forgot when he put that giant list together.

Catastrophic Error - User attempted to use program in the manner program was meant to be used

I think you can see where this is going. This is programming. We do this stuff for fun, remember?

But in true made-for-TV fashion, wait, there's more! Seriously, guys, where are you going? Get back here. We have more awesome failure states to learn about:

At this point I wouldn't blame you if you decided to quit programming altogether. But I think it's better if we learn to do for each other what Bill did for me, twenty years ago — teach less experienced developers that a good programmer knows they have to do terrible things to their code. Do it because if you don't, I guarantee you other people will, and when they do, they will either walk away or create a support ticket. I'm not sure which is worse.

[advertisement] Find a better job the Stack Overflow way - what you need when you need it, no spam, and no scams.
Read the whole story
smadin
3 days ago
reply
learning to do good testing on my own code was by far the hardest part of becoming a competent software engineer.
Boston
etiberius
1 day ago
reply
ÜT: 33.997032,-86.035736
ChrisDL
2 days ago
reply
New York
popular
3 days ago
reply
Share this story
Delete
5 public comments
chrisminett
1 day ago
reply
QA
Milton Keynes, UK
JayM
2 days ago
reply
:)
Boston Metro Area
breadtk
2 days ago
reply
I love Atwood.
Cascadia
Courtney
2 days ago
reply
Reminder: QA testers are some of the very lowest paid people in the games industry. Tech is shit, but everyone I know and have ever read in tech has the decency to value QA as a concept (even if internalizing testing is still, cough, a challenge).
Boston, MA
walokra
3 days ago
reply
"As a programmer you are your own worst enemy, and the only way to mitigate that threat is to embrace it. Break your UI. Break your code. Do terrible things to your software."

Jupiter Submarine

3 Comments and 10 Shares

Jupiter Submarine

What if you released a submarine into Jupiter's atmosphere? Would it eventually reach a point where it would float? Could it navigate?

—KTH

Nope! Jupiter's pressure, density, and temperature curves are different from ours. At the point in Jupiter's atmosphere where the density is high enough for a submarine to float, the pressure is high enough to crush the submarine,[1]Which makes it more dense. and the temperature is high enough to melt it.[2]Which makes it harder to drive.

But there's another problem: Jupiter is a gas giant, but submarines—as you can figure out from etymology—go under water.

Air and water are different. This seems straightforward enough, but they're also the same in a lot of ways. They're both "fluids," and some of the same rules apply to each. In some sense, when you look up at the sky, you're looking up from the bottom of a deep sea of air.

Things float when they're less dense than the fluid around them. This works the same for balloons in air and boats in water. The late Terry Pratchett wrote a truly beautiful passage about this, in the prologue to his book Going Postal. He says that since water is in many respects a wetter form of air,[3]Sounds reasonable enough to me. as ships sink, eventually they reach a point where the water was too dense to sink any further. This layer forms an underwater surface on which shipwrecks collect, drifting around beneath the waves but far above the sea floor:

It’s calm there. Dead calm.

Some stricken ships have rigging; some even have sails. Many still have crew, tangled in the rigging or lashed to the wheel.

But the voyages still continue, aimlessly, with no harbour in sight, because there are currents under the ocean and so the dead ships with their skeleton crews sail on around the world, over sunken cities and between drowned mountains, until rot and shipworms eat them away and they disintegrate.

Sometimes an anchor drops, all the way to the dark, cold calmness of the abyssal plain, and disturbs the stillness of centuries by throwing up a cloud of silt.

I love that passage. It's also completely wrong. Ships sink all the way to the bottom. (Sir Terry knew this, as the rest of the passage makes clear, but he's describing how ships work on Discworld, not Earth.)

Air follows the ideal gas law. The more pressure you put on it, the smaller (and denser) it gets.

Water, on the other hand, is pretty much incompressible. When you dive into the ocean, the pressure increases as you go deeper (rising by one atmosphere every 10 meters or so) but the water's density barely changes all the way down to the sea floor.

Buoyancy depends on density, not pressure. There's a point in Jupiter's atmosphere where the pressure is equal to a little more than an Earth atmosphere—which is the pressure a submarine is used to—but the air there is barely a tenth as dense as ours. A submarine in that layer would fall even faster than it would in the air on Earth.

To reach a depth where it could "float" in Jupiter, the submarine would have to go halfway to the center of the planet, where the intense pressure turns the air into a metallic soup that's hotter than the surface of the Sun. The pressure there would be so high that not only would the submarine be crushed, the substances that make it up would probably converted into new and exciting forms. It's hard to create those kinds of conditions in a lab, so we don't know a lot about how materials behave with that much pressure pushing down on them.

In the sea, on the other hand, the density of the fluid stays relatively constant. That means the submarine can find its appropriate pressure range and float there. In other words, submarines only work because water doesn't follow the ideal gas law.

But there's one more twist: Water sort of does obey the ideal gas law. The equations governing water under normal pressure are similar to the equation for a gas under about twenty thousand atmospheres of pressure. In a sense, this is why water seems incompressible to us—it behaves as if it's already compressed so much that an extra atmosphere or two hardly makes a difference.

So, in some ways, water and air are more similar than they seem, but in the ways that matter for a submarine, they really are different.

Which, of course, brings us back to why it's called a submarine—it operates under a "mare". A vehicle designed to operate beneath a sea of air would be called a subaerine.[5]The "gas" in "gas giant" is from the Greek word for void (χάος, kháos), so maybe a vessel (σκάφη, skáphē) that travels through a gas giant's atmosphere would be a khaoskaphe.

Which, come to think of it, is a perfectly good description of a car.

Read the whole story
satadru
3 days ago
reply
I love everything about this.
New York, NY
popular
3 days ago
reply
Share this story
Delete
2 public comments
jlvanderzwan
3 days ago
reply
"The pressure there would be so high that not only would the submarine be crushed, the substances that make it up would probably converted into new and exciting forms."
I like that he managed to find a positive angle in the hypothetical scenario
jlvanderzwan
3 days ago
"This is your captain speaking. We are all going to die! But on the plus side..."
llucax
4 days ago
reply
I want a subaerin!
Berlin

The Sky

1 Comment and 7 Shares
The other half has some cool shipwrecks, rocks, and snakes, but if you move those out of the way, it also has more sky.
Read the whole story
popular
3 days ago
reply
Share this story
Delete
1 public comment
JayM
6 days ago
reply
Me too.
Boston Metro Area

Renaissance painting shows how watermelons looked before selective breeding

6 Comments and 14 Shares

A painting of fruit done by Giovanni Stanchi sometime in the mid 1600s shows that the watermelon has changed somewhat in the intervening 350 years.

Renaissance watermelon

That's because over time, we've bred watermelons to have the bright red color we recognize today. That fleshy interior is actually the watermelon's placenta, which holds the seeds. Before it was fully domesticated, that placenta lacked the high amounts of lycopene that give it the red color. Through hundreds of years of domestication, we've modified smaller watermelons with a white interior into the larger, lycopene-loaded versions we know today.

(via @robinsloan)

Tags: artfoodGiovanni Stanchi Giovanni Stanchiartfood
Read the whole story
fxer
3 days ago
reply
Finally a placenta you can enjoy without the townsfolk pitchforking you to death
Bend, Oregon
DMack
3 days ago
reply
great!
Victoria, BC
popular
3 days ago
reply
rachel
3 days ago
reply
cambridge, ma
Share this story
Delete
4 public comments
skittone
16 hours ago
reply
No, this is a watermelon that didn't have enough water during development. It happens today, too. Look at more paintings of watermelons contemporary with this one. You'll see.
Courtney
3 days ago
reply
But what of its "chemicals"
Boston, MA
aaronwe
3 days ago
reply
Revenge of the Pith.
Denver
cinebot
4 days ago
reply
TIL
toronto.
digdoug
4 days ago
Noooo GMOs! (kidding.)
steingart
4 days ago
pith for life

Saturday Morning Breakfast Cereal - The Importance of Education

5 Comments and 22 Shares

Hovertext: In fairness, my entire existence is an affectation.


New comic!
Today's News:
Read the whole story
brico
4 days ago
reply
//
Brooklyn, NY
vitormazzi
5 days ago
reply
Brasil
popular
5 days ago
reply
toddgrotenhuis
5 days ago
reply
Indianapolis
Share this story
Delete
4 public comments
StunGod
2 days ago
reply
That's the start of a world-class high school commencement speech right there.
Eugene, Oregon, USA
deezil
4 days ago
reply
Perfect.
Murray, Kentucky
digdoug
4 days ago
reply
Yup.
Louisville, KY
orpheus17d
5 days ago
reply

Next Page of Stories