I don't think that I learn much at my job, but I was surprised the other day to learn something new about microcontrollers. Well, coding in general anyhow. You see, when working with microcontrollers I use a finite state machine to control program execution. No, wait, what does that mean? That's technical gobbledy gook. It means that I have a variable and I define a bunch of different values it can take. When my program starts it goes into INITIALIZE mode and it initializes stuff. Then when its done I usually put it into IDLE where it doesn't do much of anything and usually waits for user input like a button press or something. Then depending on what happens I put it into other modes like DO_STUFF_1 or DO_STUFF_2. Different events can change the mode it's in and that produces different behaviors. The idea is that it will be a nice and orderly flow from one mode to the next and that depending on what mode you're in you won't handle certain inputs, or you'll handle them differently. The goal is predictable behavior.
But microcontrollers are anything but predictable. You see, there's these awful things called interrupts. They are what they sound like - they interrupt your program and do something else. They happen usually when hardware has done something - say a button has been pressed. When that happens, whatever you were doing previously stops and this new code executes. That's not usually so bad, but you almost always want to change the mode you're in based on what happens in that interrupt. Okay, so change the mode. Fine, whatever. I don't care.
Except I obviously do. This might happen:
CODE ALERT! CODE ALERT!
do_special_stuff_for_different(modes)
{
mode1:
easy_command();
easy_command();
---OOOOPS INTERRUPT HAPPENED HERE!----
change_mode_to(mode2)
---INTERRUPT OVER BYE BYE NOW!--------
command_that_checks_mode(); //Oops, doesn't run, wrong mode!
command_that_depends_on_the_above(); //fails, above didnt' run!
...
} //Always close your braces!
You see what happens there. Ideally, you want all the commands for a mode to run regardless of whether the mode changes halfway through.
This can be done. Just use a queue data structure to change the mode. A queue is a list of things. I can put things into the back end and take things out of the front. So when I want the mode to change, I can just put the new value for mode into the queue and then handle it in one and only one place in the program:
is(empty(mode_queue))
{
no:
mode =new_mode_from_the(mode_queue);
yes:
//Do nothing!
}
do_special_stuff_for_different(modes)
{
mode1:
easy_command();
...
}
So you only change the mode before you handle events for that mode, and never while you're handling them. This eliminates confusion for the poor code.
But, my unoriginal idea improves this - I think. Say that you're in MODE1 and you have an interrupt that wants to change the mode to MODE2. Ok, it puts the new mode into the queue and we'll handle it when the time comes. But now, before it can be handled you get another interrupt that tries to change the mode to MODE3. Well, put it in the queue and we'll handle it. When everything is said and done, you have the mode change from MODE1 to MODE2 to MODE3 right after one another. It seems OK, but wait! When we designed the system, we never intended to move from MODE2 to MODE3 because in MODE2, we set things up to get ready for MODE4 which we intend to follow MODE2 directly. But that doesn't happen. When you're in MODE2 you try to put MODE4 on the queue, but it gets in line behind MODE3. And meanwhile, if MODE3 attempts to put MODE5 next, it also fails. So you've got two different things trying to happen in sequence at the same time.
It might work, but it might not. We intended in our design to move right from MODE2 to MODE4 but we didn't do anything to ensure that it actually would. That's where my unoriginal idea comes in. These modes are stored on a microcontroller. That means they're stored with bytes, and bytes are made of bits - eight of them to be precise. Eight bits can store 256 different modes if you encode it that way, or it can store eight if you use something called one-hot encoding. One-hot encoding means that only one bit is ever a '1' at a time - the rest are zeros. Wherever the '1' is determines what the value is.
So, when we want to change modes we don't put the next mode we want to move to into the queue, we XOR the current mode with the next mode and put that into the queue. The XOR operation works on bits and it says if two bits are the same, the outcome is zero. If they're different, the outcome is 1. Since all of our modes are encoded with one-hot encoding, there shouldn't be any same bits. Wherever there was a one in either of the modes' bytes, there will be a one in the resulted XOR'd byte. Using this method we don't only record the next mode we want to go to, but we record the mode the program was in when it wanted to go there. It says 'I want to go from MODE2 to MODE4' instead of 'I want to go to MODE4'. Then, when it comes time to look at the queue and change the mode, we can make a better decision. If the request is 'I want to go from MODE2 to MODE4' but we're in MODE3 right now, it doesn't happen. It goes on to the next request which was 'I want to go from MODE3 to MODE5' and that one happens.
Now, there's an obvious flaw in this: the request to go to MODE4 is lost totally. The upshot is that if I press two buttons at the same time only one thing happens. For buttons that's good enough, but for other inputs it's not. For some inputs what you really mean to say is 'No matter what mode I'm in now, I want to go to MODE8'. How do you do that? Simple, it's.. No, wait, how DO you do that?
Oh, wait, I know how. Assuming you followed all of the above steps, then when you XOR the information in the queue with the current mode you get out a valid new mode and just switch to that. If you don't, then you can assume that you want to perform one of these unequivocal mode changes. You just have to figure out what mode you want to change to. So, in order to handle that, you can do this: instead of putting the XOR'd mode into the queue, just put the next mode you want to go to. When the program attempts to XOR it again with the current mode it WON'T get a valid mode out of it. So, it will XOR the data again with the current mode and if you meant to do one of those unequivocal jumps, it will produce a valid mode from THAT XOR operation. If you didn't mean to do an unequivocal jump, then it will produce an invalid mode. Tada!
Tuesday, March 9, 2010
Monday, March 8, 2010
Debugging
This post isn't for me. I never have to debug. I follow a strict development process in which all of the documentation I read is perfectly accurate and describes all edge case behavior. I also follow code writing procedures so well that every exception is handled, every input is sanitized completely (even to the point of predicting accurately what the user meant to enter instead of what the user did) and every return value is checked. All reported errors (which are entirely due to... well, not me anyhow) have expository messages bordering on small novels that not only tell you what caused the error but actually fix it themselves in all known copies of the program, including those in the past. Yeah, that's right - my code is so awesome that it goes back in time and fixes itself before you even see an error message.
Well, I doubt you believe that. I'm not sure what to believe anymore - the full truth of the situation is caught somewhere in an unstable time loop that will someday tear reality apart. So in the meantime, I actually debug things. Yes, things that I created. This is because you can never get away from debugging. Because documentation is Just. Plain. Wrong. Because the user put international unicode characters that you didn't even know existed into your text box. Because every library you rely on has bugs and undefined behavior. And it's only worse with circuits: the EM spectrum is effectively infinite. Wavelengths you only see in your nightmares can ruin your life in an instant. It happened with the earliest digital computers - freaking cosmic rays would cause a single bit in memory to be changed and trash your machine state. Yes, the very fabric of nature hates you and wants to give you blue screens.
The best, the very best that you can hope for is that your code or circuit does what you designed it to do. Put all your effort into meeting the spec first - later, after you're almost done debugging and trying to figure out why the slave device won't respond to a perfectly valid message, well, that's when they'll tell you that the specs they gave you were wrong and you have to wipe out some code and start over.
In any case, when all you have is a spec, all you can do is implement it. Let's imagine a scenario that involves both hardware and software. I'll imagine a small embedded sensor that has to relay data to its gateway - probably an AVR based 8-bit microcontroller with firmware that I've made, communicating with a host system over TTL-level serial (8-N-1, 115200 bps) and it collects 0-5V data with the ADC. It uses a packet-based serial communication scheme (START, MSG ID, LENGTH, DATA, END sort of deal) to transmit data every second to the host.
Ideally, you code everything, solder everything, hook up power and communication and it works. Then you go home to your supermodel wife/husband/plaything and sports car and sip scotch while listening to death metal. But the reality is that 99.9999% of the time it won't work. The questions you have to keep asking yourself:
'What might be wrong if it doesn't work?'
'What's the quickest way to test that?'
Before I begin, let me note that I said 'quickest' way to test things. When you think you're done and you're testing your code or hardware the actual system it's meant to interface and work with, then chances are your time is limited. You'll probably be close to delivery of the final product, or you'll have another group that needs to use the actual system to test. In either case, quickest is best - you want to front-load as much of this integration phase as possible into design as possible. Don't ever assume it's going to work and then attempt to throw debug capability into your design after you amazingly find that it doesn't 'just work'.
So, look at the host computer and see what it says. No communication with slave?
'What might be wrong if that doesn't work?'
You should know why specifically it shows that message - in this case let's say that it shows it because it didn't receive an answer to an initialization message. Maybe it's just not getting the message
'What is the quickest way to test that?'
I think the easiest way is to put an LED on my slave device and light it if it finds the message. So we'll create the light and lo and behold it doesn't light.
'What might be wrong if it doesn't light?'
If it doesn't light, then the serial port may not be working correctly.
'What's the quickest way to test that?'
I would create a wrap-around self-test mode. Just loop the TX lines of your slave to RX and send a test message, then light an LED if it receives what it sent out.
'What might be wrong if THAT light doesn't light up?'
At this point, if it can't communicate with itself then it's just not sending anything out (for one reason or another) or what it's sending out is gibberish and can't be read back.
'What's the quickest way to test that?'
Monitor the signal to see if it looks like a legitimate serial transmission. To do that, you'll need test points to hook up your logic analyzer or oscilloscope. So you'll either see a valid waveform, an invalid waveform, or no waveform.
So ask yourself again: 'What might be wrong if I see valid waveform or no waveform?'
If you see a valid or no waveform waveform then it's probably software: the receive or transmit buffer isn't being filled perhaps.
And then: 'What's the quickest way of testing that?'
What *I* would do is use a secondary serial port as a debug terminal so you can view the contents of the RX and TX serial buffers. Then you can see if they're being filled or not, and go on from there.
So look back at all that. Just by considering what might not work we added several things to our system: test points, a wrap-around self-test functionality and a debug terminal. If you have all of those things ready and you've tackled some of the other 'Why might this not work and what can I do to quickly test it?' scenarios then you're poised to quickly find the root of the problems you're seeing in minutes and hours instead of days and weeks. Integration (that is, combining what YOU make with what OTHER people make) is the most difficult part of any project. Specs aren't going to help you because no spec is ever complete enough to define a system. Everyone makes assumptions and doesn't tell anyone and that makes testing a pain. So save yourself some pain and plan ahead. You'll thank yourself later.
Well, I doubt you believe that. I'm not sure what to believe anymore - the full truth of the situation is caught somewhere in an unstable time loop that will someday tear reality apart. So in the meantime, I actually debug things. Yes, things that I created. This is because you can never get away from debugging. Because documentation is Just. Plain. Wrong. Because the user put international unicode characters that you didn't even know existed into your text box. Because every library you rely on has bugs and undefined behavior. And it's only worse with circuits: the EM spectrum is effectively infinite. Wavelengths you only see in your nightmares can ruin your life in an instant. It happened with the earliest digital computers - freaking cosmic rays would cause a single bit in memory to be changed and trash your machine state. Yes, the very fabric of nature hates you and wants to give you blue screens.
The best, the very best that you can hope for is that your code or circuit does what you designed it to do. Put all your effort into meeting the spec first - later, after you're almost done debugging and trying to figure out why the slave device won't respond to a perfectly valid message, well, that's when they'll tell you that the specs they gave you were wrong and you have to wipe out some code and start over.
In any case, when all you have is a spec, all you can do is implement it. Let's imagine a scenario that involves both hardware and software. I'll imagine a small embedded sensor that has to relay data to its gateway - probably an AVR based 8-bit microcontroller with firmware that I've made, communicating with a host system over TTL-level serial (8-N-1, 115200 bps) and it collects 0-5V data with the ADC. It uses a packet-based serial communication scheme (START, MSG ID, LENGTH, DATA, END sort of deal) to transmit data every second to the host.
Ideally, you code everything, solder everything, hook up power and communication and it works. Then you go home to your supermodel wife/husband/plaything and sports car and sip scotch while listening to death metal. But the reality is that 99.9999% of the time it won't work. The questions you have to keep asking yourself:
'What might be wrong if it doesn't work?'
'What's the quickest way to test that?'
Before I begin, let me note that I said 'quickest' way to test things. When you think you're done and you're testing your code or hardware the actual system it's meant to interface and work with, then chances are your time is limited. You'll probably be close to delivery of the final product, or you'll have another group that needs to use the actual system to test. In either case, quickest is best - you want to front-load as much of this integration phase as possible into design as possible. Don't ever assume it's going to work and then attempt to throw debug capability into your design after you amazingly find that it doesn't 'just work'.
So, look at the host computer and see what it says. No communication with slave?
'What might be wrong if that doesn't work?'
You should know why specifically it shows that message - in this case let's say that it shows it because it didn't receive an answer to an initialization message. Maybe it's just not getting the message
'What is the quickest way to test that?'
I think the easiest way is to put an LED on my slave device and light it if it finds the message. So we'll create the light and lo and behold it doesn't light.
'What might be wrong if it doesn't light?'
If it doesn't light, then the serial port may not be working correctly.
'What's the quickest way to test that?'
I would create a wrap-around self-test mode. Just loop the TX lines of your slave to RX and send a test message, then light an LED if it receives what it sent out.
'What might be wrong if THAT light doesn't light up?'
At this point, if it can't communicate with itself then it's just not sending anything out (for one reason or another) or what it's sending out is gibberish and can't be read back.
'What's the quickest way to test that?'
Monitor the signal to see if it looks like a legitimate serial transmission. To do that, you'll need test points to hook up your logic analyzer or oscilloscope. So you'll either see a valid waveform, an invalid waveform, or no waveform.
So ask yourself again: 'What might be wrong if I see valid waveform or no waveform?'
If you see a valid or no waveform waveform then it's probably software: the receive or transmit buffer isn't being filled perhaps.
And then: 'What's the quickest way of testing that?'
What *I* would do is use a secondary serial port as a debug terminal so you can view the contents of the RX and TX serial buffers. Then you can see if they're being filled or not, and go on from there.
So look back at all that. Just by considering what might not work we added several things to our system: test points, a wrap-around self-test functionality and a debug terminal. If you have all of those things ready and you've tackled some of the other 'Why might this not work and what can I do to quickly test it?' scenarios then you're poised to quickly find the root of the problems you're seeing in minutes and hours instead of days and weeks. Integration (that is, combining what YOU make with what OTHER people make) is the most difficult part of any project. Specs aren't going to help you because no spec is ever complete enough to define a system. Everyone makes assumptions and doesn't tell anyone and that makes testing a pain. So save yourself some pain and plan ahead. You'll thank yourself later.
Tuesday, March 2, 2010
Wherefore Art Thou Sparkfun?
Did you know there's an angyee.blogspot.com? I think it's in Portuguese and run by a female. It's all pink anyhow, but pink can be manly, so I don't know. It might help if I read Portuguese.
I just read an interesting flame war over on Hackaday about whether Sparkfun is overpriced and, well, dumb. Overpriced is for certain, but that's the name of the game. Everyone who sells you something they bought from someone else will be 'overpriced' in that you don't have the money or storage to buy 1000 of anything and wait for others to buy them from you. You're buying the convenience of getting one and only one of something.
In fact, I just bought some ATMega328 DIP chips from Sparkfun. After the flame war I was feeling guilty about it so I checked DigiKey for their price. It's the same. The exact same. The only difference is that Sparkfun offers less of a volume discount. Their stock counter says they have over a thousand of them, so they got the nice $3.04/unit price and are selling them at $4.30 - just like DigiKey. Yes, they're making money, but why not just buy from DigiKey?
That brings me to the second thing that you get from Sparkfun - an explanation. When you search for ATMega328 on DigiKey you get five different chips in varying packages and a comparison table that's about a half mile long. If you don't know that you want the DIP version you're screwed. Lucky me, I do know.
But this totally avoids a more important point: How do you know you want an ATMega328 at all? Sparkfun spells it out for you: it's the Arduino chip but with more program memory. More is better right? Even if you don't know how much program memory you need, why not have more? Plus they tell you that it will work in place of the chip already in your Arduino but wait, don't change that chip yet! You need the bootloader programmed on there for everything to work properly. DigiKey would not tell you that. Heck, DigiKey will barely make it easy for you to give them money.
That's another thing Sparkfun has going for it: their web design is not straight out of 1995. It has pictures and a shopping cart and colors! Oh, and navigation. DigiKey has an awful Flash version of their print catalog. Yes, they thought it would be good to simulate turning pages on the internet. That hasn't been a good idea since Geocities. Of course, DigiKey started with its paper catalog and must really feel attached to it. I can't fault them for sticking with success, but the idea of even using a 1000 page catalog is... so, so unappealing. And a waste of paper.
So the second point is whether Sparkfun is dumb. And by dumb I mean facile. Childish. Dorky but in a bad way. The issue at hand was creating projects like '5 foot Nintendo controllers'. I must admit that so much of the hobby electronics seems like a big dick waving contest. Who can create the coolest steampunk doo-dad? I don't care. Or this gem recently featured on Hacknmod: 'Twitter Controlled LED IKEA Table using Bluetooth'
Let me just pause a minute to let that sink in.
...
...
Okay. Bluetooth is neat. My Wiimotes are Bluetooth and I think it's great I can hook them up to my computer and read their data. It makes a lot of sense as a Personal Area Network protocol. I like headsets. So I don't dislike Bluetooth. I also think RGB leds are interesting - with Red, Green and Blue we can make all colors! It'd be great for use as a status indicator - red is bad, green is good, orange is warning, etc. I like... coffee tables? I guess. I don't dislike them anyhow.
But I just picture this geek sitting at this table with his friends, itching to show off his new toy that he made. So in the middle of the conversation the whips out his phone and says 'Watch, I'm going to Twitter to my table and change its color! I made this! Hold on. I have to type out the message... almost there... Oh I don't have 3G, this might take a bit... Ok sent! Now it should turn green.. uh. any second... uh.. Maybe I have to reboot the computer... hold on...'
Or you have worse projects like TV-B-Gone. The sole purpose of that invention is to make yourself feel good at others' expense. In a bar? Football game that everyone else is watching too loud? Can't hear you and your friends talk about how counter-culture you are? Whip out your TV-B-Gone and turn off everyone else's entertainment! That TV wasn't doing anything for you!
So a lot of this hobby electronics community consists of everyone trying to outdo this month's steampunk widget or Twitter-using Ardunio-controlled status symbol. You know where it goes from here: What started as an honest effort to educate people, have a good time and share things turns into a contest. I saw it happen with LAN parties. Instead of having fun and laughs people started the biggest hard drive contest, or the most porn contest or the biggest monitor/best system specs contest. My friends and I held LAN parties in high school. Some we charged for. Despite lugging their system across town and PAYING to get in some people just wouldn't play computer games! They'd hang around, look over people's shoulders and slow down peoples computers by transferring porn while they were trying to play Unreal Tournament. It just wasn't worth it after a while and I fear the same thing will happen with this 'community'.
In conclusion: Overpriced - probably for some things, not for others. Do your homework. Facile? Childish? Lacking in true content? A bit. There's still plenty of good stuff over at Sparkfun and their top-selling items are components - not kits. But I worry about everyone else. When blogs just echo each others' postings of Twitter-controlled steampunk widgets instead of producing something... substantive, well, I get concerned.
I just read an interesting flame war over on Hackaday about whether Sparkfun is overpriced and, well, dumb. Overpriced is for certain, but that's the name of the game. Everyone who sells you something they bought from someone else will be 'overpriced' in that you don't have the money or storage to buy 1000 of anything and wait for others to buy them from you. You're buying the convenience of getting one and only one of something.
In fact, I just bought some ATMega328 DIP chips from Sparkfun. After the flame war I was feeling guilty about it so I checked DigiKey for their price. It's the same. The exact same. The only difference is that Sparkfun offers less of a volume discount. Their stock counter says they have over a thousand of them, so they got the nice $3.04/unit price and are selling them at $4.30 - just like DigiKey. Yes, they're making money, but why not just buy from DigiKey?
That brings me to the second thing that you get from Sparkfun - an explanation. When you search for ATMega328 on DigiKey you get five different chips in varying packages and a comparison table that's about a half mile long. If you don't know that you want the DIP version you're screwed. Lucky me, I do know.
But this totally avoids a more important point: How do you know you want an ATMega328 at all? Sparkfun spells it out for you: it's the Arduino chip but with more program memory. More is better right? Even if you don't know how much program memory you need, why not have more? Plus they tell you that it will work in place of the chip already in your Arduino but wait, don't change that chip yet! You need the bootloader programmed on there for everything to work properly. DigiKey would not tell you that. Heck, DigiKey will barely make it easy for you to give them money.
That's another thing Sparkfun has going for it: their web design is not straight out of 1995. It has pictures and a shopping cart and colors! Oh, and navigation. DigiKey has an awful Flash version of their print catalog. Yes, they thought it would be good to simulate turning pages on the internet. That hasn't been a good idea since Geocities. Of course, DigiKey started with its paper catalog and must really feel attached to it. I can't fault them for sticking with success, but the idea of even using a 1000 page catalog is... so, so unappealing. And a waste of paper.
So the second point is whether Sparkfun is dumb. And by dumb I mean facile. Childish. Dorky but in a bad way. The issue at hand was creating projects like '5 foot Nintendo controllers'. I must admit that so much of the hobby electronics seems like a big dick waving contest. Who can create the coolest steampunk doo-dad? I don't care. Or this gem recently featured on Hacknmod: 'Twitter Controlled LED IKEA Table using Bluetooth'
Let me just pause a minute to let that sink in.
...
...
Okay. Bluetooth is neat. My Wiimotes are Bluetooth and I think it's great I can hook them up to my computer and read their data. It makes a lot of sense as a Personal Area Network protocol. I like headsets. So I don't dislike Bluetooth. I also think RGB leds are interesting - with Red, Green and Blue we can make all colors! It'd be great for use as a status indicator - red is bad, green is good, orange is warning, etc. I like... coffee tables? I guess. I don't dislike them anyhow.
But I just picture this geek sitting at this table with his friends, itching to show off his new toy that he made. So in the middle of the conversation the whips out his phone and says 'Watch, I'm going to Twitter to my table and change its color! I made this! Hold on. I have to type out the message... almost there... Oh I don't have 3G, this might take a bit... Ok sent! Now it should turn green.. uh. any second... uh.. Maybe I have to reboot the computer... hold on...'
Or you have worse projects like TV-B-Gone. The sole purpose of that invention is to make yourself feel good at others' expense. In a bar? Football game that everyone else is watching too loud? Can't hear you and your friends talk about how counter-culture you are? Whip out your TV-B-Gone and turn off everyone else's entertainment! That TV wasn't doing anything for you!
So a lot of this hobby electronics community consists of everyone trying to outdo this month's steampunk widget or Twitter-using Ardunio-controlled status symbol. You know where it goes from here: What started as an honest effort to educate people, have a good time and share things turns into a contest. I saw it happen with LAN parties. Instead of having fun and laughs people started the biggest hard drive contest, or the most porn contest or the biggest monitor/best system specs contest. My friends and I held LAN parties in high school. Some we charged for. Despite lugging their system across town and PAYING to get in some people just wouldn't play computer games! They'd hang around, look over people's shoulders and slow down peoples computers by transferring porn while they were trying to play Unreal Tournament. It just wasn't worth it after a while and I fear the same thing will happen with this 'community'.
In conclusion: Overpriced - probably for some things, not for others. Do your homework. Facile? Childish? Lacking in true content? A bit. There's still plenty of good stuff over at Sparkfun and their top-selling items are components - not kits. But I worry about everyone else. When blogs just echo each others' postings of Twitter-controlled steampunk widgets instead of producing something... substantive, well, I get concerned.
Tuesday, September 15, 2009
On Requirements
I like looking at job postings. It's kinda like shopping for a new TV. 'Oooh, this one is for designing analog circuits!' instead of 'Ooooh, this one has three HDMI ports!'
But they're still funny, funny things. There's so many problems with how people are hired nowadays. For instance, I rarely see jobs that ask for less than 5 years of experience in... something. Whatever the job is about. Want a job making circuits? Five years experience in making circuits, mandatory. Your resume is not even considered if you don't have five years of valid work experience. Go work for $random_big_corporation with a well-known name developing circuits for five years and we'll consider you.
What exactly is the value of five years of 'professional' work experience? Surely you have a number of designs under your belt, a list of components you use, probably a few contacts for samples, support, etc? But if you've been hacking together circuits since you were five and have a web page full of stuff you've done, but only two years of work experience then you're not supposed to apply. What does the five years working for a company guarantee them? Certainly not quality. Anyone can remain employed with a certain title and be bad at their job. I see plenty of people like that, but when they leave they'll put right on their resume - '5 years of bad designs, rework, lost profit and profanity. But my title was analog design engineer the whole time.' That guy wins.
And what's with the specific skills? 'Must use Eagle for schematics and layout.' Ok, I'll learn Eagle. Not my preferred solution but I'll do it if it gets me a job. Oh wait, it doesn't say that. It says 'Proficiency in Eagle schematic capture and layout required'. What? When you're looking for a mechanic do you put 'Must have proficiency with Craftsman brand crescent wrenches'? I've used plenty of schematic capture programs and none of them are black magic (except maybe PSPICE. Grrrrr....). I'm sure I can use Eagle very well if you give me a few hours to play with it. Heck, I can DOWNLOAD it and play with it - I'll get it done before I come to work for you! The tool is not supposed to define the job. If anything, arbitrary requirements only diminish the talent pool of people who can help you. (Note I said 'arbitrary' requirements. Some requirements are sadly justified.)
So your resume has to have a bullet point - 'Created 12346463113 circuit desgins for a toaster using Eagle'. Perfect. That gets past the filter. Why do the tools matter so much? True, if I'm going to work for a company that's doing a large program in C#, then I had better have worked with C# before. But that's what coders do. Code monkeys. People who get specifications in and produce code for output. Then a freaking computer checks their work with a unit test and tells them if they did it wrong. These people are automatons. Their job requires almost no original thinking. Engineering is supposed to be about creativity - finding solutions to problems. I always thought I would be sat down and they'd say something like 'This hyperdrive keeps overloading when we turn it on. We need to reach the Tok'Ra in three days before Apophis comes in his mothership and beats the crap out of us.' To which I'd say 'I'll put my engineering mind to work on that problem right away. And I need to work with Major Carter. Alone. Naked.' What's NOT supposed to happen is for them to then say 'Oh by the way, it all has to be done in Lisp. You have 5 years of Lisp experience, right?' Whatever happened to the right tool for the job? You know - how it's supposed to make things easier/cheaper/faster?
And don't you love how every job has its little 'niche'? This position is for an automation engineer, not an electrical engineer. This one is for an embedded application developer, not a software engineer with a specialty in embedded systems. The proposed scope is so small it's like it's not even worth it. Even if you have superior experience it doesn't matter.
'This position requires experience with PLCs'.
'Oh, those are microcontrollers with a whole bunch of electronics. I could design one of those. Can I have the job?'
'No, you just said you don't have any experience with PLCs.'
*facepalm*
Or better yet, your similar experience is worthless:
'I studied to be a controls engineer but I think I fit for this DSP position. DSP and controls stem from the same theoretical background and I've also had extensive training in numerical methods for computer systems. Also, I created an embedded sensor platform that used DSP, so I have practical experience in embedded programming and DSP. Can I have the job?'
'I'm sorry, we're not hiring controls engineers.'
*facepalm*
If I had to boil it down to one question it would be:
Why are businesses afraid to hire anyone but the person who exactly fits?
There are so many modifiers on these job listings that you'd think they had millions of people to choose from and they could afford to be picky. Ideally on the internet they do, but then they do stupid things like say 'Local candidates only' or refuse to pay for people to come out and be interviewed. Or not pay for relocation. Or not help a spouse get a job. So you're limited to whatever people can be found at hand. And they're not going to find their perfect match. I have friends who look for mates like this. Yeah, they're single. And they're missing out on a great part of life.
While it's true that companies cannot afford turnover, they also cannot afford to delay hiring for too long. If a job sits, the work doesn't get done. Or you overwork the people you do have which leads to turnover. All out of an.. ideal? Is it a value nowadays to not train people? To not give people a chance? Not to invest in them? To be picky? To not try new approaches, hire people with new skillsets?
While I can't fathom the reasons that businesses follow these hiring practices I can tell you that it is costing them people. Good people. Specifically, young people. Comparatively untalented, inexperienced good young people. These hiring practices are biased against those who haven't had the chance to develop whatever random skill that is in vogue nowadays.
But that's ok. Soon the baby boomers will retire. And then they'll have to be less picky.
But they're still funny, funny things. There's so many problems with how people are hired nowadays. For instance, I rarely see jobs that ask for less than 5 years of experience in... something. Whatever the job is about. Want a job making circuits? Five years experience in making circuits, mandatory. Your resume is not even considered if you don't have five years of valid work experience. Go work for $random_big_corporation with a well-known name developing circuits for five years and we'll consider you.
What exactly is the value of five years of 'professional' work experience? Surely you have a number of designs under your belt, a list of components you use, probably a few contacts for samples, support, etc? But if you've been hacking together circuits since you were five and have a web page full of stuff you've done, but only two years of work experience then you're not supposed to apply. What does the five years working for a company guarantee them? Certainly not quality. Anyone can remain employed with a certain title and be bad at their job. I see plenty of people like that, but when they leave they'll put right on their resume - '5 years of bad designs, rework, lost profit and profanity. But my title was analog design engineer the whole time.' That guy wins.
And what's with the specific skills? 'Must use Eagle for schematics and layout.' Ok, I'll learn Eagle. Not my preferred solution but I'll do it if it gets me a job. Oh wait, it doesn't say that. It says 'Proficiency in Eagle schematic capture and layout required'. What? When you're looking for a mechanic do you put 'Must have proficiency with Craftsman brand crescent wrenches'? I've used plenty of schematic capture programs and none of them are black magic (except maybe PSPICE. Grrrrr....). I'm sure I can use Eagle very well if you give me a few hours to play with it. Heck, I can DOWNLOAD it and play with it - I'll get it done before I come to work for you! The tool is not supposed to define the job. If anything, arbitrary requirements only diminish the talent pool of people who can help you. (Note I said 'arbitrary' requirements. Some requirements are sadly justified.)
So your resume has to have a bullet point - 'Created 12346463113 circuit desgins for a toaster using Eagle'. Perfect. That gets past the filter. Why do the tools matter so much? True, if I'm going to work for a company that's doing a large program in C#, then I had better have worked with C# before. But that's what coders do. Code monkeys. People who get specifications in and produce code for output. Then a freaking computer checks their work with a unit test and tells them if they did it wrong. These people are automatons. Their job requires almost no original thinking. Engineering is supposed to be about creativity - finding solutions to problems. I always thought I would be sat down and they'd say something like 'This hyperdrive keeps overloading when we turn it on. We need to reach the Tok'Ra in three days before Apophis comes in his mothership and beats the crap out of us.' To which I'd say 'I'll put my engineering mind to work on that problem right away. And I need to work with Major Carter. Alone. Naked.' What's NOT supposed to happen is for them to then say 'Oh by the way, it all has to be done in Lisp. You have 5 years of Lisp experience, right?' Whatever happened to the right tool for the job? You know - how it's supposed to make things easier/cheaper/faster?
And don't you love how every job has its little 'niche'? This position is for an automation engineer, not an electrical engineer. This one is for an embedded application developer, not a software engineer with a specialty in embedded systems. The proposed scope is so small it's like it's not even worth it. Even if you have superior experience it doesn't matter.
'This position requires experience with PLCs'.
'Oh, those are microcontrollers with a whole bunch of electronics. I could design one of those. Can I have the job?'
'No, you just said you don't have any experience with PLCs.'
*facepalm*
Or better yet, your similar experience is worthless:
'I studied to be a controls engineer but I think I fit for this DSP position. DSP and controls stem from the same theoretical background and I've also had extensive training in numerical methods for computer systems. Also, I created an embedded sensor platform that used DSP, so I have practical experience in embedded programming and DSP. Can I have the job?'
'I'm sorry, we're not hiring controls engineers.'
*facepalm*
If I had to boil it down to one question it would be:
Why are businesses afraid to hire anyone but the person who exactly fits?
There are so many modifiers on these job listings that you'd think they had millions of people to choose from and they could afford to be picky. Ideally on the internet they do, but then they do stupid things like say 'Local candidates only' or refuse to pay for people to come out and be interviewed. Or not pay for relocation. Or not help a spouse get a job. So you're limited to whatever people can be found at hand. And they're not going to find their perfect match. I have friends who look for mates like this. Yeah, they're single. And they're missing out on a great part of life.
While it's true that companies cannot afford turnover, they also cannot afford to delay hiring for too long. If a job sits, the work doesn't get done. Or you overwork the people you do have which leads to turnover. All out of an.. ideal? Is it a value nowadays to not train people? To not give people a chance? Not to invest in them? To be picky? To not try new approaches, hire people with new skillsets?
While I can't fathom the reasons that businesses follow these hiring practices I can tell you that it is costing them people. Good people. Specifically, young people. Comparatively untalented, inexperienced good young people. These hiring practices are biased against those who haven't had the chance to develop whatever random skill that is in vogue nowadays.
But that's ok. Soon the baby boomers will retire. And then they'll have to be less picky.
Tuesday, September 8, 2009
On Being 'Well Rounded'
Following up my previous post on how well-rounded I believe I am, I am realizing that being well-rounded is not good. At least, not in my position. Let's consider my position and see why being well-rounded but not deep in any particular skill is not good.
I work for a large company and it employs many people. MANY people. We have all kinds of engineers, technicians, secretaries, project managers, etc. If it can happen on a project chances are we've seen it and hired for it. Need someone to create a schedule and manage a budget? We've got project managers and they've got secretaries. Need someone to design an antenna feed? We have seasoned RF engineers. Need someone to program an 8-bit microcontroller, create interfacing electronics and build an enclosure for everything? Well, no. We don't need one person to do that when we could have three separate people do it. People who excel in their individual areas and can get the job done quicker and better than one person.
Let's be serious - you wouldn't combine all of those tasks into one person unless it was absolutely necessary or desirable. When might those confluence of events happen that make it necessary or desirable? Let's tackle necessary first. It might be necessary to do it with one person because that's all you have. You either can't find people who are skilled in those areas or you can't use them if you did find them. The skillset might not exist in your company if it's small and might not exist in your area if you're in a small town or other backwater type place (like most of where I grew up...). So you use what's available to you and hope that it can get you by. And it might be desirable. You could contract out the work but then you have communication issues and overhead costs and such. If the work isn't particularly difficult then it might not be worth it to bring new people on even if they could get it done in half the time. So a wide array of basic knowledge could be useful if you couldn't hire more people and didn't care too much about time lost and/or wasted.
But at a large company those don't generally hold true. You usually have a ready supply of many differently-skilled people. You probably have at least two people to choose from who have your skill, so you'll always choose the person who is better at what you want to do. Then this person gets more experience and hones his/her skill and eventually becomes an expert. Then, unless this person is unavailable, you will always go to this person if you need his/her skill. In the situation where two people know the skill but have unequal levels of experience, the more experienced person always wins.
And time is usually very important at a large company. There's never enough of it. Competition is fierce and to maintain market position you have to be timely. Contrast with a smaller business: there is little/no market position to maintain so releases of products can be more easily delayed without losing too much money over it. Not that deadlines aren't important to a smaller company, but if they let a deadline slip they are likely to lose less money than a large company, even as a percentage of income.
Both of these factors contribute to drive people to specialization in large companies. With so many people being available, you have to set yourself apart to make an impact. In some circumstances intimate knowledge of a project may make it more worthwhile that you perform multiple tasks with different skillsets yourself. Or they could just put the person with the right skillset underneath you and have you lead him/her.
That's the major difference: A large company is more able and more likely to trade labor for time, where a smaller company doesn't have this luxury. If you aim to be a jack of all trades, shoot for a small company that can't support many people.
Update: I've done a little thinking and I believe there are a couple more things to be said for this line of thinking. 1) The 'time first' mentality tends to push people towards specialization in skills and it also pushes entire organizations towards specialization in skills. If you know Labview and you can do the job in Labview, chances are you'll do it in Labview. So a C# programmer is going to have a hard time. Over time the company becomes a monoculture and tries to apply its one major skillset to all problems (for good or ill). 2) The 'time first' thinking need not be limited to skill sets. If you can buy an off-the-shelf product that does what you need then it makes no sense to build it in-house. You're essentially buying the skillset you need ready-made. This also can lead to a monoculture of suppliers - with certain businesses being preferred over others because of past experience. In and of itself, buying this experience rather than 'growing' it in-house is an acceptable tradeoff for certain decisions but definitely not all decisions. 3) The monoculture induced by either of the above methods can kill a business. If this trend moves forward to its logical conclusion (which is admittedly far-fetched) then you'll have a handful of experts skilled at using a small number of skills/products, or you'll just buy everything from someone else. You run into two problems with this: what happens when your extra-skilled engineers retire/get hit by a bus/find a better offer? Brain drain. What happens when all you do is buy other people's products and put them together? Brain drain again - you now have people whose sole skill is figuring out what other products to buy and re-sell. You're no longer an engineering firm - you're at best a project management firm and at worst a re-seller.
Neither of the above outcomes are guaranteed to happen. There are many other pressures that will come to bear on an organization before this brain drain becomes absolute. However, it may still become terminal before it is absolute and the organization may not survive. There are two ways to combat brain drain: First, never outsource (directly or by means of buying COTS products) your core competency. If you write e-commerce software then outsource your server management, not your programming. If you build Arduinos then outsource your board fabrication, not your board layout. If you do that then you are paying people to develop their skills at the expense of your own. Then, when they are the experts they have no reason to keep you around, or at least, no reason to let you have a big slice of the profit. Second, you must, MUST invest in pursuing different/new technologies and you MUST invest in training less-skilled people. If you have a choice between two people of different skill levels, consider choosing both. Split the work up along skill-level lines and let the less-skilled person cut his/her teeth on the easy stuff and let the more-skilled person handle the hard stuff. But keep them together - working together, seated together and give them the same access to resources/people. Chances are the less-experienced person is younger than the more experienced one and will be around longer than him/her. You'll need the same level of experience if not more in 20 years time, so plan for it!
It is less efficient to make these investments in lower-skill areas and people, but unless you plan for the future you could find your company on the chopping block.
I work for a large company and it employs many people. MANY people. We have all kinds of engineers, technicians, secretaries, project managers, etc. If it can happen on a project chances are we've seen it and hired for it. Need someone to create a schedule and manage a budget? We've got project managers and they've got secretaries. Need someone to design an antenna feed? We have seasoned RF engineers. Need someone to program an 8-bit microcontroller, create interfacing electronics and build an enclosure for everything? Well, no. We don't need one person to do that when we could have three separate people do it. People who excel in their individual areas and can get the job done quicker and better than one person.
Let's be serious - you wouldn't combine all of those tasks into one person unless it was absolutely necessary or desirable. When might those confluence of events happen that make it necessary or desirable? Let's tackle necessary first. It might be necessary to do it with one person because that's all you have. You either can't find people who are skilled in those areas or you can't use them if you did find them. The skillset might not exist in your company if it's small and might not exist in your area if you're in a small town or other backwater type place (like most of where I grew up...). So you use what's available to you and hope that it can get you by. And it might be desirable. You could contract out the work but then you have communication issues and overhead costs and such. If the work isn't particularly difficult then it might not be worth it to bring new people on even if they could get it done in half the time. So a wide array of basic knowledge could be useful if you couldn't hire more people and didn't care too much about time lost and/or wasted.
But at a large company those don't generally hold true. You usually have a ready supply of many differently-skilled people. You probably have at least two people to choose from who have your skill, so you'll always choose the person who is better at what you want to do. Then this person gets more experience and hones his/her skill and eventually becomes an expert. Then, unless this person is unavailable, you will always go to this person if you need his/her skill. In the situation where two people know the skill but have unequal levels of experience, the more experienced person always wins.
And time is usually very important at a large company. There's never enough of it. Competition is fierce and to maintain market position you have to be timely. Contrast with a smaller business: there is little/no market position to maintain so releases of products can be more easily delayed without losing too much money over it. Not that deadlines aren't important to a smaller company, but if they let a deadline slip they are likely to lose less money than a large company, even as a percentage of income.
Both of these factors contribute to drive people to specialization in large companies. With so many people being available, you have to set yourself apart to make an impact. In some circumstances intimate knowledge of a project may make it more worthwhile that you perform multiple tasks with different skillsets yourself. Or they could just put the person with the right skillset underneath you and have you lead him/her.
That's the major difference: A large company is more able and more likely to trade labor for time, where a smaller company doesn't have this luxury. If you aim to be a jack of all trades, shoot for a small company that can't support many people.
Update: I've done a little thinking and I believe there are a couple more things to be said for this line of thinking. 1) The 'time first' mentality tends to push people towards specialization in skills and it also pushes entire organizations towards specialization in skills. If you know Labview and you can do the job in Labview, chances are you'll do it in Labview. So a C# programmer is going to have a hard time. Over time the company becomes a monoculture and tries to apply its one major skillset to all problems (for good or ill). 2) The 'time first' thinking need not be limited to skill sets. If you can buy an off-the-shelf product that does what you need then it makes no sense to build it in-house. You're essentially buying the skillset you need ready-made. This also can lead to a monoculture of suppliers - with certain businesses being preferred over others because of past experience. In and of itself, buying this experience rather than 'growing' it in-house is an acceptable tradeoff for certain decisions but definitely not all decisions. 3) The monoculture induced by either of the above methods can kill a business. If this trend moves forward to its logical conclusion (which is admittedly far-fetched) then you'll have a handful of experts skilled at using a small number of skills/products, or you'll just buy everything from someone else. You run into two problems with this: what happens when your extra-skilled engineers retire/get hit by a bus/find a better offer? Brain drain. What happens when all you do is buy other people's products and put them together? Brain drain again - you now have people whose sole skill is figuring out what other products to buy and re-sell. You're no longer an engineering firm - you're at best a project management firm and at worst a re-seller.
Neither of the above outcomes are guaranteed to happen. There are many other pressures that will come to bear on an organization before this brain drain becomes absolute. However, it may still become terminal before it is absolute and the organization may not survive. There are two ways to combat brain drain: First, never outsource (directly or by means of buying COTS products) your core competency. If you write e-commerce software then outsource your server management, not your programming. If you build Arduinos then outsource your board fabrication, not your board layout. If you do that then you are paying people to develop their skills at the expense of your own. Then, when they are the experts they have no reason to keep you around, or at least, no reason to let you have a big slice of the profit. Second, you must, MUST invest in pursuing different/new technologies and you MUST invest in training less-skilled people. If you have a choice between two people of different skill levels, consider choosing both. Split the work up along skill-level lines and let the less-skilled person cut his/her teeth on the easy stuff and let the more-skilled person handle the hard stuff. But keep them together - working together, seated together and give them the same access to resources/people. Chances are the less-experienced person is younger than the more experienced one and will be around longer than him/her. You'll need the same level of experience if not more in 20 years time, so plan for it!
It is less efficient to make these investments in lower-skill areas and people, but unless you plan for the future you could find your company on the chopping block.
Wednesday, August 26, 2009
Complications...
I consider myself a fairly well-rounded engineer. My specialty is control systems but that's in name only. It doesn't say embedded systems on my MS diploma because I had already taken all of the embedded classes for non-grad credit. It says communications on there because I sat through all of the comm classes (and got A's in them) but even though I know a lot I wouldn't consider that my bag. It doesn't say 'math minor' on my BS degree because I was two classes short (I decided to get a head start on my MS instead of the math minor). I've been programming since I was 6 in BASIC, C, Perl, Python, etc. That doesn't make me a CS major, but the years after that of learning to use source control, taking OOP classes, using unit tests and documenting with Doxygen makes me at least a friend (you guys will be my friend, right?). I built robots when I was a teenager and learned the basics of electromechanical systems as a controls engineer, so I'm claiming some mechanical experience as well. And I can speak German.
But I find as I grow older that some areas I just don't know about. Worse, I think I've built them up so that they seem so difficult that it's not worth it to even try to learn about them. TCP/IP, networking, ethernet - all that is something I've been interested in but thought the barrier to entry was too high. I've fussed about around the edges - I can tell you that the ethernet physical layer uses differential signal and (I believe) a 350MHz signal. I've done web programming and that introduced me to ports and such, but I don't take the time to go and just learn the stuff. I would start and I'd see the 7-layer OSI model and my eyes would just glaze over. Who the hell needs 7 layers (unless it's lasagna)? What are they cramming in there that it NEEDS 7 layers. Is it really this complicated to send data across the internet? I deal with microcontrollers and RS-232. I can send data that way, but for some reason people see the need to make twittering power meters out of the same microcontrollers. Other than being just a foolish idea it seems way too complicated if you have to interpret every layer of this 7-layer monstrosity just to do something as asinine as say 'Your refrigerator is now using 78 watts of power!'
So I figured I wouldn't deal with it. Who needs internet connectivity? I'll get along just fine. But still, it vexes me. It's something I don't know. I have a friend who does all this sort of stuff, makes routers in his free time. So I ask him 'What do you DO? What do you know that I don't know?' And he replies 'I can tell you exactly how a machine responds to a ping request. Where the message goes, where it comes from, what happens. It's complicated but I know it.' Basically, he knows how the OSI model works, what each level does, what happens. And the trick is it's mostly programming after a point. But not straightforward programming: complicated CS-type programming. Layers of abstraction built upon layers of abstraction so in the end you don't know that you're dealing with bits and voltages. You see, software people are TERRIFIED of bits and voltages and they will do anything they can to abstract those away. They have sacrificial programmers that write drivers to interface the bits and voltages to sane, reasonable things like floats and strings. They'd have a minor episode if they saw a character instead of a string. They NEED the 7-layers of the OSI model to be able to effectively ignore the basic truth of what's happening: bits are being represented by voltages. By the time you get to the 5th layer you're dealing with all kinds of structs, connection IDs, sessions and voltagephobia so that you don't know what's going on. If you're me that is.
If he tried to explain it all I think I wouldn't have understood. He could have explained it in Elvish and it would have made as much sense. So I ignore it again BUT IT STILL BOTHERS ME. Especially since I designed what I thought was a very complicated, nice and worthwhile messaging system for microcontrollers built on top of RS-485. It had circular buffers, message queues, priority, timeliness, guaranteed message delivery and all that jazz. It was complicated but I just started at the bottom and worked up. Pretty soon *I* had a few layers just to implement serial communication between a couple of devices. You had to have addresses and ACKs and collision sensing and much more to handle all this. It gets complicated quickly. Even when you start simple you always have the edge case. "Oops, what about this? Better add an address field. Oops, better add parity. Gotta ACK that for sure.."
It adds up. So I thought I might take another crack at TCP/IP and you know what? It turns out it's a bunch of things I already know. Just more queues and buffers and ACKs. When a ping happens (I think this is how it goes...) it's sent to the right computer (as determined by its IP address) where the network layer reads the message, finds it's an ICMP ping packet and puts the information in a special struct then pushes it into a queue for the ICMP handling process to take care of. When it gets around to it, it creates a response packet, tells the network layer where to send it (what IP address) and puts all that data into another struct and pushes it onto a queue for the network layer. That's it. Not too complicated - just data structures, processes and lots of teamwork. I learned something about TCP/IP.
TCP/IP is a complicated system, there's no question. But it does a LOT. It can reliably send data halfway around the world to a computer you didn't know existed in a few seconds. That sort of success is built up on layers and layers of success - each layer being tested and battle-hardened until it has so many special cases that it looks like an insane asylum. But once again - IT WORKS. Simpler systems would not. I don't begrudge the creators of the magical internet their seven layers anymore. It's not simple but it's not incomprehensible. It uses tools and methods that I was aware of - I just wasnt' aware of how they pieced them together. Now I am. The moral of the story is that if there's something you want to learn or need to learn don't think that it's impossible just because it's complicated, and don't condemn the creators of the system just because it's complicated. Just take it slow, re-read a lot and eventually it will make sense. Eventually.
But I find as I grow older that some areas I just don't know about. Worse, I think I've built them up so that they seem so difficult that it's not worth it to even try to learn about them. TCP/IP, networking, ethernet - all that is something I've been interested in but thought the barrier to entry was too high. I've fussed about around the edges - I can tell you that the ethernet physical layer uses differential signal and (I believe) a 350MHz signal. I've done web programming and that introduced me to ports and such, but I don't take the time to go and just learn the stuff. I would start and I'd see the 7-layer OSI model and my eyes would just glaze over. Who the hell needs 7 layers (unless it's lasagna)? What are they cramming in there that it NEEDS 7 layers. Is it really this complicated to send data across the internet? I deal with microcontrollers and RS-232. I can send data that way, but for some reason people see the need to make twittering power meters out of the same microcontrollers. Other than being just a foolish idea it seems way too complicated if you have to interpret every layer of this 7-layer monstrosity just to do something as asinine as say 'Your refrigerator is now using 78 watts of power!'
So I figured I wouldn't deal with it. Who needs internet connectivity? I'll get along just fine. But still, it vexes me. It's something I don't know. I have a friend who does all this sort of stuff, makes routers in his free time. So I ask him 'What do you DO? What do you know that I don't know?' And he replies 'I can tell you exactly how a machine responds to a ping request. Where the message goes, where it comes from, what happens. It's complicated but I know it.' Basically, he knows how the OSI model works, what each level does, what happens. And the trick is it's mostly programming after a point. But not straightforward programming: complicated CS-type programming. Layers of abstraction built upon layers of abstraction so in the end you don't know that you're dealing with bits and voltages. You see, software people are TERRIFIED of bits and voltages and they will do anything they can to abstract those away. They have sacrificial programmers that write drivers to interface the bits and voltages to sane, reasonable things like floats and strings. They'd have a minor episode if they saw a character instead of a string. They NEED the 7-layers of the OSI model to be able to effectively ignore the basic truth of what's happening: bits are being represented by voltages. By the time you get to the 5th layer you're dealing with all kinds of structs, connection IDs, sessions and voltagephobia so that you don't know what's going on. If you're me that is.
If he tried to explain it all I think I wouldn't have understood. He could have explained it in Elvish and it would have made as much sense. So I ignore it again BUT IT STILL BOTHERS ME. Especially since I designed what I thought was a very complicated, nice and worthwhile messaging system for microcontrollers built on top of RS-485. It had circular buffers, message queues, priority, timeliness, guaranteed message delivery and all that jazz. It was complicated but I just started at the bottom and worked up. Pretty soon *I* had a few layers just to implement serial communication between a couple of devices. You had to have addresses and ACKs and collision sensing and much more to handle all this. It gets complicated quickly. Even when you start simple you always have the edge case. "Oops, what about this? Better add an address field. Oops, better add parity. Gotta ACK that for sure.."
It adds up. So I thought I might take another crack at TCP/IP and you know what? It turns out it's a bunch of things I already know. Just more queues and buffers and ACKs. When a ping happens (I think this is how it goes...) it's sent to the right computer (as determined by its IP address) where the network layer reads the message, finds it's an ICMP ping packet and puts the information in a special struct then pushes it into a queue for the ICMP handling process to take care of. When it gets around to it, it creates a response packet, tells the network layer where to send it (what IP address) and puts all that data into another struct and pushes it onto a queue for the network layer. That's it. Not too complicated - just data structures, processes and lots of teamwork. I learned something about TCP/IP.
TCP/IP is a complicated system, there's no question. But it does a LOT. It can reliably send data halfway around the world to a computer you didn't know existed in a few seconds. That sort of success is built up on layers and layers of success - each layer being tested and battle-hardened until it has so many special cases that it looks like an insane asylum. But once again - IT WORKS. Simpler systems would not. I don't begrudge the creators of the magical internet their seven layers anymore. It's not simple but it's not incomprehensible. It uses tools and methods that I was aware of - I just wasnt' aware of how they pieced them together. Now I am. The moral of the story is that if there's something you want to learn or need to learn don't think that it's impossible just because it's complicated, and don't condemn the creators of the system just because it's complicated. Just take it slow, re-read a lot and eventually it will make sense. Eventually.
Thursday, August 20, 2009
Content or Not Content?
That title up there is actually a clever double-meaning. I'll get to those meanings in a second. Suffice it to say I'm smart and it makes me feel smarter to withhold information from you for a few minutes longer. It won't be terribly long, so just bear with me.
I've often heard that writers can't write if they're happy. After all, how boring is happy? Have you ever imagined yourself perfectly content with not a care in the world? How long did you keep imaging that before it you moved on to something more interesting? It takes me about five seconds. I imagine myself sitting in a chair with a smile on my face and... then I repeat that. Forever. That's dull. Writers know this either consciously or subconsciously and strive to keep themselves aggravated. After all, writing is about conflict. Protagonists, antagonists, twists, man vs. man, man vs. nature, man vs. God, etc. So it doesn't do to live a life of contentment because the more conflict you're familiar with, the more you have to write about. Those writers make good books (in case you didn't catch it, the first meaning of the title was 'content' as in 'the opposite of conflicted').
So perhaps I can take it as an indication of my level of contentedness that I don't write here much. That's actually incorrect or at least a confusing argument. For instance, what kind of content could I put here? I started this blog to detail cool ideas I had and hope that other people would say 'wow, that's neat! I didn't know you could do that!'. I have some of those. From time to time. But my day-to-day work isn't exactly to work with super-awesome ideas all the time. It's somewhat hard to breed super-awesome ideas ("Hey guys, let's make robots with neural networks that train themselves to efficiently compete for limited resources against other robots!") when the only ideas you work with are super-pedestrian ("Hey guys, let's use Labview for test software again! All right! Just like the last 50 times! High-Five!"). Now the total contents of this blog are by no means all of the super-awesome ideas I've come up with, but it's enough of them. What I DIDN'T want to do with this blog was to 1) whine about my life and how horrible it is, 2) just post links to cool things OTHER people have done and 3) update about how I haven't had time to update.
I hate whining. And my life isn't awful or even excessively boring. What's the worst thing that happened to me lately? I had a fight with my wife this morning. Sure there was yelling. Sure there was screaming. Sure I kicked a robot (poor Roomba!) Sure we were angry. So what? That's not bad, that's a fight. That's a normal fight. I'll tell you what we didn't do. We didn't threaten to leave each other. We didn't say things like 'My ex-girlfriend never did this to me! That's why I like her much more than you!' We pushed each others' buttons and eventually apologized to each other. Wow. I'll tell you the number one thing I fear is getting in fights with my wife, but that's not the worst thing in the world. And how boring is my life? Well today I had to go through my Labview sub-VIs and re-arrange the connections one-by-one. I have about 20 of them. Yeah it's boring but I grew up on a farm. My dad used to have me stand in front of open gates and keep the pigs in just so he wouldn't have to close the gate and reopen it when he wanted to get out with the tractor. I did that for hours. In winter. I think I'll survive my office.
I also hate when people just link other things on blogs. 'Hey look at this cool kegerator robot!' Ok. That's good. But most of the EE/hacking blogs I read linked to that site on that particular day. It was a little excessive to read about it five different times, and I think we'd live in a worse world if I made it six. Just a link, no commentary, no analysis, no further ideas. Just aggregation. Go blagosphere. If anyone is actually reading this be assured I will NOT do that to you. If you, for some reason, subscribe to this blog you will not get that sort of 'content' (second meaning of the title!). You will get something original even if it's just meaningless ranting like right now (which, honestly probably isn't that original. Read Ecclesiastes).
And posting about how you have no time to post? No. Just Say No. Let me say one thing: it is essential to actively maintain something you want to build a following around. If you want people to read it then update it every day even if it's not particularly useful information or even tangentially related to your subject. People will either read it for the sake of reading or stop reading it altogether. But the people who read it for the sake of reading it will continue, daily, religiously. Then you can put ads in front of their face and get a shiny nickel. But it has to be NEW or at least something they don't ALREADY KNOW. If you dont' update your blog for a while then guess what? People know that. They can see it. So if you update and say 'I haven't updated for a while' they will respond 'We know' and leave. People aren't interested in things they already know. Better to update less often and with actual information than to tell people something they already know.
So that's my rant. Can you expect high-quality updates from me from now on? Probably not. I would actually have to do interesting things, or in fact, things at all. I'd have to have something to write about and it turns out I only rarely have that. And, if I start writing about non-engineering things I risk becoming like everyone else. And I HATE everyone else. They make me angry, hence the name of the blog.
I've often heard that writers can't write if they're happy. After all, how boring is happy? Have you ever imagined yourself perfectly content with not a care in the world? How long did you keep imaging that before it you moved on to something more interesting? It takes me about five seconds. I imagine myself sitting in a chair with a smile on my face and... then I repeat that. Forever. That's dull. Writers know this either consciously or subconsciously and strive to keep themselves aggravated. After all, writing is about conflict. Protagonists, antagonists, twists, man vs. man, man vs. nature, man vs. God, etc. So it doesn't do to live a life of contentment because the more conflict you're familiar with, the more you have to write about. Those writers make good books (in case you didn't catch it, the first meaning of the title was 'content' as in 'the opposite of conflicted').
So perhaps I can take it as an indication of my level of contentedness that I don't write here much. That's actually incorrect or at least a confusing argument. For instance, what kind of content could I put here? I started this blog to detail cool ideas I had and hope that other people would say 'wow, that's neat! I didn't know you could do that!'. I have some of those. From time to time. But my day-to-day work isn't exactly to work with super-awesome ideas all the time. It's somewhat hard to breed super-awesome ideas ("Hey guys, let's make robots with neural networks that train themselves to efficiently compete for limited resources against other robots!") when the only ideas you work with are super-pedestrian ("Hey guys, let's use Labview for test software again! All right! Just like the last 50 times! High-Five!"). Now the total contents of this blog are by no means all of the super-awesome ideas I've come up with, but it's enough of them. What I DIDN'T want to do with this blog was to 1) whine about my life and how horrible it is, 2) just post links to cool things OTHER people have done and 3) update about how I haven't had time to update.
I hate whining. And my life isn't awful or even excessively boring. What's the worst thing that happened to me lately? I had a fight with my wife this morning. Sure there was yelling. Sure there was screaming. Sure I kicked a robot (poor Roomba!) Sure we were angry. So what? That's not bad, that's a fight. That's a normal fight. I'll tell you what we didn't do. We didn't threaten to leave each other. We didn't say things like 'My ex-girlfriend never did this to me! That's why I like her much more than you!' We pushed each others' buttons and eventually apologized to each other. Wow. I'll tell you the number one thing I fear is getting in fights with my wife, but that's not the worst thing in the world. And how boring is my life? Well today I had to go through my Labview sub-VIs and re-arrange the connections one-by-one. I have about 20 of them. Yeah it's boring but I grew up on a farm. My dad used to have me stand in front of open gates and keep the pigs in just so he wouldn't have to close the gate and reopen it when he wanted to get out with the tractor. I did that for hours. In winter. I think I'll survive my office.
I also hate when people just link other things on blogs. 'Hey look at this cool kegerator robot!' Ok. That's good. But most of the EE/hacking blogs I read linked to that site on that particular day. It was a little excessive to read about it five different times, and I think we'd live in a worse world if I made it six. Just a link, no commentary, no analysis, no further ideas. Just aggregation. Go blagosphere. If anyone is actually reading this be assured I will NOT do that to you. If you, for some reason, subscribe to this blog you will not get that sort of 'content' (second meaning of the title!). You will get something original even if it's just meaningless ranting like right now (which, honestly probably isn't that original. Read Ecclesiastes).
And posting about how you have no time to post? No. Just Say No. Let me say one thing: it is essential to actively maintain something you want to build a following around. If you want people to read it then update it every day even if it's not particularly useful information or even tangentially related to your subject. People will either read it for the sake of reading or stop reading it altogether. But the people who read it for the sake of reading it will continue, daily, religiously. Then you can put ads in front of their face and get a shiny nickel. But it has to be NEW or at least something they don't ALREADY KNOW. If you dont' update your blog for a while then guess what? People know that. They can see it. So if you update and say 'I haven't updated for a while' they will respond 'We know' and leave. People aren't interested in things they already know. Better to update less often and with actual information than to tell people something they already know.
So that's my rant. Can you expect high-quality updates from me from now on? Probably not. I would actually have to do interesting things, or in fact, things at all. I'd have to have something to write about and it turns out I only rarely have that. And, if I start writing about non-engineering things I risk becoming like everyone else. And I HATE everyone else. They make me angry, hence the name of the blog.
Subscribe to:
Posts (Atom)