I'm just saying that sexism and ageism are two sides of the same coin... ignorance and stereotyping.
As such, maybe we should be addressing that as well. After all, everyone says "we want more women in IT" and then wonders why there aren't more women in IT.
With the aging population, we're going to have a problem anyway; why discourage qualified workers (of both genders) who not only are able to "keep up", but are passionate about what they do and bring "institutional memory" to the mix?
Both sexism and ageism are viewed as "bad things", but of the two, sexism is far more deeply ingrained in the IT field. If you think older men have a problem, how about older women? It's the triple curse - not seen as being "real programmer material", seen as "too old", and with fewer opportunities in both management and other fields.
Look at all the comments in this thread - women (young and old) are invisible. The field needs more women to tone down the testosterone levels and pissing contests a bit. The only problem is, when women go for an interview, men still judge women by physical appearance and not skills.
That's why you'll see women sending out resumes using just their first initial, use email addresses that don't indicate gender, post using aliases, etc. After all, "a woman can't hold serious opinions about code - that's guy stuff!" or "She can't stand up to the demands of crunch time." or "She'll have more absenteeism to tend to family matters." or "We can't shout at her like we can at the guys." or "She'll distract the guys. I'm never going to hire a woman."
I've seen every one of those "reasons." Ageism might be a problem, but sexism is a bigger problem. The only reason it's not being addressed is because of sexism - "computers are a guy thing." So be happy you're not in that boat.
A struct doesn't have the overhead of the virtual method table, for one. For another, I can define a union and access the struct in different ways directly, rather than having to use overloaded getters and setters. These are both ways to deal with data that are just darned convenient at times. It's also a lot easier to clone a struct than to do a deep copy of a class. Also, if I cast the struct, I can extend or shrink it as needed. And structs can hold pointers to functions (and if you remember to have an explicit "this", they can even operate like c++ classes). 99% of the time, this is completely useless, but that 1% makes up for it. And because there's no overhead for method lookup, it's the fastest implementation possible outside of assembler.
I can use c99-style variable arrays, but treat the data as one continuous chunk of memory, and use bsearch do do an almost instantaneous lookup. Much less overhead than a btree or other structure (100,000 lookups per second on a 1-million record dataset on my laptop when I tested it a couple of years ago for a project where even mysql's in-memory tables weren't fast enough).
Sure it requires more planning for things like marking "rows" as being available so that you don't have to dynamically sort, grow, or shrink the data all the time, but that's what finding the fastest solution is about.
Doesn't work. Where do you think I got the instructions from originally? Geez, give it up already.
They abandoned all development on it last year for a reason. It doesn't support swing, and without swing support, it is of limited usefulness in today's world.
Look - I'm not saying that people should abandon Java. I *am* saying that Sun made some serious mistakes in the original design, and then kept everything so locked up that they couldn't be addressed. Java can stand to use a few improvements that would reduce bloat and make it more flexible if it's going to move forward.
Back in college one of the things we were taught was that healthy people should be able to perform adequately after a regular 16-hour day. Not that they have to do it all the time, but that they shouldn't be so overwhelmed by a need to sleep after 16 hours that they can't stay up.
Maybe you should cut down on the caffeine. Contrary to popular believe, it makes you require more, not less, sleep, because it both over-stimulates you during the day, and makes what sleep you get less fitful.
There are plenty of coders who know what I mean when I say you "get into the zone" and go with it. When that happens, you don't want to stop because you're getting a lot done, in a very efficient manner. You'll rest later, and you'll feel you've earned it - because if you rested now, you wouldn't be able to get to sleep anyway.
Great. What I think the javanistas don't get is that I'm NOT advocating switching everything away from java, but rather fixing the problems with the language. Sun made some serious mistakes in keeping it so locked in for so long. Top of the list would be to add multiple inheritance and get rid of interfaces (cue the "OMG BURN THE EVIL CLUELESS B*TCH" crowd).
Threads? In our day, we had ROPE! And CHAINS. No wonder your programs crash so much - they're hanging by a few threads!
And we even had a version of Unix that could run those chains like you wouldn't believe - FreeBSDM - great for when someone slashdots the pr0n servers.
And what's this about Pee Threads? Come on, tell 'em to go piss up a ROPE! "Go piss up a thread" is lame.
And your local storage is really lacking. There's not even enough room on some of those netbooks for a cup holder. Heck, a decade ago you could get a tower with TWIN cup holders.
Remember that printer in Office Space. That was a REAL printer. It took 3 men and a baseball bat to kill it. Not like today's printers that are so cheaply made that you throw them out once the starter cartridge is empty.
And those 3-1/2" floppies. Real Ninja coders could take your eye out with one of those from 30 feet. In comparison, your thumb drives are almost useless for in-house security. And what good is insecure code?
And we even had sneakernet - a great way to ensure that programmers got at least a bit of exercise, some social interaction, some face time.
Oh, come on... the original BSG was so lame that I wanted Lorne Greene to find a horse, shoot it, and turn it into Alpo.
For the yung'uns - Lorne Greene was the Canadian actor who played Commander Adama in the original series, and had previously been Pa Cartwright on the equally excretable oater Bonanza. Lots of horses, and he flogged Alpo during the commercials. Which reminds me - what DID they do with all those horses anyway?
The remake was so much better. Not just the effects, but the characters. Okay, it took them 4 episodes to make the characters their own and get rid of the last remnants of the old series feel, but the remake was a really good series.
Sorry to tell you, but HTML5 was obsoleted years ago - version 7 is supposed to be released any day now. You must be getting old!
(Try it some time - this is IT, the more outrageous, the more likely it is to be believed. (1) "People will buy their dog food at pets.com" teaches that the supply of stupidity is infinite, and (2) never pass up the opportunity for a free meal or a good joke.).
Not surprisingly, the latter group are also the ones - in my experience - who like to knock me (with ~12 years in the field) as "young," "unseasoned," and "still wet behind the ears,"
So they're jerks. It's a pleasure being able to mentor someone. It keeps both parties at the top of their game, and older people who aren't afraid that once in a while we might actually learn something in return know it.
The IT field is no different from any other field. People aren't more "logical" in their relationships in IT. Why we expect them to be is beyond me.
Or someone will mention the term, and you'll figure it out, how to do it, and how to avoid it, on your own. It's like when I was looking for a way to avoid making more than one call to the server to either append or update - I figured there had to be a way, and sure enough as soon as I saw the term "ON DUPLICATE KEY" I knew I had found what I was looking for.
People say that half the battle is knowing where to find things - I think half the battle is being able to recognize it when you see it, and having good hunches - same as debugging.
the Javanistas are really upset now because their pet language is past its' best-before date, and with the Oracle-Google lawsuit, a lot of people are FINALLY coming out of the woodwork and saying things we've been saying for years - that single inheritance was a design mistake that encourages code bloat, that the "everything is a class" model didn't work for c++ 20 years ago, and they should have learned the "classes if necessary, but not necessarily classes" mantra, that Sun was hypocritical in overloading every math operator so it works with numeric objects as well as primitives (and the + operator with strings as well) while decrying that "operator overloading is a bad thing", that the import statement is f*ed up, that we are smart enough to be trusted with structs and enums without having to wrap them in objects, that programmers CAN be trusted with a preprocessor, etc.
Java could have been a good language. Oh well, what can you do, it is what it is.
JaveME is not open source. Neither is the test suite to verify that ANY java implementation conforms to the standard. Maybe YOU need to educate yourself on the issues a bit more, young'un:-)
In Soviet Russia, Java uses YOU!
Here, it's OraKILL.
Besides, a true F/LOSS project allows for breaking backward compatibility. Or is backward compatibility so important that we should maintain IE3 standards?
Anyone with any knowledge of human psychology knows that when you work late, you get slowly more and more stupid,
I do my best work in all-night sessions. For some reason, the creative juices flow better, and once I get around the 2am hum, I'm good until 9am at least. I'd rather do 2 20-hour stints and take the rest of the week off than do the 9 to 5 - and I'll get more done, too.
I only start to turn stupid after 48 hours, and start seeing things that aren't there after 96 or more. When you're in the zone, you're GOOD! It's a natural high.
When a customer is paying you a month's expenses for 3 days work, you'll stay up the three days, you'll make damn sure you get "in the zone", and you'll be productive. You'll meet the deadline. Money and a challenge are both great motivators.
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.
A lot of times, when a project gets completed, its despite management. Management might not like it, but it's the truth.
It's only after working on both failed (because you learn a lot more from your failures) and successful projects that you can work around the problems.
Being older means once in a while protecting a younger worker by taking the blame for their screw-up, saying you must have been having a brain-fart, and you'll fix it. It means taking them aside and addressing their frustrations with being given an impossible task, and trying to brainstorm new ways to attack it. It means writing their reports for them, because you know what sort of bs management wants to hear. It means forking out money for beer and pizza at a local restaurant when one of them has a personal crisis and needs to talk privately.
It means taking the boss aside sometimes and saying "hey, I'm defending you in public but you and I both know you really REALLY f*ed up this time. Here's what you have to do to fix this, or they're going to quit." It means having the confidence to be able so say "look, I'm not saying this is a dumb idea because I think it's a dumb idea, I'm saying it's a dumb idea because company X tried it in 1997, company y tried it in 2000, company z tried it in 2003, google tried it in 2006, and they all failed. Instead of wasting 3 weeks in meetings verbally masturbating each other and then throwing this bloated project at us, you could have asked. If you really want to do it, here's what you have to cut to have even a hope in hell of getting anything within 3 months."
Unfortunately, that doesn't play as well as "yes, we think this is a great idea, let's do it!" in meetings and grumbling for the next 6 months to a year while they look elsewhere for jobs in the hope that the next place will be saner.
lawyers have nothing to do with memory management.
they don't do enough of it to make it second nature, but after a while it's like riding a bicycle.
You take off the training wheels, get overconfident, and crash horribly ?-)
For bicycles, I hadn't ridden on in 2 decades, but I bought one this summer - it was literally "like riding a bicycle", you never forget. And I never had training wheels when I was learning how to ride, so I had plenty of incentive to learn quickly - scraped knees and all.
Operator overloading really isn't feasible unless you add the requirement that every piece of code using a template or other overloadable entity must be recompiled every time said template chances.
You don't use templates to overload operators. It's all resolved at compile time.
I hate to point this out, but the average programmer is a dummy, and even the non-dummy ones still make stupid mistakes. The world is full of buggy programs that bear testament to this. And most of those bugs have to do with memory management, because it is a simple yet tedious task where any mistake or lapse of attention will likely results in a disaster sooner or later.
Like it or not, there is a reason why managed languages are gaining favour.
They're gaining in favour with dummies - as your reply points out. Most bugs are not memory allocation - there are plenty of buggy "managed code" programs out there.
I'd like to see the"something newer." Java should have been it, but it was crippled from the get-go because Sun wanted control. Picture java with multiple inheritance, operator overloading (java already overloads all the math operators, so why can't we?), naked structs and enums (we can manage our own "primitives", honest!), and a pre-procesor. A "better c++".
We don't need everything to be a class or wrapped in a class.
Ever tried to make performance sensitive MThreaded systems under high load? I dare you to build one in ANSI C!
Yes - 1000 connections a second, running for months at a time, 400 threads launched at startup, none EVER killed to reclaim memory (unlike most servers) because we wanted to avoid the overhead of killing threads and spawning new ones. The boxes it ran on were old 800mhz dual-core BSD with 2 gig. They were tested and ran fine on newer boxes with a half-gig of ram (though they've been upgraded in the last year to 2ghz/16gig ram during a change of co-lo because it's cheap, so why not?).
A second one, 100 threads at startup, same deal except that it could expand the thread pool as required without limit. Again, no respawning of threads to claim back leaking memory.
It's possible to write leak-proof c/c++ code, without smart pointers or reference counting or resorting to killing off threads to "fix" a memory leak.
Third one, same deal as the second. They all talk to each other, two of them talk to the outside world, and everything is hunky-dory. To the rest of the world, they look like ordinary web servers (until you try to look at the server signature - there is none). They load their modules at start time (each one has a different set of modules), and do things like parse out and generate xml, combine queries from multiple sources so that they can hit the database with one big query instead of hundreds of smaller ones, then split the results back to the individual threads as required - saves a LOT of overhead.
All 3, plus the db, on that same lowly 800mhz dual-core.
So yes, it's possible, and I've already done it. No need to dare me.
Memory management is something that can be taught pretty quickly. It boils down to always knowing who owns what, same as the real world.
The reasons why people screw it up are simple -
they don't do enough of it to make it second nature, but after a while it's like riding a bicycle.
they're rushed to "get it out the door"
That second one applies to more than just memory management - it's the bane of all developers, no matter what your language.
However, my beef with java isn't with memory allocation, but with the way that the language was dumbed down. Every mathematical operator is overloaded in Java, but coders aren't allowed to do the same. Enums and structs are gone, because programmers can't be trusted with them - make them wrap it in an object and and eliminate bugs (didn't work...) Multiple inheritance was too hard for them to implement, so we got stuck with single inheritance - this is probably my biggest beef.
All these show a disdain for the learning skills of programmers. We're not dummies, and we should be given tools that are MORE, not less, expressive.
HW accelarated (sic) GC can wipe the floor with the most annaly (sic) tuned C app.
Garbage collection is for people who need a safety net.
Smart pointers are the usual means for c++ programmers to "manage garbage collection", but they're not the optimal solution, in part because they're not actually smart (circular references, etc., so you no need weak smart pointers, blah blah blah).
Smart|weak pointers are not needed. Proper design spells out who allocates what, who owns it, and who frees it. Anything else is laziness on the part of the programmer, or a response to management's insistence on not allowing enough "thinking time" in the process.
So, with no garbage collection and no reference counting overhead, where's c's disadvantage? Right, there is none.
gcj under linux says you can't. I already tried that. Where do you think I got the error message from?
And no, I'm not saying that static linking is "the only form of compilation." Object code is the result of compilation. Whether you stick it into a lib or link it directly into your executable is irrelevant. I've been doing this for more than a quarter-century - I know the difference.
The only reason they would require the presence of libgcj (and why gcj refuses to statically link) is because it needs the interpreter at runtime; there's no other way to support reflection, for example, because Sun implemented it wrong.
You won't get an argument from me on that score. Too bad you posted anonymously, because what you said is VERY true.
"Thinking time" for a programmer is devalued, even though even carpenters know "measure twice, cut once" saves time and money, and field engineers know to ask the advice of the tradespeople when looking over the blueprints.
But when it comes to building code, it's a different story. Instead, it's "do this - this shouldn't take more than %arbitrary_time minutes" - sure, but you can only get away with that for so long before your code looks as unplanned as it is.
So you end up with undocumented code ("you'll have time to do the documentation later"), code that has corner-cases that are untested, code that duplicates functionality because it's quicker to cut-n-paste to get the boss off your back than it is to try to generalize a block of code for re-use, etc.
OOP was supposed to fix that. When it's not over-used it's great. But of course, like everything else, "if a little is good, a lot must be better."
And putting more priority on adding features, even while the current features don't work right and the code needs a good scrubbing, or worse, "selling the prototype".. not good.
I fed it the source file - don't be silly. gcj 4.4 gives me the crap I wrote about, and as I pointed out, it doesn't support the GUI - every action throws an exception. That certainly is not "supporting java."
Then again, you're running Windows. Maybe it's that good old "write once for each platform" thing, because it sure doesn't work on my linux box.
Again, you only further prove my point - access via java objects sucks. You can get "close" to c performance by using primitives, but then you've eliminated java's overhead for accessing object methods and properties. You can't do that with most java code because most java classes don't have a corresponding "primitive" representation.
So no, higher-level code would run slower in java, because you are stuck at the higher level, when I avoid it. I don't have to wrap everything into classes. Sure, I use classes when necessary, but not necessarily classes. Not when a struct will do. Not when a nice chunk of uninitialized ram will do. Not when some pointer math will solve the problem quickly in one line.
Basically, any thread that had a request added it to the string. A thread might have 10 different selects. Why not do them all at once, along with 50 other threads?
Put 1000 queries into that single string, then call the c api to execute it. Then "peel off" the results. You can't do this with php, and you may have some difficulty doing it with java (I'd have to check the API), but under c with mysql, it works like you wouldn't believe. A word of caution - use ON DUPLICATE KEY as much as possible - this way, if you have two statements that would both try to append the same key value, you can use the latter one to do an update. This solves the biggest problem of multiple-statement execution. Unfortunately, pg doesn't have on duplicate key yet.
Obviously made-up example "insert into users (name, id, access_time) values "blah" "blah" "blah" on duplicate key update users set access_time=now() where id="id" limit 1";
"on duplicate key" is one of those miracle statements - when you need it, it works miracles.
Looking at the pglibs it isn't able to return everything for a multi-statement query, only the last result - darn, that kind of sucks, but it can still be useful - for example, you might have 4 or 5 inserts, a few updates then a select. You could do them all, saving the select as the last statement so you get the results. "insert into blah; insert into foo; insert into yuck; update sess; select from pages;" would return your select (or an error if a previous statement failed).
Instead of arguing, I'll provide proof. You're welcome to compile the source on your own machine to see that I'm not making things up. Java is SLOOOWWW even on code that it optimizes, because of the inherent overhead.
Java is more than 20x slower than c in simple repetitive loops (gee, why didn't it optimize them to be "faster than c"?
"compiled" java is even slower - more than 100x slower.
The reason they stopped working on gcj is because it doesn't work - I compiled a swing app I wrote that works perfectly - the gcj "compiled" version threw errors with every mouse click.
An examination of the gcj "compiled code" shows that it's just a wrapper for the classes - it calls libgcj to interpret them at runtime. It does NOT generate native code.
If you want to use the term "supports" to mean "slow and doesn't work properly", then I guess you could say gcj "supports" java. But don't you think that's pushing it a bit?
I'm just saying that sexism and ageism are two sides of the same coin ... ignorance and stereotyping.
As such, maybe we should be addressing that as well. After all, everyone says "we want more women in IT" and then wonders why there aren't more women in IT.
With the aging population, we're going to have a problem anyway; why discourage qualified workers (of both genders) who not only are able to "keep up", but are passionate about what they do and bring "institutional memory" to the mix?
Both sexism and ageism are viewed as "bad things", but of the two, sexism is far more deeply ingrained in the IT field. If you think older men have a problem, how about older women? It's the triple curse - not seen as being "real programmer material", seen as "too old", and with fewer opportunities in both management and other fields.
Look at all the comments in this thread - women (young and old) are invisible. The field needs more women to tone down the testosterone levels and pissing contests a bit. The only problem is, when women go for an interview, men still judge women by physical appearance and not skills.
That's why you'll see women sending out resumes using just their first initial, use email addresses that don't indicate gender, post using aliases, etc. After all, "a woman can't hold serious opinions about code - that's guy stuff!" or "She can't stand up to the demands of crunch time." or "She'll have more absenteeism to tend to family matters." or "We can't shout at her like we can at the guys." or "She'll distract the guys. I'm never going to hire a woman."
I've seen every one of those "reasons." Ageism might be a problem, but sexism is a bigger problem. The only reason it's not being addressed is because of sexism - "computers are a guy thing." So be happy you're not in that boat.
A struct doesn't have the overhead of the virtual method table, for one. For another, I can define a union and access the struct in different ways directly, rather than having to use overloaded getters and setters. These are both ways to deal with data that are just darned convenient at times. It's also a lot easier to clone a struct than to do a deep copy of a class. Also, if I cast the struct, I can extend or shrink it as needed. And structs can hold pointers to functions (and if you remember to have an explicit "this", they can even operate like c++ classes). 99% of the time, this is completely useless, but that 1% makes up for it. And because there's no overhead for method lookup, it's the fastest implementation possible outside of assembler.
I can use c99-style variable arrays, but treat the data as one continuous chunk of memory, and use bsearch do do an almost instantaneous lookup. Much less overhead than a btree or other structure (100,000 lookups per second on a 1-million record dataset on my laptop when I tested it a couple of years ago for a project where even mysql's in-memory tables weren't fast enough).
Sure it requires more planning for things like marking "rows" as being available so that you don't have to dynamically sort, grow, or shrink the data all the time, but that's what finding the fastest solution is about.
They abandoned all development on it last year for a reason. It doesn't support swing, and without swing support, it is of limited usefulness in today's world.
Look - I'm not saying that people should abandon Java. I *am* saying that Sun made some serious mistakes in the original design, and then kept everything so locked up that they couldn't be addressed. Java can stand to use a few improvements that would reduce bloat and make it more flexible if it's going to move forward.
Back in college one of the things we were taught was that healthy people should be able to perform adequately after a regular 16-hour day. Not that they have to do it all the time, but that they shouldn't be so overwhelmed by a need to sleep after 16 hours that they can't stay up.
Maybe you should cut down on the caffeine. Contrary to popular believe, it makes you require more, not less, sleep, because it both over-stimulates you during the day, and makes what sleep you get less fitful.
There are plenty of coders who know what I mean when I say you "get into the zone" and go with it. When that happens, you don't want to stop because you're getting a lot done, in a very efficient manner. You'll rest later, and you'll feel you've earned it - because if you rested now, you wouldn't be able to get to sleep anyway.
Great. What I think the javanistas don't get is that I'm NOT advocating switching everything away from java, but rather fixing the problems with the language. Sun made some serious mistakes in keeping it so locked in for so long. Top of the list would be to add multiple inheritance and get rid of interfaces (cue the "OMG BURN THE EVIL CLUELESS B*TCH" crowd).
Threads? In our day, we had ROPE! And CHAINS. No wonder your programs crash so much - they're hanging by a few threads!
And we even had a version of Unix that could run those chains like you wouldn't believe - FreeBSDM - great for when someone slashdots the pr0n servers.
And what's this about Pee Threads? Come on, tell 'em to go piss up a ROPE! "Go piss up a thread" is lame.
And your local storage is really lacking. There's not even enough room on some of those netbooks for a cup holder. Heck, a decade ago you could get a tower with TWIN cup holders.
Remember that printer in Office Space. That was a REAL printer. It took 3 men and a baseball bat to kill it. Not like today's printers that are so cheaply made that you throw them out once the starter cartridge is empty.
And those 3-1/2" floppies. Real Ninja coders could take your eye out with one of those from 30 feet. In comparison, your thumb drives are almost useless for in-house security. And what good is insecure code?
And we even had sneakernet - a great way to ensure that programmers got at least a bit of exercise, some social interaction, some face time.
Oh, come on ... the original BSG was so lame that I wanted Lorne Greene to find a horse, shoot it, and turn it into Alpo.
For the yung'uns - Lorne Greene was the Canadian actor who played Commander Adama in the original series, and had previously been Pa Cartwright on the equally excretable oater Bonanza. Lots of horses, and he flogged Alpo during the commercials. Which reminds me - what DID they do with all those horses anyway?
The remake was so much better. Not just the effects, but the characters. Okay, it took them 4 episodes to make the characters their own and get rid of the last remnants of the old series feel, but the remake was a really good series.
Sorry to tell you, but HTML5 was obsoleted years ago - version 7 is supposed to be released any day now. You must be getting old!
(Try it some time - this is IT, the more outrageous, the more likely it is to be believed. (1) "People will buy their dog food at pets.com" teaches that the supply of stupidity is infinite, and (2) never pass up the opportunity for a free meal or a good joke.).
So they're jerks. It's a pleasure being able to mentor someone. It keeps both parties at the top of their game, and older people who aren't afraid that once in a while we might actually learn something in return know it.
The IT field is no different from any other field. People aren't more "logical" in their relationships in IT. Why we expect them to be is beyond me.
Or someone will mention the term, and you'll figure it out, how to do it, and how to avoid it, on your own. It's like when I was looking for a way to avoid making more than one call to the server to either append or update - I figured there had to be a way, and sure enough as soon as I saw the term "ON DUPLICATE KEY" I knew I had found what I was looking for.
People say that half the battle is knowing where to find things - I think half the battle is being able to recognize it when you see it, and having good hunches - same as debugging.
the Javanistas are really upset now because their pet language is past its' best-before date, and with the Oracle-Google lawsuit, a lot of people are FINALLY coming out of the woodwork and saying things we've been saying for years - that single inheritance was a design mistake that encourages code bloat, that the "everything is a class" model didn't work for c++ 20 years ago, and they should have learned the "classes if necessary, but not necessarily classes" mantra, that Sun was hypocritical in overloading every math operator so it works with numeric objects as well as primitives (and the + operator with strings as well) while decrying that "operator overloading is a bad thing", that the import statement is f*ed up, that we are smart enough to be trusted with structs and enums without having to wrap them in objects, that programmers CAN be trusted with a preprocessor, etc.
Java could have been a good language. Oh well, what can you do, it is what it is.
JaveME is not open source. Neither is the test suite to verify that ANY java implementation conforms to the standard. Maybe YOU need to educate yourself on the issues a bit more, young'un :-)
In Soviet Russia, Java uses YOU!
Here, it's OraKILL.
Besides, a true F/LOSS project allows for breaking backward compatibility. Or is backward compatibility so important that we should maintain IE3 standards?
I do my best work in all-night sessions. For some reason, the creative juices flow better, and once I get around the 2am hum, I'm good until 9am at least. I'd rather do 2 20-hour stints and take the rest of the week off than do the 9 to 5 - and I'll get more done, too.
I only start to turn stupid after 48 hours, and start seeing things that aren't there after 96 or more. When you're in the zone, you're GOOD! It's a natural high.
When a customer is paying you a month's expenses for 3 days work, you'll stay up the three days, you'll make damn sure you get "in the zone", and you'll be productive. You'll meet the deadline. Money and a challenge are both great motivators.
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.
A lot of times, when a project gets completed, its despite management. Management might not like it, but it's the truth.
It's only after working on both failed (because you learn a lot more from your failures) and successful projects that you can work around the problems.
Being older means once in a while protecting a younger worker by taking the blame for their screw-up, saying you must have been having a brain-fart, and you'll fix it. It means taking them aside and addressing their frustrations with being given an impossible task, and trying to brainstorm new ways to attack it. It means writing their reports for them, because you know what sort of bs management wants to hear. It means forking out money for beer and pizza at a local restaurant when one of them has a personal crisis and needs to talk privately.
It means taking the boss aside sometimes and saying "hey, I'm defending you in public but you and I both know you really REALLY f*ed up this time. Here's what you have to do to fix this, or they're going to quit." It means having the confidence to be able so say "look, I'm not saying this is a dumb idea because I think it's a dumb idea, I'm saying it's a dumb idea because company X tried it in 1997, company y tried it in 2000, company z tried it in 2003, google tried it in 2006, and they all failed. Instead of wasting 3 weeks in meetings verbally masturbating each other and then throwing this bloated project at us, you could have asked. If you really want to do it, here's what you have to cut to have even a hope in hell of getting anything within 3 months."
Unfortunately, that doesn't play as well as "yes, we think this is a great idea, let's do it!" in meetings and grumbling for the next 6 months to a year while they look elsewhere for jobs in the hope that the next place will be saner.
lawyers have nothing to do with memory management.
I'd like to see the"something newer." Java should have been it, but it was crippled from the get-go because Sun wanted control. Picture java with multiple inheritance, operator overloading (java already overloads all the math operators, so why can't we?), naked structs and enums (we can manage our own "primitives", honest!), and a pre-procesor. A "better c++".
We don't need everything to be a class or wrapped in a class.
Yes - 1000 connections a second, running for months at a time, 400 threads launched at startup, none EVER killed to reclaim memory (unlike most servers) because we wanted to avoid the overhead of killing threads and spawning new ones. The boxes it ran on were old 800mhz dual-core BSD with 2 gig. They were tested and ran fine on newer boxes with a half-gig of ram (though they've been upgraded in the last year to 2ghz/16gig ram during a change of co-lo because it's cheap, so why not?).
A second one, 100 threads at startup, same deal except that it could expand the thread pool as required without limit. Again, no respawning of threads to claim back leaking memory.
It's possible to write leak-proof c/c++ code, without smart pointers or reference counting or resorting to killing off threads to "fix" a memory leak.
Third one, same deal as the second. They all talk to each other, two of them talk to the outside world, and everything is hunky-dory. To the rest of the world, they look like ordinary web servers (until you try to look at the server signature - there is none). They load their modules at start time (each one has a different set of modules), and do things like parse out and generate xml, combine queries from multiple sources so that they can hit the database with one big query instead of hundreds of smaller ones, then split the results back to the individual threads as required - saves a LOT of overhead.
All 3, plus the db, on that same lowly 800mhz dual-core.
So yes, it's possible, and I've already done it. No need to dare me.
Memory management is something that can be taught pretty quickly. It boils down to always knowing who owns what, same as the real world.
The reasons why people screw it up are simple -
That second one applies to more than just memory management - it's the bane of all developers, no matter what your language.
However, my beef with java isn't with memory allocation, but with the way that the language was dumbed down. Every mathematical operator is overloaded in Java, but coders aren't allowed to do the same. Enums and structs are gone, because programmers can't be trusted with them - make them wrap it in an object and and eliminate bugs (didn't work ...) Multiple inheritance was too hard for them to implement, so we got stuck with single inheritance - this is probably my biggest beef.
All these show a disdain for the learning skills of programmers. We're not dummies, and we should be given tools that are MORE, not less, expressive.
Garbage collection is for people who need a safety net.
Smart pointers are the usual means for c++ programmers to "manage garbage collection", but they're not the optimal solution, in part because they're not actually smart (circular references, etc., so you no need weak smart pointers, blah blah blah).
Smart|weak pointers are not needed. Proper design spells out who allocates what, who owns it, and who frees it. Anything else is laziness on the part of the programmer, or a response to management's insistence on not allowing enough "thinking time" in the process.
So, with no garbage collection and no reference counting overhead, where's c's disadvantage? Right, there is none.
gcj under linux says you can't. I already tried that. Where do you think I got the error message from?
And no, I'm not saying that static linking is "the only form of compilation." Object code is the result of compilation. Whether you stick it into a lib or link it directly into your executable is irrelevant. I've been doing this for more than a quarter-century - I know the difference.
The only reason they would require the presence of libgcj (and why gcj refuses to statically link) is because it needs the interpreter at runtime; there's no other way to support reflection, for example, because Sun implemented it wrong.
You won't get an argument from me on that score. Too bad you posted anonymously, because what you said is VERY true.
"Thinking time" for a programmer is devalued, even though even carpenters know "measure twice, cut once" saves time and money, and field engineers know to ask the advice of the tradespeople when looking over the blueprints.
But when it comes to building code, it's a different story. Instead, it's "do this - this shouldn't take more than %arbitrary_time minutes" - sure, but you can only get away with that for so long before your code looks as unplanned as it is.
So you end up with undocumented code ("you'll have time to do the documentation later"), code that has corner-cases that are untested, code that duplicates functionality because it's quicker to cut-n-paste to get the boss off your back than it is to try to generalize a block of code for re-use, etc.
OOP was supposed to fix that. When it's not over-used it's great. But of course, like everything else, "if a little is good, a lot must be better."
And putting more priority on adding features, even while the current features don't work right and the code needs a good scrubbing, or worse, "selling the prototype" .. not good.
It's sad.
Then again, you're running Windows. Maybe it's that good old "write once for each platform" thing, because it sure doesn't work on my linux box.
Again, you only further prove my point - access via java objects sucks. You can get "close" to c performance by using primitives, but then you've eliminated java's overhead for accessing object methods and properties. You can't do that with most java code because most java classes don't have a corresponding "primitive" representation.
So no, higher-level code would run slower in java, because you are stuck at the higher level, when I avoid it. I don't have to wrap everything into classes. Sure, I use classes when necessary, but not necessarily classes. Not when a struct will do. Not when a nice chunk of uninitialized ram will do. Not when some pointer math will solve the problem quickly in one line.
sql = malloc(ONE_MEG); ...", query1, query2, query3, query4, query5 ....);
sql = sprintf(%s;%s;%s;%s;%s;%s;%s;%s
Basically, any thread that had a request added it to the string. A thread might have 10 different selects. Why not do them all at once, along with 50 other threads?
Put 1000 queries into that single string, then call the c api to execute it. Then "peel off" the results. You can't do this with php, and you may have some difficulty doing it with java (I'd have to check the API), but under c with mysql, it works like you wouldn't believe. A word of caution - use ON DUPLICATE KEY as much as possible - this way, if you have two statements that would both try to append the same key value, you can use the latter one to do an update. This solves the biggest problem of multiple-statement execution. Unfortunately, pg doesn't have on duplicate key yet.
Obviously made-up example "insert into users (name, id, access_time) values "blah" "blah" "blah" on duplicate key update users set access_time=now() where id="id" limit 1";
"on duplicate key" is one of those miracle statements - when you need it, it works miracles.
Looking at the pglibs it isn't able to return everything for a multi-statement query, only the last result - darn, that kind of sucks, but it can still be useful - for example, you might have 4 or 5 inserts, a few updates then a select. You could do them all, saving the select as the last statement so you get the results. "insert into blah; insert into foo; insert into yuck; update sess; select from pages;" would return your select (or an error if a previous statement failed).
Here's the docs for mysql c api multiple-statement execution and result retrieval.
BTW - since everyone's been on my case claiming that "java can be faster than c" and that "gcj compiles code" I figured I'd , and I also tested gcj and took a look at the "compiled" program.
Java has its place, but not where you need high performance. It's a dog, really :-)
Instead of arguing, I'll provide proof. You're welcome to compile the source on your own machine to see that I'm not making things up. Java is SLOOOWWW even on code that it optimizes, because of the inherent overhead.
Real-word benchmark written just for you weekend Javanistas
If you want to use the term "supports" to mean "slow and doesn't work properly", then I guess you could say gcj "supports" java. But don't you think that's pushing it a bit?