last updated:06 Aug 2003 15:00 UK time
|
 |
|
(Comments added for week ending Sun 02 Mar 2003) | View Other Weeks
|
|
| Remote Desktop/Remote Assistant | Sun 02 Mar | Caleb Calpp |
| I regularly use Remote Desktop. My issue is that it blanks the screen of the host display. My uses include multimedia, so I need the host display (a 50 plasma) to remain active. tightVNC, etc is too slow, I want to use Remote Desktop. I know that Remote Assistance uses the same terminal services base as Remote Desktop and does NOT blank the host display. The problem is I cannot find a way to automate Remote Assistance invitation and granting of the Remote Assistance session.
Does anyone know a workaround to allow the Remote Assistance session to be full implemented REMOTELY, without requiring being at the host pc???
Thanks
--Caleb |
| Sun 02 Mar | RRKSS | Have you tried the Remote Desktop feature in Microsoft Netmeeting? Go to run and type 'conf' to start it up. Once you have gone through the wizard and started the actual program all you have to do is click 'Remote Desktop Sharing' under tools. I hope that helps |
|
| "Less than expert" Technical Professionals? | Sun 02 Mar | Philo |
|
Im having growing unhappiness with the lack of technical expertise I see in the IT industry. As I advance in proficiency, I keep thinking that there is so much more I have to learn - I feel like a journeyman, thinking there are true masters out there.
But increasingly Im thinking I *am* a master in a sea of journeymen...
The most recent thing thats made me think this - I deal with an EDI document company. When we signed the contract with them, they guaranteed they could handle XML. Well, it turns out handle means barely cope with - they only handle it by writing it out as a flat file, which means through integration we kept having to harp on them about violating XML standards (and they still cant handle empty tag shorthand: )
Okay, so their salesmen were a mite overeager, fair enough. But even in EDI, where they are supposed to be experts, we keep having to teach them stuff. The latest is dealing with 997 acknowledgement documents, where it seems they have no concept of how they are supposed to work. Last week their senior mapper commented how cool some of the stuff were doing is, when all were doing is following the specification.
And so it goes. DBAs that dont understand stored procedures; sysadmins who dont understand DNS caching; programmers who cant grasp recursion...
Is it just me? Are my expectations too high?
Philo |
| Sun 02 Mar | anonymous | I have definitely noticed this. I work with a bunch of Perl programmers who don't understand variable interpolation in double quoted strings. Not to mention all variables are global in all of our scripts because no one understands scoping. These practices are actually encouraged by the people in charge. They don't want anyone who never made it past page 10 of Learning Perl to worry about learning anything.
I think the problem is too many people become technical professionals because of the money. I have yet to work with someone who does it for the money that is any good at it. I guess it doesn't hurt that most people have low expectations for software. |
| Sun 02 Mar | mackinac | >>> I think the problem is too many people become technical professionals because of the money. <<<
They wouldn't be working at a technical job if someone hadn't decided to hire them.
This thread sounds a lot like others we have had. The people who post to this site are technical professionals who get frustrated by seeing such things. But the people who make the decisions that create such a work environment are management people. It would be very interesting to get a few of them to tell us why they make the decisions they do, but I don't think we're going to hear from them. |
| Sun 02 Mar | IMO | You get what you pay for. Companies hire the anyone that will do the job for the least amount. These Technical Professionals are really just task doers. If you have competence and want to make money go contracting. If you have competence and want to do real interesting work try getting a research programmer position at a national lab or university. |
| Sun 02 Mar | The Real PC | What is a research programmer? |
| Sun 02 Mar | Patrik | >What is a research programmer?
A programmer that works with a team of researchers who works on some unsolved cool problem. Think Palo Alto Research Labs or the likes of it...
Thats my take :) |
| Sun 02 Mar | Matt H. | You get what you pay for. Companies hire the anyone that will do the job for the least amount
This is -NOT- always true.
Personally. I think a lot of it has to do with core competancies and insecurity.
Formula for failure:
If a company has insecure management ('B People'), they will hire people who are not as good as they are ('C People') in order to feel more secure. At this point, the company is just screwed. :-) Joel Spolsky wrote an essay on this, so it must be true. :-)
Forumula for success:
By the same token, if a company is founded by coders or the companies 'strategic edge' involves technology - and the management of those areas gets the best and the brightest - you might NOT have a problem, because they view Technology and as INVESTMENT, not a cost center.
This is especially hard to do if you are coding internal apps.
It's easier to do if you are selling the stuff, but mistakes are still common. My conclusions? In order to be recognized as exceptional, and get paid for it, you need a few conditions:
(1) Be able to articulate the value of what you do, and why it's more than joe incompetant,
(2) Have a management team that intutitively 'gets' technology and views it as an investment,
(3) Have a work environment this has pride and recognition, instead of fear and insecurity.
In any event, good luck. In my experience, birds of a feather flock together. Perhaps you've just been flying with the wrong flock ... |
| Sun 02 Mar | Matt H. | This is especially hard to do if you are coding internal apps.
--- When i wrote this above, I ment it in the context of 'articulate the value of what you are doing'
In other words, if what you do this year will sell for $1,000,000, it's pretty easy to understand the value of hiring the best and brightest. If you're doing internal apps, it's harder to 'prove' the 'worth' of hiring the best and paying them what they are worth.
regards, |
| Sun 02 Mar | Bored Bystander | I think there are several factors in confluence:
First, software has become a mass market commodity. So the hiring needs of businesses far exceed the gene pool's and the educational systems' ability to produce competent candidates for software development. It's one thing if a need for 10x the number of plumbers we currently have all of a suddenly became an issue for economic growth in the next decade. Instead, our economy in the 90's needed masses of people to do work that only a small and gifted percentile of the population is capable of doing competently and 'getting'. The ability to think and reason abstractly doesn't grow on trees.
Secondly, like any hot growth industry, the computer industry has become a hotbed of inflated egos and a prevailing attitude that anyone who is any good acts like they're God. Dripping arrogance has become pretty much an expected mentality in this field. So you often can't distinguish the really good people at first glance from the ones that are only talking themselves up who can't perform.
Third - the commodity nature of programming and the ego factor have created a living example of Gresham's Law - good currency chases out bad. By that I mean that it doesn't really matter how good you are, it's more a question whether you are well connected enough to be heard above 10 or 100 other people with the same nominal 'skills'. It doesn't matter if you can design and engineer effectively at a high level, and if you can adapt quickly, at least when it comes to convincing someone to hire you. No, hirability anymore comes down to a number of petty factors such as: not intimidating the hiring managers; pure personality match; having the right alphabet soup skills, the right language versions, etc; and being in the right age group so that you won't cost the employer too much in health insurance, time off for necessary family matters, etc.
Except for tiny pockets of virtue, this industry excels at crapping on experienced people that know how to achieve results. It doesn't seem to make any sense on the surface, but look at how many programmers of age 45+ are around. If experience were valued, you wouldn't have the widespread habit of referring to anyone with years of experience as an old fogey loser who is tainted by experience with outdated technology. The demographics pretty much point to a meatgrinder that treats individuals like trash and wants only a PC-acceptable template person. |
| Sun 02 Mar | Bored Bystander | >> Gresham's Law - good currency chases out bad
ACK, *I* should be chased out.
I MEANT:
Gresham's Law - bad currency chases out good.
SORRY! |
| Sun 02 Mar | Walter Rumsby | If 'A's hire 'A's and 'B's hire 'C's, who hired the 'B's in the first place? :)
An issue here is mentorship. I see people coming straight out of colleges and other training courses, etc being hired as programmers. Fine, no issue here, the issue is that some of these people are 'let loose' without any/enough guidance from somebody with enough experience (AND the skills to guide them) to teach them best practices, potholes to avoid, etc. These unchecked bad habits become standard practice, as these developers get 'more experience' (ie. they clock up more years), they get more respect/power/influence over projects - in situations like this 'years accrued' is not necessarily a clear measure of ability. |
|
| Writing Perfect Code? | Sun 02 Mar | anon |
| For many weeks now, I have been writing near-perfect code, the first time.
What I mean by this is that I have been in the flow to such an extent for such a long time now that when I need to write function X or write query Y or build screen Z, Ive been able to do it almost effortlessly and with a seemingly impossibly-low error rate. The code just pours forth, fully-formed, along with some of the most rigorous unit tests Ive ever written that **invariably** beat that code to death without a single error.
This is in huge contract to how I coded just six months ago or so, where (comparitively) I was stumbling and falling over myself to get even moderately complex modules built. It seemed that I was proceeding in a normal way then, on par with some of my sharpest coworkers.
Ive started to worry quite a lot about this, mostly that the code that *seems* right, which sprang fully-formed from my fingertips, is actually riddled with fatal bugs that will rear up and devestate my companys reputation. But some of this perfect code has been in production for almost five months, being used by thousands every day without so much of a peep of complaint.
Im wondering if Im experiencing delusions of grandeur, or if this is normal after one has gained a certain level of experience. FYI, I have about six years of relatively broad experience, and much of that was spent designing large systems as well as developing them.
So, has anyone had similar experiences, or am I just crazy? |
| Sun 02 Mar | Also anon | When you have a solid grasp of what it is you need to write, it usually ends up being easy to code as you mentioned. OTOH when you don't have a good grasp of what needs to be done it is then a drudgery. This has happened to me many times. A good attitude and perseverance are more important than the fickle, 'The first time I code something I got it right.' |
| Sun 02 Mar | sgf | Whnever I code something and it compiles AND runs correctly the first time I get nervous. I know I must have missed something..... |
| Sun 02 Mar | Greg | Strange how that happens. I was able to do to something like this. I think what happened is that I was just aware of each function/method's inputs and outputs. My thinking was just simpler, as if I stripped out all those extraneous thoughts that lead to confusion.
I can occasionally do this now in those little python utils I make for myself (right now I'm just studying) and the only time I'm tripped up is when I use one of those destructive functions that return nil. As you might be able to tell, I hate state destruction except as an optimization... |
|
| Why should Joel want your E-mail? | Sun 02 Mar | Vlad |
| Needless to say, that Joel is a crafty clever person. Somehow he wants all of our Emails to be registred in his database. Why? |
| Sun 02 Mar | Stephen Jones | So he can send you an email when he posts something interesting? |
| Sun 02 Mar | Eric Debois | ...so he can sell it to a spammer and make $100 and destroy his rep in one smooth move? |
| Sun 02 Mar | Joe Blandy | ... because there can never be enough conspiracy theories on the internet? |
| Sun 02 Mar | Li-fan Chen | Joel won't lose all of his reputations unless we (his readership) are really smart.
Hypothetically speaking, by selling the addresses to a generic 'Evil List Reseller'.. Joel will get his 100? dollars, but he has a good chance we'll never trace it back to him.
For example by not ID the list as
'interested in bug tracking software or software development software'
or
'interested in Human Computer Interface or User Interface Designs'
and by not making the mistake of sell them only closely related softwares--how can we tell the next optical mouse spam ad is made possible with Joel's help.
By carefully spam us with some generic ads or two it will add some serious doubt. And most of us have too little time to dwell on any single spam to take the analysis that far.
There are a few ways for you to trace a spam back to Joel should he ever decide to sell the list, here's one:
1. Use a dummy email address hosted on your SMTP server, it should never be used or seen by anyone, and it should be registered only at the mailing list JoelOnSoftware.com. If you start getting email on this dummy email address's inbox-Joel sold his soul to the devil. This dummy email address needs to point to a non-blocking, but non-replying, and perhaps auto emptying inbox and a report should be sent to the monitor on a monthly basis to indicate whether the list was sold or not.
You can automate this and use it at more than one site by setting up a auto email name generator:
two random letters to indicate first and middle name and concatted with a random known lastname or vise versa concatted to your email domain.
So
fcsmith@bigicecreamstore.com
etsmith@bigicecreamstore.com
An auto email name generator is not enough.. you have to then associate that with the list or site you are monitoring. One such site might be Joel on software. Make a web interface and you can start monitoring lists and sites offering any email subscriptions.
If you dope the list on a regularly scheduled period, you can even find out when the list was stolen or sold.
So fcssmith@bigicecreamstore.com was added to the list in October of last year
But etsmith@bigicecreamstore.com was added in March of this year..
etsmith was not spammed although fcssmith was spammed, there fore, the list was sold/stolen before March 2003 but after October 2002...
Some lists are carefully designed to lazily fight against this a bit.. but most are too busy spamming to notice. But one way you can be more anonymous is to use a few more domains or use a highly objectionable domain name. Like @eff.org.
I think this is how major corporations ensure their carefully collection list of company to subscriber relationships aren't being stolen by internal staff.
This is also how some anti-spam algorithms learn to differentiate a genuine spammer from a non spammer.
It's like throwing thousands of little rubber duck into the ocean with radio and tracking them :-) |
| Sun 02 Mar | Li-fan Chen | As a follow up... a lot of mailing list cleaning involves getting rid of inactive subscribers. Spammers don't do this, they want to spam you as many times as possible, the cost is so little after all.
But major corporates don't send email out the same way. They don't want to spam, they want to build a relationship. So they put a lot more effort into these emailings, using actual serious mailers and taking care of security, privacy and the personalization of the content. Each such email cost much much more, and the consequences of accidentally spamming due to a overzealous marketing drone is nothing short of a few major lawsuits and lots of lost of reputation. So what they do is clean lists often. The best way to clean a list and reduce cost is to get rid of non-interactive users. If you don't click on a HTML web email, you aren't being active. If you don't open a web email, you aren't being active. If your email server bounces for a significant number of time--you are being inactive. If you have asked to be on some big 'I don't need any spam anymore!!' clearing house--you are being inactive. Anyway, the point is.. the list cleaners will clean you off the list and you will no longer be getting anymore 'crap'--from those specific major companies anyway.
So if you want your rubber ducky to keep floating.. you'll actually have to write a robot to open these messages the way a real person would.. even click on those tracked links the way a real person would.. and perhaps.. even see the crazy pop-up ads like a real person would. An API like Perl::LWP should help you pull this off. |
| Sun 02 Mar | Dennis Atkins | It proves nothing if you get spam at that joel-only address if that address looks anything like a name. Spammers now send to every possible letter permutation they can think up that might make sense.
This is why my email addresses that are well guarded that look like:
dennis@megalocorp.com
get tons of spam, but
b29o1h3n@megalocorp.com
...gets NO spam.
[not real email addresses - for demonstration purposes only]
On the other hand, I use the name trick to see which charities sell my address and phone number to con artists:
'Hello, is this Pheadukits Atkins? You have won a free time share condo stay in Barbados!'
'Sorry, there is no one my that name here.' (Note to self - never trust 'Feed the Kids Inc.' again.) |
| Sun 02 Mar | Vlad | Let's make thing clear at this point: I never suspected Joel into being a spammer.
All I understood - Joel wants all of us to register with his mailing list. I think it's a real reason for asking us, to subscribe in order to get the last article.
I would not believe an actual reason: 'an article is too hot, to publish it for the masses'. One way or another, sooner or later it will leak to the masses. |
| Sun 02 Mar | David Clayworth | Why don't we wait for this article? From the excerpt published, it looks as though Joel is about to say something on the nature of online community (which would of course have an effect on the online communicty he hosts, hence the puzzling reference to Heisenburg effects). Maybe its an experiment on the nature of community using email, compared with community by discussion board.
Looking forward to that article. |
| Sun 02 Mar | Li-fan Chen | Dennis Atkins: awesome catch, it's true a SMTP visit can probably get away with sending a few bogus emails just to see which will actually make it through. If an SMTP server is too dumb it will actually reply back which bogus email is really real. A smart but cynical SMTP server should answer not so truthfully.
-- David |
| Sun 02 Mar | Geoff Bennett | Maybe Joel is doing it to reduce bandwidth costs for his service provider? If he posts the article on the website, a bjillion people will bang away at it costing a gazzilion dollars a minute in bandwidth for all the page loads. You sign up for an email -- and not everyone will because it crosses some people's 'care factor' boundaries when they have to enter their email address, and the rest are just paranoid -- and instantly a very succinct and deliberate group of people will receive the same article. If they want someone else to see it, they will have to forward it on (not actually permitted, if you read the blurb Joel wrote), but this won't cost Joel's provider an off-white cent.
Quite a simple and elegant solution, if you think about it.
That, or Joel is doing a study on email address user names to see which ones are the weirdest. |
|
| Python with C or C++? | Sat 01 Mar | Brian Hall |
| No, not a language war - chill :D
Rather, I have a question. I am presently taking up learning Python for my own edification (Im not a professional programmer, and dont plan on being one - though I might at some point be a project manager), and after I would like to learn C or C++ - however, I really dont understand at all how they are different.
So as the value of a tool is relative to what you wish to use it for, here is what my desire to do is:
I primarily want to learn Python for client-side programming, for use in quickly building a variety of applications (preferably that run fine on as many platforms as possible), but primarily for use with games. As such I would very much like to learn languages which are more suited for GUI client-side programming than Java is (I presently already know Java and PHP, and in Java I just find it...well, not really designed for what I want to do with it, as evidenced by the attrociousness of Swing/AWT), and be sufficiently speedy for such applications.
C/C++ obviously suggests itself, but from what I have learned of Python one can merely do the majority of the work and prototyping there, then simply rewrite code which is not sufficiently speedy - or which Python doesnt/cant do as well as C/C++ - in C/C++ without much of a problem.
So the only question is...I dont really understand what the difference is in C and C++. I know that both Python and PHP are written in C, and most games are written in C++, and most cross-platform programs it seems are written in C...but I just dont know why. Apparently a big part of C++s features are not multi-platform compatible (templates?)?
Would someone care to enlighten me to the nuances, and the ways in which one or the other is lacking or outstanding? Is there any reason Id actually want to spend any time learning C instead of/along with C++?
Also, have any of you done work using the C/C++ with Python combination? How did you like it, and do you think the project was better for having used both - aside from the natural problems of working with 2 different languages, anyway?
How in general do you like working in a higher level language, and only dropping down to a lower level to do some things that arent done as well in the higher level language? |
| Sat 01 Mar | Bored Bystander | On the distinction between C and C++: a good highly technical overview is Stroustroup's Annotated C++ Reference Guide.
C++ is C with object oriented features added - the whole notion of classes, for instance. A C++ class is actually derived (intellectually speaking) from the C 'struct' which is the record structure. If you know C++ you automatically know C, at least as far as nuts and bolts goes.
The main difference between C++ and some other object oriented languages is that C++ is 'bound' at compile time. C++ was designed to have no appreciable overhead in terms of run time efficiency, beyond the extra indirection of virtual methods. You can't decide to call a method by a name only known at run time in C++, for instance.
>> How in general do you like working in a higher level language, and only dropping down to a lower level to do some things that aren't done as well in the higher level language?
I personally don't. Calling one language's procedures from another is tedious monkey work because you generally have to establish a calling prototype in the language you call from. This can add a lot of time and effort to a project if the quantity of such calls is widespread, unless you have automated tools to create the declarations or proxies in the calling language.
This is why I have gravitated to Delphi. It is a true compiled language with the efficiency of C++ and allows you to create new components compatible with the Delphi forms designer in the same language that the applications are written in. With Delphi there is little hassle involved in writing extension components or inheriting and modifying the base behavior of existing classes.
(I expect someone with a huge chip on their shoulder to come out of the woodwork and disparage each and every thing I've stated... talking about C++ and other languages is like that... let the flames begin... LOL) |
| Sat 01 Mar | | If you intend to code a game then you will want to learn C/C++. The reason(s) for this are:
1. DirectX and OpenGL, the two most popular game graphics platforms, are C/C++ libraries.
2. C/C++ are systems languages. The system you code your game on will likely have been written in C/C++ and assembly. Thus coding your game in the native environment will be easier.
3. Depending on your chosen game platform, you will most likely only have C/C++ as an option. Especially for console games.
4. IMO C/C++ are elegant languages and, when coding games, you'll need this elegance to work some of the problems you will encounter. (Don't take elegance to mean bad coding practices.)
5. Although possible, interfacing another language with native C/C++ code is a hassle if you're not familiar with things like calling conventions, stack frames, data type conversion etc.
6. As far as learning C versus C++, I would say get a good book on C++. As mentioned C++ includes C. No pun intended. Be aware though, learning C and C++ is (somtimes) easy on the surface, but knowing what is happening behind the scenes takes experience. |
| Sat 01 Mar | Dennis Atkins | Is jumping straight into C++ with the ARM really the way to go? Is there someone who actually started out programming this way?
Seems tough - the ARM is a tough read. And C++ is full of ... subtleties. (Effective C++ by Meyers is where to get started finding out about these subtelties.)
I use C and C++ (have never coded in C/C++ as that's not a language) a lot I see them as two very different things that require very different approaches, even though they share many things.
Anyway the comments about libraries are true - most libraries are going to require access through C or C++.
To learn C, I always recommend the K&R as it is a tutorial. But then don't miss 'C Traps and Pitfalls' and 'Deep C Secrets' to get the full mastery of C.
Once you feel good with C, start in on C++ if you like. I suggest a wary approach, cautiously adopting just a little C++ at a time and adding to it. Designing your own template library, for example, is pretty hard core and should not be attempted right off. As is weaving in exceptions into everything you do. |
| Sat 01 Mar | JD | >> 'have never coded in C/C++ as that's not a language'
Dennis, I'm sure an intelligent man such as yourself could deduce that the poster meant C and/or C++ and was using the / as shorthand notation. Then again some of the most intelligent men do lack common sense. |
| Sat 01 Mar | Dennis Atkins | JD,
I believe it was Stroustroup himself who made the point that 'C/C++' is not a language in some recent articles he wrote on the work to reunify C & C++. Many people do believe that 'C/C++' is a language and list it on their resumes as such. |
| Sat 01 Mar | Dennis Atkins | And wouldja look at this I even found the dang quote thanks to the miracle of google:
http://www.cuj.com/articles/2002/0208/0208c/0208c.htm?topic=reference&topic=refernece
>Modern C [1, 2] and C++ [3] are sibling languages [4, 5] descended from Classic C [6]. In many people’s minds, they are (wrongly, but understandably) fused into the mythical C/C++ programming language. There is no C/C++ language, but there is a C/C++ community. In last month’s CUJ, I described some of the incompatibilities that complicate the work of developers within that C/C++ community. In this article, I’ll discuss some of the underlying myths that help perpetuate these incompatibilities. I’ll also show why more compatibility (ideally, full compatibility) is in the best interest of the C/C++ community. Next month, I’ll present some examples of how the incompatibilities in C and C++ might be resolved.
Heh heh. It's an insider thing. You'd know about this if you were down with C++. :-P |
| Sat 01 Mar | Dennis Atkins | Oh and Brian, read that article for a great overview of some of the big issues. |
| Sat 01 Mar | JD | >> 'I believe it was Stroustroup himself who made the point that 'C/C++' is not a language in some recent articles he wrote on the work to reunify C & C++. Many people do believe that 'C/C++' is a language and list it on their resumes as such.'
Stroustroup appears to be a nitpicker who needs a life.
Anyone who lists 'C/C++' on their resume and believes that the term is a language, is a liar. Then again a lot of people seem to lie on their resumes now-a-days.
A little common sense goes a long way. If a person can't look at 'C/C++' and read it as 'C and/or C++' then they must be a self-righteous perfectionist. |
| Sat 01 Mar | Bored Bystander | Yup, I missed a few things:
DEFINITELY learn 'Modern' C at least. C is the lowest common denominator for almost all programming libraries and APIs. I agree and I didn't mention this and it didn't occur to me when I posted earlier. (I am assuming that Modern C means classic K&R C with optional, not mandatory function prototypes and a few other modern constructs? Classic K&R C was an almost typeless junk language... oh boy, let the flames begin NOW... heh)
The ARM is a reference book. Using it to learn C++ would be like using a dictionary to learn English (well, almost.) I mentioned it as a 'root document' that, in theory, you could use as a reference to the scope and major features of the C++ language.
I've read Scott Meyer's Effective C++ and it's a short, insightful, conversational book with a lot of great examples of OOP nuance applied to C++. I'm not certain that it's a good first book on C++ because it assumes that you kind of know the syntax and the reason for things in C++. Effective C++ is a great read for someone who understands C++ nuts and bolts and wants to understand why and where to use language features in real projects.
Also agreed that bitching about C/C++ as an proper noun denoting a language is the height of anality. Anyone but a technical recruiter knows what the phrase is intended to mean. |
| Sat 01 Mar | Dennis Atkins | Stroustrop advises learning C++ first BUT learning the C-like part of C++ that is used for procedural programming:
http://www.research.att.com/~bs/learn.html
I think his advise is similar but better than mine to just learn C first. I also agree with what he is saying that tackling classes an inheritance after learning the procedural core makes sense.
-
I agree that Effective C++ is an intermediate level book, but once you know the procedural core and the basic syntax of classes and inheritence, you should get the book and start trying to understand it since it condenses the gist years of hard won best practices and outlines traps and pitfalls in C++ usage.
If you think you are competant in C, Effective C++ is the standard by which to judge yourself.
If you think you are an guru/expert, Sutter's Exceptional C++ books might be the standard to check. Many things in there are way too high level for me and essentially show that C++ is far too convoluted and complex and filled with bizarre unexpected behavior for mere mortals to master. It's the language we love to hate.
-
Yeah, Bjorne's being an anal blowhard. And yet, it's kind of a funny insider thing. I have noticed that after his article came out, I started to see 'C,C++' appear on resumes instead of 'C/C++'. These comma people are folks that had read the article and proved to keep up with all the subtleties of C++. But... like whatever, dudes! |
| Sat 01 Mar | Dennis Atkins | Bored,
Right - when I said K&R I meant the 2nd ed., which is ANSI C, which differs from Standard C. I think the early C that is the essentially typeless language you are thinking of is B. Standard C has types. The latest and greatest now is C99, which is ANSI C with some useful extensions and a couple frivolous ones. One obvious and useful part of C99 is to admit that line-comments (//) are part of C since every modern compiler accepts them in C already. |
| Sun 02 Mar | Danil | In my experience, anybody with C/C++ on their resume doesn't know either (the code they generate cannot be compiled with a C compiler, but the code derives very little benefit from the overhead that C++ brings to the table). C++, in particular, is HARD.
Best C++ intro book is Koenig _Accelerated C++_. It's probably the best starting point after you've been coding in python for a while. After that, if you still think C++ is a good idea, pick up Meyers I.
There are efforts for easing the interaction between Python and C++; see the folks over at boost.org. I'm not aware of a similar effort for C.
As a professional programmer, my advice... well, all learning is good, so if these big rocks look interesting, by all means go ahead. But I bet there are better uses for your time. Python rocks.
Another idea: Pick up the Abrash Graphics Black Book. Because (1) if you really cared about speed, you'd write it in assembler anyway ;-) (2) it will teach you about a lot of optimizations available without changing your implementation language. |
| Sun 02 Mar | Bored Bystander | >> I think the early C that is the essentially typeless language you are thinking of is B. Standard C has types.
C in the pre-function prototype days let you do weird things with no complaint, like use ints in place of pointers. Yes, K&R C had types so to speak but they were so non-enforced that you might as well have had no types, just int assumed for everything that wasn't a struct.
BTW, is lint still around? Do people still use it? |
| Sun 02 Mar | | Lint is still around. It is available at Programmers Paradise I think. Remember the adds that would give a code example then they would ask you to figure out why the code broke? Do I use it? I would if I could. |
| Sun 02 Mar | Bic Pen | >> 'if you really cared about speed, you'd write it in assembler anyway ;-)'
Not a true statement. |
| Sun 02 Mar | John Moore | Firstly, It's good to see more people take up a higher level (more productive) language.
Secondly, C++ is extremely complex, to learn the entire language. In comparison, C is quite simple.
I advise you learn C (everyone should know C), and only C++ if it is required. |
| Sun 02 Mar | Andrew Reid | People who put 'C/C++' on their resumes are probably doing it for the benefit of recruitment agents (who don't understand that knowledge of C++ implies knowledge of C). |
| Sun 02 Mar | Li-fan Chen | If you really want to produced games, with 2D it looks that there's few learning curve as patient as Flash 5 and 6. With a web service behind the Flash applet, you can get a lot of online gaming concepts implemented. |
| Sun 02 Mar | Li-fan Chen | Someone mentioned Koenig's book. 'Accelerated C++' is an excellent way to learn the subset language I think of as 'broken c++'.. (like broken english).
Basically it will show you enough C++ to get around and do your work in most day to day small applications. From there you just have to figure out an environment like Visual C++ 6.0 or GNU C++ to get around. There will be days you wish you had a 12 years C vet around to help you around a serious problem.. but most of the time you'll make do with this and a few other books. |
| Sun 02 Mar | doobius | learn C then C++
and use this www.pygame.org
python is a very popular language for game logic with C or C++ where speed is need for rendering etc.
pyugame uses SDL , http://www.libsdl.org/index.php, which is written in C but works great with C++, just like python. |
|
| Not Programming | Sat 01 Mar | Justin |
| Quick poll: What is the single favourite humour site you visit regularly when youre supposed to be working?
Mine is http://www.dilbert.com . As an aside if you also visit this, did you use the List Of The Day, before it was removed (I ask, because some of names here look spookily familiar)? |
| Sat 01 Mar | Prakash S | I get Calvin & Hobbes delivered to my inbox, other than that watching the markets is always a joke :-) |
| Sat 01 Mar | Patrik | Dilbert
...and if Im bored, I havent read all goodies at
www.satirewire.com |
| Sat 01 Mar | Vincent | I don't visit often but
http://www.despair.com/
is quite amusing. |
| Sat 01 Mar | Robert Chevallier | morning ritual at work:
http://www.dilbert.com
http://www.somethingpositive.net |
| Sat 01 Mar | Bella | www.theonion.com is the most clever humor you will ever encounter in your life. |
| Sat 01 Mar | Bella | http://www.theonion.com |
| Sat 01 Mar | anonymous | http://www.homestarrunner.com |
| Sat 01 Mar | Nick H | Gotta give a plug for Dave Barry's blog - http://davebarry.blogspot.com/ |
| Sat 01 Mar | John McQuilling | sharktank at computerworld.com. Crazy things that have happened in the industry. |
| Sat 01 Mar | Hardware Guy | Three consistenty-funny sites:
The Onion (mentioned above)
Dave Barry's Blog (also mentioned above)
Fanatical Apathy, which you can find at:
http://felbers.net/mt/ |
| Sat 01 Mar | Tim Sullivan | http://www.somethingpositive.net
http://www.smallstoriesonline.com
http://www.brunocomic.com
http://www.penny-arcade.com
That's my usual bunch. There are others (megatokyo, for instance) that I read on and off, but something positive is the main one I use for pure, dark laughter. |
| Sun 02 Mar | Tim Sullivan | Whoops, that should be:
http://www.brunostrip.com |
| Sun 02 Mar | bored developer | www.fark.com
The photoshop threads are very amusing. |
| Sun 02 Mar | Neil E | www.b3ta.com |
| Sun 02 Mar | David Clayworth | I thought there were no new Calvin and Hobbes strips for years? If that's not true, please, please, tell me where I can find them. |
| Sun 02 Mar | Ricardo | www.userfriendly.org |
|
| a third place | Sat 01 Mar | Victor Lombardi |
| As an information architect in New York, I was a little jealous of my colleagues in Silicon Valley that all seemed to know and hang out together. Whenever someone tried to start an IA gathering at a third place in NY it lost momentum quickly. Few companies in this economy are willing to host professional meetings, and there arent many cafes with space and quiet enough to have serious chats.
I instead started an IA Salon - called a salon as we meet in someones home. Details: http://www.iawiki.net/IASalon Its been continuing nicely once per month for about 9 months now.
So for us, the successful third place is our homes, but our homes shared with others. |
| Sat 01 Mar | Brian R. | Hate to rub it in, but that is one nice thing about California. I knew a group of about 15 people that play at a pizza place one night a week, when that closes, they go to the donut shop 100 ft. away.
Never been to N.Y. Yeah, there is a lot of room out here. I live in Greater L.A. area. |
| Sat 01 Mar | Kevin Postlewaite | As someone who lives in the Bay Area (CA), I was surprised to see Joel mention it as a place supposedly particularly lacking in 'third places'. Yeah, there are a lot of people who moved out here after college (like me, e.g.). It turns out, though, that these are almost the exact people who have interests in common with me. There are tons of 'third places' out here. Personally, I regularly attend a gaming group that met multiple times a week and sometimes drew more than 20 people. And there are a lot of outdoors-y groups too. There aren't a lot of places with such a high density of smart, interesting people as the Bay Area. |
| Sat 01 Mar | John C. | I think the availability of potential 'third places' varies tremendously by neighborhood. And one of the things about mostly suburban areas is that, while third places may exist, it can be hard to find them unless you know exactly where to look. The best way to know where to look is to ask local experts, but if you're new to an area and have few friends, that can be tough, especially for people who lean toward introversion in the first place.
I live in Seattle now, and I see a huge contrast between the availability of these kind of places in different areas. I live right in the city, and within walking distance there are a number of non-franchise coffee places that encourage prolonged stays, local pubs that offer regional microbrews, etc. Lots of options for third places that you can find just by walking around for a few minutes. But over on the Eastside, in Microsoft's neighborhood, it's a different story entirely. It's not really pedestrian-friendly, and you can get in your car and drive around for hours trying to find an interesting place to hang out. That's not to say that suitable third places don't exist at all, but I suspect they're either vastly fewer in number or just much harder to locate.
I've found the Bay Area to have similar variation. In certain areas, like parts of SF itself, Berkeley, and so on, finding third places is no problem. In other places, like much of the Valley, they exist but you have to search around a bit. If your daily commute is from a gigantic planned housing development in San Jose, up 101, and along some arterial into a monotonous office park, you sure won't see a lot of potential third places along the way. |
| Sat 01 Mar | Alberto | It's a bit of a chicken and egg situation, have the 'third places' disappeared because nobody wanted them anymore, or did they disappear becuse as Joel says 'capalist society has eroded' them all?
I think people are slowly turning back on to the knowledge that people generally have always needed other people to maintain a quality standard of life, meaning that interaction with others is a great source of pleasure and offers a feeling of belonging.
(I think I need grammer lessons)
The last 30 years of work has bought great social change, most of us are far richer than we would have been in previous lives, but it has come at a cost, maybe we're not prepared to sacrifice our sense of community afterall. |
| Sat 01 Mar | mackinac | >>> I think people are slowly turning back on to the knowledge that people generally have always needed other people to maintain a quality standard of life, meaning that interaction with others is a great source of pleasure and offers a feeling of belonging. <<<
Or it can be a source of pain and offer a feeling of exclusion.
I grew up in a house with a porch. People knew their neighbors, but I don't remember people stopping by to sit on the porch and talk. Third place interaction tended to be at places such as churches. Now I live in a big condo building. I know a few of my neighbors and am familiar enough with many of them to say hello when passing in the elevator or at the grocery store. But most of my third place interaction is at a couple of community organizations I belong to. And they are too far to walk to. Not much different from the good old days.
On line communities based on maillists or discussion boards are a recent phenomenon, but one where I see significant advantages even if you don't have in person interaction. They give one more control over those interactions and offer the possibility of maximizing the pleasure/pain ratio.
By increasing our area for potential interaction from our physical neighborhood to the entire on-line population we increase the possibility of finding others of common interest.
By limiting interaction to text messages we can reduce the potential for exclusion from the group based on prejudices against the class of people we happen to belong to.
I have noticed that some maillist or USENET online communities have evolved to the point where participants decide to meet in real life (e.g RABfests). |
| Sat 01 Mar | Dennis Atkins | There are places in the bay area where stuff is happening but they are not near downtown. Downtown is totally dead after 10pm unless dingy coffee shops and preteen transvestite hookers are your third place. |
| Sun 02 Mar | n | Right next door to me here in Cologne, some lisp guys are meeting once a month. (Perhaps to take back computing.)
I think the dotcom implosion ensured that only the crazy ones stay in informatics. So meeting is more worthwhile now.
Offtopic, to the original poster: don't you note that people have a hard time working with you when by extension they're just 'knowledge workers' to your Information Architect? I guess we don't have to veer offtopic though... |
| Sun 02 Mar | Victor | RE>Offtopic, to the original poster: don't you note that people have a hard time working with you when by extension they're just 'knowledge workers' to your Information Architect?
Not sure what you mean. I actually started the group because the level of conversation in electronic forums was rather low, and I (and, as it turns out, we) wanted to pursue more in-depth issues. That also became a factor in who was invited to the salon. If that sounds - as I think you're implying - elitist, then maybe it is. But it's highly satisfying and doesn't keep us from sharing what we learn in other forums with other people, which we do.
btw, Information Architecture is becoming a fairly well-established discipline, this isn't just me with a pretentious title :-) see http://www.aifia.org/ |
| Sun 02 Mar | B# | I have to ask... What is Asilomar? |
| Sun 02 Mar | n | No, I wasn't implying you were elitist. Rather, I was thinking about some esteem problems I've observed, from east coast people who reacted to that term 'information architect.' No criticism intended. ;) |
|
| Handling Errors | Fri 28 Feb | RM |
| I have seen excellent books on Design Patterns, Debugging, Refactoring, Development Mythologies, User Interface Design, Team/Code Management. But I dont know any books about handling errors. I have done Google and Amazon search but no luck.
Any recommendation ? |
| Fri 28 Feb | Go Linux Go! | What language? I know that there are general guidelines on handling errors, but any detailed text is going to use a specific language since error handling varies from language to language. |
| Sat 01 Mar | Go Linux Go! | FWIW, I did a search on Amazon for 'Exception Handling' and got 3 results. One is handling errors in ASP.NET, 1 in Java and one appears to be a collection of computer science notes on the topic. |
| Sat 01 Mar | Joel Spolsky | There's a whole O'Reilly book about developing error messages:
http://www.oreilly.com/catalog/error/ |
| Sat 01 Mar | Liron Levy | At the risk of starting a flaming war here are my
guidelines:
1) Avoid exceptions like the plague - never throw them, only catch them (and translate to a decent error object). I know all OOP gurus will not like what I say, but I think the world would be a little better place without them :-)
2) Use a general result object and make every method return this object by default.
3) Every result object should contain the following fields: error code (used by the software to determine behavior), error string (used by humans to understand the failure), and extra data (e.g., Object in Java) that can contain additional information you want to pass with the result (like the result of a calculation).
The point on exceptions needs a little more explanation: The problem with exceptions is that you cannot always expect them in code - in such a case they make the thread of execution terminate which makes your software extremely unreliable. In C++ you cannot even KNOW if you need to use a proper try/catch clause when calling a method. In Java you sometimes know (non-Runtime exceptions) and sometimes you don't. At least when using result objects you can ALWAYS check the result and the thread does not terminate if you don't.
If you want some real examples - drop me an email and I'll send you an example.
Good luck |
| Sat 01 Mar | Dennis Atkins | Bless you Levy!
Listen up to this gentleman everyone! At last someone who understands! |
| Sat 01 Mar | Alyosha` | Liron: maybe it's my inexperience talking, but ... WTF?
I love how Java handles exceptions (by putting the throwable exceptions in the method signature and kicking out compiler errors if they aren't handled). It actually forces you to consider the possible exceptional conditions. There's nothing about checking error codes by hand that encourages the programmer to (a) recognize that the function may fail and (b) do something intelligent with the failure.
(It's true that subclasses of RuntimeException need not be handled, but everyone knows RuntimeException should be used sparingly and for unrecoverable exceptional conditions anyways).
You'll be fighting an uphill battle trying to ensure that every function is checked for errors, and even if you were to manage that, nine times out of ten your error handling will be going to be no more sophisticated than to print the error message and terminate, which is what exceptions do by default anyways.
After all, if the coder didn't expect the exception, what else is he going to do with it?
If what you want to do is print the error message and continue on regardless of the consequences of the unforseen error, you might as well wrap your function up into one big try-catch block, than try to add error checking to each one of the fifty function calls.
And in the case that the coder actually handled the error-checking intelligently, he must have already known what kinds of exceptional conditions could crop up, in which case your objection 'but you don't know what to expect' makes no sense.
So what does your solution do besides create code bloat and inviting difficult to debug 'oops-I-forgot-the-error-checking' defects?
I don't mean to start a flame war or anything, but I genuinely don't see any advantage of your method. |
| Sat 01 Mar | Dennis Atkins | If I had a dollar for every kiosk, billboard and website that unhelpfully tells the average customer that the computer has crashed on an unhandled Java exception, I could buy a lot of coffee. That's the deal. If this stuff is so great, how come the Big Guys can't get it right? |
| Sun 02 Mar | Alyosha` | That sort of comment is unverifiable/unfalsfiable. Do you have some quantifiable measurements of whether unhandled Java exceptions are more common than undetected errors in programs that manually check error codes?
I'm certainly no researcher, but I really haven't seen many production-quality commercial applications throw Java exceptions. I've never seen one of these bombed kiosks or billboards you've mentioned (although I've seen lots of BSODs in airport terminals) ...
Okay, I'll admit that I've seen a lot of unhandled Java exceptions in web applets, but then again Java applets aren't the highest quality code out there, either. |
| Sun 02 Mar | RM | Liron Levy:
When I was doing my internship, I was once told by a senior developer that Exceptions are not always the best idea, (though they did not really have any alternative), I was never convinced until now. I thank you for your explanation.
I thought of a similar idea as you suggested. Basically, every object knows how to handle and propagate errors. For example, Suppose Object A instantiates Object B,C,D. If B,C and D report errors to A, then A will translate these errors to an error in terms of its operations. (ie, if B reports DividedByZeroError, A might translate it into “OutOfBoundValueError”) And finally report it back to its predecessor. Recursively, objects at higher level will have better understanding of what went wrong beneath without too much detail.
The main difference between yours and mine is that mine is done by having an Error-Handling method in each object, instead of every method returning “a general result”. But I am neither convinced of my own, simply because I am inexperienced and have not seen/read much about handling errors. One reason why I am looking for a good book about handling error in general.
Anyway, I thank you everyone for your inputs.
PS: When I say “Errors”, I meant all kind of errors; Run-Time, Application, Calculation, Fatal, UnHoly, System, Missing-XYZ, Incomplete, Math, Floating-Point etc. |
| Sun 02 Mar | n | Hmm, your description of 'result objects' is interesting, but I've never heard of them before and google turns up nothing. Is there a book which talks about this, or perhaps a language where this is assumed?
By the way, in Java, using a runtime exception thoughtlessly is very bad form. |
| Sun 02 Mar | Walter Rumsby | I have to say 'WTF' too.
If your code never throws Exceptions, only catches them, what is there for the code that uses your classes (and not standard/3rd party APIs) to catch?
You suggest using a general result object and make every method return this.
Hmm. Doesn't the make your API slightly less clear? I never like the idea of setters returning results.
This result object you propose contains an error code (why not just use a specific type of Exception?), and error String (why not throw new XException( errorString );?) and an actual return value... maybe, f the method is ACTUALLY supposed to return something. This technique just seems to make the result of a method call a lot less clear - all your methods are returning ResultObject, and not the 'actual' return type (eg. you can easily tell from the method signature when you want to use public Date getDate() vs. public long getTime()). And what if you're implementing some language/standards defined interface that does not use the ResultObject idiom?
Furthermore, the ResultObject framework may create hassles when integrating your code with another program (eg. using your code as a .jar to another program). Instead of using a language feature to convey error information, you're using your own solution with the associated overhead (extra lines of code, other developers needing to get up to speed, possibility of having to mix methods that return ResultObjects AND throw Exceptions). |
| Sun 02 Mar | Liron Levy | I was talking out of heavy experience working with exceptions. I'm really convinced they are bad (always).
Some of you suggested that it is a 'bad' idea to throw
runtime exceptions. Cool - but the JDK itself did that for
me more times thn I care to remember ...
If the guys at Sun did such a lousy job - I think it means something ...
Another point - Most commercial libraries I happened to
work with did not use exceptions at all (e.g., ILOG) just
because of the problems involved.
Someone here said that returning a result object is not a very
'Clear' way as this is not enforced by the software.
My answer to this is simple - define coding guidelines and
enforce THEM (you have to do this anyway).
Good Luck |
Sun 02 Mar | Liron Levy | For those who are interested I've pasted the code for
the implementation of this idea:
There are two files: NMEresult.java that contains the code
for the result object, and NMEerrcode.java that contains the code for the error codes.
[----------------------- NMEresult -----------------------]
package nme.base;
// Needed in order to allow instances of NMEresult to travel
// process boundaries.
import java.io.Serializable;
/**
* Defines the general result of performing NME requests.
* It should be used by all NME system modules. The result
* encapsulates an error indication and description in the
* case the request performing was not successful or
* the result data if the request has succeeded.
* Note that the implementation is not synchronized. In most cases
* the result object will be first fully constructed by one thread and after
* that it will be used by another one. Anyway, if multiple threads access
* a result concurrently and at least one of them modifies it, the
* access must be synchronized externally.
*/
public class NMEresult
implements Serializable
{
// ----------------------------------------------------------
// public enumerations
// ----------------------------------------------------------
/** Error message for the case of illegal error code. */
public static final String ILLEGAL_CODE_ERR_MSG =
'The error cannot be resolved, the error code is illegal';
// ----------------------------------------------------------
// public methods
// ----------------------------------------------------------
/**
* Constructs a successful result object with neither associated
* request identifier nor any result data.
*
* @see #NMEresult(int, Serializable)
*/
public NMEresult()
{
initialize(NMEerrcode.E_SUCCESS, null, null);
} // NMEresult
/**
* Constructs a successful result object with given result data.
*
* @param extra_data the additional result data. The given
* reference is stored, no cloning is performed.
* @see #NMEresult(int, Serializable)
*/
public NMEresult(Serializable extra_data)
{
initialize(NMEerrcode.E_SUCCESS, null, extra_data);
} // NMEresult
/**
* Constructs a result object with given error code and provided
* error message. The extra data field is left unspecified.
*
* @param err_code the code of the error.
* @param err_msg the problem description. If is null,
* the standard description is used.
*/
public NMEresult(int err_code, String err_msg)
{
initialize(err_code, err_msg, null);
} // NMEresult
/**
* Constructs an erroneous result object with given error code
* and standard error description. The extra data field is left
* unspecified.
*
* @param error_code the code of the error.
* @see #NMEresult(int, String, int, Serializable)
*/
public NMEresult(int error_code)
{
initialize(error_code, null, null);
} // NMEresult
/**
* Constructs an erroneous result object with given error code,
* description and additional data.
*
* @param error_code the code of the error.
* @param error_msg the problem description. If is null,
* the standard description is used.
* @param extra_data the additional result data. The given
* reference is stored, no cloning is performed.
* @see #NMEresult(int, String, int, Serializable)
*/
public NMEresult(int error_code,
String error_msg,
Serializable extra_data)
{
initialize(error_code, error_msg, extra_data);
} // NMEresult
/**
* Checks if the given result is successful.
*
* @return true if the result is successful;
* false otherwise.
*/
public boolean isSuccess()
{
return (m_ErrorCode == NMEerrcode.E_SUCCESS);
} // isSuccess
/**
* Returns the code of the error associated with the result.
*
* @return the result error code.
*/
public int getErrorCode()
{
return m_ErrorCode;
} // getErrorCode
/**
* Defines the error code and standard problem description for the result.
* Use {@link #setErrorMsg} method later for redefining the
* error description to non-standard.
*
* @param error_code the result error code.
*/
public void setErrorCode(int error_code)
{
// Set the error code.
m_ErrorCode = error_code;
// Set the error message, using the standard description.
m_ErrorMsg = getStandardErrorDescr(m_ErrorCode);
} // setErrorCode
/**
* Returns the description of the error associated with the result.
*
* @return the result error description.
*/
public String getErrorMsg()
{
// If the error message is set for the result, return it.
if (m_ErrorMsg != null)
return m_ErrorMsg;
// The error message is not set, return the standard
// description, according to the result error code.
// We should not actually get here, because the error
// message is always set according to the code. The case
// is possible only if the message was explicitly set to null.
return getStandardErrorDescr(m_ErrorCode);
} // getErrorMsg
/**
* Defines the error message of the result. The message is set
* exactly to the given string (even if it is null).
* No changes are performed in order to make is suitable to the
* result error code.
*
* @param error_msg the problem description.
*/
public void setErrorMsg(String error_msg)
{
m_ErrorMsg = error_msg;
} // setErrorMsg
/**
* Assigns standard error description to the error
* message of the result.
*/
public void setStandardErrorMsg()
{
m_ErrorMsg = getStandardErrorDescr(m_ErrorCode);
} // setStandardErrorMsg
/**
* Appends given string to the currently defined error message of the
* result.
*
* @param error_msg the string to be appended.
*/
public void appendErrorMsg(String error_msg)
{
if (error_msg != null)
{
StringBuffer new_description = new StringBuffer();
if (m_ErrorMsg != null)
new_description.append(m_ErrorMsg + ', ');
new_description.append(error_msg);
m_ErrorMsg = new String(new_description);
} // if
} // appendErrorMsg
/**
* Returns the additional data associated with the result.
*
* @return the additional result data.
*/
public Serializable getExtraData()
{
return m_ExtraData;
} // getExtraData
/**
* Defines the additional data associated with the result.
*
* @param extra_data the additional result data to be stored.
*/
public void setExtraData(Serializable extra_data)
{
m_ExtraData = extra_data;
} // setExtraData
/**
* Generates a string representation of the result. It indicates
* if the request has failed or succeeded and gives the error
* description or resulting data representation respectively.
*
* @return the string representation of the result.
*/
public String toString()
{
// String representation parts.
String header;
String error_msg = null;
// The flag shows if error information is needed.
boolean add_error_info;
// Temporary buffer for creating the resulting string.
StringBuffer buf = new StringBuffer();
// Constract the header of the string and check if the
// error info should be retrieved.
if (m_ErrorCode == NMEerrcode.E_SUCCESS)
{
header = 'The request succeeded';
add_error_info = false;
}
else
{
header = 'The request failed';
add_error_info = true;
error_msg = getErrorMsg();
} // else
// Actually create the string.
buf.append(header);
if (add_error_info)
{
buf.append(': error code = ' + m_ErrorCode);
buf.append(' [' + error_msg + ']');
}
if (m_ExtraData != null)
{
buf.append(', result data = ' + m_ExtraData);
}
return (new String(buf));
} // toString
// ----------------------------------------------------------
// private methods
// ----------------------------------------------------------
/**
* Initializes the request object with given values.
*
* @param error_code the code of the error.
* @param error_msg the string that describes the problem. If is
* null, the standard description is used.
* @param extra_data some additional result data. The given
* reference is stored, no cloning is performed.
*/
private void initialize(int error_code,
String error_msg,
Serializable extra_data)
{
m_ErrorCode = error_code;
if (error_msg != null)
{
m_ErrorMsg = error_msg;
}
else
{
m_ErrorMsg = getStandardErrorDescr(m_ErrorCode);
}
m_ExtraData = extra_data;
} // initialize
/**
* Returns the standard error description for the error with a given code.
*
* @param error_code the code of the error.
* @return the standard description of the error.
*/
private String getStandardErrorDescr(int error_code)
{
String error_descr;
// Compute the error range to which this error code belongs
int err_range = error_code / 100;
// Compute the index in the error range of the error code
int err_index = error_code % 100;
// Make sure that the description table can address this description
try
{
error_descr =
NMEerrcode.ALL_ERR_DESCRIPTIONS[err_range][err_index];
}
catch (Exception e)
{
// The error code is illegal, return the appropriate
// error message.
error_descr = ILLEGAL_CODE_ERR_MSG;
}
return error_descr;
} // getStandardErrorDescr
// ----------------------------------------------------------
// private variables
// ----------------------------------------------------------
/** The code of the error. */
private int m_ErrorCode;
/** The error message with exact problem description. */
private String m_ErrorMsg;
/** Some additional result data. */
private Serializable m_ExtraData;
} // NMEresult
[-------------------- END OF NMEresult -----------------------]
[-------------------- START OF NMEerrcode ------------------]
package nme.base;
import com.outbackinc.services.protocol.snmp.*;
/**
* Defines global error codes and their standard descriptions for
* all NME system modules.
*/
public class NMEerrcode
{
// ----------------------------------------------------------
// STANDARD ERROR CODES
// ----------------------------------------------------------
/** Success. */
public static final int E_SUCCESS = 0;
/** Indicates that the client is not permitted to invoke the request. */
public static final int E_PERMISSION_DENIED = 1;
/** Indicates some unexpected software error occurred. */
public static final int E_INTERNAL_SOFTWARE_ERROR = 2;
/** Indicates a timeout problem */
public static final int E_REQUEST_TIMEOUT = 3;
/** Indicates that the software was requested to change
into an illegal state */
public static final int E_ILLEGAL_STATE = 4;
/** Indicates that there is security model failure. */
public static final int E_SECURITY_MODEL_FAILURE = 5;
// ----------------------------------------------------------
// SNMP ACCESS MODULE ERROR CODES
// ----------------------------------------------------------
/** Indicates a 'No Such Name' SNMP error */
public static final int E_SA_NO_SUCH_NAME = 100;
/** Indicates a 'Authorization Error' SNMP error */
public static final int E_SA_AUTHORIZATION_ERROR = 101;
/** Indicates a 'Unknown IP Address' SNMP error */
public static final int E_SA_UNKNOWN_IP_ADDRESS = 102;
/** Indicates a 'General' SNMP error */
public static final int E_SA_GENERAL_ERROR = 103;
/** Indicates a 'Bad Value' SNMP error */
public static final int E_SA_BAD_VALUE = 104;
/** Indicates a 'No Access' SNMP error */
public static final int E_SA_NO_ACCESS = 105;
/** Indicates a 'Inconsistent Name' SNMP error */
public static final int E_SA_INCONSISTENT_NAME = 106;
/** Indicates a 'Incosistent Value' SNMP error */
public static final int E_SA_INCONSISTENT_VALUE = 107;
/** Indicates a 'Resource Unavailable' SNMP error */
public static final int E_SA_RESOURCE_UNAVAILABLE = 108;
/** Indicates a 'Not Writable' SNMP error */
public static final int E_SA_NOT_WRITABLE = 109;
/** Indicates a 'Wrong Type' SNMP error */
public static final int E_SA_WRONG_TYPE = 110;
/** Indicates a 'Wrong Length' SNMP error */
public static final int E_SA_WRONG_LENGTH = 111;
/** Indicates a 'Wrong Encoding' SNMP error */
public static final int E_SA_WRONG_ENCODING = 112;
/** Indicates a 'Wrong Value' SNMP error */
public static final int E_SA_WRONG_VALUE = 113;
/** Indicates a 'No Creation' SNMP error */
public static final int E_SA_NO_CREATION = 114;
/** Indicates a 'Too Big' SNMP error */
public static final int E_SA_TOO_BIG = 115;
/** Indicates a 'Commit Failed' SNMP error */
public static final int E_SA_COMMIT_FAILED = 116;
/** Indicates a 'Undo Failed' SNMP error */
public static final int E_SA_UNDO_FAILED = 117;
/** Indicates a 'Unknown request or data type' SNMP error */
public static final int E_SA_UNSUPPORTED_TYPE = 118;
/** Indicates that there is no data about the request. */
public static final int E_SA_NO_DATA = 119;
// ----------------------------------------------------------
// DEVICE ACCESS MODULE ERROR CODES
// ----------------------------------------------------------
/** Indicates that the operation has failed because the i
in the device access data structure. */
public static final int E_DA_NOT_FOUND = 200;
/** Indicates that the device is already defined with a specific type and
cannot be changed. */
public static final int E_DA_REQ_DENIED = 201;
/** Indicates that the operation failed to start because one of the IP
addresses specified in the request cannot be found in the network. */
public static final int E_DA_UNKNOWN_DEVICE = 202;
/** Indicates that the request has failed because the device that processed
the request does not support one or more of the attributes in the request.*/
public static final int E_DA_NO_SUCH_ATTRIB = 203;
/** Indicates that some general device error has occurred. Further
information will be supplied in the result error string. */
public static final int E_DA_GENERAL_ERROR = 204;
/** The type or instance of the management information is not accessible due
to access control settings. */
public static final int E_DA_NO_ACCESS = 205;
/** This error is returned if the request contained a value that has a
different type then the one in the device itself. */
public static final int E_DA_WRONG_TYPE = 206;
/** This error is returned if the value field that was specified in the
request is illegal and should not be used. */
public static final int E_DA_WRONG_VALUE = 207;
/** Indicates that the request has failed due to a failure to set one of the
variable bindings and that the state of the agent is not affected by
this request. */
public static final int E_DA_COMMIT_FAILED = 208;
/** Indicates that the request has failed due to a failure to set one of the
variable bindings and that the state of the agent could not be restored
to its previous settings. */
public static final int E_DA_UNDO_FAILED = 209;
// More error codes here ...
/** Indicates Error code ranges */
public static final int STANDARD_ERRORS_RANGE = 0;
public static final int SNMP_ACCESS_ERRORS_RANGE = 1;
public static final int DEVICE_ACCESS_RANGE = 2 ;
// More error ranges are welcome (100 error codes per range MAX !!)
/** Standard error descriptions for all error codes (including success). */
public static final String STANDARD_ERR_DESCR[] =
{
'Request succeeded',
'Client is not permitted to invoke the request',
'Unexpected software error',
'Request has timed out',
'Illegal state error',
'Security model failure'
};
/** Snmp Access Module error messages */
public static final String SNMP_ACCESS_ERR_DESCR[] =
{
'No such MIB name',
'Authorization error',
'Unknown IP address used',
'General error',
'Bad value',
'No access',
'Inconsistent name used',
'Inconsistent value used',
'Resource unavailable',
'Scalar is not writable',
'Wrong type used in request',
'Wrong length used in request',
'Wrong encoding error',
'Wrong value used in request',
'Object cannot be created',
'Response is too big',
'Snmp COMMIT has failed',
'Snmp UNDO has failed',
'Snmp received unsupported type',
'No data about the request'
};
/** Device Access Module error messages */
public static final String DEVICE_ACCESS_ERR_DESCR[] =
{
'device was not found',
'device is already defined',
'Unknown IP address used',
'No such attribute',
'General error',
'No Access error',
'Wrong type used in request',
'Wrong value used in request',
'Commit failed',
'Snmp UNDO has failed',
};
/**
* This table contains description tables for all error ranges.
* Whenever a new error code is introduced, a corresponding
* description string should be entered in its corresponding range
* strings array
*/
public static final String ALL_ERR_DESCRIPTIONS[][] =
{
STANDARD_ERR_DESCR,
SNMP_ACCESS_ERR_DESCR,
DEVICE_ACCESS_ERR_DESCR
// Add more array references here for each new module
};
/**
* This method converts jSnmp error codes to local error codes.
* @param snmp_err_code jSnmp error code
* @return Returns local error code that match the given jSnmp error code.
*/
public static int mapSnmpError(int snmp_err_code)
{
switch(snmp_err_code)
{
case SnmpConstants.SNMP_ERR_TIMEOUT:
return E_REQUEST_TIMEOUT;
case SnmpConstants.SNMP_ERR_SECURITY_EXCEPTION:
return E_SECURITY_MODEL_FAILURE;
case SnmpConstants.SNMP_ERR_NOSUCHNAME:
return E_SA_NO_SUCH_NAME;
case SnmpConstants.SNMP_ERR_AUTHORIZATIONERROR:
return E_SA_AUTHORIZATION_ERROR;
case SnmpConstants.SNMP_ERR_UNKNOWN_HOST:
return E_SA_UNKNOWN_IP_ADDRESS;
case SnmpConstants.SNMP_ERR_GENERAL:
return E_SA_GENERAL_ERROR;
case SnmpConstants.SNMP_ERR_BADVALUE:
return E_SA_BAD_VALUE;
case SnmpConstants.SNMP_ERR_NOACCESS:
return E_SA_NO_ACCESS;
case SnmpConstants.SNMP_ERR_INCONSISTENTNAME:
return E_SA_INCONSISTENT_NAME;
case SnmpConstants.SNMP_ERR_INCONSISTENTVALUE:
return E_SA_INCONSISTENT_VALUE;
case SnmpConstants.SNMP_ERR_RESOURCEUNAVAILABLE:
return E_SA_RESOURCE_UNAVAILABLE;
case SnmpConstants.SNMP_ERR_NOTWRITABLE:
return E_SA_NOT_WRITABLE;
case SnmpConstants.SNMP_ERR_WRONGTYPE:
return E_SA_WRONG_TYPE;
case SnmpConstants.SNMP_ERR_WRONGLENGTH:
return E_SA_WRONG_LENGTH;
case SnmpConstants.SNMP_ERR_WRONGENCODING:
return E_SA_WRONG_ENCODING;
case SnmpConstants.SNMP_ERR_WRONGVALUE:
return E_SA_WRONG_VALUE;
case SnmpConstants.SNMP_ERR_NOCREATION:
return E_SA_NO_CREATION;
case SnmpConstants.SNMP_ERR_TOOBIG:
return E_SA_TOO_BIG;
case SnmpConstants.SNMP_ERR_COMMITFAILED:
return E_SA_COMMIT_FAILED;
case SnmpConstants.SNMP_ERR_UNDOFAILED:
return E_SA_UNDO_FAILED;
case SnmpConstants.SNMP_ERR_UNSUPPORTED_TYPE:
return E_SA_UNSUPPORTED_TYPE;
case SnmpConstants.SNMP_ERR_NOSUCHINSTANCE:
return E_SA_NO_SUCH_NAME;
default:
return E_SA_GENERAL_ERROR;
}
}
} // NMEerrcode
[----------------- END OF NMEerrcode ----------------------] |
| Sun 02 Mar | Alyosha` | To answer n's question, ResultObjects (and/or result error codes) are the mess that exceptions were designed to solve. As I mentioned before, the problem with checking for error codes after every operation is insane code bloat and impossible to track down bugs when you forget a error check.
Liron: Actually I made a bit of a mistake when I said that RuntimeExceptions should be rare/unrecoverable events (I was thinking of Errors when I said that).
RuntimeExceptions consist mainly of stack underflows, divide by zero, null pointer, class casting, and bounds checking type errors -- that is to say, programming errors which would hose a C++ program and should never occur in a properly debugged program. Failures of this catagory always indicate a defect in programming, a blatant and forseeable violation of the pre-condition design contract, and not an exceptional but otherwise legal condition that prevents an operation from completing.
Maybe *YOUR* code is full of NPEs and array bounds exceptions, especially given strange inputs, but I wouldn't blame the language or libraries for that ...
I've honestly never had the problems you have with Java's exception model, so I'm a bit boggled as to why they're so difficult for you.
But, maybe it's because I haven't done as much hard-core programming as you.
Regarding coding guidelines, I love practical suggestions for better code, but honestly, eliminating overlooked error checks by laying down the law in the form of coding guidelines is a lot like trying to eliminate teen pregnancy by preaching complete abstinence to schoolchildren.
No, no, that's a bad analogy. Even as much pressure biology exerts on adolescents to have sex, it's still not anywhere near the pressure programmers have to skip error checks if they think they can get away with it.
Exceptions make life so much easier. |
| Sun 02 Mar | Liron Levy |
That's fine in theory ...
In my experience - programmers need to handle every
error condition. For this matter - using try/catch or if/else
is the same thing actually.
Good code is usually ugly in this respect (its littered with error handling clauses) ...
Again - the THEORY says that you shouldn't throw runtime
exceptions where non-runtime exceptions are enought.
Practice says that you will use internal or external libraries
that do just that.
By explicitly returning a result object - you actually FORCE
the programmer to consider the consequences of his/her
behavior (by examining the documentation of the method).
A code that throws an exception can be easily overlooked (especially true for C# and C++, less true but still a problem in Java) by the programmer because its prototype does not show anything special that need handling. |
Sun 02 Mar | Liron Levy |
Just a comment on what Alyosha said earlier:
Failures of this catagory always indicate a defect in programming, a blatant and forseeable violation of the pre-condition design contract, and not an exceptional but otherwise legal condition that prevents an operation from completing.
There is nothing stopping you from throwing RuntimeExceptions yourself and there are several JDK modules that do just that (e.g., when reading a corrupted JPG file ...). This caused our software to fail in a customer site and there was very little that testing could do to actually reveal this bug (the exceptions were thrown on a very specific case of corruption) in the first place. |
| Sun 02 Mar | RM | I am sure many of us are familiar with COM. Looking at how COM deals with errors, it uses HRESULT which is almost the same as Levy's model. Can this scheme be abused ? or strictly enforced? My experience says programmers are only checking and using S_OK and E_FAIL though it can offer much more. The problem is people are misusing and abusing the models. And the code is a mess (which is almost always the case for handling errors)
With Regard to Exception, I agree with Levy because Exception (as the name implies ) should be reserved for the 'Exception' cases where the programmers don't have control over, such as OutOfMemoryException or NetworkConnectionException. This is where Levy is right about catch-exception but not throwing. Basically Exceptions should be exclusively reserved for Run-Time Errors only.
Consider this. Suppose you have hundreds of objects, millions of lines of code, many are throwing their own exceptions, some are throwing the same. Once it is caught somewhere, Is it easy to trace back to find out who throws it. From my limited experience, it is almost impossible to tell why the error occurs. All I can tell is something unexpected happend but not why.
How does the general result or HRESULT solve the problem? Maybe it does not but It is more predictable and easier to trace back to the origin than Exception. Because it does not suddenly jump to the 'Catch' clause, it is also easier to find the execution path where the problem occurs.
Both Exceptions and Levy's model, have advantage and disadvantage. And yes, both can be abused and misused. Tha'ts why I am still in search of better techniques.
Again, I am looking for the techniques that is independent of Programming Language. |
| Sun 02 Mar | Alyosha` | Agreed that every error condition must be handled, and that good error-handling code has some ugliness to it. That said, wrapping a try/catch around a block of exception-prone code is a whole lot less ugly than checking error codes at every method invocation.
'By explicitly returning a result object - you actually FORCE
the programmer to consider the consequences of his/her
behavior.'
Not so. At most you mildly encourage the programmer to consider consequences of exceptional conditions, but there is nothing preventing the programmer from omitting the error test. Not like in Java, where checked exceptions Must Be Handled, Period.
(It's too bad that C++ and C# don't have this nifty feature, but regardless, I'd still use exceptions on those platforms, if only for the benefit of writing my error handling code once instead of at every method invocation).
* * *
So the JDK bombed when you tried to get it to load a corrupted JPG? Sounds like a good old-fashioned library bug to me. It's not Sun's coding guidelines to throw unchecked exceptions in cases like that.
Having never seen it before, I'd bet quarters to nickels it was array index out of bounds exception from a buffer overrun. Yeah, in theory there should never be bugs in your external libraries, but ... sometimes it happens ...
You should have been glad to see the exception though; if it happened in a C++ library, it would have overrun the buffer silently and then only ten minutes later start coughing up blood.
And while we're on the subject of theory vs. practice ...
The THEORY says that you should check error results after calling a 'dangerous' method, the PRACTICE says that invariably you or your coworkers is going to forget that error check and it's gonna bite you in the ass, as your code fails silently and you have no idea what caused it.
This cure is worse than the disease. |
| Sun 02 Mar | n | This is where macros would come in handy in Java. I'd often like to say: catch all unknown exceptions (except for threadinterrupted, rethrow it) and run some failure handler. |
| Sun 02 Mar | n | Hmm, actually macros aren't needed, this can be done with functions.
I suspect exceptions are good for quickly building code, when you don't mind trashing the current context and going up to one that has enough information to handle the error and cleanup. But OTOH, when I have a stable design, result objects certainly look worth considering. |
| Sun 02 Mar | Andrew Reid | Liron wrote: 'In my experience - programmers need to handle every
error condition. For this matter - using try/catch or if/else
is the same thing actually.'
Not really. with exceptions you can check for errors in only a few places. With error return codes you have to check the code on almost every line.
For example
try
{
foo1();
foo2();
foo3();
...
}
catch()
{
// error handling
}
instead of
if(foo1() == ERROR)
{
// error handling
}
if(foo2() == ERROR)
{
// error handling
}
if(foo3() == ERROR)
{
// error handling
}
... |
| Sun 02 Mar | raindog | I worked on a huge system, written in very readble Perl (yes, that's possible).
We used the following approach - every function that was supposed to return some result, returned 2 objects: result and an error object (if error occured). Note: in Perl, functions can return arbitrary number of objects. It seems to be cleaner than combining result and error in some artificial 'result object', which is not really a single object.
So, our normal code looked like this:
my ($result, $error) = foo();
if ($error) {
# use $error->code and $error->description
...
}
In the foo() function, the results were returned as
return (undef, $error); # if errors happened
or
return $some_result; # if everthing is OK.
Note: there's no need to pass some fake NO_ERROR object or NULL. No error means no error, literally.
Of course, this approach is possible only for languages that support multiple return values: Perl, Python, Ruby, etc. |
| Sun 02 Mar | Exceptional Coder :P | I think the idea of using a generic ResultObject to facilitate is a really bad one. One of the key features of structured exception handling mechanisms like the one supported by Java is that the exceptions have well defined type information associated with them. This provides several benefits. The compiler can help check things being primary among them. If a sub-procedure is altered to generate additional exceptions, the compiler will show you that you need to modify client procedures, for instance. Also, the type information is very useful in communicating the semantics of the exceptional condition, much moreso than some arbitrary integer constant. It's also useful, IMHO, to have language facilities for structuring the exception handling code, rather than putting a big switch statement in there, hopefully as a catchall. And finally, using scalar constants just begs for compatibility problems between libraries that may use the same numbers differently. Exceptions defined in namespaces do not suffer this shortcoming.
The ResultObject scheme being discussed is similar to arguments I hear about using languages that don't force you to declare the types of your variables. This is great for slapping code together quickly, but in taking this route you take away one of your most powerful tools for ensuring correctness: the compiler's type checking mechanism.
The main problem I see with exceptions comes from what appears to me to be programmer laziness. I can't even count the times I've seen someone stick a catch(Exception e) { /*do nothing*/ } into the code, just to shut the compiler up. It could be that the programmer is working on the mainline code and doesn't want to lose the train of thought by considering exceptional conditions, but that kind of code makes it into the shared code stream enough that I have my doubts.
There are things about currently popular exception management approaches that bug me. The biggest of these is probably how they work in combination with inheritance. In most cases, though, I prefer them over alternatives like the one mentioned above by a wide margin. If one of my teammates used this approach, I'd expect a *very* good reason for it. |
|
| MS to open source for China | Fri 28 Feb | Dennis Atkins |
| Microsoft is going to let the CHinese government have tehir source code:
http://story.news.yahoo.com/news?tmpl=story2&cid=568&e=15&u=/nm/20030228/bs_nm/tech_microsoft_china_dc
Also, Microsoft is going to invest $750 million in China.
Gates says, That actually has zero dollars of revenue associated with it because its a free thing, but Id say its a very important thing.
Heh heh. Tech people are such pushovers. Man what a dumb move by MS.
Obviously having the source code will give them a serious technical advantage. Say goodbye to your jobs Americans! |
| Fri 28 Feb | Simon Lucy | I imagine its the same as all other governments that have the Source Access licence. Basically you can go to some Microsoft facility, play with the source, run tests etc but you can't take it away with you.
This is an example of 'opening the kimono' not releasing source. |
| Fri 28 Feb | Nat Ersoz | When someone from MSFT utters the words 'open the kimono', find the exit or grab the vaseline. |
| Fri 28 Feb | Simon Lucy | This, I presume, is from personal experience Nat? |
| Fri 28 Feb | Ran Whittle | So does this mean that the creators of the Code Red mess that we went through a while back will now be more likely to have access to Windows source code? I am not saying that the Chinese Govt. sponsored that attack, but I can't help but wonder about the security implications of this decision. |
| Fri 28 Feb | Nick H | It's probably not such a stupid idea. I think M$ faces some serious OS competition in China. Besides Linux, I've read that there's a government-backed effort to develop a Win98-equivalent OS.
The link below goes into more detail. Security and M$ information gathering are the big concerns.
http://biz.yahoo.com/ap/030228/microsoft_china_2.html |
| Fri 28 Feb | doobius | 'have their sorce code'
'controlled access to its source code'
not the same thing and not open source. a desperate move to keep a fifith of the worlds population from growing up on Linux. |
| Fri 28 Feb | Nat Ersoz | CAll me 'Mazola Boy'. Mmmmmm. Butter. |
| Fri 28 Feb | Chris Tavares | That whole thing really strikes me as odd.
The main reason for China wanting the source code to windows is to do a security audit - take out the NSA back doors, for instance.
But there's no guarantee that the source they get to look at is the the source code to the actual bits that get shipped! |
| Fri 28 Feb | Go Linux Go! | 'Obviously having the source code will give them a serious technical advantage.'
How do you figure that? What kind of advantage? I seriously doubt that there is some golden nugget of programming Zen that is only contained in the Windows source code.
If you're referring to finding some 'undocumented' feature and using that, then I'd recommend you think that through again. |
| Fri 28 Feb | Jeff MacDonald | 'Tech people are such pushovers. Man what a dumb move by MS.'
If you look back at the history of Microsoft thus far, they have made very few 'really stupid' decisions (please don't flood the board with examples of stupid things Microsoft has done - I can read the news, too - I'm speaking generally to prove a point).
Sure, there are a million 'unpopular' decisions, but in the end those decisions ultimately benefited the company (try to separate 'benefiting the company' from 'benefiting the industry' and 'benefiting the user' - Microsoft is in business to make money for their shareholders, like it or not) .
Do I care for all of Microsoft's business practices? No way. But despite how much hatred so many people have for the company, their decisions appear to be 'dumb moves' until that one day (months or years later) when the competition goes, 'Oh, THAT'S why they did that. Damn, we should have done that.'
Make no mistake - Microsoft does EVERYTHING for a reason. Why they do things, however, is initially sometimes quite a mystery.
At this point, all we have is a bunch of maybes and suspicions for why they're doing this. As time goes by, however, we're going to discover the bigger picture and be surprised we didn't see it sooner.
-Jeff |
| Fri 28 Feb | Harold | >Obviously having the source code will give them a serious technical advantage. Say goodbye to your jobs Americans!
They already have a serious technical advantage - a lot of very intelligent people. If we assume a Chinese population of 1.2 billion then I would estimate that they have about 2.4 million people with Mensa level IQs. I imagine a lot of these people will start coding for peanuts or fun and then we will have so much free software that no one will pay for it. Anyway how many people in China pay for software now ? Very few I would guess. I bet Microsoft sell more software to Iceland or Ireland than they do to China. |
| Fri 28 Feb | one programmer's opinion | 'Very few I would guess. I bet Microsoft sell more software to Iceland or Ireland than they do to China. '
Yup. The Chinese (government, businessmen, I.T. workers, etc.) are big time pirates. For example, many of the Computer Science students in China possess or have free access to just about any software product or I.T. related book they want or need. Note: I'm not saying that piracy is only going on in China! |
| Fri 28 Feb | Dennis Atkins | Right, that's what I was thinking -- it seems extremely unlikely that anyone in China is going to suddenly start buying MS products rather than pirating them, so opening the source code up doesn't provide much strategic advantage, which is what I assume they are seeking to gain.
I think MS, intoxicated with the idea of 1 billion new customers is following the same path that a lot of other US companies trying to break into China followed, only to get double-crossed and triple-whammied once the Chinese had all the information they needed to start producing their own stuff.
The latest versions of Windows are supposed to be much harder to pirate, requiring telephone calls and hardware checks, than older ones and MS may be getting close to the point where they are impossible to pirate -- unless you have the source code of course... then you can manufacture your own.
I don't think the Chineses government has any interest in switching to Linux actually - but I do think they can use that story to their advantage to get access to the source code so they can make the copies they need.
And of course allow their intelligence arm to prepare worms to unleash upon the Western capitalists Infidels! |
| Fri 28 Feb | american sceptic | the attitude of americans to china never ceases to bewilder me...with a population of 1.2 billion, huge over crowding problems and an iffy economy, china has had a good excuse for years to start a few foreign wars, but aside from a few border squabbles have not done so.
America, OTOH, has been involved in a war every few years. truth is, Ive lost count of them all.
And thats not counting the various countries they have been bombing, manipulating and otherwise badly treating.
which is the country that has done most to ensure international peace? my vote goes to china for doing nothing whatsoever one way or the other....kind of sad really. |
| Fri 28 Feb | Go Linux Go! | must...resist..the urge...to flame...the naive simpleton who posted... |
| Fri 28 Feb | Bored Bystander | Uh, now let me get this straight.
According to the article, the Chinese government is being given 'controlled' access to the source code for Windows and other Microsoft products.
And we ALL know the very high, almost religious esteem in which China and other far east countries view intellectual property law. I'm sure that anyone who inspects or peruses this source code will have *NO* contact with a competing platform developer, right?
LOL!
Excuse me for the overtones of stereotype in the following comment, but how long before 'Yankee Dog Die'/'Red Dawn' 'Window 200x' comes out...?
God, what a profoundly stupid move. Unless MS has decided to give away the desktop product market in those countries, and possibly the rest of the world, too... |
| Sat 01 Mar | one programmer's opinion | 'the attitude of americans to china never ceases to bewilder me...'
Huh? I think you need to re-read the postings. The following is what we are discussing here:
Microsoft (like many other American companies) wants to do business with the Chinese government and the rest of China. They have decided to give China their source code because they are well aware of the Chinese government's preference for Open Source solutions such as the Linux OS.
Some of us don't think this move will help Microsoft increase their sales in that country. The latest statistic that I have read is that for every copy of Windows sold in China ten copies are acquired through piracy. Personally, I think the 10 to 1 ratio is too low (20 or 30 to 1 sounds about right to me). |
| Sat 01 Mar | Eat Mensans for breakfast | Harold,
Sorry for the criticism my man, but your statement that 'If we assume a Chinese population of 1.2 billion then I would estimate that they have about 2.4 million people with Mensa level IQs.' is wrong. First of all, Mensa is for people with an IQ in the top 2% of the population. That would make 24 million members--not 2.4.
Of course, the normative comparison to the U.S. is also worthless as these 24 million people might actually be much smarter (or much dumber) than an American Mensan. Also, what makes you think that software developers should automatically be grouped in with Mensans (an inference based upon your assumption that Chinese Mensans would take to writing code)? Having actually been in Mensa, I can tell you that IT types definitely abound, but so do librarians, prostitutes, farmers, and every other kind of person that you wouldn't normally think of as 'smart' (except many did have broken glasses and smelly T-shirts ala Meatballs). |
| Sat 01 Mar | Harold | Yes, you are right. It should be 24 million possible Mensa members in China. It was very late at night when I wrote that comment - that's my attempt at an excuse. This is a scary prospect for paid programmers. I take your point that many of these egg heads will not be interested in coding, but it will only take a small percentage of them to swamp the market with free stuff.
>Of course, the normative comparison to the U.S. is also worthless as these 24 million people might actually be much smarter (or much dumber) than an American Mensan.
I think it is safe to assume that the Chinese who score above the 98th pecentile on an IQ test are no less intelligent than the Americans or Brits who can do the same. I am not interested in starting a flame war about race and IQ but I have not come across any references showing that the Chinese score lower on intelligence than other races.
You say you were in Mensa and you found many people there who you wouldn't call smart. Well my wife would get into Mensa very easily and she comes out with some very stupid comments. She has just told me that the Chinese are not very inventive ! |
| Sat 01 Mar | Neil E | Hmm, american sceptic, you should try googling for 'tibet occupation' for starters. |
| Sat 01 Mar | Simon Lucy | This thread, along with several others recently, seems to be showing that the ability to read is now an optional skill. |
| Sat 01 Mar | american sceptic | 'Hmm, american sceptic, you should try googling for 'tibet occupation' for starters. '
ok...so thats *one* war since 1949...still looking good in comparison to america.. |
| Sun 02 Mar | Go Linux Go! | ' ok...so thats *one* war since 1949...still looking good in comparison to america.. '
Did they teach history where you went to school? How about China's involvement in the Korean War?
Yeah, China is a wonderful place. Such a democracy. Such freedoms. Just ask any Falun Gong member.
Idiot. |
| Sun 02 Mar | Go Linux Go! | Ok, I apologize for the 'idiot' comment... |
| Sun 02 Mar | american patriot | 'Yeah, China is a wonderful place. Such a democracy. Such freedoms. Just ask any Falun Gong member.'
actually I didn't mention freedoms at all, I was discussing wars.....and even given the korean war china is *still* doing an awful lot better than america....... |
|
| A New Kind of Science | Fri 28 Feb | Just me (Sir to you) |
| I know from past topics some of you like this kind of stuff, so I just wanted to let you know that Stephen Wolframs Stanford University talk in the Seminar on Computer Systems series is up on murl.
http://murl.microsoft.com/LectureDetails.asp?1002 |
| Fri 28 Feb | The Real PC | I think I have already asked if anyone here is interested in digital physics and no one answered.
No one could see the connections between computer science and linguistics, either. People are not usually able to see connections between closely related fields, sadly enough.
Donald Knuth mentioned DP in his lectures about God and computers. I have believed for a long time that our world is made out of information, rather than 'matter' (whatever that is).
As far as I know the ideas of DP started with Ed Fredkin and cellular automata, and the 'life' game. |
| Fri 28 Feb | Just me (Sir to you) | History of cellular automata
http://www.wolframscience.com/reference/notes/876b |
| Fri 28 Feb | Dimitri. | Interesting things, these theories.
I think cs is giving a new way of looking on physics. Not necessarily that the universum really _is_ a computer, but that it can be viewed as a computer, and using computer thinking on its workings can yield valid and interesting results. Really, what this really means is that instead of using mathematics as an instrument, you use a computer model as an instrument.
But, historically speaking, any fundamentally new way of seeing things in science takes a lot of time to be accepted. |
| Fri 28 Feb | Go Linux Go! | The reviews on Amazon.com for his book are amusing to read. |
| Fri 28 Feb | Brian Hall | I believe it was Skeptic magazine or something like that, and it did a feature on a presentation Wolfram gave to a panel/group of scientists.
One of the points made against Wolfram was that, according to everything he has said, cellular automata would represent a 'new' kind of _computation_, not a 'new' kind of science. It is merely one more tool for science to use, and it doesn't really seem all that useful either.
Ultimately it was the consensus that, while cellular automata could come to be a greatly useful computational tool in various fields of science, and possibly open up a field of study of its own, only time will tell just how useful it would be. No one, save Wolfram, seemed to think it would be an actual revolution in science - only a bit of an evolution, at best, if it amounted to anything at all.
It was also noted that Wolfram just so happens to follow the exact formula of all sorts of scientists-gone-kooks in the past - working alone, self-publishing in a book rather than in peer-reviewed journals, one big huge book yet no articles (so far) have been published in peer reviewed journals, not acknowleding the work of other scientists, most of the footnotes refer to his own works and further comments, not to support for the things he says, and many grandious claims of how many practical and useful applications there are of various things, yet he presents nothing that is actually Direct and Specific. All bad signs.
He surely has advanced the field of cellular automata in various ways. But that, it seems, is about it. |
| Fri 28 Feb | Simon Lucy | I wouldn't assume that no one could make the connection between linguistics and computing just because no one was interested in a thread that contained it.
If you want to see an example of the Universe as an addressable store, see NULL-A by A.E Van Vogt. |
| Fri 28 Feb | doobius | 'Is the Universe a Computer'
From the latest JOHO:
http://www.hyperorg.com/backissues/joho-feb25-03.html#UAC |
| Fri 28 Feb | The Real PC | [I believe it was Skeptic magazine or something like that]
The skeptic web sites I've seen are basically against any ideas different from the status quo. I am 100% for skepticism, but simply dismissing any idea different from what you already know is not skepticism, it's fundamentalism.
I've seen articles in the skeptic's dictionary, for example, that reject research even without any evidence against it, because it doesn't fit their pre-conceived world view.
I'm not defending Wolfram's book and didn't read it (who has time for that?). I have a vague concept of the implications of DP and CA, and it makes sense to me anyway.
My point is this: be very skeptical of the so-called skeptics. DP says the universe is discrete, and that is a radically different perspective, and I think will turn out to be very important. |
Sat 01 Mar | Brian Hall |
I am 100% for skepticism, but simply dismissing any idea different from what you already know is not skepticism, it's fundamentalism.
Oh I quite agree - to not be skeptical of skeptics would make one not much of a skeptic ;)
The point was, however, that it was the panel/group at his presentation that was doing most of the questioning/debating and such. It was the skeptical magazine, or article - I just can't recall - that was relaying the information and commenting on it.
Further, due to the way it was written it was not at all merely dismissing anything - it was, however, noting just how lacking in support many of the claims for a 'new kind of science' are. In short, the evidence does not support his conclusions and assertions. To put a fine point on it, 'They laughed at Einstein...but they also laughed at Boso the Clown.'
The conclusion as a whole was that it is likely much less than the hype, and not a 'new kind of science', but surely some interesting things will come out of it - just nothing like Wolfram seems to think. |
Sat 01 Mar | Brian Hall | Oh, and:
I've seen articles in the skeptic's dictionary, for example, that reject research even without any evidence against it, because it doesn't fit their pre-conceived world view.
This is new to me - do you have a more specific example?
I have seen him - the author of the dictionary - be a bit free with logic and dismissal in his various email exchanges and such on the site, but beyond that I'm aware of nothing quite like what you are talking about. |
| Sat 01 Mar | The Real PC | http://skepdic.com/pear.html
They accuse the researchers of cheating, etc., without a shred of evidence.
I have seen this kind of illogical hysterical accusation lot. If the results contradict materialist assumptions, the research must be flawed. Many so-called skeptics cannot deal with the thought of materialism being obsolete. They are not skeptics they are narrow-minded defenders of a faith.
And I do think DP is a new kind of science. Thinking of the universe as made of information (or relationships) is very different from the traditional approach. There is no ultimate particle; ultimately all matter is mental and the universe is just a big mind.
DP does not necessarily lead to a religious outlook, but DP and religion (or mysticism, or whatever you want to call it) are compatible.
I think that's why Knuth likes it.
I read part of Fredkin's website and he seems to be an atheist, though. DP does not require faith in higher intelligence. |
| Sat 01 Mar | Alyosha` | That's a pretty harsh way to spin that article, PC.
Given the choice between several mundane causes of an unexplained phenomenon, and one exotic cause of the same phenomenon, it's natural to suspect a mundane cause over the exotic one.
In this case the mundane causes suggested are ones that have plauged scientific investigation since the dawn of time, let alone scientific investigation of THIS particular phenomenon: selection effects, drawing conclusions from marginal experimental results, human error, self deception, and yes ... even outright cheating.
A result of one part in a thousand ... the miscatagorization of one test, or the rejection of one experiment in a thousand would be enough to produce an effect like this. Sounds pretty close to the natural human error rate, actually.
* * *
'I have believed for a long time that our world is made out of information, rather than 'matter' (whatever that is).'
As for myself, I've long believed that the world is made out of matter, rather than 'information' (whatever that is).
Granted, it's not as sexy a worldview as idealistic monism ('all is mind'), but at least it squares with my general observations ...
Namely, that information is what we call matter in organized form, that consciousness is an emergent property of matter organized in complex form. To say it is the other way around, that matter is information in the concrete form, is totally unconvincing to me and alien to my experience.
Put simply, I've noticed something unusually strange about my universe: it takes a material brain to think. Never saw a rock or a puff of wind that was capable of such a thing. There's a fantastic correlation between the complexity of a brain (or computer) and its apparent ability to process information ... and I don't think that's a coincidence.
Moreover, there's also the interesting phenomenon that if the material structure of a brain or computer is disturbed, its ability to process information is likewise significantly affected.
So I can understand matter divorced from intelligence, but I cannot concieve of intelligence liberated from its material bonds.
Maybe that says more about my lack of imagination, or my 'fundamentalist' materialism, but I doubt it ...
* * *
Now to touch briefly on the original topic of this thread ...
So it appears that the universe and cellular atomata both display the property of complex structures arising from simple rules.
Fascinating. So what new insight does this give us about the universe in which we live?
(time passes)
I'm .... still ... waiting ...
Hrmmm, maybe the whole universe we know is a computer simulation. Maybe there's a horde of Cartesian Demons trying to decieve me about everything, maybe everything's a figment of my imagination. But, you know, I got my surrealism fix from watching the Matrix; it was good entertainment, but to seriously contemplate such a fundamentally unprovable and fantastic hypothesis is really a waste of brain cycles.
I think some people have a fetish for being more fascinated with the analogy they've cleverly discovered between two seemingly unrelated items, than in investigating the unique and individual aspects of the things themselves. |
| Sun 02 Mar | The Real PC | Alyosha,
In implying the PEAR researchers are making stupid mistakes or cheating, after 20 years of observing this kind of effect, skepdic is really grasping at straws.
As for being a materialist, there's nothing wrong with that, as long as you are open-minded and willing to consider the evidence against it. Keep in mind you are observing only from a human, 4-D perspective. And don't assume everyone who has ever communicated with 'supernatural' beings is a lunatic, and don't assume every psychic researcher is a fraud or stupid. If you can form an objective and unbiased, and informed, opinion that reality starts with matter, not information, there's nothing wrong with that. (Except that it's bizarre to insist that there is any ultimate particle, but anyway).
Regarding the Matrix:
The philosophy behind the movie, like most science fiction, is materialist. Even though our world is a virtual reality, there is a material reality that generates it. But the idea that our reality is 'computer-generated' is, if you think DP may be valid, quite reasonable. |
| Sun 02 Mar | Alyosha` | Let me get this straight ...
When myself, the skeptic's dictionary, and others suggest that the list of usual suspects may be responsible for the modest results of the micro-PK experiments, that's 'grasping at straws', but to attribute it to some ill-defined and completely mysterious 'power of the mind' which has no grounding in the laws of physics that we know of up until now, well, that's somehow not grasping at straws?
I really wonder what your basis of comparison is. |
|
| Philosophy of long hours vs not | Wed 26 Feb | Mikayla |
| I would have to say there is something wrong with the theory of programmers getting bullied into working long hours. Its more complex than that.
Honestly, many of us (especially when were young and have limited responsibilities) enjoy working long hours on occasion. However, we know (or quickly learn) we shouldnt do it for nothing. Also, that the people / companies who encourage us are worse than the ones that discourage us, and the ones that get more forceful than encourage are not worth any respect at all. They have less respect for me than I have for me, and I have to cut that off before it affects my perspective and Im lost in an endless downward spiral.
(Im currently worried about having to quit my job, a state which many people are not ethical enough to sympathize with. I would say or privileged enough but my situation seems more due to discipline over the last five years and my priorities, not sheer luck.)
Can anyone tell me why I have perfectly reasonable relationships with other humans, yet find myself acting obsessive-compulsive and codependent about companies and ideas? I get the impression Im not the only one. |
| Wed 26 Feb | Kevin | Do what you have to do. Life is too short to be unhappy. |
| Wed 26 Feb | Daniel Shchyokin | Not refering to anyone in particular, but coould there be such a thing as a code slut? |
| Wed 26 Feb | anon | Surrounded by thoughtlessness, it is easy to secondguess the obvious things which go without saying. Careful. |
| Wed 26 Feb | Ron Burk | > Can anyone tell me why I have perfectly
> reasonable relationships with other
> humans, yet find myself acting
> obsessive-compulsive and codependent
> about companies and ideas?
Can't tell anything about you in particular, but it's worth noting in general the psychological research that indicates that people just out of college derive more of their self-esteem from their work and work relationships than from their intimate relationships. Only a fair number of years down the road does that balance tend to swing the other way. When your ego is tied strongly to your work, counter-productive behaviors are perhaps more likely. |
| Thu 27 Feb | one programmer's opinion | Mikayla wrote, 'I would have to say there is something wrong with the theory of programmers getting bullied into working long hours. It's more complex than that.'
In most situations it is NOT more complex than that. All companies have a hierarchial power structure and in just about all of these organizations -- a programmer -- works at or close to the bottom of this power structure. You don't want to work long hours to help get a project done sooner? You don't want to come in on Saturday or the middle of the night to fix a production problem? Then don't do it. In many instances, your boss or his/her boss will simply find someone else who is willing to do so.
Like you (I think) I wish things worked differently then they do, unfortunately, we live in a very imperfect world. This (having little power or control) is one reason why so many programmers seem to be interested in starting their own consulting business.
Personally, I didn't catch the techie bug of loving what I do (coding, learning new technologies, losing track of time, etc.) until later on in my career when I moved off the mainframe. Of course, nowadays I have a whole slew of new things that I like to bitch about besides working too much. |
| Thu 27 Feb | Daniel Shchyokin | The problem with the current generation of techies (me included) lets say 22-30 is that we are so used to having our butts kissed that we have never learned to negotiate. I are either macho masochists- i.e. I code 14 hours a day and love it and anyone who doesn't is a loser, or have a woe is me attitude.
I for one am learning though, for instance its 11:00 and I am at work because 'something came up' but when the manager asked me If I can stay late, my first words were not an angry 'no', or a 'ins not fair' (which is par for the course for me when I am tired), but a firm but polite 'If do this today, you won't need me for most of tommorrow, right?', and would't ya know it, I won't have to be there till 3:00 pm tommorrow.
keep in mind:
some managers don't realize you wan't to do anything other than code.
some businesses are genuinely evil (I have worked for one) others just need you to be flexible
some managers don't even realize the hours you are working, unless you tell them.
keep your cool don't make every situation a battle of wills, make it a bargaining sessions. most managers and especially business types relate much better to that. |
| Thu 27 Feb | Dino | 'Can anyone tell me why I have perfectly reasonable relationships with other humans, yet find myself acting obsessive-compulsive and codependent about companies and ideas?'
I guess you must find your own answers in this case.
But from a pragmatical perspective, Kevin is right: life is to short not to have fun.
Cheers
Dino |
| Thu 27 Feb | Philip Janus | 'some managers don't even realize the hours you are working, unless you tell them. '
A lesson I learned the hard way.
It's 3am, you've just finished a marathon coding session and checked everything into SourceSafe. What is the absolute most important thing you can possibly do before you shut down?
Send your boss an email with the status. The contents of the email really don't matter - you just want to 'clock out' with a timestamp on the email.
I once worked four 20-hour days in a row finishing an app for a demonstration. Who got the kudos? The guy who worked until 2am one night but sent an email to his boss when he was done.
'I got your email - what were you doing here at 2am? You're the *man*!'
Philo |
| Thu 27 Feb | Philip Janus | And regarding working long hours, IMHO it's a combination of:
1) Pride in your work
2) Seeing work as a challenge
3) The need for approval
4) Enjoying your work
I think if you don't have one of those factors, you'll clock out at 5. It's the true geeks that have the unfortunate confluence of factors that make us strive to kill ourselves in service to a goal.
Philo |
| Thu 27 Feb | John Ridout | You mean you don't program your computer to send an email at 2am while you are asleep in bed? |
| Thu 27 Feb | Philip Janus | I was gonna make a comment about ethics but I figured 'nahhh... I don't need to....'
[grin]
Philo |
| Thu 27 Feb | Practical geezer | Philo,
Though not having those motivations might lead one to leave at five, the argument is not reversible.
In other words, leaving at five does not prove one is not motivated.
Just thought I should mention it. |
| Thu 27 Feb | Ian Stallings | Philo,
You should use your evil genius side and do what any self serving programmer would do, automate it. Have your app send out an email detailing what you've 'done' at 2am. I bet you could randomly generate your accomplishments and it would simply be glanced at. Maybe pull your accomplishments from a dictionary of tech words and marketing fluff ;-) |
| Thu 27 Feb | Rubin | Mikayla,
If your self respect depends on how much other people respect you, then you already lost the battle. I learned after much grief and pain that I am more than another warm body in a software sweatshop, and I act accordingly. If there's nothing for me, I won't make sacrifices.
By the wa | |