Tech's Dark Secret, It's All About Age
theodp writes "Universities really should tell engineering students what to expect in the long term and how to manage their technical careers. Citing ex-Microsoft CTO David Vaskevitch's belief that younger workers have more energy and are sometimes more creative, Wadwha warns that reports of ageism's death have been greatly exaggerated. While encouraging managers to consider the value of the experience older techies bring, Wadwha also offers some get-real advice to those whose hair is beginning to grey: 1) Move up the ladder into management, architecture, or design; switch to sales or product management; jump ship and become an entrepreneur. 2) If you're going to stay in programming, realize that the deck is stacked against you, so be prepared to earn less as you gain experience. 3) Keep your skills current — to be coding for a living when you're 50, you'll need to be able to out-code the new kids on the block. Wadwha's piece strikes a chord with 50-something Dave Winer, who calls the rampant ageism 'really f***ed up,' adding that, 'It's probably the reason why we keep going around in the same loops over and over, because we chuck our experience, wholesale, every ten years or so.'"
Anyone in the field who hasn't figured this out yet needs to be let go. Programming requires long nights staring blankly at mind-muddling objective languages. Experienced directors/designers have the foresight to be able to properly direct all that youthful energy to the most worthwhile pursuits, rather than just letting them wander aimlessly through some other other geek's code.
When the foot seeks the place of the head, the line is crossed. Know your place. Keep your place. Be a shoe.
who calls the rampant ageism 'really f***ed up,'
Phhhbbt, sounds like something your average old timer would say ...
'It's probably the reason why we keep going around in the same loops over and over, because we chuck our experience, wholesale, every ten years or so.'
Oh, sure the initial steps in the web's client/server model may have had resembled the dumb terminals and mainframes of the days of yore but with HTML5 my generation is bringing in a new original and fresh way of computing where worker threads and local storage give us the ability to distribute ...
*red LED under the skin of eldavojohn's arm starts flashing*
What's this!? What? Wait, no! Nooo! It can't be!
*eldavojohn stands up to run only to be met by two members of the sunset squad holding stun batons behind him*
No, I just turned 28! You bastards, I was supposed to have more time! It's not my time yet!
*as they drag him away, a young acne faced male takes his place and begins mockingly humming "Circle of Life" from the Lion King while tearing down the X-Files poster and MST3K figurines adorning the cubicle*
My work here is dung.
What is that? When I was younger I could code more, but I wouldn't say I coded better. Now I take my time and produce efficent, well documented, fully tested code - which functions 1000x better than my 'mass produced' code. Any *good* programmer programs well - not in volume.
Any 50+ year old programmer should be able to keep up with 25yo programmers, knowing how to program isn't just knowing the ins and outs of the hottest language - it is knowing HOW to program so that you can swap languages efficently. (Yes, there is time to learn differences in languages, etc) But anyone worth their salt can jump where needed and go.
Being said, if your first language was cold fusion and it is all you have done for the last 12 years, you may have a difficult time switching to C!
Ditching experience would be unheard of in medicine, engineering, law, carpentry, pluming, construction, etc, etc, etc....
But only us have the balls to say that youth trumps experience, I wasn't aware kids were born with all computer science concepts from the get go.
How is it that a senior programmer ends up in sales?
Maybe we are not taken seriously because our professional low self esteem.
If managers could pay people in their 50's what they people in their 20's, it wouldn't be an issue. As always, the bottom line is the only thing that really matters.
If you're going to stay in programming, realize that the deck is stacked against you, so be prepared to earn less as you gain experience.
In my experience at a company with 1,300 employees, young people are relegated to support calls. The older people (over 40 years), produce [quality] code at an exceptional rate.
Recently, we had to modify a java function for one of our clients whose client was dealing with money which was worth so little in dollar terms. i.e. 1 US dollar goes for about 2,500 in their money.
All young folks including myself were just fiddling around the code. This "old" man who had never looked at the code only needed about 12 minutes to solve the problem.
By the way, this code would 'translate' 1,234,567,890 to One billion, two hundred thirty four million, five hundred sixty seven thousand eight hundred ninety shillings only.
So I do not agree with that statement entirely. In fact this old man is paid about 2.5 times more than myself. I have 7 years java, VB and PHP experience.
A while back, a friend of mine -- a very experienced software development manager -- was running a development team, and was planning to hire a developer who was in his early 40s. One of the team members openly objected to the candidate because of his age, saying something like, "How could he possibly be up to date on current technology or keep up with the rest of the team? He's so old!" My friend eventually hired him anyway, and the "old" developer turned out to be a superstar, one of the best on the team.
That was about eight years ago. The guy who raised the objection is now about the same age as the candidate he had wanted to reject. I wonder if he's facing the same kind of age discrimination, now that he's "so old."
Building Better Software
I would like to hear from programmers that have been at it for 10 or more years that aren't 'burned out'
love is just extroverted narcissism
as in, arts and crafts: in many ways, programming is an art form, not a science
and honestly, if you take exception to this description, i will go so far as to say you aren't a real programmer. you haven't pored over a piece of code, and, after cognitively digesting it, sat back and thought: "beautiful". that's an aesthetic description. because programming DOES have a genuine aesthetic component to it that really delineates the difference between a creative rock star and a code maintenance bureaucratic functionary
but what kind of art is it, cognitively speaking? and i would say: it is more like a being a movie director than being a musician
but people THINK of programmers like musicians, with a musician's career arc: you are a nobody, then you skyrocket to fame, then you fade and are a forgotten has-been doing greatest hits at the country fair: called in to adjust their COBOL from the 1980s
programmers should be thought of like movie directors, who can most certainly be a geniuses at a young age, like robert rodriguez, but don't really hit their prime until their 30s and 40s, like chris nolan, and are still valuable as greybeards making great stuff in their 60s and 70s, like martin scorsese. and the young hot shot movie directors might be glowing hot, flying by the seat of his pants with tiny production budgets and just his friends to help, like a young programmer fueled on soft drinks and potato chips at 3 am. but the older movie directors are sitting atop large multimillion dollar productions, with a giant staff of cinematographers and key grips and production assistants... more like commanding a battleship than a dinghy. in programmer terms: moving into management
so as for the prejudice of ageism in programming: maybe there is just something about a young supple mind that makes art that is exciting and electric. i mean i had to do a double take just now composing this comment: i described a good programmer as a rock star above. showing that even within my own way of thinking about programming, i am applying the false musician's metaphor for the artistry that is programming, when it is more like being a movie director
programmers are movie directors, not musicians. that's my metaphor and my message, even if i myself can't keep my story straight
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
I leave at 5PM because my experience has taught me how to avoid many of the problem new coders create for themselves. I get twice as much done in half the time compared to when I first started. Looking back at my first experiences as a programmer, I laugh at all the late nights spent working diligently to complete code only to find that I had checked in something inadvertently or forgotten to check something in that broke the build. This in turn wasted many other people time simple because I was too tired to think. The idea that technology has changed tremendously and older coders experience no longer applies is LOL. First the technology has primarily gotten smaller and faster. And coding techniques have improved in some ways but degraded in others. It all still ends up as binary in the end, something many of my younger colleagues don't deem to get which leads to some extremely sloppy techniques. These arguments are mainly bull similar to memes like out sourcing saves money (usually at the expense of time and quality).
There's no future in management, and geeks hate managing people anyway so wtf? I've been asked a few times and no, I won't do it. Thing is, I like writing code. I *enjoy* it. It's why I come to work and what I like to do. I don't *want* to referee the personalities in the office and I surely don't want to be the one who answers for everyone else's fuckups. Not to mention, excess management is usually the first to get cut when job reductions go around. who wants that? I'd rather be a hired hand for some consulting outfit. The benefits suck, and people think your dogsh#t, but if you can get over that it's a good application for experience and the change of scenery on projects is nice too.
boycott slashdot February 10th - 17th check out: altSlashdot.org
The field expanded greatly in the 1990's. When I interview with a tech lead, that tech lead is usually younger than me. During the interview process, the tech lead sees from my resume that I have a lot of experience and knowledge, and then sees from his overly-targeted interview questions that I am not expert on the specific thing he happens to be working on day and night at the moment. Based on a "failed" interview, the tech lead is able to dismiss a potential leadership threat.
This will continue to go on until there is more age diversity in the field, which will take several decades for the dot-commers to mature. Meanwhile, since I started nearly a decade before dot-com, I more or less am limited to those businesses that have people older than me.
What I've observed as an I.T. guy who often worked along-side developers is, management often decides a certain technology is the way forward for a given project. At that point, the experienced developers are sometimes left out in the cold, because although they may have, say, 6 years of good experience coding in Java, they didn't spend time on the latest Microsoft technologies. The "new kid on the block", by contrast, may have claimed experience in that area, so to management, he's the "better bet".
Most likely, the REAL problem here is that management doesn't buy into or grasp the idea that the development language used is rather immaterial. If you've got someone with many years of experience coding in a specific language, it'd probably yield the best results to let them continue doing that. Ask them to produce product X or Y with whichever tools they're most versed in using!
Instead though, there's an overall sense that programming languages get "stale" after a while, and a new product needs to be designed with a new language.
I'd say I only have a few personal anecdotal stories to back this belief up, so it could be way off base ... except how much demand is there today for developers with experience in COBOL or Fortran or BASIC, or Pascal, or Forth? I've always worked in a "Support Specialist" or "Network Management" role, but I've observed all these programming languages come and go -- and it seems like such a bad deal for a developer. He/she has to put in so much effort to learn and subsequently master one, only to find it fading into obscurity.
Seen many "Be a surgeon in 21 days!" or "Criminal Law for Dummies" books lately?
How about a plumber doing all his work with a single screwdriver and no other tools, equipment or material?
A nine-year-old with a "PC" can be a programmer since.. well... decades now.
And while surgeon's/plumber's/lawyer's etc. hands on experience accumulates only in him/her and can't be transplanted into another human with a click of a mouse - that nine-year-old copy/pasting someone else's code is actively using all the accumulated experience in the world that he can google-out.
And that is not even going into how you can hire someone from India to do the coding you need for a fraction of what you would have to pay that nine-year-old.
Mit der Dummheit kämpfen Götter selbst vergebens
Well, first, Engineers shouldn't become programmers. They should know how to program, but otherwise it's a mismatch of talent.
Second, programmers who are still just crafting code after 45 years in the field should go somewhere and get a shot of ambition. Programming is a good place for younger folks to keep them out of trouble. Sooner or later the smart ones figure out that programming is more about creating solutions to problems rather than writing code. Figure out a solution and then pass it off the the young guys to do the drudge work. Those that don't figure this out will eventually give up and migrate to management, sales, Art or something more suited to their talents.
Third, problems don't solve themselves, but code can write itself. Writing programs that write programs frees up truly creative minds and you get the benefits of not having to hang around with a bunch of hotshot, know-it-alls who don't listen to their elders.
Hey, I've been programming for 45 years, and I know what I'm talking about...
"The mind works quicker than you think!"
I wrote this last year on Stackoverflow. Still holds true this year. Edited slightly to remove reference to another post there.
I'm 49 and I'm a programmer.
Well actually I'm a DBA, IT consultant and Business Analyst too. But in my heart I'm a coder - and I think I'm getting better with age. And I make a nice living at it, thank you - but I put a lot of effort into setting myself up that way.
There has always been ageism in IT. I entered commercial IT relatively late in my mid-20 after being a research scientist (biological - but writing scientific code for analysis). When I went to move jobs at 28 looking for an Analyst/Programmer job one recruitment company told me I was 'too old'.
Ha. Since then I've done a rollercoaster so far as coding is concerned - followed the big corporate trail up though systems analyst to project manager by my mid-30s before deciding I really missed coding. Went to a small organisation as senior developer then morphed into DBA for 7 years - but started writing code at home which grew contacts and income until I started running my own consultancy a little over 10 years ago. I purposely don't grow larger because I don't want to spend my time managing other people, but I do have a large network of other consultants in complementary fields (graphics, management consultancy etc) I can collaborate with.
My clients are nearly all in the SME sector, most I talk to the boss directly and they no or limited development support inhouse. Age in this case is an advantage as experience with systems in business means that people trust me as I can both deliver software, and deliver the right software for the business context. There is something awfully satisfying about being able to go to a client and say 'you need to spend $10k on this hardware and software development to support this' and the client does it because they trust your abilities and the experience you bring to recommend that decision. It helps I'm a complete neophile too and I replace my skillset every 5 or 6 years - I'm currently moving to Python and .Net (and raving about Ironpython for desktop apps)
So I spend about 50% of my time writing code, 25% doing 'business IT consultancy' and 25% general purpose IT to support that - for instance several of the systems I've developed for my clients are web based - and I run the web servers to host them.
And lastly it's a great job for fitting with family life and commitments. I have my office in the house (large room, lots of computers and screens) and I work probably 10 hours a day, but it fits with family. I've been at home when my kids were small and when they've come back from school as they've grown older. I don't even have to be in one place - last week I had to see a client on site at the same city when my son is a student, so I go in, see my client at lunchtime, sit in Starbucks all afternoon coding on my laptop, then take him out for dinner. Perfect mix :-)
So ageism - phah. Ageism is only a problem if you associate with people who are ageist - and as a society we're growing older and many of those older people who do have work going are not going to be comfortable with giving it to youngsters. There's plenty of opportunity for older developers, but you have to play to the strength of the experience you've accumulated and adapt. If you don't learn new technologies and stay excited by what's happening then that's your problem, not ageism.
Myself I see myself coding until I drop. I'm actually looking forward to being more flexible as I get older - when all the kids have left home we've plans to equip a camper-van with all the tech I need and wander around europe nomadically for a year or three working remotely as needed.
Coding is the best occupation ever invented. Who on earth would want to give it up?
ITT: A handful of above average, many average, and a handful of below average programmers giving advice, all thinking they're above average and qualified to do so.
while(1) attack(People.Sandy);
This makes no sense to me. If he'd said, "expect that your 30 years experience will allow you to command a salary roughly equivalent to someone with only 10 years experience" then I'd be on board with that. But to actually earn less because of additional experience? As in, "If you had 10 years experience we'd pay you X, but since you have 20 years experience we'll only pay you 0.8X"? That's nuts.
My personal experience is that people pay based on the position, and the position usually has some experience requirements. No position requires more than 10 years experience, so any experience beyond that is superfluous. So the salary arc for a developer, assuming he stays in development (and not architecture, design, etc.), should steadily increase from year 0 to maybe year 10, then mostly plateau.
Productivity is secondary to one attribute that management (particularly of large organizations) seeks above all else: naivete. Management loves young, fresh faces. In spite of lower productivity and less experience on the job, what employers value is that unquestioning loyalty that comes with youth. Once people gain a certain amount of experience, they start calling 'bullshit' on the PHB's plans and that's the end of career growth.
Its a management style inherited from the military where there's a need for cannon fodder. Grab the rifle and charge the machine gun nest. Once the grunts start to realize that there's a better way to get the job done, and not get your ass shot off, its time to bring in the new recruits.
This isn't as true for smaller organizations or those with flatter management structures. Here, workers are expected to contribute across several levels of the software (or engineering) development life cycle. In larger groups, where these boundaries are more strictly defined and reflected on the organizational structure, such cross disciplinary communications are not encouraged. They are often viewed as an additional burden on the management structure.
So, your best bet, once you have acquired this kind of experience, is to seek a job position in an organization that values it.
Have gnu, will travel.
The problem at Microsoft is that, once someone has reached a level of experience enabling them to spot flaws in the overall product architecture, they become a burden on management. Questions along the lines of, "Why don't we just fix this crap?" interfere with getting the next release of crap out the door. So its time to move them aside and hire in someone who still thinks Ballmer is God.
It's getting difficult to find such people without having to recruit in the third world.
Have gnu, will travel.
Some years ago, I was reading a flame here on slashdot and one of the insults was calling RMS an old dinosaur from the 256 color era. I grew up with the 16 color Commodore 64, so that made me older than the dinosaurs. That was the first time I felt really, really old and I was 24 at the time.
On a more serious note though, I will say that I am a better coder than I was 10 years ago but so much has changed. My professor would keep going on about bits and bytes like the difference between a short and long really mattered and "look to embedded". Well here we are and seriously nobody could give a fuck if a variable is short or long, possibly if it's in a huge array or many database records but mostly not even then.
Don't get me wrong, I don't think going through everything from BASIC to assembler to Pascal to MFC to Java 1.0 was useless, it's background and general knowledge but it's not very to the point. In fact, some of it would today be anti-patterns you should unlearn. In short I think you can subtract several years of useless skills, if I went back with modern tools and libraries I think I could achieve the same level in maybe 5-7 years. And the further back you go, the less relevant it is to modern programming.
And by modern I mean high level, we still need people to hack in C but not for most applications. There are jobs for COBOL programmers still, too. But today if I was building a house I'd rather do it like modern construction. Lots of prefab, but it still takes skill putting it all together.
Live today, because you never know what tomorrow brings
I'm 42. While concerned about my future in tech, I'm not too worried about long-term employment prospects because I see a looming labor shortage. The oldest Baby Boomers are turning 65. While many of them are not very tech-savvy, they are successful business men and women (e.g. yuppies, DINKs). As this huge generation begins to retire there will be a void to fill at all levels.
Worst-case I'll get a job in a nursing home refilling their Tang and listening to Vietnam stories.
Nostalgia isn't what it used to be.
A lot of people seem to think that programmer productivity has something to do with lines of code produced. That misconception gets propagated by uninformed managers, who are basically looking for something that is easy to measure.
In reality, productivity has more to do with achieving required behaviors with a minimum of code-writing. When a fresh-out writes 3000 lines of code, discards or changes 2900 of them, and ends up with a 700 line program that only sort-of works and only remotely resembles the design, after 10 weeks of working 70 hours a week, is that really productive? If an older guy thinks about the problem for two weeks, spends a day or two writing docs, writes a couple pages of code in one morning, tests it that afternoon, tweeks it a little the next morning, spends another day improving comments and updating docs, and has the whole thing finished and solid in 3 weeks, is that really less productive?
Uninformed managers reward the guy who works 80 hours a week and writes lots of bugs. The buggy code needs to be fixed, which then requires heroic amounts of overtime. They reward the overtime, without understanding why it was needed. By contrast, the guy who gets it right the first time, and doesn't need to fix it, doesn't have to work those silly hours. The uninformed managers also do not understand why a program doesn't need to be fixed, and why overtime is not really needed, and so the better programmers are not usually rewarded.
Programming is about function and behavior, not lines of code.
Just for fun, I sometimes run 'uncrustify' on a mess of old code, or change a variable name, before doing a small logic change. My nontechnical director gets a report that counts the lines in each commit.
I'm in the unenviable position of getting older (35) and am starting to see the beginnings of this trend.
The three suggestions the author offers are sage advice. Keeping your skills up and taking on higher-level roles are really good ways to ensure you'll at least stay employed. Point 2 is equally important - save like crazy during your prime earning years, so you aren't forced to be that 50-year-old guy who demands $125K for a $70K position because you actually need the income. The reality is that there is little hope you'll convince an employer that paying more for your skills is worth it. Management only sees you as a cost, and wants to maximize the amount of value they get out of you. Even if the 22-year old screws up a few times, the 80-hour weeks he's going to be able to pull to fix things will offset the extra salary. Counterintuitive? Yes, but it's standard Business School 101 fare, so we have to deal with it.
It really stinks that you can't have a full career with a path laid out for you like you used to. if you're not the entrepreneurial sort (which I definitely am not,) you're going to be stuck either bouncing around in short full-time stints or even shorter contracting stints. I'm a systems person, and really enjoy solving tough integration/sysadmin problems. I hate people management and project management, so I've concentrated on keeping my knowledge current and not being the person constantly begging for raises. It's worked well so far - I have a pretty good reputation within my smallish specialty field. My next plan is to ditch full-time employment and start contracting - but even that's dangerous. Like the article says, those of us who are older have families counting on us; we don't live alone in a one-bedroom apartment with no financial concerns beyond next month's rent.
The more entrepreneurial types among us older folk would clean up if they started a contracting firm based on the concept of companies paying for experience. I can't tell you how many projects (both business-related and IT-related) I've been on where a company hires one of the big-name consultancies (Accenture, Bain, Booz, McKinsey, etc). These firms hire Ivy-league graduates (early 20s, typically very little work experience) on the premise that they're smart and have a good reputation. Unfortunately, I've found their skills lacking, and they tend to learn on the job, causing downtime, wasted meeting time, etc. If some slick sales guy could convince a company that a bunch of people who have seen all the tech industry hype cycles, know what's really going on, and know how to solve problems based on having done it before, we'd have a working business model.
I'm in my mid-30s, and have already long experienced exactly what you describe, and agree 100%. We also do use codegen heavily to create a *maintainable* fast pipe between "problem to solve" to "solution".
Of course, going the entrepreneur route does force some of those issues, as solving the customer's problems is what puts food on the table, not just cranking code and keeping a boss off your back. But even then, quite a bit of my increase in perspective came well before, when I realized that what I want to build in terms of my own hobby interests requires more than just me working on it, if I want to reach my creative goals in this lifetime.
Forgot one alternative - become the token "old guy" that helps keep the DOJ from breathing down management's necks.
Be prepared to have your red stapler taken away, though.
This guy doesn't care about the US workers at all. See his support on offshoring.
Twitter supports and protects racists - by smearing their critics with the "Hate Speech" label.
Companies have no interest in paying more for people more skilled in software engineering. They want people who can "just write code." The medium-term to long-term consequences of writing unmaintainable, disorganized, undocumented code are almost never recognized by management. And even if they were recognized, we live in a short-term-profit world, where it is standard practice to run a project or company into the ground by releasing a shoddy product which holds together just enough to avoid lawsuits.
A company who values older developers is a company who values the quality and long-term viability of its products. Good luck finding one of those.
The Internet is full. Go away.
I predict that one day Google will be crucified by the government for their blatant ageism. And I mean crucified. The racist equivalent would be if 5 African-Americans worked in their entire corporation.
Just wait.
If you "get stupid" after 16 hours of being awake, maybe you need to see your doctor, because you don't sound like you meet the definition of "physically fit" - which is, among other things, being able to do at least moderate exercise after a day of work.
Don't be ridiculous. The average person does sleep about 8 hours and stay up for 16. By the end of the day they're tired and they do, indeed, suffer decreased brain function. Particularly in a case when you're working later than normal, or perhaps so late you've approached or passed your town bedtime, almost anyone is going to be less sharp than they would be during their initial 8 hours of work.
As for "needing to see a doctor" -- that's again silly. Disregarding the fact that having your brain worn down from large amounts of work doesn't correlate at all with being or not being physically fit, people generally aren't doing exercise at bedtime after being awake for 16 hours, they're doing their exercise either before work or after work, which is usually after being awake for 11 -13 hours on average, I'd guess.
You may be perfectly happy working two 20-hour stints. That's great. But it's so far out of the norm that it's basically a freakish ability (not in the pejorative sense; just really unusual). Don't confuse your own ability with thinking someone else who kind of likes to sleep on an average schedule somehow needs a doctor.
The Quirkz Handbook of Self-Improvement for People Who Are Already Pretty Okay
When you're in the zone, you're GOOD!
No, you think you're good. You won't actually know until somebody else looks at your results. One of the first things to go when brains start getting impaired is the ability to judge your own capabilities.
I also take some exception to the goal of "creative juices". For any system that needs to be reliable and maintainable, the last thing I want is a developer that got overly creative. That doesn't mean that there's no room for appropriate refactoring and the like, but a lot of "creative" code can quickly turn into "wtf!" code when somebody else looks at it. Great software is often the most simple, straightforward, even boring stuff imaginable.
I am officially gone from
The average person's IQ declines with age.
[Citation needed]
I found articles about IQ and race, IQ and sex, IQ and health, but not one dealing with age. AFAIK, your IQ only declines with age if you have alsheimer's or some other medical condition that would affect your brain.
Decline in testosterone just makes you more laid back and harder to piss off. Nobody can think straight when they're pissed off. How productive are you when you're ina bad mood? Testosterone has a negative effect on IQ; have you ever seen a genius on steroids?
Free Martian Whores!
Granted in my mid-30s I'm not greybeard but I can tell you that you don't earn less as your experience increases. If you do, you're not doing very well with the job hunt. Poeple pay you more for your ability to get things done despite difficulties that will stump an inexperienced coder.
This article is pure drivel. It's advice made to con old experienced programmers to undervalue themselves, put up with shitty conditions and leave the game. It's the kind of advice a used car salesman gives you as he's trying to sell you an old bomb with the engine about to fall out. This guy's either a coder who wants less competition or he's a manager looking to hire cheap.
Oh and one more thing: If you can't out-code quite naturally a college grad after 20 years in the game, you're in the wrong game, or in the wrong job all along. By naturally I mean without spending a lot of your own time learning.
These posts express my own personal views, not those of my employer
How do you do this?
The efficient way is to keep relevant counts as you add and remove documents in a database and look it up. You wouldn't malloc anything.
Just sayin.
rd