Slashdot Mirror


Bill Joy's Takes on C#

f00zbll writes: "Cnet is running an article by Bill Joy on security and how it relates to C# and Microsoft at large. BJ quotes verbatim: 'C# provides the ability to write unsafe code. In unsafe code it is possible to declare and operate on pointers, to perform conversions between pointers and integral types, to take the address of variables, and so forth.'"

561 comments

  1. What we should really call it... by mcrbids · · Score: 2, Troll
    C-Flat?

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
    1. Re:What we should really call it... by Dr+Caleb · · Score: 3
      IIRC, the beep made by the original IBM PC was musically somewhere between C Sharp and D.

      Guess that's why the sound was so obnoxious. C# kinda makes sense now, eh!

      --
      "History doesn't repeat itself, but it does rhyme." Mark Twain
    2. Re:What we should really call it... by RMSIsAnIdiot · · Score: 0

      Most likely, this would happen:


      Unable to handle kernel NULL pointer dereference at virtual address 00000040
      current->tss.cr3 = 00101000, %cr3 = 00101000
      *pde = 00000000
      Oops: 0000
      CPU: 0
      EIP: 0010:[]
      EFLAGS: 00010217
      eax: 00000000 ebx: c38eaa40 ecx: 00000000 edx: c38eaa40
      esi: c0ada0f4 edi: 00000014 ebp: c01ddf40 esp: c01ddf2c
      ds: 0018 es: 0018 ss: 0018
      Process lifesupport (pid: 423, process nr: 0, stackpage=c01dd000)
      Stack: c38eaa40 c01d3274 c38eaa40 00000002 00000001 c38eaa40 c014bf65 c38eaa40 c3c9038c c01d3274 00000001 c01ffce4 0001a82e c01ddf94 0001a82f 0008df94 c01178fd c01dc000 00000000 c0110555 00000001 c01dc000 0001a82e 00000018
      Call Trace: [<c014bf65>] [<c01178fd>] [<c0110555>] [<c010784d>] [<c0107855>] [<c0108fc0>] [<c0106000>] [<c010607b>] [<c0106000>] [<c0100175>]
      Code: 8b 40 40 ff d0 83 c4 04 eb 20 89 f6 ff 05 0c 32 1d c0 8b 55
      Aiee, killing interrupt handler
      Kernel panic: Attempted to kill the idle task!


      And then you would die.

      --

    3. Re:What we should really call it... by Anonymous Coward · · Score: 0

      is Bill Joy crying that Sun missed the opportunity to coerce Microsoft into Sun's limited java license...

      Bill Joy messed up

    4. Re:What we should really call it... by oldwarrior · · Score: 0

      C# is for grown ups. Java is for moonies. When you need to link to a C++ binary for top speed but also allow managed memory and simple VB-like programming power for the easy stuff, C# is perfect. Java could have been successful in these cases had JNI not been intentionally brain-damaged. JNI is intentially slow with overly complex usability so that folks won't try to get the most out of their hardware. If JNI let Java do what unmanaged C# can do so easily, then C# would never have been necessary. C# is post Java.

      --
      If it were done when 'tis done, then t'were well it were done quickly... MacBeth
    5. Re:What we should really call it... by oldwarrior · · Score: 0

      >>[stallman.org] is a Communist idiot. -- That statement is an oxymoron.

      --
      If it were done when 'tis done, then t'were well it were done quickly... MacBeth
    6. Re:What we should really call it... by pokeyburro · · Score: 1

      When I first saw it, I thought "C-pound". I think "C-pound" is kinda funny, but even when I want to discuss it seriously, I catch myself calling it "C-pound" by accident.

      "C-pound". Heh.

      --
      Lately democracy seems to be based on the skybox, the Happy Meal box, the X-box, and the idiot box.
    7. Re:What we should really call it... by Anonymous Coward · · Score: 0

      What the hell is this? I've been visiting Slashdot for years and everybody keeps telling me that Linux is stable and doesn't crash. Only now do I realaize that all my OSS fanatic idiotism has gone to waste...

    8. Re:What we should really call it... by james_underscore · · Score: 1

      The normal pronunciation of the # symbol in the UK is "hash". To me it seems natural to call it C-Hash, which I find funny for some reason.

      -- James

    9. Re:What we should really call it... by Mirus+Nex · · Score: 1

      How about C Octothorpe?

    10. Re:What we should really call it... by Anonymous Coward · · Score: 0

      No .... D-Flat

    11. Re:What we should really call it... by Mister+Snee · · Score: 1

      C-Hash.

    12. Re:What we should really call it... by Ann+O'Nymous-Coward · · Score: 1

      "To me it seems natural to call it C-Hash, which I find funny for some reason."

      I like it! Two possibilities, both of which are sad/funny/true:

      (1) It makes a hash out of C

      (2) It sounds like "Cash", which of course is the real reason M$ came up with the language in the first place. ;>

    13. Re:What we should really call it... by styrotech · · Score: 1

      Is that with a silent R?

    14. Re:What we should really call it... by Graspee_Leemoor · · Score: 2, Insightful

      You make a good point, bringing up the JNI. I would like to continue this by criticisizing language designers who like to claim that their language doesn't let you do anything dangerous, but then provide a native interface so that when you need to do something you can't do in their language you can link to the routine written in C or whatever. They can then bounce around when programs have security flaws, saying that "Java is secure" and "Well the hole was in the C part" etc.

      Especially when the extra functionality you need is written for this application and is not just a link to a previously-written module it is damn handy being able to write it in the same language. In my view it is very cool of MS to allow you to use c# for everything.

      graspee

  2. So what? by mosch · · Score: 5, Interesting
    Since when does the ability to use pointers mean that something is wrong? C allows a lot of 'unsafe' code to be written, yet we're all using operating systems writting in C, with very little trouble caused by the OS itself.

    Sure, it'd be great (for Sun) for everybody to rewrite the world in Java, but in reality nobody can justify requiring 50% higher CPU usage in exchange for the ability to let programmers be careless.

    I'm not saying Java is a bad thing at all, merely that C# isn't any worse than C, C++, perl or python. It's a shame when a press release manages to get linked from slashdot's main page, but that's all this is. Sorry Joy, but I'm not buying it.

    1. Re:So what? by BlackSol · · Score: 5, Insightful

      Uhmmm How many buffer overflow exploits & crashes have there been of the years?

      But I do love C though...

      --
      $sig=$1 if($brain =~ /idea\s+(.*)/i);
    2. Re:So what? by Hiro+Antagonist · · Score: 4

      I think the difference is that .NET and C# are designed as a network-based platform; e.g., you grab code off of the 'net as you need it, rather than storing everything locally. Having "unsafe" code in such an environment is utterly suicide, as it allows pretty much anybody who can put code on the network for you to use can do what they want to your system.

      Java actually does the opposite of "letting programmers be careless"; it forces them to be pedantic. In Java, you *have* to check that data is formatted properly, or your program will throw an exception and die. You have to properly typecast objects, define variables, and return from non-void functions, or the compiler will return an error. Java forces the programmer to handle all the boring, tedious work of making sure their code handles error conditions in a proper manner; because if it doesn't, the program will crash. But it will never allow access to the system outside of the JVM -- making Java a very safe network application platform.

      --

      --
      I Hit the Karma Cap, and All I Got Was This Lousy .sig.
    3. Re:So what? by Anonymous Coward · · Score: 5, Informative

      The willingness of people to post without knowing the fundamentals of .Net astounds me.

      You need a special security privilege to run unsafe code. Code downloaded from the net doesn't have this permission, so it can't run unsafe code.

    4. Re:So what? by the_2nd_coming · · Score: 1

      and yet again, MS, in an attempt tomake it just as safe for the network, just makes it harder to code poorly so as to move programmers to code well.

      "lay your security hopes at the door of the programmers descretion" has always been MS's mantra rather than "just don't let them"

      --



      I am the Alpha and the Omega-3
    5. Re:So what? by the_2nd_coming · · Score: 1

      ah yes but just wait until the first security hole in the VM shows up...then who will be needing a security code? eh!!

      the solution is just don't let them code that way.

      --



      I am the Alpha and the Omega-3
    6. Re:So what? by Anonymous Coward · · Score: 0

      Oh right, that would be as opposed to those 100% safe java scripts. Nobody ever executed unsafe Java code from a malicious web site, because you have to jump through hoops to allow that. Yes, obviously C# is extremely dangerous. And the fact that this is Bill Joy commenting about a Microsoft initiative should not in any way reduce our confidence in his analysis. Also, newcomers to Slashdot might like to know at this point that Slashdot coverage of anything to do with Microsoft is always 100% fair and objective.

    7. Re:So what? by good-n-nappy · · Score: 5, Insightful

      Or wait until Microsoft adds a dialog box that says "Allow unsafe code from Microsft? 'OK' 'CANCEL' 'ALWAYS TRUST MICROSOFT'"

      Then the problem is transferred to the weakest link - the user. Just like a Word file that asks if you want to run macros. How many users always know when they should say yes?

      --
      Never underestimate the power of fiber.
    8. Re:So what? by Hiro+Antagonist · · Score: 5, Insightful

      There's also (in theory) a special security privilege to run "potentially harmful" ActiveX scripts or Outlook macros; yet they seem to slip through on a regular basis. I have little faith in Microsoft's ability to successfully implement a decent security model, based on their track history alone. The JVM doesn't provide any memory manipulation capabilities whatsoever, so even massive bugs in the JVM don't necessarily open up your entire system. I'd place a bet that there are ways around C# security.

      I will admit that I'm not fantastically well-versed in .NET (who is?), but I do understand the fundamentals.

      Furthermore, using code that handles memory directly is a lousy way to implement platform independent software; why do you think there are so many little-to-big-to-little endian conversion functions in C?

      --

      --
      I Hit the Karma Cap, and All I Got Was This Lousy .sig.
    9. Re:So what? by Anonymous Coward · · Score: 0

      Its really sad that the parent of this post is 100% correct and is rated the same as its sibling by "the_2nd_coming" which is completely wrong (and also stupid).

    10. Re:So what? by Anonymous Coward · · Score: 1, Insightful

      Oh right, that would be as opposed to those 100% safe java scripts.

      There's no such thing as a "Java script". Java is not a scripting language. If you're referring to JavaScript, that has nothing to do with Java except the name.

    11. Re:So what? by jdavidb · · Score: 2

      In Java, you *have* to check that data is formatted properly, or your program will throw an exception and die.



      Even that isn't enough. You have to check that the data is formatted properly for the functions you call with it, or you will get an exception. (Maybe, if you're lucky.) But there's nothing in the language to force you to make sure that the data you use doesn't contain special characters with unintended effects (such as appending additional commands to delete files, etc.) For that, you would want Perl taint mode.

    12. Re:So what? by SirSlud · · Score: 5

      The very existance of such an 'unsafe' flag allows for the possibility of a bug in the VM's security architecture that /could/ (I said could) allow malicious coders to flag their 3rd party code as 'safe', or otherhwise circumvent said facility.

      I think the issue at hand here is one of transparency. If this goes the way MS wants it to go, you'll likely not be aware of when you're computer is fetching code to execute from the network, so you've very little idea of the risks you expose your computer to. You're left with far more possible ways of exposing remote users to malicious code. Should you: trick them into thinking it's local code via a dialog? trick the VM into thinking its local code? exploit the requirement for the 'unsafe' flag in order to run unsafe code? There are now numerous ways of going out attempting to execute unsafe code on remote boxes.

      Now, take C, which, yes, most apps are written in, but you download them, install them, and go through a process that essentially makes you aware that your computer now has additional code residing on it, which /could/ be malicious.

      Then take Java, where you /shouldnt/ be able to write unsafe code. A much safer (better, faster, etc are not the issue here) approach when you're dealing with situations in which you might be transparently running execution code fetched from remote untrusted or unfamiliar locations. Only a bug in the VM could lead to code being allowed outside the sandbox, and even then, there is nothing in the language that could let the casual programmer attempt to munch memory, etc ... I'm apt to believe this kind of achitecture likely leads to less possible problems than the .Net approach (of allowing unsafe code at the 'discretion' of the VM). Basically, there are far fewer 'paths' to exploit in the VM in order to execute malicious unsafe code in user memory, and once an exploit is discovered, you still can't really use java to write memory sniffers or access devices, or whatnot.

      Ah well. Thats my 2 cents, from what I understand. For transparent remote-code network applications, I'll take Java's slow-but-safe approach any day of the week over MS's yet-to-be-fulfilled promises of being able to properly manage their own can of (marktable) worms.

      --
      "Old man yells at systemd"
    13. Re:So what? by Shiny+Metal+S. · · Score: 1
      Just like a Word file that asks if you want to run macros. How many users always know when they should say yes?
      It's a good practice to not agree for anything you don't understand... When you don't know if you should say yes - just say no.
      --

      ~shiny
      WILL HACK FOR $$$

    14. Re:So what? by Hiro+Antagonist · · Score: 4, Interesting

      There is a gross difference between Javascript and Java; Javascript is an in-brower scripting language with a rather vague specification. Java is a different beast entirely.

      Java applets are actually different from Java applications; they don't have the ability to interact directly with the contents of the hard drive, in addition to all of the other limitations running in the JVM. The most malicious things that a Java applet can do are make lots of windows (not a problem on a Unix box), or present false information to the user -- essentially, Java applets are no more harmful than HTML.

      I direct you to a pertinent section of the CERT/CC Malicious Web Scripts FAQ:


      Should I disable Java applets?

      The risk associated with Java applets is significantly different
      from some of the other technologies. Java has a robust security
      mechanism designed to deal with situations like these that prevents
      sensitive information from being disclosed or client information from
      being damaged.

      However, Java applets written by an attacker can still be loaded
      while your are viewing a legitimate web page. The problems that can
      arise are similar to those involving the and other HTML
      tags. For example, an attacker could develop a "Trojan Horse" program
      that presented misleading information and prompted you for a password.
      If you failed to recognize the malicious applet for what it was, you
      could accidentally disclose sensitive information.

      You must make your own determination about disabling Java applets,
      based on your tolerance for these risks. If you choose to disable
      Java, please see the detailed instructions below.
      --

      --
      I Hit the Karma Cap, and All I Got Was This Lousy .sig.
    15. Re:So what? by GSloop · · Score: 5, Insightful

      So, it would be perfectly OK for GM to put a "change oil" button on the dashboard of all cars. When you push the button, all the oil is dumped out of the engine.

      Every year around 250,000 people destroy their cars from this button.

      Who's problem is it? The user - probably. But it's GM's problem too. Any problem that occurs in significant numbers is a DESIGN problem. Sure, the user shouldn't, but good design will make it more difficult for a user to screw themselves. It will ALWAYS still be possible - the goal is to make it less likely that the user will do so unwittingly.

      Thus, MS's bugs are mostly MS's fault. They don't care about decent design. To blame the user is a cop-out.

      Cheers!

    16. Re:So what? by kin_korn_karn · · Score: 1

      most people use Word docs at work.

      people are scared to death of their employers and will do anything to make them happy.

      thus, people will always say 'yes' on anything involving work.

      See Also: Enron's 401k plan.

    17. Re:So what? by good-n-nappy · · Score: 1

      True, but this isn't necessarily a reasoned decision. If users see the same dialog box 20 times then they may start to click "OK" out of habit. There is plenty of empirical evidence to make this argument.

      Its also inconvenient for most users if they have to understand what the macros do in every Word document they receive.

      --
      Never underestimate the power of fiber.
    18. Re:So what? by dnoyeb · · Score: 1

      Meaningless. Lets list some "safe" programs. ICQ AIM IE Outlook Express. Real player Morpheus etc... All installed locally. All decalred safe. C# will let all using pointers. All susceptible to buffer overrun exploits.

    19. Re:So what? by Shiny+Metal+S. · · Score: 1
      I'm not saying that people don't answer yes for questions they don't read, hear or understand.

      I'm only saying that it's stupid, that's it. :)

      --

      ~shiny
      WILL HACK FOR $$$

    20. Re:So what? by jallen02 · · Score: 0, Offtopic

      How is Counter-Strike these days. No more 90210?

      :)

    21. Re:So what? by Shiny+Metal+S. · · Score: 4, Insightful
      You're right. If there were no chainsaws, people wouldn't cut off their fingers with them. But that would also mean that other people won't be able to effectively do their work.

      My point is, that when your first priority is to protect stupid people from doing stupid things, you often also protect smart people from doing smart things.

      Maybe I'm just old-fashioned, but I like to understand decisions which I make.

      But I don't know if you understood me, I was commenting:

      Just like a Word file that asks if you want to run macros. How many users always know when they should say yes?
      and I said, that:
      It's a good practice to not agree for anything you don't understand... When you don't know if you should say yes - just say no.
      Do you really disagree with that?
      --

      ~shiny
      WILL HACK FOR $$$

    22. Re:So what? by Lazarus+Short · · Score: 5, Insightful

      I'm not too well-versed on .NET (or compiler/interpreter issues in general), so maybe this is a stupid question, but just because C# has features to manipulate "pointers" doesn't necessarily mean that you're really playing with actual memory addresses, does it? It could just be an (internally bounds-checked) index into a big ol' byte array or something, right?

      e.g.

      print(foo);
      // interpreter looks up "foo" in the symbol
      // table, gets (e.g.) 23, and outputs memory[23]

      fooaddr = address_of(foo);
      // interpreter looks up "foo" in the symbol
      // table, again gets 23; looks up "fooaddr",
      // gets 24, and does memory[24] = 23

      fooaddr = fooaddr + 10;
      print value_at(fooadr);
      // interpreter compares fooaddr (which is 33) to
      // mem_size (which is 30), and dies (or whatever)

      As long as you test in your "value_at" function, you should be clear (from this particular problem, at least)

      Oh, and nice nick, BTW.

      --
      The most valuable commodity I know of is information. - Michael Douglas as Gordon Gekko, Wall Street
    23. Re:So what? by Anonymous Coward · · Score: 0
      Good troll... got a couple of bites, at least.

      You would have got extra points, though, if you'd managed to misspell "Bill Joy"

    24. Re:So what? by arkanes · · Score: 2

      Perl taint mode doesn't do that at all... all taint mode does is force you to apply a regexp to your data before you can use it. ANY regexp. So it's still perfectly possible to screw yourself, just if you do you have only your regexp skills to blame.

    25. Re:So what? by Shiny+Metal+S. · · Score: 1
      most people use Word docs at work.
      "Whenever you find that you are on the side of the majority, it is time to pause and reflect." - Mark Twain
      people are scared to death of their employers and will do anything to make them happy. thus, people will always say 'yes' on anything involving work.
      This gives me an idea how to eliminate the most stupid people from the company.
      --

      ~shiny
      WILL HACK FOR $$$

    26. Re:So what? by km790816 · · Score: 3, Interesting

      Keep in mind that it is remarkably easy for an administrator, either for the local machine or the whole network, to specify .NET security policies that cannot be overriden. This includes never allowing unsafe code that has not been previously authorized by an admin. It's simple, it's powerful, it allows great inter-op with Win32 and COM.

      .NET Framework Enterprise Security Policy Administration and Deployment

    27. Re:So what? by Anonymous+Brave+Guy · · Score: 5, Insightful
      Uhmmm How many buffer overflow exploits & crashes have there been of the years?

      Many. Then again, how many OSes written in Java have their been over the years?

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    28. Re:So what? by km790816 · · Score: 5, Insightful

      On a side note: Does anyone really expect Joy to say anything even remotely suportive of C#. Even if C#/.NET was the greatest thing since sliced bread, (I'm not saying it is) does anyone really expect anyone from Sun, especially one of the guys that created Java, to say anything possitive, supportive?

      It's like asking BillG his opinion on Linux or LarryE his opinion on DB2.

      Let's keep things in perspective, kids.

    29. Re:So what? by Anonymous Coward · · Score: 0

      You're an idiot. You clearly have no idea what "unsafe" means in the context of the CLR. Here's a clue: unsafe on one context (crappy applications) doesn't mean the same thing it does in another (the CLR).

    30. Re:So what? by mtrupe · · Score: 1

      Its obvious that you are not an OS or embedded developer.... Direct memory access is essential.

    31. Re:So what? by ekrout · · Score: 2

      Ironic. Read my weblog entry for today -- it's about hardware support for pointer safety.

      --

      If you celebrate Xmas, befriend me (538
    32. Re:So what? by mtrupe · · Score: 0, Flamebait

      That is an idiotic analogy. We are talking about tools.

      Here is a better analogy-
      Sears makes vice grips, which can perform a number of tasks, but you probably should not clamp them down on your penis.

    33. Re:So what? by JamesOfTheDesert · · Score: 2
      Java is not a scripting language.

      Sure it is. Java is converted to byte code, which scripts a virtual machine. Try running 'top'; The application running is the JVM, not your specific program. You see 'java', not 'SunOwnsMyAss.class' or whatever your program is named.

      (Yeah, yeah, I know, JIT, compiled to native code, blah blah. That's an optimization on top of the JVM. You could do the same for Perl or Python, but that wouldn't mean they weren't scripting languages.)

      --

      Java is the blue pill
      Choose the red pill
    34. Re:So what? by Anonymous Coward · · Score: 0

      How is this ironic? Do you know what irony is?

    35. Re:So what? by nwalker · · Score: 1

      Actually, there is no dialog box. You will merely get a security permission denial error.

      I'm amazed how many people critize the .NET developer platform without having used it, and make assumptions based on previous M$ products.

    36. Re:So what? by Hast · · Score: 2, Insightful

      Naturally, you should make it possible for lumberjacks to use chainsaws. It is also "common sense" that you don't give a chainsaw to your 5 year old to play with.

      Choice is very good, but too much choice is generally bad. Particularly when you give the options to people which clearly shouldn't have them.

      This is why it's not a good idea to let unsafe code be executed on a machine. Even if the user presses "OK" and thus at least the programmer or Microsoft can't be blamed. After all, if the user had any common sense he would know that it is bad to run untrusted code.

      Unfortunately common sense isn't.

      And if people didn't agree to things they didn't understand a lot of people would never get past the first install prompt they faced. As said, if you make user friendly programs and OS's, then you should expect that you will have a lot of computer novices behind the wheels.

    37. Re:So what? by mcc · · Score: 3, Interesting

      And lots of administrators won't bother. The network of NT machines at the high school i went to, just for an example, had a random administrator who was given the job just becuase he'd been a teacher who knew some stuff about computers, and he knew how to set up racks of ethernet switches, and he read some books. This person didn't really have much concept of security; he just disabled anything at all anyone might possibly have wanted to have done, making the computers somewhat irritating to use. And then he went to the people who'd hired him and said, look, on the NT machines you can only run netscape and wordperfect and notepad! It is secure! You will not have to worry about the students abusing the computers! And they were content.

      Despite this, there really was no security to speak of. All he'd done was limit the programs that could be executed to a small list of "approved" software. But he did it by name-- which meant that if you dropped winamp on a machine and renamed it to "notepad.exe", you could run it. The machines all had borland 5 on them, and you could execute programs you had the source to by running them in borland. And those programs could exec() others. And the write permissions were set such that one user could install Snood!, and every other user who used that particular machine forevermore would have Gator Download Assistant or whatever the hell it's called popping up every time they used netscape.

      The point of my story is this: Admining is not all that simple, and many people don't try that hard at it. Windows administration gives you *lots* of options. Lots and lots of options. There's always going to be a couple configuration options that every administrator misses, somewhere, even if they're trying really hard. And lots of the administrators out there are just doing the bare minimum they have to to get their paycheck.

      So, basically, even if it *is* really easy for an organisation to set up a windows xp machine to be really secure and locked down and 'safe', and even if the vast majority of deployers do go in and work out the settings just the way they're meant to,

      If .NET blows up into something really, really big, then the networks of that minority of sysadmins who *don't* know what they're doing, like the one at my high school, are *all* that the next great internet worm needs to wreak quite a lot of havoc.

      Just a thought.

    38. Re:So what? by unclefucknut · · Score: 1
      Furthermore, using code that handles memory directly is a lousy way to implement platform independent software; why do you think there are so many little-to-big-to-little endian conversion functions in C?

      and what difference does direct memory access have when these problems arise in communication channels (not located IN memory mind you)?

    39. Re:So what? by MikeBabcock · · Score: 2

      You're missing the type of "unsafe" code the poster was refering to -- unsafe in coding practice, not in whether it has been cryptographically signed or not. Just because a program is signed (or even distributed with the OS) doesn't mean it is _safe_.

      --
      - Michael T. Babcock (Yes, I blog)
    40. Re:So what? by Anonymous Coward · · Score: 0

      There's also (in theory) a special security privilege to run "potentially harmful" ActiveX scripts or Outlook macros; yet they seem to slip through on a regular basis.

      And if ActiveX and VBS scripts were so great, why would Microsoft go to great expense to replace all of that with the .NET runtime? Especially if the outcome would be the same.

      I'll let you mull that over while you bask in your insightfulness.

    41. Re:So what? by Anonymous Coward · · Score: 0
      Choice is very good, but too much choice is generally bad


      Are we in a communist society? An statement like this just seems to reflect the current sentiment of some people in the U.S.A. It's like people don't want to take responsibility for themselves anymore. Lately, if someone fucks something up once, Congress passes a law to fix it. I won't even go into how many "choices" we used to have that are being legislated away from us (by choice of the people no less!)since 9/11.

      If you don't understand something, err on the safe side. Take responsibility for yourself, for your computer and belongings. "Just say no" if you don't understand!
    42. Re:So what? by Anonymous Coward · · Score: 0

      Technically, JSP files don't contain Java code, they contain "script" which is translated into Java. It just so happens that the "script" currently looks exactly like Java, but that's not an absolute requirement.

    43. Re:So what? by Anonymous Coward · · Score: 0

      The code to be executed is verified by the runtime to be safe by examination of the instructions themselves before it is JIT'd... changing/altering the unsafe flag maliciously in this case will not allow an attacker to run untrusted code on your machine.

    44. Re:So what? by good-n-nappy · · Score: 1

      OK that sounds good on the surface. But we're talking about uses that are similar to Java. So anytime I go to a site that runs the equivalent of an applet, I have to call up the administrator to approve the code?

      Sure, this only applies to "unsafe" code but what's the point of unsafe if no one is going to use it because of unweildy security restrictions. Imagine if they tried to do this with Word macros for example. So every time you want to run a Word macro you have to have admin authorization. Then either no one would use macros (not likely) or this security policy would be changed. And guess what the policy will probably change to... a user dialog box.

      Your argument works OK if we're talking about the traditional software model - where software is installed once by an admin. But that is not the .NET model.

      --
      Never underestimate the power of fiber.
    45. Re:So what? by Anonymous Coward · · Score: 0

      >Ironic
      Get a dictionary.

    46. Re:So what? by tshak · · Score: 2

      I'd place a bet that there are ways around C# security.

      Yup, it's called C++.

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    47. Re:So what? by Anonymous Coward · · Score: 0

      FUD. There is no transparent remote code being executed on home users machines. Yes, on a TRUSTED NETWORK inside of a CORPORATE ENVIRONMENT it is possible for an internal employee to hack a workstation (duh). A ".NET Web Service" runs as a "web site" off of IE, and has nothing to do with C# or the .NET Framework (it's all HTML and JavaScript).

    48. Re:So what? by sheldon · · Score: 2

      You know if you weld the hood of a car shut, the user will never be able to change their oil themselves so it will have to be done by a GM Certified mechanic.

      But the other day welding the hood shut was a bad thing.

      Oh, it's so hard to keep these car analogies straight!

    49. Re:So what? by tricorn · · Score: 1

      Then C is a scripting language also, and the term becomes meaningless. Whether a language can be translated to run directly on the hardware, or needs an interpreter, is mostly irrelevant (a true scripting language is unlikely to be able, or find it useful, to be translated into a native application.

      A scripting language is more a collection of attributes than a hard-and-fast distinction. Most scripting languages are translated directly from source in an interpreter; usually the interpreter is embedded in a program that does other useful things, which the scripting language can control; usually the end user can specify and modify some or all of the scripts that get executed at different times, either to add extensions or to configure the application. Some things are more one than the other, such as various dialects of BASIC.

    50. Re:So what? by Alsee · · Score: 2

      what difference does direct memory access have

      Because the computer gets it's instructions from memory. You have the risk of changing the next instruction in memory to "Format C:".

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
    51. Re:So what? by tomgilder · · Score: 1
      Or wait until Microsoft adds a dialog box that says "Allow unsafe code from Microsft? 'OK' 'CANCEL' 'ALWAYS TRUST MICROSOFT'"
      They already have.


      .NET defaults to fully trusting local code signed with the MS strong name.

    52. Re:So what? by theridersofrohan · · Score: 1
      Many. Then again, how many OSes written in Java have their been over the years?


      But the buffer overflow exploits and crashes have not been just in kernels... How about userland stuff such as ISS/apache, sendmail/exchange etc? Java wouldn't allow that...


      Again though, I do like C...

    53. Re:So what? by Anonymous Coward · · Score: 0

      If you can prevent running unsafe code, how can you possibly run anything unless you have all of the following:

      1) Technical design of the application
      2) Full source code, source of libraries used, etc.
      3) A debugger featuring assembler and high level source debugging.

      Anything I can not verify myself to be secure can in practice not be secure. Anything verified for me by Microsoft is immediately filed with the results of their previous records.

    54. Re:So what? by MagPulse · · Score: 1
      And if people didn't agree to things they didn't understand a lot of people would never get past the first install prompt they faced.

      Exactly. Users are consistently rewarded by clicking OK when they're not sure about things. Clicking OK to enable a virus to execute may not immediately give negative feedback. Only days or weeks later might the system show problems, and possibly in seemingly unrelated ways.

    55. Re:So what? by Anonymous Coward · · Score: 0

      (bowing)

    56. Re:So what? by Graspee_Leemoor · · Score: 1

      One- JavaOS. And lo! it was crap.

      graspee

    57. Re:So what? by Anonymous Coward · · Score: 0

      Saying Microsoft is responsible for developers writing code that is bug ridden and sloppy is like blaming the manufacturer of a hammer for the poor work done by contractors. Your analogy skills are akin to Enron's ability to make money.

    58. Re:So what? by Anonymous Coward · · Score: 0

      Only because it wasn't Scottish.

    59. Re:So what? by bay43270 · · Score: 2

      Maybe I'm just old-fashioned, but I like to understand decisions which I make. That was fine when we were only effected by decisions we make on our own. But now, with these Microsoft bugs, we are constantly effected by the decisions made by others. I may not open email attachments, but if two people in my entire company do, I get 300 emails and I have to restore the backups from my shared drive.

    60. Re:So what? by GSloop · · Score: 1

      Well, have you ever noticed that No or Cancel isn't always the safe thing to do when asked something by Windows?

      For example, when you virus scanner finds a virus, the usual choices are - Delete it, Quarantine it, or Don't do anything. So saying No here is BAD. I can't come up with other examples, but I am sure they are many.

      We're not talking about legislating rights! SHEESH We're talking about reasonable OS and application design. A reasonable design will anticipate common user errors, and TRY to make it difficult to make them. Take the chainsaw example. Most chainsaws have a kickback brake. This means when you use the saw improperly, and it kicks back, the saw stops the chain so you don't get turned into dog food. Have we eliminated choice? No, we just did proper engineering to prevent accidents where possible, even when the saw in misused!

      As for rights that are gone since 9/11, just thank Seig Heil Ashcroft. The justice department was just waiting for such an event, and then asked for the moon. Unfortunatly, since there we're not any BIG MONEY interests opposing such laws, the individuals of the US got screwed. [Depressing huh?!]

      Cheers!

    61. Re:So what? by quintessent · · Score: 2

      Should you: trick them into thinking it's local code via a dialog?

      Such a dialog wouldn't be very effective. The program would have to convince the user to dig into the system's system security policy settings and change them. But even in Java, if you can convince users to do that, you've got them.

      trick the VM into thinking its local code?

      To change its status from untrusted to trusted, your code would need to get outside the sandbox. But if it can get outside the sandbox, maybe it doesn't need to convince the VM after all...

      exploit the requirement for the 'unsafe' flag in order to run unsafe code?

      If the VM sees unsafe instructions in the wrong context, it will not let the code run. The unsafe flag doesn't matter.

      Java has many of the same potential vulnerabilities. Java, like C# has trusted and untrusted modes. The real risk in untrusted mode is that someone will mess up the files on your disk. But, in both languages, this will not happen unless code finds a way out of the sandbox. The advantage of Java is that it has been around longer; it is a more mature platform with a larger installed base. The advantage of C# is they could learn from Java's experience in making something with a lot of the same advantages, but with more flexibility.

    62. Re:So what? by Anonymous Coward · · Score: 0

      Not really, Sun's 1.4 includes sun.misc.Unsafe do to exactly the type of stuff you're describing. http://jguru.com/forums/view.jsp?EID=440215

    63. Re:So what? by Shiny+Metal+S. · · Score: 1
      Maybe I'm just old-fashioned, but I like to understand decisions which I make.
      That was fine when we were only effected by decisions we make on our own.
      So you suggest that I should not like to understand decisions which I make?

      I don't understand what is your point. I just stated my personal, subjective opinion. I said what I like and I will not stop liking that, because other people don't like the same. That's a matter of taste. I like to know what I'm doing. Therefore, I don't say yes, when being asked questions I don't understand. And however controversial it may seem to be, it's just my opinion, so the only reasonable riposte would be: "That's funny, I don't like to understand decisions which I make. You probably really are old-fashioned." or "Me too!"

      --

      ~shiny
      WILL HACK FOR $$$

    64. Re:So what? by jsse · · Score: 2

      This is just like disallowing certain functions to be run in Intranet. The admin here once disallow javascript running but turn out we cannot access to our cooperation database as some functions in javascript cannot be used.

      Similar case here, yes an admin can disable any function but what if they live on these functions? His point is that they shouldn't make such an design at the first place.

    65. Re:So what? by jsse · · Score: 3, Insightful

      On a side note: Does anyone really expect Joy to say anything even remotely suportive of C#. Even if C#/.NET was the greatest thing since sliced bread, (I'm not saying it is) does anyone really expect anyone from Sun, especially one of the guys that created Java, to say anything possitive, supportive?

      So you mean no Java developers can critize C#, especially those who work in SUN, even when the opinions might be reasonable and valid?

      Tell Microsoft stop calling GPL virus! :D

      Let's keep things in perspective, kids.

      I know you are not calling me kids, but I found this statement funny when you said it. :D

    66. Re:So what? by jsse · · Score: 2

      indexing arrays isn't the biggest application on using pointers. :)

      They are talking about abusing pointers, like buffer overflow, not the convenience of using pointers.

      Btw, Java offer similar convenience in using reference in arrays. Yes you may say performance-wise pointer is much better, but consider running code over network security usually outweight performance in most case.

    67. Re:So what? by Malcontent · · Score: 2

      " You're right. If there were no chainsaws, people wouldn't cut off their fingers with them."

      And yet chainsaws have all kinds safety devices built into them to prevent people from hurting themselves.

      --

      War is necrophilia.

    68. Re:So what? by fenux · · Score: 1

      My point is, that when your first priority is to protect stupid people from doing stupid things, you often also protect smart people from doing smart things.

      I'm not clear with this point... i agree it protects stupid people from doing stupid, but is does not protect smart people from doing smart things. It hides some stuff, but it allows them to rtfm and open the hood and find the same button, not on the dashboard, but at the oil resevoir... It forces them to read the car manual before being able to screw arround with the car. this also makes it possible for 'not-smart' people to read the same manual and also be able to do the 'avanced-button-push-stuff' if they really wanted too .. making some things harder to find, doesn't make them harder to use, it just makes sure that noone kan by accident hit the button or be tempted to push the button when they shouldn't.

    69. Re:So what? by unclefucknut · · Score: 1

      Yes, but host byte ordering is of no relevance with respect to this...? I think you should copy'n'paste the whole context before replying ;P

    70. Re:So what? by AndrewHowe · · Score: 2

      Actually it's bird wee.

    71. Re:So what? by julesh · · Score: 1

      Not a huge number. But I don't suspect you'll see many written in C# either, for the same reason: both are too demanding of their runtime environment.

    72. Re:So what? by Anonymous Coward · · Score: 0

      It's a good practice to not agree for anything you don't understand... When you don't know if you should say yes - just say no.

      The firewall has detected an untrusted connection on port 4999, would you like to close this connection?
      [Yes] [No]

    73. Re:So what? by spinlocked · · Score: 1

      One that I know of. JavaOS - it ran on JavaStations. It was crap.

      --
      # init 5
      Connection closed.


      Oh... ...bugger.
    74. Re:So what? by Anonymous Coward · · Score: 0

      You've forgotten one small fact: MS's bugs are the users' problem. Read any software license agreement, it doesn't have to be MS's agreement, any agreement will do. Somewhere in there after the crap about how you don't own this software, there's always that nice little line saying something like "*company* isn't responsible for any harm to a user's data, etc..."

      GM takes responsiblity for their mistakes, MS blames the users. It doesn't matter who's fault the problem is, the agreement between MS and its users states that MS is not responsible.

      Jason

    75. Re:So what? by DVega · · Score: 1
      "Then again, how many OSes written in Java have their been over the years?"

      None. You will not see an OS written in C# either.

      C# is an application level language. So, it make sense to make it safe. It would reduce exploits and crashes.

      You will never find a buffer overflow in Java.

      --
      MOD THE CHILD UP!
    76. Re:So what? by jdavidb · · Score: 1

      Change "at all" to "exactly."

    77. Re:So what? by JWhitlock · · Score: 2
      It's a good practice to not agree to anything you don't understand... When you don't know if you should say yes - just say no.

      Do you really disagree with that?

      Wow - if I did that all the time, I may not be happily married now...

    78. Re:So what? by Shiny+Metal+S. · · Score: 1

      It depends. If I'm in the paranoid mood, I block remote connections to my ephemeral ports and kindly ask my users to use passive ftp sessions. If I'm in more careless and indulgent mood, than I'm generally cool if that's a tcp connection from port 21, when there is open socket from 1024-4999 on my host to 21 on that remote host, but I do check if it's a trusted ftp client listening on my 4999. But my firewall doesn't pop up a dialog box with "[Yes] [No]" for every suspicious packet. If it's suspicious, it just ignores the syn packet, usually not even sending a rst. But sometimes when I'm bored, I send syn ack and see what is sent later... I often listen to suspicious connections on port 23, those are the most fun. Once I've written a fake telnet client giving access to anyone for any user/pass and running bash in a chroot jail. Quite a few people thought they got root and it was quite funny looking at how they were trying to open different backdoors. And the fake file system in my chroot jail was such a mess that they often didn't know what OS actually was it! Man, those where the days! :)

      --

      ~shiny
      WILL HACK FOR $$$

    79. Re:So what? by TRACK-YOUR-POSITION · · Score: 1

      Other riposte: Gee, there's two interpretations of your post, one of which is purely subjective but has nothing to do with C# or word files, the other based on implications one might make from this purely subjective idea into how C#, Java or .doc files should be designed. I guess I'll assume you're not a moron and consider it the latter.

    80. Re:So what? by TRACK-YOUR-POSITION · · Score: 1

      So unsafe features never work? The user must have SOME way of getting unsafe code to work, or unsafe features wouldn't exist. I'm amazed at those who've used the .NET developer platform but don't understand logic. Oh, wait a minute...

    81. Re:So what? by Salsaman · · Score: 2
      Java does a lot of optimisations automatically (such as inlining getters/setters).

      I wouldn't be surprised if indexed arrays ARE turned into pointers in the byte code.

    82. Re:So what? by gorilla · · Score: 2
      Buffer overflow exploits are technically different to pointer problems.

      With a pointer problem, you point the pointer to something you shouldn't have. With a buffer overflow, the pointer is pointing to the correct place, but you stuff too much data into it.

      Some languages have references instead of pointers. The difference between a pointer and a reference is that a reference can only be taken of a well defined object, not an arbitary address, and no arithmetic is allowed on references.

      This means that you can always be sure that a reference is either valid and pointing correctly to an object, or invalid, and not pointing towards anything (NULL in C terms).

      However, this doesn't actually gaurantee that buffer overflow exploits are impossible. If you take a reference of an object that can hold 255 characters, and try to stuff 1024 characters into it, then there is still a chance to cause a buffer overflow. To avoid this, you need to ensure that your low level functions for copying data between the objects ensure that both the reference is valid, and that the target object is sized apropriatly (perhaps by resizing it as required).

      Java, C# & Perl all do this, which is why they're relativily immune to buffer overflows, with only flaws in the language implementation leaving you vunerable.

    83. Re:So what? by gorilla · · Score: 2

      There is only so far you can go in making the programmer write reasonable behaviour into the program. Yes, you can write the wrong regexp and untaint something dangerous in Perl, but how could a program know this? Similarly in Java you can just catch an exception and ignore it, when you should do something with the exception. However, at least the language has tried. Without taint mode or exceptions, the programmer can accidentally do the wrong thing. With them, he has to be boneheaded deliberatly.

    84. Re:So what? by Shiny+Metal+S. · · Score: 1
      Other riposte: Gee, there's two interpretations of your post, one of which is purely subjective but has nothing to do with C# or word files, the other based on implications one might make from this purely subjective idea into how C#, Java or .doc files should be designed. I guess I'll assume you're not a moron and consider it the latter.
      I think you strongly overestimate my deep insight when I said: It's a good practice to not agree for anything you don't understand... When you don't know if you should say yes - just say no. In fact, however deep and full of genius that might have sounded (considering all of those deep references to C# and Java linguistic design, together with Microsoft Office file formats and the security model of software from Sun Microsystems and Microsoft), the shameful truth is, I was just trying to get some attention saying something funny and, well, I got more attention than ever. But thanks for assuming that I'm not a moron. And however I realize that it was just a sociotechnical trick (to force my reaction "oh, I can't disagree because that would mean I'm a moron!"), I still think that was really sweet. :)
      --

      ~shiny
      WILL HACK FOR $$$

    85. Re:So what? by frozenray · · Score: 1

      Keep in mind that it is remarkably easy for an administrator, either for the local machine or the whole network, to specify .NET security policies that cannot be overriden.

      You are, in my opinion, pointing out one of the fundamental flaws about the way Microsoft (and some other major software developers, too) think about security. They design with features and ease of use in mind, but make security opt-in because it generally gets in the user's (and the administrator's) way.

      The problem with this approach is that no matter how easy it is to enable the security features, many people will not know about the process or just be too lazy or whatever. Maybe just one percent or less, but given the overall population of, for example, Windows, that's quite a lot of users. The "opt-in security" approach practically guarantees that the internet is going to be plagued by the offspring of CodeRed, Nimda and ILU for years to come.

      I like OpenBSD's way of doing things better (at least as far as I can tell, I'm not using it myself): Start with a rather minimal, peer reviewed feature set. If the administrator adds an insecure application to it, he'll still get owned - but that will be fewer people than with the opt-in approach.

      Raymond

      --
      "There are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare." - Blair Houghton
    86. Re:So what? by km790816 · · Score: 2

      No. I'm saying we should keep things in perspective. I'm a java developer and I love .NET. I'm saying that one should be careful to whom one listens.

      I'd say listen to Windows guys about what they think of Linux, but I'm not going to base my decision on what's on Microsoft.com.

    87. Re:So what? by Godeke · · Score: 1

      It's a good practice to not agree for anything you don't understand... When you don't know if you should say yes - just say no.

      "Save changes to document Really Important Stuff? (yes/no)"

      No

      Aaaarrggh... look what you made me do!!!

      --
      Sig under construction since 1998.
    88. Re:So what? by Shiny+Metal+S. · · Score: 2
      It's a good practice to not agree for anything you don't understand... When you don't know if you should say yes - just say no.
      "Save changes to document Really Important Stuff? (yes/no)"
      No
      Aaaarrggh... look what you made me do!!!
      If you don't understand that, then you have much more serious problem than anything what I'm talking about here.
      --

      ~shiny
      WILL HACK FOR $$$

  3. Cbb by 2ms · · Score: 1

    At best it would be C double flat

  4. Taaaaaake oooooooon ceeeeeeee by Anonymous Coward · · Score: 0

    Take on the C

    1. Re:Taaaaaake oooooooon ceeeeeeee by Anonymous Coward · · Score: 0

      Take C on!

      whoa oh oh oooohhhhh

  5. Is this a shock? by soulhuntre · · Score: 1, Flamebait

    "Bill Joy, co-founder and chief scientist of Sun Microsystems, is the principal designer of the Berkeley version of the Unix operating system (BSD) and a co-author of "The Java Language Specification."

    So he doesn't like .NET. What a shock. he's usually so balanced and objective.

    Ah well, when he gets stomped flat again he can always sue, that seems to be sun's primary strategy these days.

    --
    --> Fight tyranny and repression.... read /. at -1!
    1. Re:Is this a shock? by Anonymous Coward · · Score: 0

      Isn't that also /Microsoft/'s strategy these days (and many past)? The difference is that Microsoft uses lawsuits as a method to bully smaller companies that they don't want to or are unable to buy.

  6. Trustworthy Code by SteveX · · Score: 5, Interesting

    You can use C# to write "Unsafe" code, but it's the runtime that ultimately decides whether or not to let it run. For example, if the VM that the browser creates tries to launch a C# app downloaded from the Internet, and it's "Unsafe", the CLR will refuse to run it.

    Difference between C# and ActiveX in this case is that in ActiveX, everything is "Unsafe" and you either take it or leave it. In Java, of course, everything is "safe". C# can go either way.

    I really hope that Microsoft simply makes it impossible to run "Unsafe" CLR code in the browser. Not even an option.

    - Steve

    1. Re:Trustworthy Code by martinde · · Score: 1

      In Java, everything is "safe" except for calls to native. (I.e. there's a way around it in Java too.)

    2. Re:Trustworthy Code by xphase · · Score: 3, Informative

      The problem is that even "safe" Java has had security problems. Not relating to the language itself necessarily, but relating to browser/platform implementations.

      See the Risks Digest:

      17.39

      17.83

      18.18

      and there are many more listed in the archives.

      So until the languge/CLR mature enough, then there will be more problems with an insecure language.

      Also, note that most early Java security problems were found because sun encouraged people to find them, and then Sun would fix the problems. Microsoft doesn't want people to find and disclose bugs in it's software, so it may take longer to mature security wise.

      --xPhase
      P.S. pardon any spelling errors, i'm tired.

      --
      The following sentence is TRUE. The previous sentence is FALSE.
    3. Re:Trustworthy Code by gergi · · Score: 2

      C/C++ is unsafe because it allows to have pointers.
      Java is safe because it doesn't.
      C# is either safe or unsafe, depending on how you write the code?
      So... why would we use C# in place of C++ for applications where safety isn't necessary (or more likely, practical)? and why use C# over Java when safety is desired?

      --
      Nosce te Ipsum
    4. Re:Trustworthy Code by TWR · · Score: 2
      Except that you can't run native code in an applet unless the applet is signed AND the user has granted recognition to the signature.

      -jon

      --

      Remember Amalek.

    5. Re:Trustworthy Code by Anonymous Coward · · Score: 0
      How about because Java takes an eternity and a half to get anything done?


      The real question is, why ever use Java when you have C#?

    6. Re:Trustworthy Code by Anonymous Coward · · Score: 0

      ... and the same should be true for unsafe code in .Net.

    7. Re:Trustworthy Code by Guignol · · Score: 1

      How is this "unsafety" managed ?
      I really wonder how the VM knows the code is safe or not.
      If it is just marked at compile time, then it won't be long till a modified compiler will mark just about anything as safe even if not. We all know why and from who.
      So how does the VM executes new downloaded code ?
      Does it verify it completely before just to know if indeed it is safe or not ? and then isn't this a rather long process ?
      How does this work ? in the end where do you want your trust to go today ?

    8. Re:Trustworthy Code by Glock27 · · Score: 2
      In Java, of course, everything is "safe".

      Not for at least two usages of the word "safe".

      First, Java can run C code using JNI, just not by default in the browser sandbox. Any Java application can use JNI. This is the direct comparison with the "unsafe" keyword in C#. The main difference here is it is much less easy to mix unsafe code throughout your project in Java.

      Second, Java can do "unsafe" (in the generic sense) things like delete files, just not by default in the browser sandbox.

      Finally, a signed Java applet running in the browser sandbox can request additional privileges outside the sandbox, but it is up to the user to grant them.

      I hope that helped.

      299,792,458 m/s...not just a good idea, its the law!

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    9. Re:Trustworthy Code by Anonymous Coward · · Score: 0

      Because I can write twice as much in half the time in C# for many applications. Yes, just like Java, however, a lot of us find C# and .NET a lot more elegant.

    10. Re:Trustworthy Code by FastT · · Score: 2

      One clarification. Potentially unsafe code in Java, such as deleting files, must be written to explicitly request permissions from the Java security infrastructure. Code that does not ask permission will not run in a sandboxed environment. Java's security infrastructure is not tied to running in a browser or other hosted environment--the user can change the permissions for running any piece of Java code, anywhere on the system.

      --

      The only certainty is entropy.
    11. Re:Trustworthy Code by Glock27 · · Score: 2
      One clarification. Potentially unsafe code in Java, such as deleting files, must be written to explicitly request permissions from the Java security infrastructure. Code that does not ask permission will not run in a sandboxed environment. Java's security infrastructure is not tied to running in a browser or other hosted environment--the user can change the permissions for running any piece of Java code, anywhere on the system.

      The default behavior for Java applications, though, is no sandbox.

      299,792,458 m/s...not just a good idea, its the law!

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    12. Re:Trustworthy Code by tomgilder · · Score: 1
      I really hope that Microsoft simply makes it impossible to run "Unsafe" CLR code in the browser. Not even an option.

      There is an option - but its quite well hidden and obvious as to what it does. IMO its a shame you can't disable ActiveX in IE and only enable .NET apps.

      You can see the default security policy on MSDN. Basically controls in the Internet Zone, by default can...
      • Show an open file dialog to the user, and read a file if the user selects one.
      • Have up to 10Mb of isolated local storage for up to 365 days.
      • Display a print prompt dialog.
      • Open top-level windows of a limited size.
      • Connect back to the site of origin to send/receive data.
      • Put data onto the clipboard, but only read data copied from itself.
    13. Re:Trustworthy Code by Graspee_Leemoor · · Score: 0, Flamebait

      Oooooh, Java is safe! You can't hurt yourself! Just like a nice rubber room! See? You can run round bouncing off the nice safe walls and still be safe and happy. Oh so happy.

      Give me the power! Give me the electricity crackling through my fingers that is C!

      World Shakin' !

      graspee

    14. Re:Trustworthy Code by spongman · · Score: 2

      it verifies the code instruction by instruction. Java VMs do this too. it's pretty simple.

    15. Re:Trustworthy Code by gorilla · · Score: 2

      It's very important to seperate the design, and the implementation. In an ideal world, they will be the same, but we don't live in an ideal world. If the design is good, then it's possible to fix the implementation. On the other hand, if the design is bad, then nothing you can do with the implementation will fix it. This is the problem that MS Office, MS Outlook and Javascript have, in that their basic security model is flawed, and have had to be tweaked as exploits were discovered.

  7. Secure code IS NOT related to language. by DaEvOsH · · Score: 1

    Yes, C# makes programs written by stupid programmers a tad most secure.

    But I wonder why MOST of all the secure code is written in unsecure C or C++. I think it all boils down to coding practices and priorities. MS priorities are very different from that that has, traditionally, produced safe code.

    Now if MS gets itself together with this 'secure' software initiative open source and linux is going to face a big challenge. My XP computer has not crashed in 3 monthes, and I use it 10, 15 hours every day in what I consider a heavy load. It's still bloatware in many aspects, but it is good.

    1. Re:Secure code IS NOT related to language. by MtViewGuy · · Score: 2

      I think someone should throw the gauntlet down: let's see Bill Joy come up with a truly secure code for Java. And I mean some that meets the C2 standards for security, too.

      What is known is that you can write some pretty destructive programs in Java, too. Why do you think Network Associates and Symantec have spent a lot of time with their antivirus programs to protect against unsafe Java programs?

    2. Re:Secure code IS NOT related to language. by crush · · Score: 1

      I think someone should throw the gauntlet down: let's see Bill Joy come up with a truly secure code for Java. And I mean some that meets the C2 standards for security, too.

      Or how about a Sun Microsystems sponsored competition to see who can come up with the most destructive C# programs? There would be bonus points for getting them to do destructive things to Linux boxes running Mono!

    3. Re:Secure code IS NOT related to language. by Anonymous Coward · · Score: 0

      Why do you think Network Associates and Symantec have spent a lot of time with their antivirus programs to protect against unsafe Java programs?

      So they can make more money?

  8. That's ok, we forgive you. by AltGrendel · · Score: 1, Offtopic

    NOT!

    --
    The simple truth is that interstellar distances will not fit into the human imagination

    - Douglas Adams

    1. Re:That's ok, we forgive you. by nixadmin · · Score: 1

      THanks~!

  9. Unsafe code by Anonymous Coward · · Score: 1, Insightful

    It is possible to write unsafe code in any language that gives you access to the OS. This is called "power" as in "C is a very powerful language".

    The alternative is "safe" code as in "Java is a very safe language because you can't step outside its sandbox".

    C# is what happens when Java developers grow beyond the sandbox.

  10. An Unsafe code example: by CTalkobt · · Score: 0, Troll
    Let's see... I wonder if this would be allowed if unsafe is now a keyword in C#:

    a = (unsafe_case)( get_secure_password( "XX

    The joys of MS programming languages.

    Btw the open and close blockquote cause auto-indentation unless you force a [p] (substitute) on the line being blockquoted.

    --
    There's a gorilla from Manilla whose a fella that stinks of vanilla and has salmonella.
    1. Re:An Unsafe code example: by Anonymous Coward · · Score: 0

      Umm, yeah, that's what blockquote does, bumfuck.

  11. C# FUD? by glh · · Score: 4, Interesting

    This sounds like FUD. He didn't really post any examples about what kind of problems C# has for security, that would have been helpful.

    I think a lot of people are upset because MS has actually come out with something that can compare with Java finally.. The ability to write unsafe (unmanaged is what that really means, meaning the garbage collector and built in memory management features of the CLR won't touch it) is an added bonus to Java.

    I think the real question is- how secure is the .NET common language runtime?

    1. Re:C# FUD? by Anonymous Coward · · Score: 0

      Unsafe code is not the same as unmanaged code. Unmanaged code is regular x86 code that can do anything it wants. Unsafe code is managed code (IL opcodes) that the runtime cannot verify is always safe, such as direct pointer manipulations.

    2. Re:C# FUD? by Zeinfeld · · Score: 2
      This sounds like FUD. He didn't really post any examples about what kind of problems C# has for security, that would have been helpful.

      I really would hope that Joy would be above stooping to a FUD strategy. But apparently not.

      What Joy does is to conflate two separate issues. The first is network code, the second is adding runtime code safety to C.

      Nobody disputes the fact that network code should be safe. Microsoft's security policies don't let you download unsafe code by default and the CLI runtime checker kicks in in precisely the same way it does in Java.

      That is not the same as saying that there is no use in any circumstance for unsafe code. The vast majority of the Linux kernel is 'unsafe code' if you want to be pejorative. Java simply refuses to ever let you write a piece of code of that type in Java and tries to make interfacing to that type of code as hard as possible. Microsoft on the other hand have rather a lot of legacy C++ code that they want to access even though they can't rewrite every line in C#. I think that Microsoft's interest here is closer to that of most developers.

      As for the MIME type FUD, it is a real pity that sun deliberately bypassed the MIME type system in HTTP to prevent firewalls being able to block Java. I made the protest at the time, they ignored it.

      Equally criticising Microsoft for not implementing the Javascript security model is a bit rich since few people outside Netscape would agree that Javascript has a security model. By their own admission Javascript was thrown together in a fortnight and thrown out the door with almost no checking.

      Sun would do much better to consider how they are going to survive as a specialist hardware manufacturer as Linux comoditizes the UNIX workstation market rather than spend their time engaged starting stupid arguments with Microsoft. As Balmer himself points out lots of companies have lost their way by focussing on Microsoft's business model instead of their own.

      The problem with Java is that it is a closed, proprietary language whose primary design criteria has become 'get Microsoft'. In the process Java has been deliberately made less useful to windows programmers, which means the vast majority.

      I think that Sun is playing right into Microsoft's hands by balkanizing software development into Java and Windows camps. History suggests that the larger developer pool will win out in the end. A stupid, stupid strategy.

      --
      Looking for an Information Security student project suggestion?
      Try http://dotcrimeManifesto.com/
    3. Re:C# FUD? by Anonymous Coward · · Score: 0
      The problem with Java is that it is a closed, proprietary language whose primary design criteria has become 'get Microsoft'. In the process Java has been deliberately made less useful to windows programmers, which means the vast majority.


      Unlike C#/.NET which is a closed, proprietary technology who's primary design criteria has always been "get the internet onto Windows and nothing else". Please don't come back with "what about mono", since you know as well as I do Microsoft will put just enough hooks in their version to make other versions a hassle to use in some way or another.


      Also, it'd be great if you could point out how exactly Java has become "anti-Microsoft" in any way except by Microsoft itself? Time and time again Microsoft has demonstrated that they refuse to inter-operate properly with other technologies that aren't centered around Windows. How this "helps" those enterprise Windows programmers who must deal with a growing number of non-Windows systems (ie: the vast majority) is seemingly only knowable by a select few like you.

    4. Re:C# FUD? by Anonymous Coward · · Score: 0

      Watch out, its an astroturfer. Obviously with a small army of paid moderators at his back. Don't point out the big, gaping flaws in his logic unless you want BSA goons knocking at your door.

    5. Re:C# FUD? by Zeinfeld · · Score: 2
      Also, it'd be great if you could point out how exactly Java has become "anti-Microsoft" in any way except by Microsoft itself?

      There is nothing to prevent people writing to a portable sub-set of C# if they chose to do so. That is very different from Java which denies choice, programmers are forced to program to the lowest common denominator.

      The problem with Java is that the language will always be limited to the subset of functionality that it serves Sun's interests to provide. Optimised i86 code and direct access to native O/S features don't meet those interests. So they will never be first class features of the language, even if Sun does not sick its lawyers onto companies that try to provide them.

      While C# reflects Microsoft's interests those are much more closely tied to those of developers. It is not in Microsoft's interest to limit functionality in any way.

      --
      Looking for an Information Security student project suggestion?
      Try http://dotcrimeManifesto.com/
    6. Re:C# FUD? by RickHunter · · Score: 3, Informative

      The problem with Java is that it is a closed, proprietary language whose primary design criteria has become 'get Microsoft'. In the process Java has been deliberately made less useful to windows programmers, which means the vast majority.

      Care to explain just how Sun is doing this? Every Java tool I've seen has either been totally platform-neutral (which I suppose can be interpreted as 'get Microsoft') or heavily biased towards Windows users. The 1.4 JVM adds a whole load of useful new stuff - again in a platform-independant way. How is this evidence of a "get Microsoft" mentality? Or making it any less useful to Windows programmer?

      And network code and runtime code safety aren't two seperate issues. They're the same issue. Making sure code that's been fetched and run from a remote source, perhaps as a small part of a larger program, doesn't go on a wild romp through the system sounds pretty damn similar to a "runtime code safety" issue to me.

      Finally, what exactly do you mean by "prevent firewalls from blocking Java"? Do you mean "blocking Java applets"? "blocking Javascript"? (Which is NOT Sun, BTW)

    7. Re:C# FUD? by negacao · · Score: 0
      I totally agree...

      Because of this article alone, I've come to thinking that Bill Joy is a blithering idiot..

      Go figure..

    8. Re:C# FUD? by unclefucknut · · Score: 1
      managed and unmanaged code refers to memory handling (GC or not to GC).

      Unsafe code can be both IL code (managed and unmanaged) and x86 code (managed and unmanaged) if I have understood everything correctly.

    9. Re:C# FUD? by ChannelX · · Score: 1
      There is nothing to prevent people writing to a portable sub-set of C# if they chose to do so. That is very different from Java which denies choice, programmers are forced to program to the lowest common denominator.

      This is completely untrue. First of all nobody is holding a gun to anyone's head to program in Java. Second, what exactly is lowest common denominator? 1.02? 1.1? 1.2? 1.3? 1.4?


      Again and again and again people act like Java on the client is where it's at and it simply isn't true. Windows features mean shit where Java is most popular which is on the server.

      The problem with Java is that the language will always be limited to the subset of functionality that it serves Sun's interests to provide.

      Again total bullshit. If it were only Sun's interest the JCP wouldn't exist. If it were only Sun's interest Oracle wouldnt have created a native compiler for Java in the Oracle DB.
      --
      My blog: http://jkratz.dyndns.org/~jason/blog/
    10. Re:C# FUD? by Zeinfeld · · Score: 2
      This is completely untrue. First of all nobody is holding a gun to anyone's head to program in Java.

      That is not what I said. Java only allows you the choice to use it or not. If you try to develop a version of the language that meets your needs that Sun does not like, Sun will sick lawyers on you.

      Again total bullshit. If it were only Sun's interest the JCP wouldn't exist. If it were only Sun's interest Oracle wouldnt have created a native compiler for Java in the Oracle DB.

      My experience of JCP is that Sun decides who gets to chair your group then the chair goes off to do what they damn well please. It is not an open process at all. Oracles's java compiler is clearly in the interests of Sun as well as Oracle.

      --
      Looking for an Information Security student project suggestion?
      Try http://dotcrimeManifesto.com/
    11. Re:C# FUD? by jimfrost · · Score: 1
      Generally speaking I agree with you. I note, however, that Java has always had the ability to integrate with unsafe code via native libraries. In effect Java's version of the "unsafe" keyword is "native".



      This is occasionally useful, but practically speaking I've not had to use it even once in a production setting and I would avoid it if at all possible because you see best benefit from Java if you're taking advantage of its protection mechanisms. I find myself to be a solid 300% more productive long-term in Java than I was in either C or C++ (and I'm prodigious in all of them). On top of that, released bug counts are down an astounding 90% and tend to have much reduced impact. I don't know about you, but a three-fold improvement in productivity and an order of magnitude reduction in bug counts is something I can (and do) take to the bank.



      Regarding the viability of C#, I don't see any particular reason why it cannot be quite popular, although I would have significant reservations in architecting systems that utilize code downloading even in a safe environment. In my experience downloading code into a runtime becomes a real problem whenever you can't be sure that the runtime is the same version as the one which you originally targetted. Differences, even very minor differences, show up as improperly executing code. We saw this in spades while trying to develop Java applets that would run in various versions of Netscape.



      I am as yet unfamiliar with how C# handles this particular wrinkle, but it is critical to the widespread success of a downloadable format.



      I for one think that C# is likely to be a huge step forward in any case, particularly if Microsoft redesigned its APIs in the process. God knows that the MFC classes suck rocks. They did a rather nice job in J++ (RIP), and I can only hope that the J++ work carried over to C#.

      --
      jim frost
      jimf@frostbytes.com
    12. Re:C# FUD? by Anonymous Coward · · Score: 0

      No, you do not understand it correctly. But don't let that stop you from posting. This is /., after all.

    13. Re:C# FUD? by ChannelX · · Score: 1
      That is not what I said. Java only allows you the choice to use it or not. If you try to develop a version of the language that meets your needs that Sun does not like, Sun will sick lawyers on you.
      As is their right....its their language. I still dont get why everyone thinks that submitting your language to a standards body is a panacea. It isn't. Look at how limited the C# submission to ECMA is and how much control Microsoft still retains over it.
      My experience of JCP is that Sun decides who gets to chair your group then the chair goes off to do what they damn well please.
      And of course I have to ask how you came to get that experience? I've never heard of anything similar.
      Oracles's java compiler is clearly in the interests of Sun as well as Oracle.
      Aside from the fact that its related to Java I dont quite see how it is really in Sun's interest that Oracle made a compiler for their DB product. It definitely is in the interest of Oracle's customers and Oracle but I just dont see that Sun would be any better off one way or another by it.
      --
      My blog: http://jkratz.dyndns.org/~jason/blog/
  12. C# sounds powerful! by Anonymous Coward · · Score: 0

    What they describe sounds like an increase in flexibility for the programmer.

    The objection to what C# lets you do reminds me of the time old codenazis who scream and shout about using "Goto"

    The same mindset is found with those who say that M$ should get rid of the Start button in Windows. Not replace it with something better and leave it still there: just get rid of it altogether.

    1. Re:C# sounds powerful! by Anonymous Coward · · Score: 0

      The objection to what C# lets you do reminds me of the time old codenazis who scream and shout about using "Goto"

      No compiler for you!

      P.S. - I will personally kill any programmer who suggests the usage of GOTOs in my shop.

  13. Wow by mosch · · Score: 2

    Wow, so Sun doesn't like MS technologies. What's next, Microsoft spreading FUD about Open Source?

  14. define "unsafe" again please by JDizzy · · Score: 2

    "In unsafe code it is possible to declare and operate on pointers"

    I'm not a computer scientist, just a unix admin. My question is: Since when has operating on pointers been considered unsafe? Pardon my lack of understanding, but with that definition, wouldn't 99.9% of all code then be considered unsafe? And does't JAAVA use pointers too? Honestly I duno..

    --
    It isn't a lie if you belive it.
    1. Re:define "unsafe" again please by Kingpin · · Score: 1


      If Java crashes, it may take the VM down. Not
      other apps. This is why Java is a good choice for
      eg. mobile units (phones, PDAs..). Naturally people
      can screw up on the VM, but at least Joe Blow cannot
      take down your embedded OS by his Downer.java.

      --
      Unable to read configuration file '/bigassraid/htdig//conf/14229.conf'
      Geocrawler error message.
    2. Re:define "unsafe" again please by TulioSerpio · · Score: 1

      In Java you cant use pointers.

      --

      I'm from Argentina: Tango, Asado, Mate, Gaucho, Maradona, YPF

    3. Re:define "unsafe" again please by pizen · · Score: 1

      And does't JAAVA(sic) use pointers too?

      Java uses pointers internally but the programmer never as to see or deal with those pointers.

    4. Re:define "unsafe" again please by ArthurDent · · Score: 3, Informative

      Pointers are pretty ubiquitous in C, and a large percentage of existing code is in C, but not 99%. Now, you can write good pointer code and bad pointer code just like anything else. To declare all code that uses pointers to be unsafe is bizarre. The danger with pointers is that you can get them pointing at weird places and get weird results. :)

      Java (unless things have changed recently) does not use pointers. That, IMHO, is one of it's benefits, not because pointers make things unsafe, but because the code is easier to follow and understand.

      Ben

    5. Re:define "unsafe" again please by gergi · · Score: 2

      Java doesn't have pointers... well, at least not that you (as the programmer) can see.

      --
      Nosce te Ipsum
    6. Re:define "unsafe" again please by Rich0 · · Score: 1

      My understanding is that Java does not use pointers, but I could be mistaken. Honestly, I'm not a big fan of pointers. They have some uses, but I think languages and libraries and optimizers have progressed to the point where they are no longer necessary. Unfortunately, the C language is structured in a manner that makes it almost impossible to not use them. I learned Pascal back in middle school, and pointers were a feature that got explained somewhere around chapter 50 of most books. In C you're using them around chapter 2. Of course, pointers are closer to how the actual machine operates, and back in the day of highly limited CPU power it was important to cut out the fat anywhere you could. Now, optimizing compilers are pretty good, and when that isn't enough most companies would rather spend a few thousand bucks on a faster computer than fight off bugs because of some obscure memory leak. I'm all for good coding practices. Even if poorly written programs don't crash, they still can be slower and much harder to maintain. Still, we don't deter bad driving by designing cars that explode because of a 1 MPH collision. We shouldn't design languages that way either...

    7. Re:define "unsafe" again please by Shiny+Metal+S. · · Score: 1
      I'm not a computer scientist, just a unix admin. My question is: Since when has operating on pointers been considered unsafe?
      It's unsafe in a sense, that your code can segfault.
      --

      ~shiny
      WILL HACK FOR $$$

    8. Re:define "unsafe" again please by watanabe · · Score: 4
      The reason that one considers working with pointers unsafe is that, for example, in C, one uses the pointer to get at an actual location in memory, and do something with what is there. Programmers frequently want to work quickly and directly with the actual bytes in RAM; for example a 10x10 integer array may be implemented in C for performance / algorithm reasons as a 1 dimensional array of 100 integers.

      The problem occurs when the programmer writes their code to work through that array using pointer / address arithmetic. Perhaps the programmer is one byte off in their math, but only on the 100th integer. That is, they read the 101st number.

      Maybe the 100th number is 99% of the time 0, and 1% of the time is 1 (I know, I'm mixing my bits and bytes, but, bear with me, please). The 101st number is just some random value in RAM. It might be 0, or it might be 1. It might be used by some other structure, it might not be used. YOU DON'T KNOW. However, the bug will only show up in the event that you use the number, and that the number is different than you expected. Those two don't happen so often. Ergo -> Jane programmer spends two weeks of her life tracking down a random crash triggered by a function that relies on that last value being 0 based on certain preconditions.

      This isn't about computers crashing, it's about memory error bugs. I once wrote a ray tracer which got the colors terribly wrong once the light sources got too bright. After some checking, it turns out my light values weren't being capped at 8 bits. They were overwriting into the adjacent byte, and screwing up color values for pixels near them. Oops. Things like that don't _ever_ happen in Java, say.

    9. Re:define "unsafe" again please by aoeuid · · Score: 1

      Its windows fault itself if it lets you point your pointers to those odd locations. Since the 386 Intel processors have had a feature known as protected mode which has allowed the operating system to assign specific memory regions to each application, and it will generate an exception letting windows know when it happens that another application tries to read or write to this area. The security risk is not inherently with the concept of pointers. It's with the fact that some operating systems don't adequately protect their memory. Pointers are a fundemental aspect of programming, and always have been.

    10. Re:define "unsafe" again please by Anonymous Coward · · Score: 4, Insightful

      The key point here is memory safety, which C (and C#'s with the unsafe keyword) lack. In a language with memory safety, buffer overrun vulnerabilities and the like can't happen.

      Typically, memory safety is tied to type safety. (But, memory safety really has nothing to do with pointers. For instance, SML/NJ allows pointers, but is memory safe, since the type system won't let you treat an integer as a pointer. In SML/NJ, the type system essentially provides you with a proof that your code is memory safe). So, if your code type checks, it *is* memory safe.

      The two concepts are distinct, though. Java is memory safe, but you can break the type system with casting. So their is no *static* guarantee that your code is memory safe, but the VM includes runtime checks to make this a dynamic guarantee.

    11. Re:define "unsafe" again please by Chris+Burke · · Score: 2

      I'm being pedantic here, but the 286 was actually where protected mode was introduced. It was a 16-bit protected mode, and thus not very cool, but it did provide a modern notion of segmentation where you could prevent programs from accessing memory outside of those areas defined in their segment descriptors.

      What's too bad though is that when the 386 came out and introduced the vastly more flexible paging mechanism, the segmentation stayed. Now, basically all programs run with 1 code and 1 data segment, with base address 0 and range 4GB, and paging takes care of everything else. But what's a little more cruft in x86? :)

      --

      The enemies of Democracy are
    12. Re:define "unsafe" again please by Charles+Dexter+Ward · · Score: 1, Insightful

      I'm not a computer scientist, just a unix admin. My question is: Since when has operating on pointers been considered unsafe?
      That statement is a dangerous one for you reputation as a good admin. Almost every bug or security hole is related to bad pointer handling. Pointers are a very powerful tool, but as such, they are extremely dangerous, specially when used in a not type-safe environment.
      As for your claim of 99.9% of the code to be considered as unsafe, i dont think the percentage is so big, but it comes quite near. How do you think the patchers and support staff live from?. It's an inevitable part of software.

      Just for the record, JAVA does NOT have pointers.

    13. Re:define "unsafe" again please by ArthurDent · · Score: 1

      No, it's the programmer's fault for letting their pointers get out of control. Protected mode would not be needed if not for buggy code that other processes need to be protected from. Those exceptions are caused by bugs in the code that raised them.

      The OS can compound the problem by not using protected mode, but strictly speaking it's not the OS' fault that someone wrote buggy code.

      Ben

    14. Re:define "unsafe" again please by cheezit · · Score: 1

      Pointers are NOT unsafe. However, there are several "safety" problems with pointers in C. A different language that allowed the use of pointers could avoid these problems.
      1. Untyped pointers (void*): I can create a generic pointer that prevents the compiler from enforcing type safety. Not a good practice for general-purpose code, but sometimes it is required.
      2. Pointer arithmetic. Arrays are handled as pointer+offset; this can lead to problems when array size is ignored or miscalculated.
      3. Mixing of data pointers and code pointers. The fact that I can take a function pointer and store it in a void * creates flexibility but also problems. The compiler is prevented from protecting the function pointers.

      Java uses "references" which are just fancy pointers but you can easily find the pointer value that the VM is using at runtime. It's just that you can't do anything useful with it in your application.

      --
      Premature optimization is the root of all evil
    15. Re:define "unsafe" again please by markmoss · · Score: 5, Informative

      First off, I'm primarily a hardware engineer, who writes small programs in C or assembly that deal directly with hardware. So I use pointers and other "unsafe" code a lot; they are both extremely useful and extremely frustrating when it comes to debug time.

      Pointers let you use just about any arbitrary number as an address and poke data in there. The virtual memory system might block this on the grounds that you don't have a page at that address -- but not all computers have the hardware to do that, you can still do horrible things by writing to the wrong place in the pages you do own, and if the protection does block the misplaced write, the resulting invalid page error is not pretty from the user's point of view.

      Pointers can be used safely -- if you program very well, like checking every address before you use it (which takes a hell of a lot of extra code), or checking the data going into the pointer calculations to ensure that no way could a wrong value come out (which assumes you didn't make any programming mistakes). And if it is a case of running downloaded code where there is a finite chance that the programmer is _maliciously_ misusing pointers, there is no way for the computer to analyze the code and detect this before you run it. Hence Microsoft's attempt to make internet and e-mail user friendly by automatically running any included executables spawned a plague of viruses, worms, and trojans...

      C++ gives you the choice of traditional pointers or references. A "reference" is a sort of super-pointer that includes data on where valid targets must be, and gets checked for validity every time you use it. I don't do Java, but I am under the impression that it uses references only. That isn't enough in itself to prevent writing Java viruses, but it gives the OS a fighting chance of confining them to the sandbox...

      OTOH, no computer is going to run entirely on "safe" code. At some level, the code has to read and write hardware registers. To do that, you take the numeric address of the register, and use that as a pointer. True, a good, secure OS would confine all such activities to drivers, which can only be installed by the administrator, who ought to know the difference between a driver and a trojan. But Microsoft doesn't write OS's like that -- NT/2000/XP is rather improved on DOS where direct writes to the video card were almost mandatory, but the security is still swiss cheese.

      Incidentally, the original reason for C allowing all sorts of unsafe activities (pointers everywhere, strcpy with no length check, etc.) was performance. Checking the length of a string every time it was used took CPU cycles and RAM to hold the extra machine code. So the creators of C left it up to the programmer to shove in an if statement to check the length when the string was input, and to do the math and pop in another if statement anywhere it was possible for the string to grow too long. This was efficient, but puts quite a load on the programmer. About that time, I was running an 8 bit computer with 16K of RAM, clock speed under 1M, and all the accounting, class schedules, grade reports, etc. for a small college went through it. Efficiency was important! Now, who's going to notice whether the program runs in 1 millisecond or 2? It's better to be reliable. And it's necessary to get the program up and running pretty fast -- that's a lot easier if you don't have to worry about pointers going wild except when you do go to the hardware.

      In C# apparently the programmer has the choice of using references and avoiding all "unsafe" code, or of declaring a module "unsafe" and programming any way that gets the job done. By making "unsafe" a PITA, they've encouraged programmers to avoid it except when absolutely necessary. I have a suspicion that once the coders get used to it, that will increase their productivity overall. In addition, it gives any tool that may run code from outside a quick way of determining whether the code was written to be safe or not. In theory...

      I have serious doubts about whether that (being able to run "safe" C-sharp programs) will actually work. First off, won't a virus-writer be able to hack the tags that say "unsafe"? Second, ways to do unsafe things in "safe" code will be discovered. Third, if your OS has security like swiss cheese, no program is going to really be safe. Do e-mail viruses actually have to do anything that isn't allowed?

      From what I've heard, Microsoft's idea of securing Outlook was to have it look at the HTML tag, and if it said executable pop up a warning which is incomprehensible to the people who are actually ignorant enough to get e-mail viruses. ('Yeah, it's from a trusted source. See the "From" line...') But if the HTML said "text", then it passed the attachment on to the Windows "open" command, which determines the type of the attachment by looking at the attachment, and if it was .exe or dozens of script-containing formats, it would let it run. Surely virus writers wouldn't be _dishonest_ and change the HTML tag so their .exe's would slip through...

      Until that sort of thinking changes, giving people a way of tagging the programs "safe" or "unsafe" is just asking for trouble.

    16. Re:define "unsafe" again please by JDizzy · · Score: 2, Troll

      That statement is a dangerous one for you reputation as a good admin.

      Really, how so... is my reputation damaged for asking silly questions? I don't do c/c++, or java.. the most I do is perl, and php... so my reputation for the job I do is in good form in that regards.

      Clearly, the lack of pointers to me would indicate an advantage in the fact that managing the pointer would be anoying for a developer. Why not let the compiler take the burden?

      --
      It isn't a lie if you belive it.
    17. Re:define "unsafe" again please by Yunzil · · Score: 1

      3. Mixing of data pointers and code pointers. The fact that I can take a function pointer and store it in a void * creates flexibility but also problems. The compiler is prevented from protecting the function pointers.

      Strictly speaking this is not allowed by ANSI C. If you turn on -ansi -pedantic, gcc complains:

      warning: ANSI forbids assignment between function pointer and `void *'

    18. Re:define "unsafe" again please by bigjocker · · Score: 1

      As a system admin you should know that almost all system admins nughtmares come from unsafe code. The unsafe code is almos always product of bad use of pointers.

      For what you say you must be a script programmer (for the perl and php), but not a UNIX system administrator.

      In JAVA the compiler DOES take the burden. Thats the idea of not having pointers shown to the coder

      --
      Life isn't like a box of chocolates. It's more like a jar of jalapenos. What you do today, might burn your ass tomorrow.
    19. Re:define "unsafe" again please by JDizzy · · Score: 2

      I AM A Unix systems Admin for my company. I do not program in C/C++, nor do I write JAVA. So by your logic, that means I'm not a Unix system admin? By that logic, it would mean all Unix admins would have to write in a lang that used pointers. I hardly think all Unix admins fall under that catagory.

      --
      It isn't a lie if you belive it.
    20. Re:define "unsafe" again please by unclefucknut · · Score: 2, Interesting

      "C++ gives you the choice of traditional pointers or references. A "reference" is a sort of super-pointer that includes data on where valid targets must be, and gets checked for validity every time you use it. I don't do Java, but I am under the impression that it uses references only. That isn't enough in itself to prevent writing Java viruses, but it gives the OS a fighting chance of confining them to the sandbox... "

      Actually, references are nothing but pointers under the hood. You can think of it as a constantly dereferenced pointer if you wish. References have the extra requirement that it must always have been initialized with a reference to an existing object. This is what the compiler enforces. But the compiler may be fooled as well:

      Object& func()
      {
      Object x;
      Object& obj = x;
      return x;
      }

      Object& y = func();

      What is y refering to now? This is perfectly legal C++ in some weird way. You can use y if you wish, and in most cases it will work (depending on compiler).

      ( Pointer version would look like:
      Object* func()
      {
      Object x;
      return
      }

      Object* y = func();

      I just hade to clear that up ;)

    21. Re:define "unsafe" again please by swillden · · Score: 3, Insightful

      "C++ gives you the choice of traditional pointers or references. A "reference" is a sort of super-pointer that includes data on where valid targets must be, and gets checked for validity every time you use it."

      This is not true. C++ references are exactly like pointers, except that you cannot rebind them. With a pointer you can point it one place, then point it another. With a reference you have to define the place it points when you create it and you cannot move it later. So:

      Foo& f = *(Foo*)0;
      cout << f.someValue;

      will still shoot you in the foot just as effectively as:

      Foo* f = 0;
      printf("%d", f.someValue);

      OTOH, in Java, they call everything a reference, but it's really more like a C pointer except that there is no pointer arithmetic. Oh, and it *is* always checked. Try to use a null reference? Exception. Try to typecast a reference in an invalid way? Exception.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    22. Re:define "unsafe" again please by Graspee_Leemoor · · Score: 1

      Ah old days. Wasn't it the case that the 286 wouldn't actually let you leave protected mode except by rebooting ?

      graspee

    23. Re:define "unsafe" again please by Anonymous Coward · · Score: 0

      A segfault in C is a message from the layer below (the OS) that the program tried to do something it is not allowed to do.

      An exception in Java is a message from the layer below (the runtime) that the program tried to do something it is not allowed to do.

      Both can be caught by the program, and both will lead to the program terminating if they are not caught.

      So apart from the different names, and the sandbox vs. OS doing the check[1], there is no difference.

      So, you might just as well say, that Java is unsafe in a sense, that your code can throw an exception.

      [1] When you don't have a runtime, you can't let the runtime do the check. If you cannot live without a runtime, then please go ahead, and use VBRUN300.DLL

    24. Re:define "unsafe" again please by Anonymous Coward · · Score: 0

      So, you just removed one type of bugs, by removing a major part of the language. Well, I can also remove one type of car accidents, by removing one major part of cars - the engine.

      Of course, that would mean that I loose the things that the engine was meant to do - just as well as Java lost the things that pointers was meant to do.

      But you can still make other kinds of bugs in Java, just as easy as you can make other types of accidents with a car without an engine (e.g. slamming your hand in the door).

      I don't think the problem is pointers. Pointers are simple to understand, and easy to use. The problem is that students learn languages like Pascal (where pointers get a single page in the back of the book), and Java, so programmers don't learn how to use them. More time should be spent on teaching pointers.

    25. Re:define "unsafe" again please by markmoss · · Score: 2

      Excuse my ignorance of c++, but isn't *(Foo*)0 using pointers, so the declaration

      Foo& f = *(Foo*)0;

      would be "unsafe" in c#?

    26. Re:define "unsafe" again please by markmoss · · Score: 2

      Obviously I know less about c++ than I thought I did (I've never programmed in it), and got some things I heard about Java references mixed up with c++ references. OK, in C++ references are checked at the time of creation, rather than the time of use. That's less unsafe than pointers that are _never_ checked, but there are bound to be ways that the reference can become invalid later.

      In c, I did shoot myself in the foot with something similar to your second example once. Not twice, but that's mainly because I do such low-level programming that I do have to always think about how it comes out in machine operations... (The low-level view: x is a local variable, allocated from the stack. It goes away when the function ends, leaving y pointing to space that will be re-used for something else on the next function call. In debugging, you will be scratching your head as to why the value of *y keeps changing.)

      In your first example, it is possible for the compiler to interpret that in such a way as to make the code correct. That is, since x is returned, this object should be allocated space that outlives the function. I have no idea whether the c++ specs call for it to work this way, but if c# is purporting to be safe they certainly should do this. But is it possible to cover every way that an originally valid reference could be come invalid?

    27. Re:define "unsafe" again please by Anonymous Coward · · Score: 0

      And how many ray tracers are there written in java?

      ;o)

      Back to the days of leaving the computer on all night I suspect!

    28. Re:define "unsafe" again please by unclefucknut · · Score: 1
      In your first example, it is possible for the compiler to interpret that in such a way as to make the code correct. That is, since x is returned, this object should be allocated space that outlives the function. I have no idea whether the c++ specs call for it to work this way, but if c# is purporting to be safe they certainly should do this. But is it possible to cover every way that an originally valid reference could be come invalid?

      First of all, the compiler cannot make "intelligent" decisions about how you want the object to be used. The reason is basically because of side effects. Programming using side effects is basically the same thing as programming by maintaining state. Since we're maintaining states, the order of events (statements=memory access) is significant. (Think about it.. you cannot go to work before you have woken up :)

      Same thing here. Memory access related stuff is *very* hard to optimize the way you describe. You'd have to find every corner case and you'd have to analyze the code thouroughly during compilation - a sort of runtime analysis. In this simple example, a compiler could easily trap it (some do warn). But there are more hard to spot errors which compilers cannot easily trap.

      Anyhow, it is easier to specify simple rules which the programmer must adhere to, instead of making the compiler extremely complex. (Chances are that complex compilers produce more errors than you.) If you break the rules, it's your problem.

      C# on the other hand manages memory accesses for you. In fact you never get to touch raw memory, unless you explicitly say so (and that memory will not be in the same "environment" as your managed memory). It can do garbage collections, memory compacting, dead data removal and all sorts of things, which is very hard (if not impossible) without an extensive runtime.

      [OT Warning]: Speaking of memory managed languages, Haskell is a language that hides basically all memory from you. It is purely functional, thus there is no such thing as "state". For a non-functional programmer, writing an application in terms of equations, expressions and pattern match rules can be... hm... an experience? Anyhow, since you do not have anything called state, the runtime can mix and match any evaluation as it is needed.

      It can

      • delay evaluation, since the value may not be needed. If it is not needed, whats the point of evaluating it?
      • parallelize your code. Since the order of evaluation does not matter, expressions which do not depend on eachother, can be easily executed at the same time. Great potential for SMP usage there.
    29. Re:define "unsafe" again please by markmoss · · Score: 1

      So in Haskell, printf (or whatever the equivalent is) won't run unless the compiler or run-time decides that the value returned from it is needed? Or prints may be parallized and evaluated out of order?

      I suppose that the language does have features that keep I/O operations in order, but in the sort of low-level hardware-oriented programming I do, no damn way can you let the compiler rearrange the code...

      C# is sounding better. If only it wasn't proprietary to the evil empire...

    30. Re:define "unsafe" again please by unclefucknut · · Score: 1
      Well, Haskell cheats big time (and so do most other "pure paradigm" languages). Haskell uses something called monads for I/O. I never bothered to use monads since I used Haskell primarily for studying type systems, but I read something about Haskell having a "sublanguage" to manage I/O properly.

      One thing that has "bothered" me is the GTK bindings for Haskell. How the h*ll can one describe a GUI interface using nothing but expressions? I guess I'll have to do some investigations one of these days.. :)

      I agree with you that C# is probably better for the "ordinary programmer". It's turing complete, it has a rich class library (pretty much like java), and it has the "smooth" C syntax ;) Haskell on the other hand is very extreme in nature and requires some extreme thinking of an "ordinary programmer" since the ideas behind the Haskell language is fundamentally different from those behind C#. And I guess the same applies for a person who comes from a functional background that uses C# (or C, C++ and the like).

    31. Re:define "unsafe" again please by unclefucknut · · Score: 1

      Yes it would be considered unsafe in C#.

  15. It's another tool by Gazelem · · Score: 1

    Almost any tool can be used unsafely if you try hard enough. No language is going to be perfect. Hell, C++ makes C# look like Underwriters' Laboratory for safety and yet most commercial software is written using it.

    We as developers are (as usual) the unsafe element in any program. Cars are not unsafe in themselves just because they kill people. It's the drivers.

    Good programming practices is the key to good code. If we expect to rely on a language or environment to protect us from writing unsafe code we are shirking our responsibility to become good developers and instead breeding a whole new generation of lazy ones.

  16. C'mon. What about C and C++ and... by ErnoWindt · · Score: 0, Offtopic

    Dozens of other languages. Slashdot needs to filter out anti-Microsoft propaganda, particularly via a virtual press release from the paid hack of another would-be monopolist, and instead report on serious science and technology issues.

  17. The Furor about C# by Astral+Jung · · Score: 4, Funny

    I still don't understand what's so evil about C#. If you don't want to use it, you don't have to. But personally, I find that not using C# leaves a sizable gap in several different keys, meaning a lot of stuff comes out just sounding wrong.

    --
    "What's so random about flipping a coin? Ever heard of the I Ching?"
    1. Re:The Furor about C# by ftobin · · Score: 1

      On a similar if people taking a disliking to C# they could always look forward to the upcoming E#. There are suspicions that this language might turn out to be vaporware, however.

      /me ducks.

    2. Re:The Furor about C# by dstone · · Score: 3, Funny

      If people taking a disliking to C# they could always look forward to the upcoming E#. There are suspicions that this language might turn out to be vaporware, however.

      There's nothing vaporous about E#, however I do know that enthusiasts (in the music field field, at least) commonly refer to it as F.

    3. Re:The Furor about C# by senderista · · Score: 1

      In other news, MS recently announced a new language "B#", which takes the "unsafe" features of C# still further, while doing away with any pretense of object-orientation. Sources inside the company who've seen B# sample code say it looks remarkably similar to another well-known programming language, but would not say which...

      --
      "It amounts to the same thing whether one gets drunk alone or is a leader of nations." -- Jean-Paul Sartre
  18. Music lesson... by jeffy124 · · Score: 3, Informative

    There is no C-Flat. Occasionally it is written on a piece of music, but it refers to a B. Lowering a C half a step gives you a B-Natural. Someone suggested C-Double-Falt. That would be a B-Flat.

    The reason for this is on the piano, the player needs to be able to look down and determine where their hands are based on the missing black keys between the notes B,C and F,E.

    Although, calling C# "B" might be interesting. But then again, there was a language B by K&R that preceded C.

    --
    The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    1. Re:Music lesson... by Ieshan · · Score: 4, Funny

      And actually, that stands for C-Sharp, not C-Flat at all. You could call it D-Flat, but that'd be like a boob-job gone wrong instead of a programming language.

    2. Re:Music lesson... by Anonymous Coward · · Score: 2, Informative

      > There is no C-Flat. Occasionally it is written on a piece of music, but it refers to a B. Lowering a C half a step gives you a B-Natural. Someone suggested C-Double-Falt. That would be a B-Flat.

      If you want to get technical, get your facts straight. There IS a C-Flat. And there is also a C-double flat. It just so happens that Cb is enharmonically equivalent to B, and Cbb to Bb. The reason all this seeming complexity is kept around is so that, say, you are playin in the key of Ab minor. In Ab minor, the minor third is up by 3 half-steps, or a B. But the second is a Bb, so in order to write sheet music for Ab minor, we'd have to have a whole lot of accidentals. Therefore, we call what looks like a plain ol' regular B on the piano a Cb so that we can give scale degrees 2 and 3 different positions on the staff.

      > The reason for this is on the piano, the player needs to be able to look down and determine where their hands are based on the missing black keys between the notes B,C and F,E.

      Umm. Last time I checked music theory was not designed for incompetent pen^H^Hianists like yourself.

    3. Re:Music lesson... by jeffy124 · · Score: 1

      ok, so the piano is not entirely accurate. but for the vast majority of people here it works because they are not musicians, hence it is terms they'll easily grasp.

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    4. Re:Music lesson... by oddjob · · Score: 1, Offtopic

      B and C flat are both valid names for the same note. The different names are used depending on the key in which the music is written. The same goes for B flat and C double flat -- the same note with different names in different contexts.

    5. Re:Music lesson... by The+Cat · · Score: 1

      There is a C-flat. Most certainly. C is marked flat in the keys of G-flat (six flats) and F-flat (seven flats), IIRC

      Not particularly common keys, of course, but they are there if composers are feeling adventurous. The orchestra (especially the harp player, the low brass and anyone who has to transpose) aren't going to be *happy* about it, though...

      C# is D-flat, BTW. C-flat is tonally equivalent to B-natural, but is NOT the same note.

      Been a while since music theory... :)

    6. Re:Music lesson... by TeknoHog · · Score: 2, Interesting
      To be precise, D-flat is different from C-sharp. D-flat is a little lower in frequency than C-sharp. However, most instruments today use an 'equally tempered' scale where e.g. D-flat and C-sharp are the same note, for example the piano and anything that has a keyboard.

      The reason that classical composers wrote their works in many different keys, is that they actually sounded different. In the equally tempered scale there is no difference (except the overall pitch change).

      Disclaimer: I used to play the trumpet, which can play C-sharp and D-flat (and similar #/b pairs) differently. I believe this can also be done with string instruments.

      --
      Escher was the first MC and Giger invented the HR department.
    7. Re:Music lesson... by Anonymous Coward · · Score: 0

      I used to play the trumpet, which can play C-sharp and D-flat (and similar #/b pairs) differently. I believe this can also be done with string instruments.

      On a fretless instrument, this can be done easily. On a fretted instrument, you'd have to kludge it by bending notes.

    8. Re:Music lesson... by Anonymous Coward · · Score: 0

      The one true instrument is voice. All others are mere imitation designed by Man.

    9. Re:Music lesson... by Anonymous Coward · · Score: 0

      > "If you want to get technical, get your facts
      > straight. There IS a C-Flat. And there is also
      > a C-double flat. It just so happens that Cb is
      > enharmonically equivalent to B"

      Sorry. The nit-picker in me just couldn't resist.

      Notes that are the same key on the keyboard of a piano are not necessarily the same in music. In an orchestral setting (especially with strings like violins), the notes A# and Bb (the same key on a piano) are actually different tones. An A# has a very slightly higher pitch than a Bb, and the different notes are used for different effects. (Sharps tend to sound strident, whilst flats are gloomy.)

    10. Re:Music lesson... by morbid · · Score: 0

      So why did Bach decide to have "equally tempered" scales, and where did all the modes go too?
      Isn't it like saying, in cooking, we have all these herbs and spices, they're too difficult for me, lets throw them out and make everything taste the same?

      --
      I'm out of my tree just now but please feel free to leave a banana.
    11. Re:Music lesson... by Anonymous Coward · · Score: 0

      Wow! Play me Liszt's 12th Hungarian Rhapsody!

    12. Re:Music lesson... by Golias · · Score: 3, Interesting

      The tempered scale was needed so you could build a keyboard instrument capable of playing in tune in more than one key. Otherwise, a keyboard tuned to one scale would sound horribly dissonent when playing chords for another scale. Every Fifth, Fourth, and Octive on a tempered keyboard is perfect (there's lots of web sites that breakdown the wavelengh patterns of the perfect fifth... feel free to check it out if you care), and the thirds and chromatic notes are fudged a little bit to make that possible for every note on the keyboard.

      --

      Information wants to be anthropomorphized.

    13. Re:Music lesson... by morbid · · Score: 0

      Very interesting!
      Could you please give me some links (google is not my friend -: )

      --
      I'm out of my tree just now but please feel free to leave a banana.
    14. Re:Music lesson... by Graspee_Leemoor · · Score: 2, Funny

      "Isn't it like saying, in cooking, we have all these herbs and spices, they're too difficult for me, lets throw them out and make everything taste the same?"

      Aha! You have stumbled onto the secret of English cooking!

      Graspee (UK)

    15. Re:Music lesson... by Anonymous Coward · · Score: 0

      This is not true. It is true that C flat is enharmonic to B natural (meaning they share the same pitch), but C flat and B natural are functionally different when it comes to theory.
      If you are in the key of Gb, then Cb is the sub-dominant (4th) to the tonic Gb. B natural doesn't really have a function in the key of Gb, although I guess you could call it an augmented third, which would be certainly rare indeed.

      Normally you don't run into these keys, but if you start in a flat key and begin modulating to different keys, you could end up in Gb or Cb or even, god forbid B double flat.

      Incidently, I seem to recall that in Gregorian music, there was no B natural, the standard B was a B flat, and even though you could physically produce a B natural, they wouldn't consider it an actual pitch....

      (moreover, C# is C sharp, making this music theory discussion irrelevant anyway...I guess they didn't like the sound of C Pound or C Hash).

    16. Re:Music lesson... by Anonymous Coward · · Score: 0

      Hey! I also used to play trumpet.

      Hate to disagree, but the ability to play a note different ways on a trumpet (or any other instrument) has nothing to do with whether it is flat or sharp and everything to do with the design and physics of the instrument. There is no designation on trumpet that third space C sharp is played 1 and 2, while the enharmonic D flat is played just with just the third valve. That's just the way it works out. Moreover, the lowest possible C sharp/D flat you can only play the note with one fingering. Also on piano, you can only play each C sharp/D flat with one string.

      I don't know much about tuning system, but from what I do know, the only thing that would effect the pitch would be the notes function in relation to the key...as an example a C sharp might be played a little higher if it were the dominant of the key than if it were the tonic, because in some tuning systems the fifth is stretched. But it has nothing to do with whether it's a flat or sharp of an enharmonic pitch, unless I'm on crack.

    17. Re:Music lesson... by morbid · · Score: 0

      Ah, no where is this more evident that at the traditional Brtish fisch and chip shop. At least we've got a clue now and adopted chicken tikka masala as our national dish :-)

      --
      I'm out of my tree just now but please feel free to leave a banana.
    18. Re:Music lesson... by AndrewHowe · · Score: 2

      Humphrey: "Oh, Stop!"
      Noon: "That's sick."
      Frenchy: "I agree. Nutter, you were singing in the wrong key!"
      Nutter: "No I wasn't. It was Loutzenheiser. I was singing in Eb minor."
      Frenchy: "The song's in F# major!"
      Bell: "I think they're the same thing. I mean, Eb is the relative minor of F#."
      Frenchy: "No, it isn't. The relative minor is 3 half-tones down from the major, not up!"
      Noon: "No, it's 3 down. Like A is the relative minor of C major."
      Loutzenheiser: "But isn't A# in C major?"
      Bell: "Wait, are you singing mixolydian scales, or something?"
      Frenchy: "A# is tonic to C major. It's the 6!"
      Humphrey: "No it isn't!"
      Swan: "Well, it'd be like a raised 13th if anything."
      Frenchy: "Oh well. You guys are just a bunch of loser diggers anyhow!"
      Humphrey: "Oh see. You know we're right!"

      - from Cannibal! The Musical

    19. Re:Music lesson... by jbailey999 · · Score: 2

      The Piano is "not entirely accurate" in the same way that a cat fight is "Not exactly pretty".

      But what do you expect from firewood and car parts?

  19. usafe code = power! by dollargonzo · · Score: 1

    to a certain degree, the more unsafe code a language allows yuo to write, the more powerful the language is. there is always opportunity for mistakes and scurity breeches, but sometimes that has to sacrificed for features. not bugs, features...

    QED

    --
    BSD is for people who love UNIX. Linux is for those who hate Microsoft.
    1. Re:usafe code = power! by Anonymous Coward · · Score: 0
      BSD is for people who love UNIX. Linux is for those who hate Microsoft.

      ITYM: "Linux is for people who hate Microsoft. BSD is for people who hate Microsoft and Linux."

  20. You don't say... by RailGunner · · Score: 1, Troll
    Writing safe and unsafe code is entirely the responsibility of the developer. A quote from the article: "Often a computer virus propagates by exploiting a simple programming error, typically a C program failing to check for buffer overflow, allowing input data to overwrite arbitrary portions of memory. Last year's Code Red worm exploited exactly such a bug in Microsoft IIS. "

    Well no shit.

    And this brings me to my point: Security is the job of the developer, not the language. The language can make it easier on the developer, but it really shouldn't be the end all / be all of secure code. For example, one way you can prevent buffer over-runs in C/C++ is by using strncpy() instead of strcpy().. As far as adding security to an insecure system as Joy writes, I have to wonder: Has Bill Joy ever written any kind of serious application? Does he know the first thing about programming? Is he *truly* advocating using "safe" languages for everything when secure programs can be written in other languages? Or is he truly willing to ban all "unsafe" languages like C, C++, Assembler, hell, it's still technically possibly to write machine code. Maybe he isn't going far enough - maybe all processors should be capable of only running Java BYTECODE natively. And yes, I am illustrating absurdity by being absurd. Joy needs to buy a clue here. I'll say it again - as developers writing secure applications is *OUR* job, not the job of the language we choose to develop in.

    1. Re:You don't say... by a1g2b3 · · Score: 1
      I have to wonder: Has Bill Joy ever written any kind of serious application? Does he know the first thing about programming?

      Do csh and vi count?

    2. Re:You don't say... by RailGunner · · Score: 1

      OK, I'll rephrase my question then - Has Bill Joy written any kind of serious application in the last 5 years?

    3. Re:You don't say... by Anonymous Coward · · Score: 0

      No, he meant a SERIOUS application.

    4. Re:You don't say... by BitwizeGHC · · Score: 1

      I think what he's saying is that you can't just pass code around willy-nilly like you pass JPEGs or text files since programs have the potential to actually do something.[1] Microsoft, and the Windows world in general, is incredibly cavalier about distributing .EXEs and macros all over the place since they operate on two basic assumptions:

      1) Everybody runs Windows.
      2) Any program you run will have been written by Microsoft, by third-party company, or by your own organization.

      Hence, ActiveX. Microsoft's original response to Java: why use a clunky interpreted runtime when you just hand 'em an EXE? After all they're running Windows, right?

      Java was designed with the purpose of making it safer to pass code around willy-nilly since the runtime does some checks to make sure the code is safe before executing it, at least in theory. The Java security model isn't bulletproof but that's the idea. Java actually turned out to be a big win because it's reasonably cross-platform, easy to code for, and has a huge API.

      Anyway, the moral of the story is this: As developers we must take responsibility for what we write; as users we must take responsibility for what we run.

      [1]I once conversed with someone who told me straight-facedly that he knew a way to put a virus in a JPEG so if you opened it in a browser or viewer program, it would infect your disk. I asked him how and he mentioned some BS about Sub7, then said he wasn't going to tell me; the technique was too secret and precious to divulge. Which is l33t h4x0r for "I don't know what the fuck I'm talking about."

      --
      N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
    5. Re:You don't say... by Anonymous Coward · · Score: 0


      I have to wonder: Has Bill Joy ever written any kind of serious application? Does he know the first thing about programming?


      Yes. BSD Unix. What have you written, besides uninformed slashdot rants?

    6. Re:You don't say... by elmegil · · Score: 2
      It's not the program so much as the environment that he's concerned about. Ok, so the language lets you write unsafe code. Whoopty. Except you're passing that code around the .NET environment where it could do some really nasty things if you aren't careful.

      The fallacy in your argument is that for every 10 developers who are working to write secure code (whether in a safe or unsafe language) there are at least 1 or 2 crackers working specifically to exploit how the code and the environment it runs in are unsafe. C# inherently makes this easier than java. Why would anyone allow .NET/C# code run on their machine is a mystery, because given Microsoft's track record, it seems that it will likely be yet another fruitful petri dish for crackers.

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
    7. Re:You don't say... by ryanflynn · · Score: 0

      Hmmm... I think Bill wrote a little editor called vi.

    8. Re:You don't say... by Anonymous Coward · · Score: 0

      Bill Joy was writing applications that worked correctly and quickly since back when we were still hunting Microsoft Certified Bloatware Engineers for sport :) Unfortunately, the hunts have been called off, and the herds have grown to unmanageable proportions now...

    9. Re:You don't say... by paulbd · · Score: 2

      i suggest you read the man page for strncpy(3). The strncpy() function is similar, except that not more than n bytes of src are copied. Thus, if there is no null byte among the first n bytes of src, the result wil not be null-terminated. this is a classic source of bugs in string manipulating code written in C.

    10. Re:You don't say... by the_verb · · Score: 1

      Compared to Java? Perhaps. Compared to C++? Whatever. More knee-jerking. Sigh.

      --the verb

    11. Re:You don't say... by Anonymous Coward · · Score: 0

      Java is a network language.
      That is why you can load java programs on-the-fly from
      the internet, like applets and full featured applications
      loaded using Java Web Start.
      If you trust your developers, thats great.
      But do you trust code written by someone you dont know ?
      With java, you can trust !
      If it asks for priviledges, deny it, and you will be good !
      If you want to let it access some files on your HD or
      allow it to open sockets to servers besides that where
      it was downloaded from, you can.
      If you want to write operating systems and drivers on it,
      please, don't ! :-)
      But you can.
      Use the right tool for the job.
      Java works for more than 90% of the jobs out there.
      Java is trully cross-platform.
      Something that Icaza's only can dream of with its beloved C#.

      Your job might be to write good code.
      A hackers jbo is to write good code in his view too :-)

    12. Re:You don't say... by Anonymous Coward · · Score: 0

      Java tries to take care of intentional and unintentional bugs, with success.

      Does C# even try to accomplish both ?

    13. Re:You don't say... by Anonymous Coward · · Score: 0

      He supposedly worked on http://www.jxta.org/

      BTW, attacking Bill Joy's coding skills pretty much makes you look like an goatse-sized ass. The guy was the Linus Torvalds of the 1980s.

    14. Re:You don't say... by Anonymous Coward · · Score: 0

      And your point is? Not everybody reveres those who made a few derivate *nix hacks. Writing vi or a kernel is hardly in the same class of accomplishment of people such as K&R, Knuth, or Hillis.

    15. Re:You don't say... by RailGunner · · Score: 1
      so just do this:

      TCHAR tszBuf[500];

      _tcsncpy (tszBuf, SomeBuffer);

      tszBuf[499] = 0;

      Problem solved.

    16. Re:You don't say... by Anonymous Coward · · Score: 0
      And this brings me to my point: Security is the job of the developer, not the language.

      Joy is concerned with providing stable and secure computing to users. He wants to find the most certain and most efficient way to provide users with this stability and security, and assessing blame for the state of things is of limited usefulness to that. Which is more doable? Building a language and runtime environment that makes certain types of programmer errors impossible, or ensuring that all programmers everywhere are competent, intelligent, and non-malicious?

    17. Re:You don't say... by elmegil · · Score: 1

      How much C++ is used in a transparent, free roaming over the web fashion? C# and Java are the obvious competitors for the space we're discussing, C++ is irrelevant.

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
  21. FUD machine in overdrive by coonsta · · Score: 4, Interesting
    To serious developers not familiar with C# and .NET, either don't read Joy, or be willing to look into the details yourself. You could be embarrassed if you repeat the gist of this article as lore. At the very least, you can easily convince yourself that this article is bogus in that it doesn't mention that C# has three kinds of pointers-- managed, unmanaged and transient.

    C# does allow pointers and pointer manipulation. This is mostly for programmers seeking extra performance. Like a cast in Java, declaring code as "unsafe" is equivalent to saying to the VM, "Hey, I know what I'm doing." C# pointers are definitely not as liberal as C ones (just like casts in Java are not as liberal as casts in C).

    For those sincerely seeking an intelligent discussion of pointers in the CLR, see Gough, J. "Compiling for the .NET Common Language Runtime (CLR)" Prentice Hall, NJ 2002.

    1. Re:FUD machine in overdrive by roca · · Score: 5, Insightful

      > Like a cast in Java, declaring code as "unsafe" is
      > equivalent to saying to the VM, "Hey, I know what
      > I'm doing."

      This is wrong. A Java downcast is dynamically checked and cannot compromise the integrity of the virtual machine. It is not "unsafe" in any meaningful sense of the word.

    2. Re:FUD machine in overdrive by The+Cat · · Score: 1

      C# has three kinds of pointers-- managed, unmanaged and transient.

      Sounds like a mess. Too complicated.

      "Now, which pointer type am I supposed to use here? I remember years and years of development experience with C++ and C, but the only place I remember reading about these new pointers is on CD 412 of our knowledge base in a README errata file..."

    3. Re:FUD machine in overdrive by Anonymous Coward · · Score: 0

      Sounds like a mess. Too complicated.

      Actually, it is very nice....assuming you know what you are doing (you apparently dont)

    4. Re:FUD machine in overdrive by coonsta · · Score: 1
      Java casts are checked at runtime, but statically the programmer is telling the type checker to "take a hike!"

      So to clarify the analogy, managed C# pointers interact with the garbage collector at runtime and are a "safe" pointer (relative to a C pointer, which can point to something that is subsequently free'd).

    5. Re:FUD machine in overdrive by Mike+A. · · Score: 1

      Correct. "unsafe" code in C# is more analogous to "native" code in Java.

      --

      --
      Do I look like I speak for my employer?
    6. Re:FUD machine in overdrive by ipfwadm · · Score: 1

      C# has three kinds of pointers-- managed, unmanaged and transient.

      Sounds like a mess. Too complicated.

      And Java has 4 types of references: strong, soft, weak, and phantom, but nobody ever complains that that's a mess or "too complicated."

    7. Re:FUD machine in overdrive by rossjudson · · Score: 2
      C# does allow pointers and pointer manipulation. This is mostly for programmers seeking extra performance. Like a cast in Java, declaring code as "unsafe" is equivalent to saying to the VM, "Hey, I know what I'm doing."

      And therein lies the truck-sized security hole, my friend. "I know what I'm doing" is exactly where the vast majority of security compromises start. Think about it -- you trust the vendor, so you permit their "performance enhancing" code to run. Well, they didn't have any bad intentions, but it turns out that there was a buffer overrun anyway. Crap. Now you have an executable stack 'cause a clever d00d found a way.

      C#'s Unsafe Code is trust-based security, through and through. It's another point of failure. Java's decision to prevent the running of machine code is a good one.

      I get tired of dorks who think that Java is some kind of least common denominator. It's a pretty high denominator, in my opinion. .NET looks pretty cool to me too. I just don't think "unsafe" code is a good idea.

    8. Re:FUD machine in overdrive by Anonymous Coward · · Score: 0

      Oh, God, please try to read the other replies. There's NO security hole in declaring code "unsafe". NONE, NADA, ZIP, ZILCH. Let me explain:

      Saying that code is "unsafe" means that you are telling the runtime that you want to manage your own memory in that code. The runtime will cordon you off a block of memory and keep the garbage collector away from it. You are telling it "hey, I know what I'm doing with memory, I don't need your help".

      Now, the security model is cool. It's far more fine-grained than Java's. One of the things the admin (NOT the user) of a machine can do is say "don't run any code that comes from the Internet that tries to manage its own memory" (or "tries to read from the disk" or "tries to contact the network" or "tries to load this assembly" or 10000000000 other options). So the admin can lock your box down as tight as they like. Note that by default your box comes locked down so "unsafe" code won't run, and as a user you can't change that.

    9. Re:FUD machine in overdrive by sql*kitten · · Score: 2

      This is wrong. A Java downcast is dynamically checked and cannot compromise the integrity of the virtual machine. It is not "unsafe" in any meaningful sense of the word.

      The VM can be configured to allow unsafe execution or not - that's the point. There are situations in which, if you trusted the code and were airgapped from the Internet, you would be happy to permit unsafe execution. It's up to the administrator of the VM(s) to make the decision.

    10. Re:FUD machine in overdrive by rossjudson · · Score: 2
      No security hole, huh? None, Nada, Zilch? I'm sure that's what the inventors of the Java sandbox thought when it first went out there. I'm sure that's what just about everybody has thought about every security sandbox variant that's been produced. Not one of them has come out clean.

      The bottom line is, it's a big, unknown, potential point of failure. Yes, it makes sense for the runtime to cordon off memory. No problem there. Can you assemble anything you like inside the memory? Can you run what you want there? Is it purely a buffer? Can you make things there and pass them to other, system routines? I just don't trust it. I don't think you should either.

    11. Re:FUD machine in overdrive by OsamaBinLogin · · Score: 1

      > A Java downcast is dynamically checked and cannot compromise the
      > integrity of the virtual machine. It is not "unsafe" in any
      > meaningful sense of the word.

      exactly. You can only cast to a superclass, period. This is useful and unfortunately necessary in a lot of situations, but not at all unsafe. In general, Java is a relatively bullet-proof environment for a program.

      People are not going to run their jvm's in 'unsafe' mode.

      You can get around it all and wreak havoc with a native piece of code, but you fine tune that stuff, it's hopefully small. And the majority of your app is safe from the usual bugs.

      If you get your app rated "100% Pure Java [registered trademark i think]" there can be no JNI in it and it's bulletproof. I've always been impressed with Java and I wish I was using it now.

      Given java, I see no reason for C# to exist at all, other than Microsoft's usual hegemony.

      --
      Marketing-driven companies end up over-marketing their products. Engineering-driven companies end up over-engineering
    12. Re:FUD machine in overdrive by Anonymous Coward · · Score: 0

      > exactly. You can only cast to a superclass, period.

      What are you talking about? I can cast up and down a hierarchy (subject to the downcast being valid), I just can't cast across hierarchies.

  22. Bill Joy the programmer or the Sun shareholder? by Anonymous Coward · · Score: 1, Interesting

    Bill Joy has not been a programmer for a very very long time - he is "a visionary" who also talks about a race of robots taking over the earth from time to time. His comments have to be taken with a LARGE grain of salt - he is far from objective - he owns millions of shares of Sun Micro - therefore he prefers Java. A couple years back he pocketed tens of millions from the sale of some of his stock. Now, what was he saying about C#?

    1. Re:Bill Joy the programmer or the Sun shareholder? by Anonymous Coward · · Score: 0

      It's like asking Ellison about what he thinks of MS SQL Server, or Gates about what he thinks about UNIX. Give me a break!

  23. Different targets, confused Joy by Arakonfap · · Score: 1

    I think Joy missed the point (intentionally?) on this.

    C#, while it will be used in place of Java I'm sure, is also intended for typical application programming. Just because the language supports *clearly marked* "unsafe" (as in, the programmer is able to shoot-himself-in-foot) coding practices, does not mean that IE will allow controls that require that feature to run.

    Furthermore, From what I read of C#, it is not intended to run purely by VM,and that it is -always- compiled before executing to avoid Java's slowness. Just because SOME features of Java were taken (of which, Java took most from C++!), that does not mean it has the same intention.

    Last I knew, Solaris was written in C and assembly, both of which require pointer use to get very far. Is he implying that those are unsafe and insecure?

    1. Re:Different targets, confused Joy by night_flyer · · Score: 2

      Just because the language supports *clearly marked* "unsafe" (as in, the programmer is able to shoot-himself-in-foot) coding practices, does not mean that IE will allow controls that require that feature to run.

      what will make this unsafe feature any different thatn any other unsafe feature that IE runs?

      --


      Thanks to file sharing, I purchase more CDs
      Thanks to the RIAA, I buy them used...
    2. Re:Different targets, confused Joy by anderman · · Score: 1

      Furthermore, From what I read of C#, it is not intended to run purely by VM,and that it is -always- compiled before executing to avoid Java's slowness. Just because SOME features of Java were taken (of which, Java took most from C++!), that does not mean it has the same intention.

      Java took some syntax from C++, the other features are called OOP which nobody ever took from C++.

  24. Anyone who read the article by Tribe · · Score: 2, Interesting

    Would know that right after he quoted from C# specification about unsafe code, he quoted again

    ""Unsafe code is in fact a 'safe' feature," the C# specification continues, "from the perspective of both developers and users. Unsafe code must be clearly marked with the modifier 'unsafe,' so developers can't possibly use unsafe features accidentally, and the execution engine works to ensure that unsafe code cannot be executed in an untrusted environment.""

    Seems like a good idea to me, whats wrong with that?

    1. Re:Anyone who read the article by Reality+Master+101 · · Score: 2

      Seems like a good idea to me, whats wrong with that?

      Sun and Bill Joy didn't do it that way, therefore, it's bad.

      --
      Sometimes it's best to just let stupid people be stupid.
    2. Re:Anyone who read the article by javahacker · · Score: 1

      Calling it a "safe feature" doesn't make it one!

      Most viruses depend on good human engineering to propagate, meaning they will make you want to give your machine permission to run their code.

      Anyone hear of email attachment viruses? People are silly enough to click on unknown attachments from unknown senders, what makes you think they can be allowed to decide when unsafe code should be run over the net?

  25. Uhhh, its supposed to...... by CDWert · · Score: 4, Interesting

    Uhh, and the problem with this is ???????

    All lll allow this, C3 may not be a lll but theyre trying to appeal to the uper end of that segment.

    C# allows you to write managed, OR unmanaged code as well, This is an option. As well as the coders ability to write "unsafe" code. YOU MUST INTENTIONALLY flag the code to be written as UNSAFE !

    If you dont know what you are doing and choose to do this so frigging what ???

    C# has the fundementals of a good language, forget its from MS, if it where from GNU, you;d be eating it up saying look how much better it is. I am looking forward to working with it, the .NET Visual Studio is written in C# itself , it should be pretty thouroughly debugged before its released.

    Play with it for a week , if youre a beggining C programmer youll love it, if youre experienced, youll love it for the same reasons, My bet is most of the people bitching havent read or written a single line of C#, if have and dont like it Id like to know explicity WHY ?, Ms bashing aside.......

    --
    Sig went tro...aahemmm.....fishing........
    1. Re:Uhhh, its supposed to...... by Anonymous Coward · · Score: 0

      I've been trying out the soon-to-be-released version (MSDN subscriber..expensive but well worth it :>)..Visual Studio.NET has a general feel of being a much more solid product than the ones previous to it. I'm personally looking forward to the opportunity to work with C#.

      Something that hasn't been discussed too greatly, however, is that C# is indeed an open standard..if people are so worried about how Microsoft's CLR is going to cope with security problems, what's stopping the open source community from writing a replacement?

  26. Taint mode? by chrysalis · · Score: 4, Insightful

    A language can be both 'safe' and 'unsafe'. Take a look at Perl. You can do a lot of insecure things with it. But as soon as you launch with the -T switch, your script will run in a special mode. Values coming from an insecure source will be refused by potentially dangerous functions, unless you explicitely mangle them before the call. This is extremely powerful and prevents a lot of classical security flaws.

    I don't know much about C#. But a taint mode for it would make the language pretty safe, despite the presence of pointers.


    --
    {{.sig}}
    1. Re:Taint mode? by crawling_chaos · · Score: 4, Interesting
      Two words: buffer overflow

      A "taint" mode would do nothing to catch these. Perl doesn't let you manipulate pointers and storage directly, so it's no big thing there. C#'s unsafe mode code does, and that's the big problem.

      --
      You can only drink 30 or 40 glasses of beer a day, no matter how rich you are.
      -- Colonel Adolphus Busch
    2. Re:Taint mode? by bjepson · · Score: 1
      Exactly - in C#, you can't compile anything unsafe until you enclose the code in an unsafe{} block and flip the /unsafe compiler switch.

      Plus, the runtime won't even let you run unsafe mobile code. Here's what happens when I try to run foo.exe (compiled with /unsafe) from a network share:

      Unhandled Exception:
      System.Security.Policy.PolicyException: Required
      permissions cannot be acquired.

    3. Re:Taint mode? by BigJimSlade · · Score: 1

      Taint mode? If that's what I think it is, this means Microsoft is even closer to crap than ever before!

  27. Its easy to make C# safe.. by Anonymous Coward · · Score: 0

    .. write a C# compiler in Java!

    1. Re:Its easy to make C# safe.. by Anonymous Coward · · Score: 0

      write Java in Java

  28. Hmmm so Unix is unsafe i guess by Anonymous Coward · · Score: 0

    Since it was written in C. Last i checked C has all those nasty 'unsafe' features like pointers,direct memory access,inline asm etc etc.
    For crying out loud. Just because most of today's "learn java in 30 seconds" ITI kind of programmers are not properly equiped to write decent code it doesn't mean that the whole programming community just turned DUMB from one day to the other.Or that those programmers are for that matter.
    Don't forget that most of today's applications that require decent performance levels are written in either C or C++. NOT java OR C#.Somehow cutting my performance in half to allow a sub-par programmer to write "safe" code with java does not sound like a good idea to me. Neither business-wise, or otherwise.

  29. The Fifth ICFP Programming Contest results by oodl · · Score: 1

    * Haskell is the programming tool of choice for discriminating hackers.
    * Dylan is a fine programming tool for many applications.
    * C# is for implementing slow, unsafe programs slowly

  30. The ultimate secure language by mrroot · · Score: 5, Funny

    There's been alot of controversy lately over security holes in programming languages. There is one language that has stood the test of time and proven to be the most secure language of all, with a record zero (0) reported security holes.

    Here is the link if you want to learn more.

    --
    I Heart Sorting Networks
    1. Re:The ultimate secure language by mrroot · · Score: 2

      I think we just slashdotted LOGO!!!!!!! :)

      --
      I Heart Sorting Networks
    2. Re:The ultimate secure language by tomaasz · · Score: 1

      There is at least one more language that I think is 100% secure and it is called Brainfuck.

      - simple language
      - easy to implement VM for portability
      - small VM footprint allowing use on portable devices

      http://www.muppetlabs.com/~breadbox/bf/

    3. Re:The ultimate secure language by plaa · · Score: 2

      How about BF?

      --

      I doubt, therefore I may be.
    4. Re:The ultimate secure language by morcheeba · · Score: 1

      You're forgetting I-Worm.LogoLogic.A. This, and the fact that this language controls actual hardware makes it very dangerous!! Well, Ok, just about as dangerous as pen-wielding, tone-generating, light-blinking robot can get.

  31. Microsoft doesn't do security by Anonymous Coward · · Score: 0

    And in other news, scientists after an exhuastive study have determined that bears really do poop in the woods.

    Developing.....

    Pope may be Catholic!

  32. Joy FUD Club by Master+Of+Ninja · · Score: 4, Insightful

    Yep, I think the guy's getting quite jealous of MS. Love or hate these people, the .net programming specification look very powerful, and coupled with the hard-as-nails win2k/xp combination, they will be quite hard to compete against.

    What Sun should really do is get off there behinds and match C# for features. From what I understand (not much admittedly), the Java VM just has to be extended to give it the breadth of additional languages that the CLI has (in terms of being able to use unsafe methods if the programmer wishes, so allowing C to work through it). The problem with Java has MS has the dominant desktop (and a good one it is now - really this is fact if you have to use them all day long), and they have the "standard" tools for programming. This will generate massive mindshare, and might get everyone from VB to C# (at least being "safe" might be good for programs knocked up at home).

    On an unrelated topic, I think cloning the fundamentals of C# to a open-source basis is a very good idea. I might not agree how ximian are going about it, but at least the FSF has a parallel project that can bring the new language to the world - it could persuade casual safe programming, while allowing the breadth of accessing the OS directly.

    When it comes to web services, I honestly can't see the difference between Java and C# (apart from the fact everyone will use C# as the MS-sponsored dominant language). It's all down to FUD: the .net services are basically going to be the same as before - just with a .net after them, and maybe re-written in C# now.

    Java is great, but Bill Joy think he should go get it optimised - working faster, able to compete effectively with C#.

    1. Re:Joy FUD Club by gergi · · Score: 2

      sorry but i can't let this go...

      coupled with the hard-as-nails win2k/xp combination
      hmmm... beginning to suspect you have no idea what you're talking about. it was hard getting past the hard-as-nails part. i have a new computer in my lab right now that won't install win2k and is locked up in the (default) install process where it thinks it's already installed but it really isn't.

      dominant desktop (and a good one it is now - really this is fact if you have to use them all day long)
      dominant in marketshare only... i find it endless frustrating and difficult to use. Macs are infinitely easier to use and as far as I'm concerned, so is KDE. I used to use Win9x/NT before I found linux.

      can't see the difference between Java and C#
      Java - multi-platform
      C# - windows only (you don't think MS is going to extend C# like they tried to extend Java for windows?)
      So, if you have a server running, it has to be windows if you develop in C#. Now, you'd have to be insane to use windows as a production-level server. Unix is the only way to go... thus, Java.

      Sure, I think Java could use some competition but seriously, a Microsoft Windows-only solution is not the answer.

      --
      Nosce te Ipsum
    2. Re:Joy FUD Club by gte910h · · Score: 1

      ....(at least being "safe" might be good for programs knocked up at home)....

      Is this really an issue? Since sperm is bigger than virii, any condom that is non-pourous enough to stop sperm should be safe.

      --
      Want to see every step I took to start my company? http://www.rowdylabs.com/blogs/pitchtothegods
    3. Re:Joy FUD Club by borgboy · · Score: 1

      hmmm... beginning to suspect you have no idea what you're talking about. it was hard getting past the hard-as-nails part. i have a new computer in my lab right now that won't install win2k and is locked up in the (default) install process where it thinks it's already installed but it really isn't.

      Anecdotal points about specific hardware combinations failing to install/run a specific OS that fail to mention that the combination is in fact supported by the OS developer are rather worthless. For example, I have a particular model of IBM destop pc that signal 7s every time I try to install Redhat or Suse, but then, I never bothered to see if all the hardware in those pcs was supported by either distro. The same machines run Win2k just fine. So what? It proves nothing. My anecdotal experience with our servers is that Win2k on supported, properly configured hardware will typically have very little if any unplanned downtime.

      dominant in marketshare only... i find it endless frustrating and difficult to use. Macs are infinitely easier to use and as far as I'm concerned, so is KDE. I used to use Win9x/NT before I found linux.

      I'm glad you have a choice to make. I do to, and I happen to find Win2k/XP the easiest to use.


      Java - multi-platform
      C# - windows only (you don't think MS is going to extend C# like they tried to extend Java for windows?)

      Huh?

      Now, you'd have to be insane to use windows as a production-level server.
      Lots of insane people make their living off of windows as a production-level server
      Unix is the only way to go... thus, Java.
      What happened to choice? I thought GNU was about choices? What if I gasp> don't like to code in Java? Heck, what happened to OS/400 or BSD? You can have your choices. If you are more comfortable with Unix environments, then they will typically be cheaper for you to operate. But if you don't understand how to acquire quality hardware for Windows, and you dont know how to administer it, then you hardly have any room to cast stones.

      --
      meh.
    4. Re:Joy FUD Club by Master+Of+Ninja · · Score: 1

      coupled with the hard-as-nails win2k/xp combination
      OK, you might have some bad experiences with win2k/xp, but although i've had my problems, it is nothing compared to win9x which really did my head in. Win2k really doesn't f**k up as much as 9x did, and when apps do screw up, they tend not to take down your whole system (although it has happened to me before). This is where the hard-as-nails reference comes - it is amazingly good for normal work/office use without crashing when you've got something important on it

      dominant desktop
      Each to their own, my friend. The desktop if very useable for most tasks. And when I said dominant i meant dominant as in marketshare and mindshare. That's why improving java to the C# standard would be good - its multiplatform.

      can't see the difference between Java and C#
      Got me there - although I was referring to its uses - and hopefully the FSF project will make C# multiplatform.

      to gte910h, making c# safe by default will help prevent the vb trash destorying the world with their awfulness ;-)

    5. Re:Joy FUD Club by CaseyB · · Score: 2

      Best subject line ever.

    6. Re:Joy FUD Club by Anonymous Coward · · Score: 0
      C# - windows only

      I'm sure I should reply more eloquently but due to time pressures I can only say...

      Man, you're full of shit!

    7. Re:Joy FUD Club by radish · · Score: 2


      What "features" does Java miss compared to C#?? The "feature" which allows me to write buffer overflows? Whooppeee!!

      Why do I need my JVM to run other languages? I like writing in Java thanks.

      Why do I care what the dominant desktop is? I use NT, write Java on it, and run said Java on a Solaris server farm. I personally prefer an NT desktop to a Unix one, but one of the nice things about Java is that I can use either.

      Sure, people will use C#, but I don't know a single Java developer in our firm who is even thinking of doing so...the switch will be from VB and C++ coders, and to be honest, I don't care. As long as I get to keep my JBuilder I'm happy, sitting and laughing as their servers get cracked again.

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

  33. Bill Joy the media whore by partingshot · · Score: 3, Insightful

    I stopped reading after this line:
    • "So Microsoft built ActiveX, a technique within Windows for automatically downloading and executing arbitrary programs"
    Maybe Mr. Joy should read up some more:
    --
    Anonymous posts are filtered.
    1. Re:Bill Joy the media whore by rreyelts · · Score: 2, Insightful
      Pfft... Now, why, oh why, would Mr. Joy ever say anything like that? Here's an excerpt from "The COM and COM+ Programming Primer" about ActiveX that might explain why:
      None of the other names has caused even nearly as much confusion as this one.... The reason so many people are confused by the name ActiveX is because the definition has changed. Originally ActiveX was a brand name for all COM-based Microsoft technologies that had utility on the World Wide Web.

      Emphasis mine.

      Hope you don't feel silly, because you've been taken in by Microsoft re-writing history.

      God bless,
      -Toby

    2. Re:Bill Joy the media whore by trenton · · Score: 2

      I'm not sure he can. The microsoft.com domain is blocked from within Sun, so that their researchers can troll and flame MS without knowingly being wrong.

      --
      Too big to fail? Does that make me to small to succeed?
    3. Re:Bill Joy the media whore by DavidpFitz · · Score: 2

      Rubbish! (Unless this is new!)

      I worked at Sun before, and microsoft.com was deinfitely not blocked.

      How else would we have been able to get Internet Explorer for Solaris? (Yes, some people at Sun use IE for Solaris.)

      There's loads of times when a Sun developer might need to look at MSDN, for example. And, Java support guys would definitely need access to MSDN.

  34. Breaking Story by Joe+U · · Score: 1

    This just in:

    Geek writes software that crashes, film at 11.

    Sun wants you to remember, C# is not Java, and is not a Java replacement.

    It's just a programming language that looks like C++ but has many of the benifits that Java has. It's designed to let you migrate all that code in C and C++ without much problem...

    Wait, tell me again why this is bad?

    1. Re:Breaking Story by Anonymous Coward · · Score: 0



      Sorry, but C and C++ have, if both used to their max close to nothing in common. curly braces, thats about it. Modern C++ code uses techniques that cannot be implemented in C or C# and is coded and "felt" vastly different than C. These features can of course be "hacked" in C, but one could also argue that everything could be done in assembly.
      C# has no auto-objects, no templates. That alone invalidates even a rough comparison to c++.

  35. .NET security is not an afterthought by Oink.NET · · Score: 2, Insightful

    Security in .NET has been built into the foundations of the CLR, not added as an afterthought as Bill Joy implies. Read more about it at the .NET Framework Security Overview. The reason Microsoft seems so cocky about their new "trustworthy computing" crusade is because they know their new framework makes it a lot easier to follow through on their promises. Although there is still room for programmer error, that room is now the size of a broom closet, not a stadium.

    1. Re:.NET security is not an afterthought by anderman · · Score: 1

      Just like they promised that XP was the most secure version of all and then they had that huge security hole? Oh yeah they know how to follow through on promises.

    2. Re:.NET security is not an afterthought by Tony-A · · Score: 2

      Try WWW.TrustworthyComputing.com
      Considering Microsoft's track record, I think Bill Joy is actually being kind to Microsoft.

  36. He does have a point... by gillbates · · Score: 2
    In allowing a program to be either "safe" or "unsafe", C# is little different from any other programming language - the best and highest performing code will be written in "unsafe" mode. Which leaves the users in the same position as they were before with signed/unsigned ActiveX controls; do they dare download and run an unsigned/unsafe program? Or do they give up web page features for the sake of running "safe" code?

    Java was a step in the right direction. C# may be promoted by Microsoft heavily, but the prospect of "unsafe" code is only going to send up red flags with the average users. The average desktop user doesn't want to have to worry about safe/unsafe code - they just want to be able to browse the web safely - which is what Java already provides. Sorry, Microsoft, but Java already does better what C# was intended to do.

    --
    The society for a thought-free internet welcomes you.
    1. Re:He does have a point... by ClosedSource · · Score: 1

      The average desktop user has no clue about what language was used to write an application and couldn't care less.

    2. Re:He does have a point... by Anonymous Coward · · Score: 0

      Exactly and hence why even having the *ability* to run unsafe code is silly to say the least.

    3. Re:He does have a point... by ClosedSource · · Score: 1

      Is this supposed to be a response to what I posted?

      I don't see any connection between the fact that users don't know or care about what language was used and the ability of programmers to choose between performance and "safety". Of course, programmers can write 100% safe code without the language protecting them- it's just harder.

    4. Re:He does have a point... by tomgilder · · Score: 1

      Which leaves the users in the same position as they were before with signed/unsigned ActiveX controls; do they dare download and run an unsigned/unsafe program?

      No, .NET was deliberately designed never to present an end-user with these type of dialog - because end users just cannot easily decide what to click.

      MS are trying to move all of these silly "do you want to download and run..." dialog decisions from the end-user onto an admin or secure, pre-defined security rules - which imo is a good thing.

  37. RIIIGHT by Anonymous Coward · · Score: 0

    "the programmer never [h]as to see or deal with those pointers" RIIIGHT

    Does the programmer have to deal with...

    ... null object references? YES

    ... surprises and/or logic errors when two objrefs happen to refer to the same object? YES

    ... dead objects that need to be released by explicitly niling out objrefs? YES

  38. Sun shouldn't be complacent by astrashe · · Score: 5, Interesting

    Obviously Bill Joy knows a lot more about this stuff than I do; but I think he, and many of Microsoft's critics as well as supporters, are missing a crucial piece of the puzzle.

    Many of the features that have contributed to MS's insecurity were there not because MS's engineers were too dumb to think clearly about security, but because other people decided that there was an overriding business interest that the features would serve.

    Specifically, these features usually tend to be part of the MS strategy of leveraging success in one sector into another. If you use office, it makes sense to choose VB as your scripting language. If you know VB, it makes sense to run IIS. That's why there's a VB interpreter inside every office app.

    I think that what we've seen from MS is an official change in policy -- they're saying that business considerations now suggest that security should be the #1 priority. They're admitting that the market will punish them for security holes, and that they can't sacrifice security to establish leverage from one sector to another.

    MS has always put business concerns over technical ones. For that reason, a lot of /. posters have make comments to the effect that MS isn't capable of delivering technically. It used to be the conventional wisdom here, for example, that any MS OS was destined to crash repeatedly.

    It turned out that when MS saw Unix and Linux as a threat, and when they decided that reliability was one of the biggest advantages that Unix/Linux offered, they took reliability seriously and made enormous progress in a relatively short period of time. This suggest that Windows crashed not because MS *couldn't* make it reliable, but because it wasn't a *priority* for them to do so. As soon as they saw a change in the business climate on the edge of their radar screen, they changed their behavior.

    Windows and its applications haven't been secure because MS hasn't felt it was worth making security a priority until now. There is no evidence that they couldn't cover a lot of ground very quickly in security if that's what they decided to do. And it seems as if they've decided to do just that.

    I do agree that .NET and C# are technologies that predate this new ordering of MS's priorities, and that they probably won't be very secure. Passport, the most important .NET application yet written, coded by people who ought to know the technology best, has been hacked (and patched, it's only fair to point out). If MS's people don't write secure apps with .NET, are the low end VB coders the platform is designed for going to do a better job?

    But the problem that Sun faces is that MS has proven time and time again that they're willing to spend lots of money and go through lots of iterations to take a market. They're relentless. They usually don't get it right the first time, but they usually do get it right after four attempts or so.

    I'll say something else that will probably get me modded down. After the recent flirtation between AOL and RedHat, I'm not sure that the moralistic arguments against MS hold up so well. Linux has been at the center of some pretty slimey stock swindles -- our gracious hosts, here at /., work for one of those companies.

    Meanwhile, the Bill and Melinda Gates foundation is giving extraordinary sums of money to real nuts and bolts making the world a better place kinds of causes. Gates could literally turn out to be the most significant philanthropist in the history of the world. They're giving so much money that you can almost see a chunk of what you spend on MS going to a good cause.

    All of which suggests to me that politics and the morality play that have always clouded the linux vs. windows debate should probably be put to rest.

    Windows is horribly insecure -- viruses do incredible damage in the real world, especially among the least sophisticated users. That's not political, that's a fact.

    But they're saying they're trying to clean up the mess. Sure, it's a big mess, and sure it's going to be a big job to clean it up. I give them credit for admitting it, and to taking on the task.

    1. Re:Sun shouldn't be complacent by The+Cat · · Score: 2

      If MS's people don't write secure apps with .NET, are the low end VB coders the platform is designed for going to do a better job?

      Because there'll be a great big bloatware wizard there to clicky clicky clicky your way through alllllllllllllllll the problems. And then your boss will think you're a real "goooooroo" and you can get to the day-long meeting on time so you can compare PowerPoint slides with 'Bob' from accounting.

      (The sad part about this is that I just described about 80% of "IT departments") sigh...

    2. Re:Sun shouldn't be complacent by gillbates · · Score: 2, Offtopic
      Gates could literally turn out to be the most significant philanthropist in the history of the world. They're giving so much money that you can almost see a chunk of what you spend on MS going to a good cause.

      Who said, "I tell you the truth, this poor widow has put more into the treasury than all the others. They all gave out of their wealth; but she, out of her poverty, put in everything - all she had to live on."?

      What people fail to realize is that Bill Gates' money was obtained through immoral and oppressive means. One might as well count the drug lords in South America as philanthropists as well.

      The fact that Bill Gates is giving away money doesn't make him generous. Were he a benevolent individual, he wouldn't have drummed Microsoft's competitors out of business, or artificially raised the price of Microsoft software. Do you really believe that the man who claimed that church was a waste of time is giving money for purely altruistic reasons? Isn't it more likely that he's doing these things to make he and Microsoft look good?

      In case you didn't know, the second quote is from Jesus Christ (Mark 12:43).

      --
      The society for a thought-free internet welcomes you.
    3. Re:Sun shouldn't be complacent by dghcasp · · Score: 1
      Meanwhile, the Bill and Melinda Gates foundation is giving extraordinary sums of money to real nuts and bolts making the world a better place kinds of causes. Gates could literally turn out to be the most significant philanthropist in the history of the world. They're giving so much money that you can almost see a chunk of what you spend on MS going to a good cause.
      According to the Bill Gates Wealth Clock, Gates has about 67.5 billion dollars right now. According to Newsweek, the Gates Foundation is spending 24 billion on world health.

      Assuming (which may be wrong,) that Gates put up all that money himself, that still leaves him with 43.5 billion dollars. You'd have to work for almost half a million years to earn that much (probably a million years after taxes.)

      In other words, he's not going to miss that money. It's not going to require any change to his lifestyle such like any of us "normal" people would have to face to donate 35% of our money to charity.

    4. Re:Sun shouldn't be complacent by PhotoGuy · · Score: 2
      Meanwhile, the Bill and Melinda Gates foundation is giving extraordinary sums of money to real nuts and bolts making the world a better place kinds of causes. Gates could literally turn out to be the most significant philanthropist in the history of the world. They're giving so much money that you can almost see a chunk of what you spend on MS going to a good cause.
      An awful lot of his charitable contributions are for putting Windows in schools. Not only cranks up Windows sales, gets a tax credit, and further entrenches Windows' monopoly in one of the most critical places. Seems like a pretty good deal.

      I believe his foundation (run by his dad, I think) does also contribute to other things, but the overall contributions, while large in absolute terms, are tiny in comparison to his wealth. Wasn't it Ted Turner that challenged Bill and the other Billionaires, to contribute more significant portions of their fortunes to the public good? And set a good example through his own contributions. (And I don't Bill or friends rose to the challenge at all.)

      -me
      --
      Love many, trust a few, do harm to none.
    5. Re:Sun shouldn't be complacent by StuntedMind · · Score: 1
      In other words, he's not going to miss that money. It's not going to require any change to his lifestyle such like any of us "normal" people would have to face to donate 35% of our money to charity.
      The act of charity in no way requires the charitable person to suffer appreciable loss. The gift of a penny by a millionaire is still charitable. Do not begrudge the man his due respect simply because you wish him to suffer for his donations.
    6. Re:Sun shouldn't be complacent by Anonymous Coward · · Score: 0

      What people fail to realize is that Bill Gates' money was obtained through immoral and oppressive means. One might as well count the drug lords in South America as philanthropists as well.

      So Microsoft prevents some middle class, white geeks and venture capitalists from becoming absurdly rich while Bill Gates uses most of this fortune to help third world countries and poor minorities yet somehow I should feel that he is evil.

      Can I get some of that crack you are smoking?

    7. Re:Sun shouldn't be complacent by ipfwadm · · Score: 1

      I realize this is a troll, but I'll bite...

      One might as well count the drug lords in South America as philanthropists as well.

      This is a complete non-sequitur. Are these men donating billions of dollars to charity? No, they are getting rich off the millions of dollars that junkies in America and other developed nations steal from legitimate citizens in order to fund their drug habit. And their "product" is lethal. How many people do you know have gotten killed by WindowsXP or Office?

      The fact that Bill Gates is giving away money doesn't make him generous.

      Yes, in fact it does. Merriam-Webster's Dictionary defines generous as "liberal in giving." I would say that someone who donates billions of dollars, no matter what his ulterior motives may be, is generous.

      artificially raised the price of Microsoft software.

      Software such as Windows? Which has cost the same amount for years now? The price hasn't even followed inflation, so therefore the real price of Windows has declined over the years.

      Do you really believe that the man who claimed that church was a waste of time is giving money for purely altruistic reasons?

      As a devout atheist, I take offense to this. I claim that church is a waste of time too. Does this mean any gifts I give to charity are for selfish reasons? Why does someone's ability to be altruistic depend on his religious inclinations?

    8. Re:Sun shouldn't be complacent by Zico · · Score: 0, Flamebait

      When Ted Turner made his announcement, he said that he was donating 1 billion dollars. The fine print was the he was donating that 1 billion dollars over 10 years. Gates has given 24 billion out of his 67 billion. Have you given over a third of your money to charity? Have you even given a tenth of your money to charity?

    9. Re:Sun shouldn't be complacent by Anonymous Coward · · Score: 0

      You are full of crap, and it is sick that you even quote the bible and judge Bill Gates. The fact that you believe what you do does NOT make you Christ like (nor logical) by any means.

    10. Re:Sun shouldn't be complacent by theancient2 · · Score: 1

      He's still a relatively young guy, and has a lot of time left to give away money. I believe he's been quoted as saying that his intention is to give away almost everything he has by the time he dies. (He doesn't want to spoil the kids with a million dollar inheritance and have them sit on their asses their entire lives, he said.)

    11. Re:Sun shouldn't be complacent by Anonymous Coward · · Score: 0

      Don't worry about his kids -- there's cush jobs lined for them as administrators of the "Bill Gates Foundation" already.

    12. Re:Sun shouldn't be complacent by 1g$man · · Score: 1
      Does Bill Gates have 67.5 billion or is he worth 67.5 billion. Just being worth x amount of dollars doesn't mean he has that much in cash. Somehow, I doubt Bill Gates could simply sell every share he owns of Microsoft. And even if he could, that would kind of kill most of the value.

      Now granted he's certainly not changing his lifestyle in order to donate more to charity, but don't assume the man can just throw his entire net worth around at whim.

    13. Re:Sun shouldn't be complacent by Anonymous Coward · · Score: 0
      (The sad part about this is that I just described about 80% of "IT departments")

      Really? You've done extensive surveys on this issue, I take it?

    14. Re:Sun shouldn't be complacent by Anonymous Coward · · Score: 0
      In other words, he's not going to miss that money. It's not going to require any change to his lifestyle such like any of us "normal" people would have to face to donate 35% of our money to charity.

      A lot of ultra-wealthy people could donate 35% of their money to charity without "missing" it. How many do, though?

    15. Re:Sun shouldn't be complacent by sql*kitten · · Score: 2

      I believe his foundation (run by his dad, I think) does also contribute to other things, but the overall contributions, while large in absolute terms, are tiny in comparison to his wealth. Wasn't it Ted Turner that challenged Bill and the other Billionaires, to contribute more significant portions of their fortunes to the public good?

      Remember that most of BillG's wealth is in MSFT, and he can't tap that for liquidity without the market misreading it as a sign of impending doom. Relative to his paper wealth, he's not cash-rich at all.

      Still, when Mr. surprised-by-wealth ESR starts matching BillG dollar for dollar, maybe you will have a point.

    16. Re:Sun shouldn't be complacent by MobyTurbo · · Score: 1
      I'll say something else that will probably get me modded down. After the recent flirtation between AOL and RedHat, I'm not sure that the moralistic arguments against MS hold up so well.
      There was no flirtation between AOL and Red Hat except on some news websites, it was a rumor it turns out. Also, Alan Cox said that if AOL tries to take over Red Hat he would leave; which means that Red Hat's main Linux coder indeed does have a sense of values beyond the average big corporate ones.
      Meanwhile, the Bill and Melinda Gates foundation is giving extraordinary sums of money to real nuts and bolts making the world a better place kinds of causes. Gates could literally turn out to be the most significant philanthropist in the history of the world.
      Bill Gates admitted in an interview in national media that his total financial giving in one year was an astoundingly-high-for-a-billionaire 50,000 dollars, all of it spent on computers running Windows in the Seattle Public Library system. When asked about this he said he just "didn't have enough time" to administer charitable giving. When this news made headlines within a short period of time Bill Gates established his foundation, but don't think it's not for PR rather than out of the goodness of his heart.
    17. Re:Sun shouldn't be complacent by Anonymous Coward · · Score: 0

      "he said he just "didn't have enough time" to administer charitable giving"

      Between then and now Gates was essentially demoted from CEO to CTO of MSFT by the board of directors. That gives him more time to give away his money.

      I think that he probably always intended to give away his money. It's obvious what drives him is deeper than dollar signs.

  39. JAVA does not work well by Anonymous Coward · · Score: 0

    Before Java, poor programming on web pages would merely mean that some pages looked ugly. Now after Java, browsing has become a matter of traipsing through a minefield of bad code causing script errors all over the place.

    Time to try something else....

    1. Re:JAVA does not work well by Anonymous Coward · · Score: 0

      thats java script you dumbarse not java. java applets dont cause script errors...they exception silently and die.

  40. Where do you get your facts? by Carnage4Life · · Score: 5, Interesting
    I think the difference is that .NET and C# are designed as a network-based platform; e.g., you grab code off of the 'net as you need it, rather than storing everything locally.

    Really??? What gives you this idea? Java + VM is relatively equivalent to C# + CLR (as mentioned in my article that appeared on Slashdot a while ago). Code can be downloaded from the Internet and run just like with Java applets or RMI applications but this is far from the primary design of the platform .

    Of all the people in the world I'd expect to criticize a technology without adequately reading up on it first, Bill Joy would have beemn one of the last I'd expect to do such a thing.

    Bill Joy (and your post) go on and on about the vulnerability of network programming then ends with the reference to unsafe code which aims at giving the impression that downloaded .NET code can be unsafe. However this is incorrect, and I quote
    From a technical viewpoint, the term unsafe refers to whether the program is known to be safe. Before a program is converted from intermediate language (IL) to native code, there's a part of the runtime security system known as the verifier that looks at the IL to determine whether it's safe to execute. In this context, safe means that the verifier can prove that the IL doesn't do anything unsavory.

    IL safety is important for certain Microsoft .NET scenarios--it's nice to know that the chunk of code that you downloaded from a Web site isn't going to do anything bad to your machine. The default policy for remote code (either from a Web site or from a net share) is that the code must be verified safe to execute.

    In other situations, it's useful to write code that can't be verified to be safe. In C#, any use of pointers generates unsafe code, as does any use of interop, such as COM interop or platform invoke.

    Since you don't want to write such code inadvertently, C# requires you to use the unsafe keyword on your class or method whenever you write code that deals with pointers. When you use the unsafe keyword, the resulting IL is marked as unsafe and can only run in a fully trusted environment (usually, security policy only trusts local assemblies). In the current version of the runtime, unsafe is defined at an assembly level, so having any unsafe code in assembly makes the entire assembly unsafe.
    1. Re:Where do you get your facts? by cicadia · · Score: 4, Insightful
      First off, Joy admits that code declared as unsafe "cannot be executed in an untrusted environment," at least according to the spec. He goes on to point out that we're trusting Microsoft's implementation here, which hasn't always been the best policy, at least for security issues.

      > When you use the unsafe keyword, the resulting IL is marked as unsafe and can only run in a fully trusted environment

      This bit still scares me. Does this mean that the C# compiler marks the IL as unsafe, and that the CLR trusts this marking? If that's the case, what is there to stop someone from bypassing the compiler, and editing the IL directly? (And please don't tell me it has anything to do with signed, trusted code :)

      At least the Java model is based on fairly solid theory. The environment has a lot of nice properties which make it easy for the JVM to ensure that all code executed is safe. It begins with the position, "don't trust this code," and refuses to execute anything which it cannot prove to be safe. It doesn't rely on the programmer, or the compiler, to flag unsafe sections of code.

      --
      Living better through chemicals
    2. Re:Where do you get your facts? by west · · Score: 4, Insightful

      Everyone seems to assume that most C# programs will not have unsafe constructs, making it generally practical to disallow code with unsafe constructs.

      I'm willing to bet that most C# code will contain unsafe constructs. Programmers mostly come from a C background and, like all other humans, are basically lazy. Since unsafe code is both faster and easier to write, there will be tremendous impetus to write unsafe code so as "to get it done now".

      With enough code that has unsafe constructs in it, system admins/users will end up allowing unsafe code to run by default.

      In almost all cases, users want the maximum features and least security possible. Java's "least secure" mode is a lot better than "C#"s. Therefore Java is likely to be a lot more secure than C#. Blame the users? Sure. But it's the security that is actually used that counts, not what's available.

    3. Re:Where do you get your facts? by Anonymous Coward · · Score: 0

      Since unsafe code is both faster and easier to write, there will be tremendous impetus to write unsafe code so as "to get it done now".

      You obviously have no clue what you are talking about. Since when did writing code with pointers and the like become easier than writing code wiyhout pointers? Also where are the numbers that backup your claim that it is faster.

    4. Re:Where do you get your facts? by tidge · · Score: 1

      I disagree. In this case, using the pointers is the main thing that will cause the code to be unsafe....and in C# it's a lot easier to do without the pointers.
      That's actually considered one of the "good things" about the language.

    5. Re:Where do you get your facts? by wadetemp · · Score: 2

      This bit still scares me. Does this mean that the C# compiler marks the IL as unsafe, and that the CLR trusts this marking?

      No. The runtime itself will not support the interop functionality and will instead throw exceptions when a block of code with a network origin point tries to run. It has zero to do with the compiler.

    6. Re:Where do you get your facts? by Anonymous Coward · · Score: 0
      With enough code that has unsafe constructs in it, system admins/users will end up allowing unsafe code to run by default.
      Nonsense. That's like saying "with enough services running on different ports, system admins/users will end up opening all the ports on their firewall". It just doesn't happen. The difference between my analogy and "unsafe" code in .Net is that the runtime enforces whatever policy you decide on, you don't have to manually check it all yourself as you do with a firewall.
  41. Where's the evidence? by Anonymous Coward · · Score: 0

    Sorry bill, you can cry all you want but until you can lay down the evidence of C#'s insecurities, you'll get no following.

  42. UNSAFE considered harmful... by Anonymous Coward · · Score: 0


    When pointers are outlawed, only outlaws will have pointers.

    I sentence you, Bill, to sit in the corner and read Kernighan's "Why Pascal Is Not My Favorite Programming Langauge".

  43. His argument backfired too. by Anonymous Coward · · Score: 1, Funny

    What it boils down to is that he is complaining that C# is more powerful and less crippled.

    1. Re:His argument backfired too. by mozkill · · Score: 1

      no. actually... comparing Java and C# is a mute point. they are totally different when it really comes down to it.

      java still follows the concept of running in a self contained and separate virtual machine. C# is merely a replacement for things like Visual Basic and Active-X and therefore is still part of the host operating system when it really comes down to it. Java still holds true to its roots and has never felt any pressure to change. It was made to run virtually, and C# will NEVER EVER be able to compete with that because it simply is not independent.

      Why do people keep trying to compare? it comes down to what you want in your implementation. personally, i consider C# just a shortcut feature of the C++ language. i would only use it to do something that would take too much time or effort in C++ . if i wanted to code something free of C++, then i would definitely use Java instead.

      --

      -- Betting on the survival of the media industry is a serious risk. I advise investing elsewhere.
    2. Re:His argument backfired too. by Anonymous Coward · · Score: 0

      and C# will NEVER EVER be able to compete with that because it simply is not independent.

      How many Java apps do you think windows users use regularly compared to VB apps. Remember, cross platform compatibility is only a 'feature' if your target audience uses more than one platform. And that my friend is why Java will only ever be an embedded, web script and server script language.

      If i wanted to code something free of C++, then i would definitely use Java instead.

      Unless you were programming in Windows. Then using Java would be dumb.

    3. Re:His argument backfired too. by mozkill · · Score: 1

      that is exactly my point. Java has features that make it usable only in special situations. who in their right mind would try to code a real application using Java, especially in windows? what makes Java so great is that it fits THOSE special situations better than C# does.

      Microsoft is approaching C# as if it is a "application" building language, but they are just forgetting about the fact that C++ already does this just fine, and they are naive enough to think that is what they need to do to compete with Java. C# will not compete with Java because it IS NOT an application building language. most people are brainwashed into thinking that Java is trying to replace C++. I laugh at that. That is like saying that Linux is "trying to take Microsoft windows' market share" . Its simply not true. Linux just IS. Its not trying to do anything but what it needs to do, and so is Java.

      --

      -- Betting on the survival of the media industry is a serious risk. I advise investing elsewhere.
  44. He's so unbiased by WildBeast · · Score: 2

    I mean this guy is the chief scientist of Sun Microsystems and the co-author of "The Java language specification", what exactly do you expect him to say about C# ?

  45. This one's just too funny... by Uttles · · Score: 2

    BJ quotes verbatim: 'C# provides the ability to write unsafe code. In unsafe code it is possible to declare and operate on pointers, to perform conversions between pointers and integral types, to take the address of variables, and so forth.'

    First of all (go ahead and call me a troll, like I give a fuck): it's not nice to call someone BJ, even if their initials are in fact B. J.

    "Unsafe code" has no meaning to Microsoft. I'll put it this way, code monkeys are spewing out of Devry and ITT tech (and 4 year institutions under the mask of "computer information systems" majors) daily, with no real understanding of what makes good software development, and they want a language that will be as easy as possible and will fulfill all the buzzwords like "object oriented" and "self-specification." C# will provide this, and Microsoft will support it.

    --

    ~ now you know
    1. Re:This one's just too funny... by Anonymous Coward · · Score: 0

      what about BJ Cummings on Son of the Beach? =]

  46. safety vs security by Anonymous Coward · · Score: 0
    looks like most people are getting confused between safety and security. a loose step in a ladder is unsafe while your alarm in car not working makes it insecure.


    Java has both built in safety and security. You can defeat security by using certificate or running java code as local application. however, its safety features like jvc checking bytecode, no use of pointers etc cannot be defeated in bug-free jvm implementations. c# allows you to defeat these safety features and that is the point of Bill Joy.

  47. .NET by Anonymous Coward · · Score: 0

    If you don't like it, don't use it. Your commentary is shit.

  48. For those browsing at 1 or higher... Read parent by Chris+Burke · · Score: 3, Informative

    Since he's the only one who got the point, despite being an AC.

    The whole point of a safe language is to prevent a program from accessing memory it shouldn't. This means not only buffer overruns, but the ability to fabricate a pointer itself. Which means that trusted code won't compromise security with a buffer overrun, and untrusted code can't get a pointer to anything it might want (like, say, a capability descriptor it doesn't own).

    And the dynamic aspect is critical. Static guarantees are useless, because in the untrusted code case you weren't there to see it compile. But if you can run code from someone else, and be assured that the VM is going to prevent the program from doing anything it shouldn't, then running untrusted code becomes feasible.

    Assuming you believe the VM itself can be trusted. ;)

    This is all from memory of a lecture I had in Adv. Op Sys almost 2 years ago, so take that as you will. :)

    --

    The enemies of Democracy are
  49. Don't feel bad Bill by Anonymous Coward · · Score: 0

    Don't feel bad Bill. It's not like you had anything to do with inventing Java anyway. Go home and write a new white paper on Jxxx. It will make you feel much better.

  50. The Politics of Microsoft by Anonymous Coward · · Score: 0

    Looking at the big picture, Microsoft is involved in very regressive politics as well. They are a big supporter of censorship (see the DMCA for example.

    If you like the philanthropy of the B&M Gates Foundation, contribute to it directly and don't buy Windows.

  51. #unsafe and unmanaged pointers by gte910h · · Score: 1

    Could someone provide a nice bit of Karma Whoreing and point to a resource about how this works?

    From the people who seem to know how this works, it seems like .Net and #Unsafe are compile time "sandboxes" if you will. If your intermeadiate code violates the principles of the sandbox, its marked unsafe. All unmanaged pointers would have to go in unsafe then I am guessing.

    Implementation gotachas are the big deal here. If the .Net security manager, say, checks the header of a downloaded program this could be a security hole (headers can be modified). If it rescans the code/binary to make sure it matches security paramaters there is no problem with this.

    --
    Want to see every step I took to start my company? http://www.rowdylabs.com/blogs/pitchtothegods
    1. Re:#unsafe and unmanaged pointers by borgboy · · Score: 2, Informative
      --
      meh.
    2. Re:#unsafe and unmanaged pointers by Anonymous Coward · · Score: 0

      All code is inherently unsafe. There is no header or marker to make code safe. The only time code may be marked as safe is when the JIT compiles the method and determines that the IL contained is type safe and performs within the security guidelines set by the user. By default, assemblies downloaded via a website have virtually no permissions, not unsafe, and no access to most of the framework. The access they do have is limited, for example a Socket may only connect back to the website's IP. It doesn't even matter if you're running an application locally that downloads and uses an assembly from a website, or vise versa. Security is always the lowest common denominator because every method involves a stackwalk back through every assembly that has been there before it.

  52. All [programming] languages have an "unsafe" mode by alexander.morgan · · Score: 2, Insightful

    ...even English. To try it, go into a biker bar and tell the toughest looking guy you liked his mother. If that doesn't do it, ask him if he has a sister. Make sure to call 911 before you do ;-)

    Yes, C# has an unsafe mode. So does Perl, Python, Java Script, and guess what--Java.

    The only difference is that C# lets you write unsafe code in C#. In Perl, Python, etc.. you would write a shared library (or link extensions into the language executable). And then of course you have to trust that the shared library is "safe."

    Yes, there are going to be security holes in programs written in C#. Only careful programming, and as much peer review as possible can reduce those mistakes. In the end, only time will tell if an application has holes.

    Long live the Department of FUD! Let's go scare some suits :-)

    --AM

  53. Nice troll, Bill Joy by borgboy · · Score: 2, Informative

    Bill makes a lot of sniping little attacks on C# that really amount to very little. So what if C# looks a lot like Java? That's what all the C++ people said about Java back in the day.

    Then, he confuses the C language and it's inherent propensity for buffer overruns and various other pointer-math related problems with the C syntax - which is about all C# really inherits from C.

    C# executes in a runtime context, just like Java does. You have several means for controlling things like "do I let downloaded code execute file I/O?" or "do I allow unverified code to execute?"

    The crucial point here is the term unverified. The C# compiler can, and by default does, generate verifiably type-safe code. It has a compiler switch (oddly enough, "/unsafe") that enables unsafe code generation that includes unverifiable code. You have to use this switch when you use a unsafe directive in your code, and you have to use that directive to employ the pointer methods that Joy references. You might even take this a step further and think that, in an config file somewhere, there is a setting to disallow unsafe code that originated from the internet.

    Bill even hints at this, and I hate to think that he is disingenuous to the point that he's failed to actually follow up and look at the mechanisms .Net uses for code access security, but he plays it off with the FUD statement that the security was tacked on to the framework after the C# language was built. That statement utterly fragments once you have taken a close look at the security infrastructure in the .Net framework. It isn't perfect, but from what I've seen, the tools are there to allow the clueful to secure the box with a fine degree of granularity.

    --
    meh.
  54. More C# FUD... by Anonymous Coward · · Score: 0

    More people sounding off that know nothing of the technology. I've built several C# apps already and I haven't had to use "unsafe" code once. He makes it seem like you can't write a C# program without using unsafe code. That's a flat out lie. Plus, he doesn't even give specifics as to why it's unsafe in the article, he just says that because Microsoft screwed up before (and they obviously did), they must have screwed up now. Unbelieveable. I wish I could get a column where I could flame anything I didn't like without understanding it.

  55. Certainly FUD by wackysootroom · · Score: 2

    MS Creates a language that is similar to Java, and even though it has been left unsaid by MS, they would like to lure Java programmers away fron Sun and towards .NET.

    MS Creates ads in DDJ and other tech publications with benchmarks that show C# trouncing Java J2EE.

    This is almost certianly a FUD tactic in retaliation to MS trying to lure developers away from the Java platform.

    1. Re:Certainly FUD by radish · · Score: 2


      Those benchmarks were a joke, really. They compared an example application (written as a tutorial, designed to be easy to read & understand) with a heavily optimized, built for performance app.

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

  56. Bill Joy is a Retard! by Bastard0 · · Score: 0, Flamebait

    This is the same guy that gave key note speeches at various trade shows and symposiums about how machines will soon be smarter than people and will take over the world and kill all of us. He is a lunatic and should be regarded as such. He is clearly reaching pretty far with his argument. Instead of showing any kind of technical example of anything or any real world situation he just speculates based on a large number of assumptions.

  57. Java has the exact same design by X · · Score: 2

    Do the following search and replace in this article:

    s/C#/Java/
    s/unsafe/native/

    And it still is true. Java has it's own "native" methods, which have all the same problems that C#'s unsafe methods have. In C#'s case it's a bit easier to work with because you don't have to change languages, (Java native methods can't be written in Java).

    Man, I hope someone calls Joy on his hypocracy.

    --
    sigs are a waste of space
    1. Re:Java has the exact same design by Anonymous Coward · · Score: 0

      native code is not platform independant. So C# might as well quit claiming to be anything if this "unsafe" modifier must be used.

      "native" would have been a better keyword that would have sounded cool while not looking like a huge oversight in that pathetic language

  58. Not Quite True by Anonymous Coward · · Score: 0

    According to my copy of the C# specification, you can write "unsafe" code (pointers, etc) - but only as long as you explicity specify "unsafe" when you declare your method. In my view, this actually makes it harder to screw up than it is in C or other languages. Besides, a bad programmer can screw up in any language, pretty much regardless of the precautions that have been taken.

  59. Every code in .NET is verified. by Utopia · · Score: 1

    Every piece of code that targets the .NET CLR has to go through a verifier. Before a program is run the verifier looks at the IL to determine whether it is safe to execute in the current context.

    Code which is marked as unsafe can only be used a fully trusted envoirnment. Currently, if a part of program is marked as unsafe the the entire program (called assembly) is marked as unsafe. So the entire assembly will not execute if it uses unsafe code.

    There is a second level of safety defined by the CLR which requires the programmer to 'demand' permissions to do certain opertaions. When your code demands permissions by using the Demand method, the common language runtime verifies that all code calling your code has the appropriate permissions. Without these permissions, the request fails. Verification of permissions is determined by performing a stack-walk.
    Demanding permissions is necessary if you are accessing protected resources or perform security-sensitive operations.

    1. Re:Every code in .NET is verified. by mugnyte · · Score: 1

      what prevents the verifier from being reverse-engineered and the flaws/holes in its checking are exploited?

      The holes would be ubiquitous, and a CLR update would have to be pushed out through the usual bump-n-grind channels after the virus struck.

      the smart hacker would move to the next hole in the found list and exploint that...on and on. exploint one at a time.

      demand permissions / unsafe checks / etc. are par for the course. its the holes inside there that are the fun spots.

      You can bet that if ONE company holds the design of the CLR, there isn't going to be much we can do to avoid these holes.

      Except pick a different methodology.

      -----------
      unsafe by mere existance

  60. "Unsafe" code absolutely necessary in win32 by Permission+Denied · · Score: 1

    There are a number of important/useful things you need pointers for in
    Win32.

    For example, if you try to write a port monitor, you absolutely
    need the fine-level control that pointers give you. A port monitor is the
    way you can extend the windows printing system to use a new network protocol
    for printing. All it does is basically read data and shove it over a
    network, taking care of the protocol (whether it be IPP, LPR, PAP, etc), in
    addition to some simple administrative things (keeping track of what
    printers are using the port monitor via the registry, etc).

    Now a couple of the functions for writing this require you to allocate a
    struct and pass that struct to another win32 function. These structs
    contain strings within them.

    The catch? The strings must be allocated exactly after the struct.
    Like this:

    struct foo {
    /* some stuff snipped */
    char *s;
    };

    ...

    struct foo *f = malloc(sizeof(struct foo) + 30);
    f->s = (char *)(&f[1]);
    _snprintf(f->s, 30, "blahblah");

    ...

    If you think this is insane, I agree with you.
    If you try to allocate the string separately from the struct, the printing
    subsystem crashes. I have no idea what the hell the Microsoft programmer
    who came up with this was doing, but that's how it works.

    Win32 (even the nicer implementations of win32 like on Windows 2000) is full
    of crap like this. You won't see this if you're writing a "business
    application" that just does file io, network access, GUI stuff, etc, but if
    you try to do anything close to "systems" programming, this is all over the
    place.

    What is "systems" programming in Win32? It's not just writing device
    drivers. That port monitor only does file and network io. It ends up being
    "systems" programming because some of Microsoft's port monitors actually
    talk to hardware directly - so the basic problem is that MS got the
    abstraction level wrong and windows still has a lot of legacy code that
    makes bad assumptions, has poor interfaces, and generally makes programming
    win32 a pain.

    Of course, you could encapsulate the bad MS interface in some sort of
    wrapper. That's what MS did with MFC and now with .NET. If you look at
    MFC's development, you'll see that it has baloonned in size. Why? Because
    more and more stuff was "wrapped", ie, MFC was extended to allow access to
    more obscure parts of the win32 API. And it still doesn't cover all of
    win32, so people have to extend it themselves. For instance, if you want
    your application to use the system tray, you have to deal directly with the
    C SDK interfaces, which are none too friendly for "managed" languages." So
    you either wait for someone to make win32 friendly for your language, or you
    take time away from your real work to write your own abstractions.

    The way I see it, .NET is meant for more than
    just your simple "business applications"
    where your program logic, not dealing with
    someone else's interfaces, are the hard part.
    Yes, java has the JNI, but that still means I have
    to write C code in order to write a port monitor.
    With C#, you don't have to program in multiple
    languages just to get some simple task done.

    The ideal solution would be to allow the "port
    monitor" to be a shell script, like I can do with
    LPRng. However, this is Windows, and the beauty
    and simplicity of Unix is nowhere to be found.

    1. Re:"Unsafe" code absolutely necessary in win32 by Anonymous Coward · · Score: 0

      Excellent points here. MFC is a horribly complicated system of wrappers to a horribly complicated API.

      Linux programming, however, has:
      -- free documentation (man)
      -- free access to the entire API
      -- things like files instead of some registry

      You need to know many less functions, and it makes programming all the more accessible.

      I've done a good share of Windows development, and I clearly second that comment about the variable length structs and other low level manipulations. Without the ability to perform these sort of actions (or at least call some shared libraries), you get what Java is. Pretty, elegant, and limited in what it can do.

      JNI is an ugly hack, and C# may improve on it, but all in all you have to write Native code to do anything beyond simple GUI's.

  61. There's "unsafe" and then there's "unsafe" by mactari · · Score: 1

    Quotes like this one from the article:
    Section 25 of the C# specification says (I quote verbatim): "C# provides the ability to write unsafe code. In unsafe code it is possible to declare and operate on pointers, to perform conversions between pointers and integral types, to take the address of variables, and so forth."
    ========

    ... make me wonder if this guy uses C on a daily basis. He seems to have succumbed to the somewhat unconscious connection between two meanings of the word "unsafe". One is that applications that allow for buffer overflows are unsafe. Another is that code that stores a few vars on the stack where nobody's watching is "unsafe" [from the point of view that it could get overwritten]. The fact that you often find you've done the first having tried to perform the second without "proper Jedi training" seems to have strengthened his otherwise unconscious connection between the uses of the word.

    Sometimes it's more efficient to write unsafe code. If he hasn't seen those needs, even if the author does use C, he probably could have gotten by just about as easily using VB. To take away the ability to write 0s & 1s however you want when you *do* need to is to, as another poster put it, is a bit pedantic on the part of the people who created the programming language.

    Do I want people doing VB tasks to have the ability to write unsafe code, in either sense of the word? Stereotypically speaking probably not. But if you're using C#, I don't see why not.

    If Bill telling me to use .doc's for all my word processing needs is bad why isn't Bill allowing me to write code the way that best fits my programming needs A Good Thing?

    --

    It's all 0s and 1s. Or it's not.
  62. I use Db by epepke · · Score: 2

    C# is just Microsoft's imitation of Db. Once again, they take something that's been around since the equally tempered scale and claim it's an innovation.

    1. Re:I use Db by mindriot · · Score: 1

      Actually, I think Db would've been a way cooler name for Ximian to choose instead of mono :)

  63. Babies by Random+Feature · · Score: 1

    Only baby programmers and script kiddies and VB wienies are afraid to handle pointers.

    The entire notion that pointer manipulation is unsafe is only because they let idiots write code.

    Anyone with half a brain can manipulate a pointer and not fsck it up. It isn't the LANGUAGE that's insecure, it's the fscking programmers using it.

    C# is crap anyway - an unholy joining of Java, VB and C++.

    --
    I don't have a solution, but I certainly admire the problem.
    1. Re:Babies by Anonymous Coward · · Score: 0
      C# is crap anyway

      Oh boy! You must be one of those 1337 h4x0rs I keep hearing about. Thanks for enlightening us poor baby programmers and VB wienies!

      Jeez. Get out from up your own ass once in a while you jerk.

    2. Re:Babies by Anonymous Coward · · Score: 0

      From your website...

      We're studying for our Masters Degrees in Computer Science at NSU and hopefully we'll be finished on June 20, 2002

      Yeah right! You're a real experienced pro then! Give me a break!

      BTW, your art is really, really sucky.

  64. Sun is attempting diversionary tactics... by Stickerboy · · Score: 3, Funny

    ...before unveiling its secret weapon in the language wars:

    COBOL#!

    Yes, with the power of COBOL# Sun will be able to monopolize the huge untapped market of legacy COBOL code that could be easily modified and brought up to cross-platform, bytecode standards.

    Since there is so much more legacy COBOL code than C/C++ (75-80% of all existing code in businesses is still COBOL), Sun will one-up Microsoft, and along with Java will be able to win over developers with its advanced security features like a rigid sandbox and no direct memory manipulation.

    Next up for Sun, Java++... it's rumored that Sun's pulling out all the stops with this one, and even including a full-fledged graphical developing environment with the J++DK, complete with an intelligent "Programming Assistant" that will warn you when you're writing unsafe code! Dancing Bill Joy or paper clip graphics optional.

    --
    Light a fire for a man and he'll be warm for a day. Light a man on fire and he'll be warm for the rest of his life.
    1. Re:Sun is attempting diversionary tactics... by Oink.NET · · Score: 2, Informative
      COBOL#!

      COBOL for .NET has already been done by Fujitsu.

    2. Re:Sun is attempting diversionary tactics... by Anonymous Coward · · Score: 0

      > COBOL code that could be easily modified and brought up to cross-platform, bytecode standards.

      Various implementations of Cobol have been using 'cross-platform bytecode' for two or three decades. Accu-Cobol for example has run-times for two or three hundred different platforms, including internet client. Compile once, distribute to wherever is necessary.

      RM, Microfocus and Microsoft Cobol also can produce portable bytecode since the late 70s, or this can be further 'generated' to native code for the platform.

  65. Direct memory manipulation is unsafe. by barjam · · Score: 2, Insightful

    Languages that use direct memory manipulation do have drawbacks in the safe/secure area.

    I don't care how good a C/C++ programmer you are, you WILL create buffer overrun situations in your code. Period. End of story.

    All it takes is one program running as a priveleged user to have a buffer overrun and bam, compromised system.

    Thats not to say Java doesn't have the same problem. All it takes is one buffer overrun situation in the VM and boom, compromised system. It is probably safer though, you only have one large c/c++ program that many folks are looking at.

    Anyhow, my opinion.
    Barjam

  66. Is safe really safe? by Anonymous Coward · · Score: 0

    The safe/unsafe markings in C# simply stop a programmer from using specific memory references. It has nothing to do with security, in the way that Joy seems to imply.

    A virus writer can still send a script or write a component that can be marked as 'safe', but will delete every file on the hard drive. After all, you don't need to mess with pointers to delete files.

    Of course, you might need to allow the component/executable access to the filesystem, but if someone sees, "This component has no unsafe code, do you want to allow it to run?", then they're going to click 'OK'.

    Sam

  67. Buffer overruns... by Utopia · · Score: 1

    The article says that typically a C program failing to check for buffer overflow

    It would be kind of interesting to point out that Microsoft Visual C++ .NET includes a new feature that helps mitigate some kinds of exploitable buffer overruns. There is a new /GS option in Visual C++ .NET. This new option inserts special code into the application or DLL startup code, as well as special code into certain functions' prolog and epilog code. The option is enabled by default for all new C++ projects. However, the option catches only stack-based buffer overruns that overwrite the function return address. It does not detect heap-based buffer overruns, nor does it detect buffer overruns that do not overwrite the return address.

    That said, there is simply no substitute for good, secure programming practices, but sometimes this isn't enough.

  68. Re: hell with C#...use Am by lugonn · · Score: 1

    I use Am so all my stuff sounds depressing and I won't get so excited if throws an exception.

    Put the code in the f*cking basket!

  69. Java has the same stuff by benwb · · Score: 2

    We can do this in java too- but instead of being able to write unsafe code in java we're forced to use JNI and code in C.

    1. Re:Java has the same stuff by oldwarrior · · Score: 0

      EEEEEEEeeeeeeeeeeeeeewwwwwwwwwwwwwwww! They made JNI impossible to use and improbably slow to run real apps with so everyone would just live with java's slowness in the JVM and buy bigger SUN machines. Prove they didn't.

      --
      If it were done when 'tis done, then t'were well it were done quickly... MacBeth
    2. Re:Java has the same stuff by pinkpineapple · · Score: 2

      JNI actually can not be ran in a sandbox. So in that respect, Java applets are safe because they can run JNI libs.

      PPA, the girl next door

      --
      -- I feel better now. Thanks for asking.
    3. Re:Java has the same stuff by pinkpineapple · · Score: 2

      Make that : CAN NOT run JNI Libs.

      --
      -- I feel better now. Thanks for asking.
    4. Re:Java has the same stuff by benwb · · Score: 2

      Actually you can do it if your applet is signed and you have granted it the UniversalLinkAccess permission. Currently it looks like this still doesn't work under mozilla, but it should. Sun claims that it works with their Java Plug-in, see JNI and Java Plug-in

    5. Re:Java has the same stuff by 21mhz · · Score: 1

      instead of being able to write unsafe code in java we're forced to use JNI and code in C.

      A good price for not having to kludge the syntax, IMHO.

      --
      My exception safety is -fno-exceptions.
  70. Damn! Great troll. by brad.hill · · Score: 2, Insightful
    You had me going until I got to "Has Bill Joy ever written any kind of serious application? Does he know the first thing about programming?"


    ROFL

  71. Sandbox for compiled code? by kindofblue · · Score: 3, Interesting
    On a decent Unix system, it's not possible, or at least difficult, to destroy other peoples data. (Not counting, of course, buggy system call implementations.) But implemented properly, even things like "while (1) { fork(); }" will not kill the whole machine, because the OS will limit the consumption of virtual memory or CPU time, and then kill the errant process or swap it out.

    So why couldn't executable code, like ActiveX or CORBA code, be sandboxed also? This should just require that the component be put into a restricted execution context, that perhaps has lower priveleges than the user's context. The component would operate like a GUEST user, and would not have access to the invoking user's priveleges and resources, like files, etc. This guest user could have it's own scheduling priorities and quotas for a subdirectory, and so on.

    All the system calls, e.g. to DLL's or DSO's would be intercepted or remapped, or something like that, so that priveleges are checked and enforced, just like java does. Since modern CPU's can trap anything from illegal memory access to code or data, to illegal port access, it should be possible to fully isolate the code. Right?

    Of course, the performance would be inferior because of the context switching between different privelege levels. But in a "safe" mode, this would be a fantastic way to run plugins for PDFs, Flash, a whole game, or some downloadable application.

    I'm not a kernel expert, but I thought that mainframes could do this forever. What about Linux? e.g. with Wine?

    BTW, this would also make peer-to-peer style distributed computation (like the SETI project) safe and still fast.

    1. Re:Sandbox for compiled code? by josepha48 · · Score: 5, Insightful
      On Linux while(1) fork() may take down the whole system. Also while (1) malloc(1024) may start to cause problems as well. Other UNIXes can be attacked by runaway proceses as well. Windows and UNIX have that problem. One process that goes awire can take down just about any system if it has the provelidges. Especially if it is run suid or as root.

      Building a system with the sandbox design in minds is easier than taking an existing system and putting it in a sandbox. Active X is already out there. How do you handle the existing Active X and put that in a box? You'd basically have to redesign active X. Word, Excell and Access all rely heavily on VB macros. How do you put them in a sandbox? Actually that may be easier to do but it would also be limiting. In the sandbox that Javascript runs in you are not supposed to be able to access files on the users filesystem. (note not supposed to there have been errors on that though). The idea was there though.

      Okay so you operate it in a GUEST account. If that guest is set up or can access files there goes security.

      The reality is that 28 days is not enought time to focus on security and Microsoft does not have a good track record when it comes to security. While it may be possible to start building in security into the existing system. Security is a continuous effort that must be thought of as part of the design. When a programmer creates a new language they must start to think security right off the bat. This was done with Java, but not C#.

      I say good luck Microsoft, but you have a lot of work ahead of you to prove to me that you can get security right without comprimising usability.

      --

      Only 'flamers' flame!

    2. Re:Sandbox for compiled code? by Anonymous Coward · · Score: 0

      on linux you can use /etc/security/limits.conf to limit the damage an infinite fork can do. in fact with a decent limits.conf even if all 6000 users on your system ran the fork program the systems load would not cross 0.2.

    3. Re:Sandbox for compiled code? by Anonymous Coward · · Score: 0

      how about just making it so that only digitally signed code can run?

    4. Re:Sandbox for compiled code? by borgboy · · Score: 1

      The reality is that 28 days is not enought time to focus on security [...]
      You are right. It is not enough. Who said they were only spending 28 days on security? I thought it was bugfixes.

      [...] and Microsoft does not have a good track record when it comes to security.
      True, but a bit disingenuous: if you sold cars to people who largely had no notion of how to operate a door lock nor inclination to learn, your customers would suffer a lot of security problems, too. Now, I'll be the first to admit that the locks dont always work, but the larger problem is, IMHO, user responsibility for security.

      While it may be possible to start building in security into the existing system. Security is a continuous effort that must be thought of as part of the design. When a programmer creates a new language they must start to think security right off the bat.
      Amen.
      This was done with Java,
      Very true.
      but not C#.
      Also true. The security responsibility lies with the infrastructure, NOT the language. But since the term Java refers to both language and infrastructure, your previous statement is misleading.

      Your attempt to bash C# fails. Security WAS a key design consideration of the infrastructure, from the start. Any MSIL (.Net Byte Code) is still subject to security verification.

      --
      meh.
    5. Re:Sandbox for compiled code? by josepha48 · · Score: 2
      "Who said they were only spending 28 days on security? I thought it was bugfixes. "

      I read that somewhere. I also read that it was for bug fixes. Still 28 days is not enought for bug fixes either. I work at a software company and we do it every release. We even back code many of the bug fixes that clients want. We also listen to our clients.

      "True, but a bit disingenuous:"

      Your analogy of cars is .. well off. Cars and operating systems are two completely different things. But since you made the comparison... cars have one button push door locks and some cars have 'automatic seat belts'. Also cars have air bags that just work most of the time. Cars think about security cause the goverment and people make regulations on how they should function and how they need to be safe. Air bags in teh front were found to save lives and then it became a requirement that ALL cars in the US have them. They don't have any regulations like that for software. Maybe we should require all software to have some sort of waranty and exchange. Maybe a firewall or something should be a requirement of ALL operating systems. Maybe virus software should too. If you look at Microsoft though they started with DOS, no security there. Then Win 3.1, no security there, just virus software. Then Win 3.51 NT, which had some security. Then Windows 95 which had little to none more like fake security. Then NT4.0 which had some. Now NT 2k I believe is the first offering that has a firewall or so I am told. Wow it only took them 10 years of working on the OS to figure out that it may be good to ship with a firewall. Hmm Linux started a firewall when? Ipchains was the first I remember using in about 98, but I know they had ipfwadm earlier than that. Hmmm OpenBSD worked solely on the premise of security since when?? Sun, the other BSD's?? Lets face it they are finally realizing that it is more important to users to have easy security and easy use and less bugs and less features.

      I'd like them to have there OS secure and stable as my parents use the OS. They don't and shouldn't have to learn about the OS and the computer. Microsoft also markets to people who don't want to learn about computers. Isn't doing things 'easier' supposed to be part of their XP marketing??? It is so easy to reinstall your OS cause it fell victum to a script virus that you got in an email.

      "The security responsibility lies with the infrastructure, NOT the language."

      Well acutally both. Since the language is reflective of the infrastructure. If the infrastructure allows for security holes so will the language. Then it is up to the programmer. I know I am not perfect. I like perl and scripting languages cause they handle most of that crap. I can code.

      "Your attempt to bash C# fails."

      I was not attempting to bash C#. I am only pointing out that like all things Microsoft it is uncertain as to how well it will actually be.

      Examples of how well they think things out and there track record are in the article. Word / Excel macros that let you open up other files. Ohh great, but security was never an issue. VB script in the email. Do users really want this? Do they need this? What are the security issues? They never though of any of this.

      Do we really need C#? Probably as much as we need Ruby, and the myrid of all the other languages that are poping up. Not really, but people will use them. You like C# great use it. Someone hacks your site cause of it, then don't come to me and don't complain about it.

      --

      Only 'flamers' flame!

    6. Re:Sandbox for compiled code? by Anonymous Coward · · Score: 0

      So, based on your intelect, you assume that Feb is the only month in which MS fixes bugs? It's like saying, "I'm taking a month of vacation" and assuming that the person never took any breaks (weekends, holidays, days off) for the last 5 years.

    7. Re:Sandbox for compiled code? by quintessent · · Score: 2

      How do you handle the existing Active X and put that in a box?

      They are in a sort of box. If you don't want ActiveX controls on the web to run, turn them off. But even by default, you won't even have the option to run an ActiveX control unless it has a secure digital certificate telling you where it came from.

    8. Re:Sandbox for compiled code? by borgboy · · Score: 1

      The point that I failed to get across in the car analogy was that there is a certain amount of resonsibility that resides with the administrator of a system that she ensure that she knows how to secure the systems in her perview. The OS developer is responsible for providing a product that can be secured. Microsoft failed miserably with this in their consumer OSs up until XP. The NT line was securable, but you did have a learning curve to get up to speed.

      I understand your statement Well acutally both. Since the language is reflective of the infrastructure but when you're talking about .Net, most of that responsibility/functionlity really has been abstracted out to the runtime.

      --
      meh.
  72. You have missed the point I believe by dnoyeb · · Score: 1

    As I have said. Most programs that have these overruns are locally installed trusted applications...(outlook express, ICQ...) "safe" has nothing to do with security. "safe" is simply a programming paradigm like "strict", it does not have anything to do with security, maybe reliability, but not security.

    1. Re:You have missed the point I believe by spongman · · Score: 2
      cunningly enough it pretty simple for a trusted application (like, say outlook.net) to create a 'safe' execution environment withing its own process (a separate ApplicationDomain) in which it can run untrusted code.

      The current episode of the .NET show is about exactly this. Well worth checking out if you want to be informed about such things.

  73. Talk about flames by f00zbll · · Score: 2, Insightful
    Sure I submitted it, but I thought it was a good joke. Who would have thought it would get accepted.

    As others have said time and time again, it's about the developer who is writing the code. Sure it's FUD, but everyone is throwing it in every direction. The only thing half way useful from the article is about each company's approach to development, which doesn't necessarily validate their products. It's good people are thinking critically about the article and poking holes in Bill Joy's article. The only problem with providing the power and benefit of unsafe code is, when some uses it inappropriately or incorrectly, it creates headaches for everyone in the project. No news there. Good developers will spend appropriate time to learn the tool and use it "correctly." Here's to the hope C# will not only be developer candy, but that it will promote good coding practices.

  74. The Emperor still has no clothes... by the_skywise · · Score: 2, Flamebait

    What kind of syntatical gobbeldy-gook is this!?!

    If I put the keyword UNSAFE in front of any line of code, C# generates a flag (similar to CONST in C/C++), that sends the keyword all the way down to the code emitter which sets a flag in the .EXE header that states "the unsafe flag was set in the code, so don't run it if you don't run "unsafe" code...

    There's NOTHING, NADA, ZIP in this system that makes the code in this program "safe". All you're REALLY saying is "MICROSOFT WARRANTS THAT THIS CODE HAS NO POINTERS! (TM)"

    That's what Joy is saying... When Microsoft has to state in their documentation "The keyword UNSAFE, marks code that is UNSAFE to run, because the code being run would be UNSAFE when it is run. This actually makes the code SAFE." There's something VERY WRONG here...

    Stop buying the Orwellian newspeak... THE EMPEROR HAS NO CLOTHES!

    1. Re:The Emperor still has no clothes... by Anonymous Coward · · Score: 0

      You, sir, are an idiot. If I wanted to hack your machine I would just write a C++ app and you'd still be stupid enough to download it and execute it.

    2. Re:The Emperor still has no clothes... by grammar+fascist · · Score: 2

      Read this again: In the current version of the runtime, unsafe is defined at an assembly level, so having any unsafe code in assembly makes the entire assembly unsafe.

      Assembly level. Therefore also opcode level. The bare instructions themselves are either inherently unsafe or marked as unsafe. It's not something in the executable header.

      It's not too difficult to imagine an instruction set like that.

      --
      I got my Linux laptop at System76.
    3. Re:The Emperor still has no clothes... by the_skywise · · Score: 1

      First off, .NET compiles to an VM layer like Java (it can also compile directly to a native binary, ).

      Secondly, it'd be...well... stupid to mark every instruction in the VM layer that's unsafe. Especially when such an action is only to inform the running machine that this executable contains unsafe code. It's specified as part of the language to force the programmer to mark out that he/she is doing something "unsafe" (riiight).

      Look at it this way... wouldn't it make more sense to "know" that certain opcodes contained in an .EXE are "unsafe" and then disallow the user to run a program that contained bad opcodes, RATHER than force the programmer to mark his source code as "unsafe", when the language will already know what actions are and aren't unsafe?

      If the choice is allowing an "unsafe" option for speed over a "safe" option for dependability... doesn't it make more sense to set that up as a compile time FLAG (I want safe code, screw safety give me speed) than forcing the user to PAINSTAKINGLY MARK OUT THE CODE that's desired to be unsafe? (and who knows, it might actually be that way by 3.0...)

    4. Re:The Emperor still has no clothes... by spongman · · Score: 2
      The CLR won't even load an assembly that contains unsafe methods unless the ApplicationDomain that requests it has the required privilege. Privilege levels cannot be raised, only lowered. The CLR checks both the metadata of the class and the individual opcodes (some of which are specifically marked as unsafe) during JIT compilation and verification (much like a JVM). The assembly will also be rejected if the metadata is innacurate.

      From 'Unsafe at the Limit' by Eric Gunnerson:

      From a technical viewpoint, the term unsafe refers to whether the program is known to be safe. Before a program is converted from intermediate language (IL) to native code, there's a part of the runtime security system known as the verifier that looks at the IL to determine whether it's safe to execute. In this context, safe means that the verifier can prove that the IL doesn't do anything unsavory.
      I little bit of R-ing the FM goes a long way.
  75. 66% of comments modded down -- must be about Linux by Anonymous Coward · · Score: 0

    What a bunch of pouty little children. No one can stand an open and honest dialogue about Linux so the cowards resort to modding down 66% of the posts to this thread. Truly pathetic.

  76. one question? by Anonymous Coward · · Score: 0

    Has anyone actually created programs of any substance using this hybrid language? Arguing about theory is one thing (and worthwhile). In reality, lets compare these languages. C was written 30 years ago. Its fast, and can do low level stuff. The low level stuff can be dangerous. If not properly utilized and managed, it can translate into major headaches. C++ brings in object oriented programming, but still a program is only as good as the programmer writing it. With the capabilities that C/c++ has, that can be dangerous. I hate having to debug memory stuff in c/c++!

    Java on the other hand is purely object oriented. You dont have to do any low level stuff because its already taken care of!
    You can code more effectively. Java has been around since 1995 and is a major language. My school just changed from teaching C++ to teaching Java. -- DePaul University CTI

    This new language is a hybrid of java and c. It has been out how long? Has anyone written any useful programs on it? Windows executables? Anything that attempts to be mission critical?

    Computers are getting faster and faster and Sun will make java better. Maybe java will be as fast as c++ one day

    1. Re:one question? by Anonymous Coward · · Score: 0

      Um, hello? Java sucks.

    2. Re:one question? by Zico · · Score: 0, Flamebait

      mappoint.msn.com is pretty useful for me, and is made from ASP.NET code in C#.

  77. Doesn't "unsafe code" spread kinda like a virus? by ozra · · Score: 1

    Since you don't want to write such code inadvertently, C# requires you to use the unsafe keyword on your class or method whenever you write code that deals with pointers. When you use the unsafe keyword, the resulting IL is marked as unsafe and can only run in a fully trusted environment (usually, security policy only trusts local assemblies). In the current version of the runtime, unsafe is defined at an assembly level, so having any unsafe code in assembly makes the entire assembly unsafe.

    Well, in case writing unsafe code becomes a frequent practice among C# programmers, this means that in order to run most of the code, you need to set the security policy to trust most of the C# code. Now, I don't know much about C# and CLR, but I assume the when your code uses libraries with unsafe code, then your code ALSO becomes unsafe. Just imagine that one very common library to use unsafe code; then the unsafe code itself will spread like a virus. And this doesn't look good.

  78. Let's assume MS *tries* to secure dotNET by JohnDenver · · Score: 2

    There's also (in theory) a special security privilege to run "potentially harmful" ActiveX scripts or Outlook macros; yet they seem to slip through on a regular basis. I have little faith in Microsoft's ability to successfully implement a decent security model, based on their track history alone.

    I think we can all agree that if there was any attempt to secure IE and Outlook from threats, it was either ignored or done half-assed.

    Just to be careful, I wouldn't compare a half-assed attempt at security to thier upcoming crusade (last crusade it was the Internet).

    I'd place a bet that there are ways around C# security.

    We'll have to wait and see. From what I understand, MS hasn't implemented a sandbox for executing applet like applications. When they do, I'm pretty sure it will be as restrictive and secure as the JVM (obviously pointer manipulation wouldn't be allowed). Why wouldn't they? It's not like they don't have experience making virtual machines.

    Furthermore, using code that handles memory directly is a lousy way to implement platform independent software; why do you think there are so many little-to-big-to-little endian conversion functions in C?

    It's not for building cross-platform code. It's for developing system code when you need to write system code.

    --
    "Communism is like having one [local] phone company " - Lenny Bruce
  79. JINI, Java by Anonymous Coward · · Score: 0

    wasn't Bill Joy the cheif architect of that little computer language we are all talking about, Java?

  80. So is Obj-C safe? by Anonymous Coward · · Score: 0

    It still provides pointer manipulation (which is damn handy) but AFAIK it kills the app if you try to access outside of its memory space. So, is it safe? What about if you mix in C functions? I'm wondering as it seems to be a good blend of OOP but without the kid gloves of Java.

    1. Re:So is Obj-C safe? by unclefucknut · · Score: 1

      Obj-C = C + Smalltalk like OO-extensions. In essence, Obj-C is a strict superset of C, thus everything you can do in C, you can do in Obj-C.

      If the program got killed off when accessing weird pointers, that was probably due to the OS and not the language itself.

    2. Re:So is Obj-C safe? by mcc · · Score: 1

      Objective C does not kill the app if it goes outside its memory space. The operating system kills the app if it goes outside its memory space, assuming you're in mac os x or linux (which you probably are if you're writing an objective c app, but not necessarily). If you compile an objective-c app for classic macos (though far as i'm aware no compiler allows that) then int *p=0;while(1)*(p++)=0; will lock up the machine just the same as a c program.

      Objective C does, however, make pointer manipulation largely unnecessary for almost any program, because it and the Foundation framework provide a good solid object oriented.. um.. foundation that make you not particularly want to do pointer manipulation and such. This is probably what you were thinking of: NSString, NSArray and similar classes have you access not the direct contents of what is stored, but accessor methods which contain bounds checking and will not allow you to, say, get the 10th element of a 9-element NSArray. This provides the functionality of boundchecking in arrays and strings that CLR and Java give with their memory safety models with significant speed improvements over what happens in java and CLR.. but that all goes out the window the instant you start doing pointer arithmetic or using C-style arrays.

      Objective C is C plus some objects, and like C it just gets compiled down to unsafe machine code in the end. I agree with your statement that Obj-C is "a good blend of OOP but without the kid gloves of Java", but that is not relevant.

      The current line of discussion is memory integrity assurance in two combatting virtual machine platforms. Languages are not relevant to that discussion, because they are a layer above-- C++ and Objective C can both be just as easily compiled to either machine code or java bytecode or CLR bytecode.. and if they do pointer arithmetic or straight C arrays, they will be as "safe" as the memory checking of the virtual machine that runs them.. and if they do not do pointer arithmetic or straight C arrays, they will be as safe as the java programming language. (which disallows pointer arithmetic.)

      I hope this clears things up a little.

    3. Re:So is Obj-C safe? by Anonymous Coward · · Score: 0

      objC is VERY VERY unsafe! One time I wrote a program where a difference in whitespace caused a segmentation fault.

      You can make the program cease to run just like this:

      [[NSObject new] raiseExceptionByDoingNonexistentMethod];

    4. Re:So is Obj-C safe? by blackwings · · Score: 1

      A segmentation fault, is either a serious bug in your code or the objC libraries, not by itself a proof that a language is unsafe! A bug in the java VM could produce the same same fault, it does not mean that Java by deffinition is unsafe.

      Neither is the ability to make a program cease to run, you can do this (or something similar) in almost any language:

      abort();

      objC is unsafe (it builds on C), but not because of the reasons you mentioned. It does however make a little bit easier to make safe code than ANSI C.

  81. Isn't he the guy ... by zangdesign · · Score: 2

    whose afraid the world is going to be taken over by giant genetically engineered killer robots or something? Probably afraid the AI will be written in C#.

    --
    To celebrate the occasion of my 1000th post, I will post no more forever on Slashdot. Goodbye.
    1. Re:Isn't he the guy ... by Anonymous Coward · · Score: 0

      Yeah, him and that other goofball Stephen Hawking.

      Information Week

  82. Even more... by GCP · · Score: 2

    Notice that Joy's article starts off sounding very technical, but never quite gets to any specific technical flaw in .Net. He just implies that it probably has a lot, without offering a single example, based on historical complaints about the company.

    If you think the "untrusted code" part was a (single) example, note that he doesn't actually point out any specific flaw.

    Java itself allows a program to delete user's entire hard drive, or write the binary op codes for a virus into a file and label it "readmeNOW.exe", if that user chooses to run the program as a standalone app. So Java has the concept of trusted and untrusted, too.

    If Joy wants to convince a technical audience that C# is dangerously insecure, you'd think he could come up with an example.

    Otherwise, it's nothing more than a fluff "I just don't like Microsoft, the company" piece.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
    1. Re:Even more... by Ozx · · Score: 0, Insightful

      In reality Joy wishes to convince non-technical people that Java is superior to C#, and through that, all of .NET... Sun's usefulness is shrinking with time, and they realize one of their most valuable assets in the future will be Java. They have no desire for MS to sack their Java developers, like free unices, Windows, and robust server solutions built around the x86 are sacking their server market...
      By convincing employers that might not know their ass from their elbow that Java is innately superior and more secure, this will shape what sort of things people will actively use to solve problems, such as technical folk with no choice but to do what their employers ask of them...

  83. Low-level features are necessary by Florian+Weimer · · Score: 2

    Some tasks simply need low-level features. If you want to use a high-level language most of the time, you have got several choices: You can write the low-level parts in a different, low-level language, you can try to outgess the compiler vendor and write source code which compiles to the required machine code using a specific compiler version (in many cases, this is the C approach), or you can use a high-level language which supports low-level programming. The third choice does not have to be the worst, especially if the low-level language features are clearly separated from the high-level ones (C fails miserably in this area).

    Remember that many mission-critical computer systems are implemented in Ada, which offers a wide range of very low-level features (interrupt handling, representation clauses, unchecked conversion of objects, and so on). Unlike C, there is also explicit support for machine addresses and address arithmetic.

    However, you should keep in mind that only certain types of security problems can be avoided automatically by choosing an appropriate programming language. Buffer overflow and format string bugs are found in almost all C software, but they are not the only cause of problems.

  84. There *are* pointers in VB by Anonymous Coward · · Score: 0

    Oh, by the way, there are pointers in VB. Not officially, and it's an "unsupported" hack, but there are.

    And VB.NET makes them official. ;)

  85. Flexibility is unsafe???? by mtrupe · · Score: 1


    I don't get it. Anyone who has done any serious development for embedded systems has to see how utterly ridiculous this article is.

  86. rreyelts the media whore by partingshot · · Score: 2



    You've been taken in by the anit MS FUD.

    Here is the most recent definition from MSDN:

    "A set of technologies that enables software
    components to interact with one another in a
    networked environment, regardless of the language
    in which they were created. ActiveX(TM) is built on
    the Component Object Model (COM). "

    Quite a step from "automatically downloading and
    executing arbitrary programs" don't you think?

    More specifically:
    "An ActiveX control is essentially a simple OLE
    object that supports the IUnknown interface. It
    usually supports many more interfaces in order to
    offer functionality, but all additional
    interfaces can be viewed as optional and, as
    such, a container should not rely on any
    additional interfaces being supported. "

    --
    Anonymous posts are filtered.
    1. Re:rreyelts the media whore by Anonymous Coward · · Score: 0

      "Anti-MS FUD" from a Microsoft programming book? Is that sort of like Stalin erasing people from the official picutres?

      The fact is that _when it was introduced_ "ActiveX" was specifically a marketing term for COM plugins in Internet Explorer.

      Anyway, the marketing of OLE/COM/Whatever has been so fucked up over the years that you either just fell off the carrot truck, or your borg implants are in waaay too deep.

    2. Re:rreyelts the media whore by Anonymous Coward · · Score: 0

      Jesus you don't know shit about anything. Please shut the hell up.

  87. Two Kettles Arguing over whos Blacker by MagikSlinger · · Score: 2, Troll

    Alas, I doubt anyone will be reading this, but I'll say it anyway:

    Java's security model always felt tacked on to me, but even still, it's pretty decent for the kinds of security issues it was meant to deal with. The problem is that Java can still be used to create viruses and other nasty problems, especially if it can sweet talk to user into giving the Java code more permissions than it would otherwise have. The same thing is true of ActiveX: all the security in the world won't protect you from a user who cranks the security in his IE down a few notches. The reason users would do this is to get access to a control or java app that can do something interesting or useful. For example, a virus scan of your harddrive.

    This leads me to a basic observation: the usefulness and capabilities of a language or programming environment is directly proportional to the amount of damage it can inflict on a system. Both languages and environments have their benefits and drawbacks, but deciding based on security is pointless: security is fundamentally a user-developer level issue. No amount of language-level or environment-level features can make computing secure if the user and developer aren't willing to think securely as well. If you do add more secure language and environment security measures, then the usefuleness of your language/environment decreases (e.g., to protect your local hard-drived files from unwanted operations, you lose the ability to save/read anywhere on your harddrive from your application). You cannot have a useful programming language/environment and still make guaranteed secure programs.

    C#'s unsafe section problems are not security problems, but robustness problems. The unsafe sections make it very easy to create code as crashable and bug ridden as a pure C/C++ app! Java's constraints don't make it more secure than C#, but they do make it easier to write robust code.

    Even with the unsafe sections, you can still write really high quality C# code because no language/environment feature can ever replace the programmer's diligence in writing secure code. And if you want code that's less bug-ridden and more robust, avoid unsafe code sections like the plague.

    My greatest qualm with C#'s unsafe section is knowing that a bunch of programmers raised on MS's crappy coding style will create components and other applications with great reams of unsafe code forcing everyone using .NET to drop their security precautions in order to get basic applications running thus creating the backdoor every script kiddie is waiting for.

    --
    The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
    1. Re:Two Kettles Arguing over whos Blacker by Anonymous Coward · · Score: 0
      Java's constraints don't make it more secure than C#, but they do make it easier to write robust code.

      It's more accurate to say it makes it harder to write non-robust code, which is different. It's just as easy to write robust code in C# if you simply constrain yourself from writing unmanaged code.

    2. Re:Two Kettles Arguing over whos Blacker by MagikSlinger · · Score: 1

      Point taken, but I dislike double negatives. :-)

      --
      The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
    3. Re:Two Kettles Arguing over whos Blacker by Zico · · Score: 0, Flamebait

      Java's constraints don't make it more secure than C#, but they do make it easier to write robust code.


      I've gotta ask for some explanation of this statement. Just because C# gives programmers the option of using things like pointers, doesn't make it any more difficult to write robust code. If some Java programmer were wanting to write a program in C#, there's absolutely nothing about it that would make him feel like he should start using pointers all of a sudden. What strikes me as the silliest thing about the article is that the Java platform lets you write the same type of "unsafe" code as C#, using JNI — it seems like Joy thinks the big sin is that the programmer can actually use his preferred language (C#) to do it, whereas with JNI you have the headache of having to write the native bits in a whole different language than Java. Anyway, because Microsoft has come up with a better language than Java, I personally find that its simplicity (like with Properties), makes code development much easier than with Java. And I'm just talking about regular Java-like, non-unsafe code.

  88. Great troll by Anonymous Coward · · Score: 0

    Great troll...really fooled the moderators...oh...you dont know its a troll?
    look at the obvious! first, he admits to not being an authority, making himself look humble, then he continues on to talk about how his opinion is right

    He even goes off on ridiculous tangents to what he was talking about in every paragraphs!
    Did you people even read what he was saying?!

    Jesus christ, how does slashdot consistently pick idiots as moderators

    1. Re:Great troll by mugnyte · · Score: 1

      YOU: modded down - not very informative - and from a coward to boot.

      are you claiming to be an authority on trolls? write us an interesting article doughboy

    2. Re:Great troll by Anonymous Coward · · Score: 0

      I did on my karma whoring account :)

      If you really are interested, read the /. troll FAQ, doughboy :>

  89. Flag "unsafe" by RichMan · · Score: 1

    I don't have the technical details on this.
    From other comments, using pointers causes a flag to be set which appears in the .EXE header indicating the code is unsafe. Is the resulting executable also encoded and signed including the flag state. Toggleing the "unsafe" flag in the header would otherwise be a trivial exercise. Please someone tell me there is some protection on the "unsafe" flag.

    1. Re:Flag "unsafe" by Anonymous Coward · · Score: 0

      Unsafe code simply fails the verifier check. You can set the flag any way you want, it still won't pass the code verifier, and therefore won't pass security.

    2. Re:Flag "unsafe" by the_verb · · Score: 1

      My understanding is that the CLI code itself is verified, not just a header. It's amazing how a suspicion turns into The Gospel Truth here if it's not corrected in within a few hours...

      --the verb

    3. Re:Flag "unsafe" by the_skywise · · Score: 1

      I don't get it.

      If it verifies the code by scanning a set of opcodes (that Microsoft designed) to look for "unsafe" code...

      Why does the programmer need to specify that she's writing unsafe code?

      Answer: MARKETING!

  90. Actually COBOL *is* part of .NET by eples · · Score: 3, Informative



    Actually, Fujitsu COBOL is part of the .NET framework. There's also Eiffel, and I think PERL too! Adding language support is easy, just build a compiler that can compile to MS's IL (Intermediate Language) instead of machine code.

    --
    I'm a 2000 man.
  91. It really shouldn't be about C# or Java... by justin+sane · · Score: 1

    What it *should* be about is security. Code which uses pointers and other potenitlaly indirection and derefrencing constructs should never come from anonymously the network, but should only put on the system by the user or administrator as a concious act. Period. Native Java is just as potentialy harmful as C# UNSAFE code. The real discussion here should be on the security of the Dot-Net environment. How secure is the run-time security? The Java solution, to allow noneperiod, is safest but limits the power of the language for native uses. Java is very frustrating if used as a general purpose language. SO in that repsect C# has potential. It is incumbent upon Microsoft to prove that in allowing indirection in C# they did not weaken security on Dot-Net. The burden of proof is on Microsoft--not C#. Given Microsoft's track record, I suspect it leaks like a sieve. But that is a suspicion. Let's hear from Microsoft and let some hackers have at it.

  92. C# - The speed of Java with the safety of C by AJWM · · Score: 3, Funny

    What a wonderful combination!

    --
    -- Alastair
    1. Re:C# - The speed of Java with the safety of C by Anonymous Coward · · Score: 0

      with the evil of microsoft.

    2. Re:C# - The speed of Java with the safety of C by Anonymous Coward · · Score: 1, Interesting

      Think of it this way: (theoretically) the portabilty of Java with the power of C.

  93. Then rewrite Solaris in Java by ToasterTester · · Score: 1

    Pointers don't kill people, bad programmers kill people.

    Buy a clue Joy pointers are good. If pointerless Java is such a swiss army knife for programming rewrite Solaris in it. Oh dam there goes memory management. Solaris is mainly C isn't it Bill.

    1. Re:Then rewrite Solaris in Java by Anonymous Coward · · Score: 0

      Joy hacked on BSD in the 80s. He knows that pointers are good.

    2. Re:Then rewrite Solaris in Java by ToasterTester · · Score: 1

      And Solaris had it good BSD roots until I believe v2.5.1 after that it became SysV based.

  94. I don't need it, therefore nobody does.. by Anonymous Coward · · Score: 0

    Has it occured to anyone that C# and .NET are not Java? That they aren't really even targeted at the same audiences.

    The comments here seem to be of the ilk: I've never needed it, therefore nobody needs it.

    There is a good reason why C# includes unsafe code. With Java, if you want to write a client side piece of software that actually can manipulate bits, memory, and buffers, you are just SOL. You just CAN'T do it.

    But I don't need to do that, the whiner's whine. Why should anyone ever want to do that? Blah blah.

    Well, I DO need to do exactly that regularly, and I don't feel like writing a nasty huge ass complex C++/C JINI POS for the rest of my application just because in three functions I need a little high performance buffer and bit twidling.

    As for being secure, who claimed that ever piece of software was run off of a web page or off the internet. Remember client software? Those strange pieces of code that users actually intall on their computers? Yeah, that 99% of all software written (in C and C++). Why do you think that client side application are written in C and C++ and NOT in Java. If you guessed the training wheel limitations that Java imposes on low level coding, you guessed right.

    90% of all of the security and stability issues in the average C/C++ program doesn't come from the low five or six low level bit twidling functions anyway. It comes from the universal use of pointers, pointer arithmetic, and lack of decent exception handling and memory management in the other functions in an application.

    So in short, for average run of the mill client side apps, the ones that real people actually install and use on their desktops (which is Microsoft's world) you can get the performance of the low level bit twidling direct buffer access pointer arithmetic and have the rest of your app in a nice safe sandbox.

    And what exactly is so wrong with that?

  95. So is anybody actually using C#? by CTalkobt · · Score: 1

    I've seen a couple of unbought books in the bookstore ( think about the sentance for a bit ) but other than that I haven't seen that much re: C#.

    Is anybody actually using it other than MS? If so, what are the particular reasons for choosing it over C,C++, or Java or something else?

    I'm actually curious - I don't understand the need for C# - Java is sufficient for platform indepandance - C# is currently just for MS-OS's, so C++ or whatever binary for your target OS would be equivlent.

    --
    There's a gorilla from Manilla whose a fella that stinks of vanilla and has salmonella.
  96. Re:Music lesson (off topic)... by pancrace · · Score: 1, Offtopic
    And there is also a C-double flat. It just so happens that Cb is enharmonically equivalent to B, and Cbb to Bb.

    Just to be *really* anal, the two are enharmonically equivalent only when tuning with equal temperament. However, if you use alternate tunings (such as tuning to perfect 5ths for a particular key, "just tuning," or using another Baroque tuning), there is a very audible difference between Cb and B, E# and F, etc.

    --
    I don't have a .sig
  97. Sun and MS are both of the same kind by pinkpineapple · · Score: 2

    I suspect that Bill Joy's article is not totally objective here. I was almost expecting the word "Advertisement below" to flash above this article.

    See, the problem is that MS may have the killer Java technology here on the server side, and Sun smells it. So expect to hear more from people at Sun bashing hard on .NET and C#.

    What's Bill's point anyway? Ok, he knows stuff as he wrote vi and csh both in C, so he probably got into pointer trouble while writing his code. But, I am not sure about what he claims here. Is he asking MS to add the keyword "unsafe" into the C# language and is he bitching because MS already moved to the ECMA?

    At least MS had the decency to move their language to a standard body right away, instead of tip toeing for about 2 years like Sun did with Java. And Sun still controls Java BTW.

    Visibly, the guy with the gray goo on top of his head is running of fuel. It shows.

    PPA, the girl next door.

    --
    -- I feel better now. Thanks for asking.
  98. Can Someone explain the UNSAFE flagging? by rlowe69 · · Score: 2

    I've been reading a lot of comments about the IL code having some sort of flag mechanism indicating unsafe portions.

    My question is this: since the end-user JIT executes IL, what stops someone from editing the IL so that it becomes 'unflagged' as unsafe and tricks the end-user into thinking it is a safe portion? Are there a group of unsafe instructions? Is the IL obfuscated in some way? Or is it just as simple as an 'unsafe=1' in the .exe header?

    I think many of our concerns about unsafe code could be answered by knowing these details. Could someone with the technical knowledge step forward?

    --
    ----- rL
    1. Re:Can Someone explain the UNSAFE flagging? by mikera · · Score: 1

      The JIT compiler performs a verification check on code marked as "safe". If it fails the verification check due to using any unsafe feature, it won't be allowed to run in a safe context.

      So no, it's not possible to get round this system by just re-marking the IL code. The only way to run unsafe code is to give it sufficient permission to run.

    2. Re:Can Someone explain the UNSAFE flagging? by rlowe69 · · Score: 2

      If it fails the verification check due to using any unsafe feature, it won't be allowed to run in a safe context.

      So it is the feature or instruction that is unsafe and if the program is in a sandbox which is not allowed to use the feature, then it flat out doesn't allow it. It doesn't sound like UNSAFE code is a security risk then .... is Bill just blowing FUD?

      --
      ----- rL
    3. Re:Can Someone explain the UNSAFE flagging? by mikera · · Score: 2

      Theoretically, you're right, and that's how it should work.

      However, that's not to say that there won't be some subtle and ingenious way to escape the sandbox, and given the complexity of .NET I'd say you have to accept that as a possibility. So it's probably harsh to say that it's all FUD given that the technology is as yet unproven.

  99. I don't know why Bill Joy's getting so worked up by Anonymous Coward · · Score: 0

    Once the nanobots take over the world, no-one's going to care about C#.

  100. Thanks for making my day! by Anonymous Coward · · Score: 0

    C4L, don't you see that you are fighting a losing battle? Ignorance such as the_skywise is useless to fight.

  101. Unsafe code is nonsense by TimTr · · Score: 1

    First: yes, it is possible to set the boundries where code is more and less safe. Scripting languages do that just as Java does. However, this stuff by Bill Joy is just nonsense. Yes, my "Hello World" application is more trusted in Java than C++ potentially. But Java doesn't run on Java, its runs in a native code implementation of a runner. From what I know there is no government agency ensuring that the JVM is absolutely secure (and even if they did - these people promised NT was too.)

    Every single time you install most any application on most any system the code is unsafe to some degree. The issue is do you trust the vendor? Do you test deployments? And how do you get the code (just downloading from annonymous people is plain silly if security is your primary concern.)

    Write the application in the language that does the job. If you are worried you have bad QC and are a bad developer, then maybe writing in Java will make you less worried about breaking someone else's OS. Hardly a ringing endorsement for Java or a horrible criticism for C#. All C# does is balance the security, independance, and similarity to C++ a bit differently than Java. Its not rocket science. Its like the owners of a 4 door and a 2 door Camry saying how horrible the other's car is - damn they are similar and the differences are a matter of taste, not absolutes.

    --
    Tim T. ... Cupertino, CA
  102. Unsafe code vs. Insecure Code by fzlgk · · Score: 1

    Unsafe code = Unmanaged code =
    allows pointers, direct allocation of memory, and you have to keep track of your own garbage collection

    Insecure Code =
    loginfunc(username,password)
    {
    return 1;
    }

    1. This may be obvious... but I would say that anyone can build an insecure program with any language.
    2. I've used C#, it's in the programmer's interest to *not* use unmanaged code both time wise, and in many cases speed wise (the conversion of managed data types to unmanaged data types and back, is expensive.)
    3. If we're concerned about unmanaged code, we should really be bitching about the latest version of C++ which (gasp) allows unmanaged code.

    essentially this whole argument is moot. it's easier to use managed code, the performance cost is negligible, and poorly writen managed code is a far more likely threat than well written unmanaged code.
    just my $.02
    -george

  103. And mine! by the_skywise · · Score: 1

    No. You've completely missed my point.

    Putting the word UNSAFE in front of a pointer declaration does not make the code dangerous. Likewise, having no UNSAFE declarations does not make the code safe (in this case, safe from exploits).

    But by merely accepting the terminology, you're already separating the code modules in your mind as "safe" and "unsafe".

    But then you probably think filtered cigarettes are perfectly fine...

    1. Re:And mine! by Mark+Pitman · · Score: 1

      I'm not sure, but I think the keyword UNSAFE is required by the compiler in order for it to even compile sections of code with pointers, etc. So I don't think it is just for marking where you think you have unsafe code, I think it is to inform the compiler that you know the code is "UNSAFE" and to go ahead and compile it anyway. I'm not much of a C/C++ programmer, so I don't use the UNSAFE keyword in C#, so I could be wrong.

    2. Re:And mine! by Anonymous Coward · · Score: 0

      You are a Goddamned idiot. Java claims to be a "safe" language because they don't have pointers. C# is a Java-like language with pointer access and calls the ability to declare code blocks where pointers are used as "unsafe" yet you quibble about what is meant by the word. Are you a fucking moron?

      Likewise, having no UNSAFE declarations does not make the code safe (in this case, safe from exploits).

      Considering that 99% of security exploits are due to pointer related exploites (buffer overflows? Duh), you are obviously full of SHIT.

    3. Re:And mine! by Salsaman · · Score: 1
      And how long would it take a malicious hacker to flip the safe/unsafe bit in an executable.

      Think about it...

    4. Re:And mine! by the_skywise · · Score: 1

      Buzz... oh I'm sorry, thank you for playing...

      Java NEVER claimed to be a "safe" language because it doesn't have pointers. Java claimed that it would prevent fewer BUGS because programmers couldn't shoot themselves in the foot with dangling pointers, or buffer overruns.

      Java claimed to be a "safe" language because it ran in a controlled VM inside of a sandbox.

      RTFM... Take the Java applet out of the sandbox, and Sun makes no guarantees to the runtime safety of the object. And as you so studiously point out, Java has no pointers... so how can it be unsafe?

      Semantics ARE everything. Now go back to playing with your scipts...

  104. WOW by Anonymous Coward · · Score: 0

    I have never seen Microsoft have so many of their cronies posting to a Slashdot article before.

    Look at all the Hotmail addresses!!!

  105. ...so he's not telling the complete truth. by Simple+Simian · · Score: 1

    Yes, ActiveX does a lot more than jump from a server into your browser and spin. Not often from my experience, but it is possible ;-)

    You could, say, write an image editor or an archive utility as an ActiveX control and use the COM handling techniques to control the data regardles if it is on the desktop, in an office document, or on a remote server. I've got to admint, this sounds like a pretty cool idea.

    But, back to practical usage - part of ActiveX in the confines of .NET is to get the new portions of your program, as well as your new programs, over the network. It serves the data from a server (remote host) to your client (your desktop, etc). A file is transferred, from server to desktop. By definition, downloaded.

    Furthermore, this seems to be supported by your citation - "enhancements specifically designed to facilitate distribution of components over high-latency networks and to provide integration of controls into Web browsers" sounds like it confirms Bill Joy's side to me, even if he glossed over some other neat tricks in the MS bag.

    Now, as far as security goes, I admit that I've never been fond of the way that IE handles its zones and it looks like .NET is using the same basic framework. Maybe if they add some extra interfaces for what falls into each zone we'll have a start of an improvement.

    I'm also not very fond of this 'no sandbox' concept. We've already had a faked signature intercepted, and with the ActiveX debut there was that protest/demonstration page which would, without prompting, shut down your system via ActiveX controls. So far MS has not done anything to set my security expectatinos better than they left them.

    --
    Rule #1, people are stupid. There are no exceptions.
  106. C$$ by peter303 · · Score: 2

    Despite its flaws it is much better than anything MicroSoft has had before from a developer's viewpoint. It makes it easy to write money-making apps on the worlds large operating system.

  107. We need a more broad term than "security" by TopherC · · Score: 1

    Obviously the real enemy of modern-day computing is bugs, not security exploits and viruses. I think we all suffer many times more (in terms of productivity loss) from program flaws and crashes than we do from system break-ins. Obviously this ratio varies a great deal from user to user, but overall I think bugs are a problem orders of magnitude greater than what we normally call "security".

    I don't know anything about C#, but I do know that Java traps things like array overwrites at runtime. These are very common programming errors in C which can often take months to track down. So not only does Java's "security" in terms of pointer handling and bounds checking protect your system from exploits, it also protects you from programs gone haywire. And it helps programmers to debug their own code as well.

    All the same logic about not running applications as root apples here as well. You do it more to protect the system from yourself than from others. I read the article as accusing C# of not providing the kid gloves that other modern languages do. Of course, bantering about "security" seems to attract a lot more attention than the more compelling arguments of "prevents you from screwing up your own system!" We have more fascination with security than we do with common sense.

  108. The whole idea of "unsafe code" is a myth. by benrg0 · · Score: 1

    The whole idea of "unsafe code" is a myth. Only operating systems can be unsafe.

    Linux and NT have always allowed even the lowliest user to create a file with any arbitrary code in it, give it executable privileges, and run it without endangering other users. This is exactly the right model for code downloaded off the web. It should be run in a separate VM as user "foreign_code_from_sitename.com", and that user's privileges should be restricted in just the way that a Java app's privileges are restricted.

    There are only two reasons this hasn't happened:

    1. Most people are running insecure OSes like Win9x and MacOS 8.
    2. The designers of the UNIX and NT platforms didn't anticipate the fine control of user privileges that would be desirable for downloaded code. You can't, for instance, restrict a user to connecting only to a specific domain on the net (as far as I know). Nor can you restrict a user to accessing only a specific set of files: instead, you have to restrict each file to certain users, which is exactly backwards.

    The first problem will eventually go away on its own. The second problem can, and should, be fixed by extending the user privilege concept at the operating system level.

    Instead, the designers of Java basically reimplemented the protected VM concept at the application level. Given that they didn't control most users' hardware or OS, this was probably the best they could do -- but it was nothing more than a gross hack, and it should be treated as such. What really bothers me about it is that they don't seem to have noticed that they were reinventing the wheel, and instead have tried to present the concept of secure executable code as though it were a radical new idea.

    Using a "safe" (i.e. type-safe) language can still be a good idea, when protection against a large class of hard-to-find bugs is more important than run-time performance. And using interpreted bytecode (aka P-code) is often a good way to make your software portable. But those are matters of reliability and portability, not security, and they can and should be left up to each individual software architect. When you're running on a machine which has very fast security support in hardware, any platform which has no way to safely run arbitrary unsigned machine code is pathetically broken. And that seems to be true of both Java and .NET.

  109. Sun's blind spot?! by netchhe · · Score: 1

    Yep, Joy got all his points right. Everything he is saying about MS technology in general and C# is absolutely correct, i would sign the paper, if not for a couple of missing pages....
    Sun delivered a great technology to solve some problems - Java and all it's semi standardized frameworks... but is that the whole story? We are dealing with a problem space, which cannot be broken down to just one paradigm. Now that's Sun's blind spot, with it's Java "für alles" paradigm, which simply does'nt scale. Some things are done better with C, perl, ruby, C++, C# or cobol or whatever etc. etc. for various very valid reasons. In this area the .NET framework is certainly not at all blind ...
    Probably Bill Joy knows this quite well, but prefers to elaborate only on the albeit important security aspects, which are'nt even in all given circumstance relevant.....How can such a great researcher, inventor and developer lend his hand in such a obvious way to his marketing department???

  110. Sun's FUD by markj02 · · Score: 5, Insightful
    The use of "unsafe" in C# is roughly analogous to the use of JNI in Java: modules using unsafe features (or native code) are identifiable as such by the runtime, and applications with security needs can exclude them. As such, C# isn't any less safe than Java. In practice, the C# approach is likely to be safer and more secure than the Java approach, since using "unsafe" inside a C# program is much more localized and much easier to get right than writing a JNI module.

    Furthermore, C# isn't even going after the same market as Java. Java's security model primarily comes into play for applets and mobile code, but that's only a tiny fraction of all applications. C#'s purpose in life is to allow programmers to create desktop and server applications more easily. For that purpose, an easy and robust interface to native code (regular expression libraries, XML parsers, etc.) is much more important than security.

    The major problem with C# isn't technical, the major problem is that there aren't any good implementations available yet (no, Microsoft's implementation isn't all that great yet) and that C# comes from Microsoft. But once there are C# implementations that are competitive with Java implementations and once C# has a life outside Microsoft, C# will be a serious threat to Java. And we may see a truly open source, efficient implementation of C# before we see one for Java.

    For the time being, I still think Java is the more logical choice for open source applications. It may yet be a few years before competitive C# implementations and libraries come along. Sun still can keep their lead by innovating and extending the Java platform, cooperating with the open source community, and being honest about the strengths and limitations of the Java platform. But if Sun continues along their current course, they will lose sooner or later.

    1. Re:Sun's FUD by micromuncher · · Score: 2, Interesting

      [ JNI and Unsafe ]
      JNI was not intended to be used as a portable solution, but Unsafe is. I have to jump through serious hoops to get Applets out of the sandbox.

      [ C# implementations ]
      What? No good implementations... the amusing thing here is I know many companies that jumped onto the C# and .NET wagon simply to avoid the problems with ASP! Even the immature technology is better that crap that just don't work right.

      [ Logical choice for Open... ]
      This argument is non sequetor. Any language can be used in open source, just as any library can be written in open source. Java won't go away, and NET# won't ever be a threat, because Java somehow managed to dominate the enterprise space. I don't think the thousands of enterprise users from oil companies to stock exchanges are going to replace their Weblogic-Oracle-Solaris systems any time soon. Consider that IIS is not an effective app. server (can't scale without external clustering), Access still can't do record locking or distributed transactions, and NT Server scheduled reboots are not acceptable...
      failover for reboots. What a joke.

      The cynic...
      p.s. Bill can lick my Salty Black Balls

      --
      /\/\icro/\/\uncher
    2. Re:Sun's FUD by markj02 · · Score: 2
      Well, as I was saying: for now, Java is still the better choice. But if good C#/CLR implementations become available on many platforms, Sun may well be in trouble. In fact, the most likely outcome is that you will see implementations that support both JVM and CLR and that allows developers to mix the two freely.

      JNI was not intended to be used as a portable solution, but Unsafe is. I have to jump through serious hoops to get Applets out of the sandbox.

      You can't get applets out of the sandbox, and neither can you use unsafe code from a C# sandbox. The point is that C#'s "unsafe" construct is very useful for non-applet applications and, as you point out yourself, Java has nothing equivalent. That's why "unsafe" is an advantage for C#: you get the same security model as with Java, but you get additional capabilities for desktop and server applications.

    3. Re:Sun's FUD by Anonymous Coward · · Score: 0

      Access??? Good lord, you're a moron.

    4. Re:Sun's FUD by Anonymous Coward · · Score: 0

      Ok. Two questions:
      1) What kind of use to you see for unmanaged applet code ?
      2) Are memory addressing compatible between different systems or is your app going to handle that ? (Ex: C# and .NET are supposed to run on linux and freebsd. Are your applets with unmanaged code going to run on windows, linux and freebsd ?)
      Thanks

    5. Re:Sun's FUD by jsse · · Score: 2

      Java's security model primarily comes into play for applets and mobile code, but that's only a tiny fraction of all applications

      Good post but like a lot of Java developers I found the above statement untrue. Java's security model is used extensively in server-side Java. Say I'm working on the EJB loader which rely heavily on it. Also, 70% of the Java development here is around server-side. Java applets may be very hot when you switch to C#, but it's definitely not the case now.

      Also, java applet does not play a too important role in mobile, as an applet eats up more memory than normal java application does. Yes it'd be a problem here but tackling space requirement in mobile devices has the priority at this moment. Btw, I don't think mobile application is a tiny market afterall! :)

    6. Re:Sun's FUD by markj02 · · Score: 2
      I don't see much use for "unmanaged applet code" (no more than for applet code that calls JNI on Java). But I see a lot of use for unsafe constructs and unmanaged code in C# applications, and that's where the unsafe features and C++ linkage in C# just look a lot nicer than JNI in Java. Hooking up a C-based regexp or image processing library to C# looks pretty simple, whereas with Java, it's a major effort.

      As for memory addressing, I don't see a big issue there. Using unsafe constructs or unmanaged code, you can, of course, write machine dependent code, but you don't have to. And unlike C/C++ or JNI, such code is explicitly marked and clearly distinguishable from safe C# code.

      What C# does is really not all that different from what Modula-3 and Ada have been doing with unsafe code. It's a pretty sensible, down-to-earth approach. As far as I can tell, there really isn't anything wrong with C#; it's a clone of Java with a few additional, useful features thrown in.

      Of course, to be absolutely clear, I won't touch C# with the proverbial 10ft pole until some decent, open, non-Microsoft implementation comes out. Even if I wanted to use Windows, which I don't, Microsoft's current implementation is pretty iffy. And, despite Sun's FUD, Microsoft clearly still out-FUDs Sun.

    7. Re:Sun's FUD by micromuncher · · Score: 1

      Uh, a signed applet can get out of the sandbox. A signed applet has access to the file system. I should know, as we do it all the time for enterprise intranet solutions. We even had a signed applet install a JNDI library, but the client freaked out...

      Mm

      --
      /\/\icro/\/\uncher
    8. Re:Sun's FUD by markj02 · · Score: 2
      Java's security model is used extensively in server-side Java. Say I'm working on the EJB loader which rely heavily on it.

      Well, there are several issues there. First, EJB isn't the same as server-side Java. In fact, I suspect EJB represents only a tiny fraction of server-side Java. Second, the mere fact that EJB calls some security APIs doesn't mean that that actually accomplishes anything (class loaders are, of course, essential, but they are needed because of namespace issues, not for security). Third, C#/CLR does have similar functionality anyway.

      (Incidentally, I am a Java developer myself, and have been since the first release in 1995.)

  111. Oh my god by Anonymous Coward · · Score: 0

    If I never read this stupid ass joke again, it'll be too soon.

    Please try to grow a brain.

    -
    Patsy Ramsey

  112. Listen Terry Riley by 21mhz · · Score: 1

    And code "In C".

    --
    My exception safety is -fno-exceptions.
  113. interpretation is the only way to guarantee safety by mrm677 · · Score: 3, Insightful

    Java is safe because it is interpreted. Sure, it is compiled, but the compiled code doesn't run on hardware.

    If .NET code is interpreted, then they can make it safe. If they have a silly marker saying "This code is safe because it doesn't operate on memory directly", then that is just silly because some hacker can easily remove this marker.

    Running code downloaded from the network, directly on your hardware, will always be somewhat dangerous. Of course that is what operating systems are for. However, there is always some way to figure out how to run malicious code in a privileged fashion.

  114. ...and this is different from K&R C how? by wagadog · · Score: 1

    you know, the language he wrote the code for the C shell and vi in, whilst a grad student at Berzerkley on a grant from...Big Blue.

  115. Look out MS is innovating again. by Anonymous Coward · · Score: 0

    XML = flat file database
    C# = java
    Word = wordperfect
    excel = 123
    Access = Dbase/Foxpro/Rbase
    .NET = XML + RPC = flat files + unix's ability to do things easily.

    Microsoft reinventing the world so we can make money, lots of it.

    1. Re:Look out MS is innovating again. by the_verb · · Score: 2, Insightful

      Linux = UNIX
      Gnome = MacOS/Windows GUI (without the consistency.)
      Gimp = Photoshop (without the cluefulness.)

      Your point is? There are certainly grounds to criticize Microsoft, but sticking to legitimate complaints rather than knee-jerk name calling does a lot of good.

      I'm an old MacOS user, and I lost count of how many technologies cut their teeth as features in the MacOS, then became successful as MS refined them and implemented them in Windows.

      It's not as if that's a *bad* thing.

      --the verb

  116. Is this the same Bill Joy that hacked on BSD? by Anonymous Coward · · Score: 0

    Bill Joy was the major hacker involved with early BSD. I think he's somewhat of a hypocrite saying this, seeing as he was the one that say, wrote an API that arbitrarily casts a struct sockaddr_in * to a struct sockaddr *, etc...

    1. Re:Is this the same Bill Joy that hacked on BSD? by borgheron · · Score: 1

      People change... styles change...

      To call someone a hippocrite simple because they programmed in a language in which pointers are a major feature is misguided at best.

      Also...

      1) Java wasn't around when BSD was created

      2) What person in their correct frame of mind would write an OS in Java anyway. (said w/ full knowledge of the fact that there are Java OS projects out there ;) ).

      Later, GJC

      --
      Gregory Casamento
      ## Chief Maintainer for GNUstep
  117. No, no, I think this was a joke. by doom · · Score: 2

    Don't you get it? "...and so forth".
    Forth, you know?

    On second thought, if you haven't heard of
    Bill Joy before...

  118. Why doesn't Bill Joy just fix the problem? by blair1q · · Score: 2

    I mean, he's Bill Joy. If he can't knock out a safety-checker for C# units in a couple of weeks, then he's not the Bill Joy we grew up with.

    --Blair

    1. Re:Why doesn't Bill Joy just fix the problem? by borgheron · · Score: 1

      Why would Bill Joy want to create a piece of software which would be contrary to his own interests in the Java language?

      GJC

      --
      Gregory Casamento
      ## Chief Maintainer for GNUstep
  119. Fundamental approach is wrong by Xerion · · Score: 2, Insightful

    There seems to be a load of discussion on the actual functionalities and implementations of C#/.NET so far. But I think we should all take a step back and look at how MS approached the whole process of designing a supposedly platform-independent, net-oriented runtime system + language.

    I think we all agree that being the language of the NET, security is of priority #1, way ahead of functionality and flexibility. However, to design any kind of secure system, it is essential that you make the strictest system, and only then relax the security restrictions to allow more functionality. But it looks like MS wanted C# to do everything, and then add security as an afterthought. It is dangerous to achieve security by incrementally restricting the system.

  120. In Java, everything safe -- NOT by GCP · · Score: 2

    I like Java. I'd just like to point out that even in Java you have safe and unsafe runtime environments.

    I could easily write a Java app that would write binary op codes for a virus directly into some of your favorite application executables. The sandbox runtime wouldn't execute you it, but the standalone runtime would if you told it to.

    Bill Joy claims that there is a form of coding called "unsafe" in C# and expects you to draw the conclusion that C# is dangerous to use. Pretty pathetic argument for someone with his technical background.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
  121. Blame Unsafe Code on Developer, Not Language by reallocate · · Score: 0, Troll

    Writing safe code is the developer's responsibility. The language has nothing to do with it. If you wanna write in C and also check for buffer overflows, you're gonna have to do it yourself. Otherwise, pick a new language.

    --
    -- Slashdot: When Public Access TV Says "No"
  122. No "unsafe" code in browser? by GCP · · Score: 2

    I really hope that Microsoft simply makes it impossible to run "Unsafe" CLR code in the browser. Not even an option.

    No, that's not necessarily what we want, at least in the long run. It's more limiting than necessary for many purposes.

    .Net has a security model that lets you configure your runtime to allow various levels of access depending on digital signature. If I'm the family computer guru, I might set up my parents' computers and my sister's computer to run -- with full access -- anything stamped with my digital signature. I would do that locally on their machines during a holiday visit.

    After setting the security admin rules locally on their machines, I can thereafter deploy full-power software that I write to their (and my own!) browsers.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
    1. Re:No "unsafe" code in browser? by Steveftoth · · Score: 2

      It it possiable to write code that scales to the security level it runs in?

      For example in java, since everything is runtime, if you are say... accessing the file system and get a security exeception doing it, then it's possiable to catch the exception and then say not write to the disk or just otherwise keep on going. Does the security precautions just stop any of the code from executing in the first place?

    2. Re:No "unsafe" code in browser? by GCP · · Score: 3, Interesting

      .Net uses security exceptions, too. It's finer grained than Java (or ActiveX) and is managed by a security admin system local to the client. You maintain the security rules yourself, or your office "helpdesk" guys do it for you, but it's done locally.

      It would be a very common thing for code to ask the runtime for permission to save a file automatically, and if permission is denied to then drop back and ask for a "safe file save" dialog box, which lets the user decide where to put the file and what to call it. The safe file save dialog doesn't even tell the app the name or location of the file that was saved. It just gives it a certificate for it, like having a valet park your car. The app doesn't know where it went, but if it wants it back, it can request it and have the contents only (not name or location) delivered back to it.

      If even this is denied, then the app can save files in a walled-off section of the hard drive managed by the .Net runtime, as something akin to a super-cookie. In this region, max file size, amount of allowed disk thrashing, etc. are all moderated by the .Net runtime.

      Java has nothing like this, and Bill Joy is hardly likely to bring that to your attention.

      --
      "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
    3. Re:No "unsafe" code in browser? by Steveftoth · · Score: 2

      So basically .Net has a 'safe local storage' while the JVM doesn't? Well if this feature of .Net becomes at all popular, Sun could release this feature in a heartbeat. The security model of Java allows for this no problem.
      I was really just wondering how closely they copied the features of Java. I hope that they made their APIs such that it's easy to switch platforms. Is MS implementing the .Net framework for any other platforms? (Not some group of OS people)

  123. more unsafe but more usable by Anonymous Coward · · Score: 0

    I don't write programs for Macs or Unix. I use C++ and all of windows advanced features. I don't care if it's unsafe. It allows me to create programs no one has done before. If I were using Java with no hard disk access my programs would probably look more at home on a Commodore 64. I prefer the power to get at the computer OS and hardware and let my Norton products worry about security issues.

  124. Oh dear. by tomgilder · · Score: 1

    So Microsoft built ActiveX, a technique within Windows for automatically downloading and executing arbitrary programs.

    Er, with a security prompt. A crap security prompt, yes, but a security prompt.

    Netscape's JavaScript was designed to prevent this through its "Same Origin" security policy, but Internet Explorer's JScript technology, which nominally supports the same scripting language, fails to implement the Same Origin policy.

    IE does implement domain security. There have been quite a few bugs in this, yes (and one major one not patched) - but this isn't a problem with JScript, just with IE.

    But C# tries to encompass all the power of C as well as features borrowed from Java. And security cannot be added to an otherwise insecure language.

    But it isn't C# that provides the security - its the .NET Framework. C# is managed by the same security as VB.NET/JScript.NET.

    So far there have been very few and quite minor holes found in the betas of the framework, and (to my knowledge) none in the final.

    If that trend continues, I think .NET could actually be quite secure. Its what ActiveX always should have been - managed.

  125. That does not mean what you think it means by DCMonkey · · Score: 1

    They aren't referring to assembly language there, if that is what you are getting at.

    --
    DCMonkey
  126. Just show me the environment that provides... by thammoud · · Score: 1

    Show me an environment that provides all of this and I will switch in a second. I am not even showing the J2EE stuff.

    1. Re:Just show me the environment that provides... by Anonymous Coward · · Score: 0

      Good luck with your request. I think it'll take quite a bit of work to come up with something that performs that poorly. It'll be even harder to duplicate the hideous mess of entity javabeans.

  127. Not a stupid question by GCP · · Score: 2

    It's a good question. .Net has several categories of pointer. Some are there to allow you to use efficient indirection as a programming paradigm without simultaneously exposing the underlying memory system of the machine. The two do *not* have to go together.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
  128. Re:interpretation is the only way to guarantee saf by tricorn · · Score: 1, Redundant

    No, it is safe because it is verifiable. What that means is a formal proof that the code doesn't violate various constraints (such as accessing memory that it shouldn't - which usually requires some level of type safety, checking arguments to function calls, etc). Once you have that level of "safety", you can then add in security models (e.g., inhibit "unlink" calls) and be sure that the code isn't going to subvert that model (such as roaming a pointer through memory looking for the permissions your code is allowed, and changing it to give yourself more permission once you find it).

    It's just a side-effect that the specific byte-codes are designed to be verifiable, where machine code is generally not (and should not - at the implementation level, you eventually have to get down and dirty, and where attempting to be "safe" would be much too slow). Once it's been verified, it can be turned into native code and it remains just as safe.

    I think Microsoft is just confusing the issue by calling it "safe" and "unsafe". It should be a matrix of "verifiable" vs. "unverifiable" and "trusted" vs. "untrusted". Code marked as "safe", but which fails the verification proof, should never be run, regardless of any code-signing levels of trust. Other than that, there isn't really any reason to mark code either way, except to avoid the overhead of trying to start checking unverifiable code when you know it is going to fail. It sounds like the "unsafe" attribute is mostly just a way to mark the source code so that a programmer doesn't inadvertently use unverifiable techniques.

  129. Deja-vu all over again! by Anonymous Coward · · Score: 0
    "You need a special security privilege to run unsafe code. Code downloaded from the net doesn't have this permission, so it can't run unsafe code."

    Hmmmm. A lot like IIS. Or Outlook. Or IE.

    But will it have spyware like M$ instant messaging?

  130. Well, if Microsoft verifies it to be safe... by Anonymous Coward · · Score: 1, Funny

    Then that's good enough for me!

  131. trouble maker by Anonymous Coward · · Score: 0

    oh, great. first it's that vi versus emacs thing, now this.

  132. *fwoosh* by Wakko+Warner · · Score: 2

    That's the sound of the sarcasm plane darting swiftly over your head, safely unseen. If you look up quickly you might be able to spot the vapor trail.

    - A.P.

    --
    "Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
  133. Not the weakest link unless you want them to be by telstar · · Score: 1

    Actually, by design .NET "shifts the burden from having to make critical security decisions--such as whether or not to run a particular application or what resources that application should be able to access--from end users to developers and administrators." This is an excerpt from a thorough security evaluation performed by Foundstone. The report can be found here.

  134. What? by tabbyTime · · Score: 1

    Read a java spec bud. 'Like a cast in Java, declaring code as "unsafe" is equivalent to saying to the VM, "Hey, I know what I'm doing."' Huh? Java downcasts do not compromise the security of the VM.

  135. Re:interpretation is the only way to guarantee saf by quintessent · · Score: 2

    Java's code does run on hardware.

    The Java compiler compiles it to byte code. Then at run-time the JIT (just-in-time compiler) available on many Java platforms compiles the byte code to native code.

    C# does the same thing. It compiles to a byte code called MSIL, and then at run-time it gets JITed to native code. And, just like Java, a C# app that you run from the web gets run in a sandbox to protect the user from malicious code.

  136. What "features"? by SuperKendall · · Score: 2

    Java has had for quite a while the ability to call C code, external DLL's, or whatever - JNI, the Java Native Interface. In fact it's also defined how external code (well, C and C++) can call into Java as well and launch a JVM from inside a native program. I've used it myself and it works just fine.

    Apart from that, I can't really think of any features the CLR or C# language has that Java is missing. What you could possibly say is missing are tools like MS provides - though Java does have many amazing tools like TogetherJ, JBuilder, Netbeans, and others. Still if for sme reason you bought into the cross-language idea (in my mind a total farce but I can see where people would find it appealing on the surface) the JVM does support many languages but there's really no tool that brings them all together at the moment.

    I agree with you on the web services aspect.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  137. Signed applets? by SuperKendall · · Score: 2

    What I like a lot about about the applet model is not just that it keeps things in the sandbox, it's how fine grained your control is over what the sadbox really is.

    An applet can do anything up to altering parts of your OS if you give it the scope. It can also be given just the barest permissions it needs, such as the ability to read and write to one directory on your computer and no other.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Signed applets? by markj02 · · Score: 2

      At least on paper, Microsoft is supporting pretty much the same model with C#/CLR (but I wouldn't want to vouch for their implementation). And where in Java, you need permission to call JNI code, in C#, you need permission to call native or unsafe code.

  138. It's a stupid question... by mraymer · · Score: 1

    ...but it's really bugging me! How the heck do I pronounce this language? Is it just, "See Pound" or what? Thanks, and don't flame the n00b!

    --

    "To confine our attention to terrestrial matters would be to limit the human spirit." -Stephen Hawking

    1. Re:It's a stupid question... by Utopia · · Score: 1

      It pronounced as csharp.
      The capital letter C followed by a musical sharp sign. Because this sign does not exist in ASCII, it is approximated as C#. This approximation leads to witty derivatives such as "C hash," "C pound," and the tortuous "C octothorpe".

  139. ability to write unsafe code? by Alien+Being · · Score: 1

    So does vi.

  140. This is a suprise? (good for them!) by xQx · · Score: 0

    I'd like to refer to a function in ANSI C, which C# came from:

    char* gets(char *strPtr)

    Notice any limit specification in that? No. ... if someone enters too much data, it overflows.
    Compile with gcc, and you get an error "gets is dangerous and should never be used"

    Since one of the greatest advantages of C (over say, VB) is the ability to USE pointers and memory addresses, and thus to CREATE potentially 'unsafe' code, is it *REALLY* a suprise MS left it in? Furthermore, is it a BAD THING that you can?

    It's about F*CKIN' time MS brought out their own (if you could call it that) programming language that was a little more difficult than "dialoguebox.text = mytext". If developers are going to write applications with buffer overflows, LET THEM. It might teach managers the difference between VB SCRIPT KIDDIEZ ($10 an hour) and WINDOWS PROGRAMMERS ($80 an hour).

    Furthermore, All current operating systems (NT or *nix kernel) are _protected mode_. Applications with buffer overflows can only hurt themselves. (with some exceptions in superuser code) .. Increased focus on OS security can't be a bad thing.

  141. Bill Joy should have done some research. by dannannan · · Score: 2, Insightful

    He should have checked out the MSDN docs. He should also have read some security studies or even done his own. Perhaps then he would have realized that the security of the CLR has nothing to do with an arbitrary bit set to mark a block of code as "safe", but rather to do with a type-safety verifier that is completely independent of the compiler and language used to generate the code in question.

    C# is not tied to the CLR like Java is tied to the JVM. The CLR (Common Language Runtime) is designed to run IL code, and there are compilers for many different languages besides just C# that can generate IL. That said, it should be clear that the security of a C# program is not derived from the C# compiler. It comes from the CLR, so the security policy is enforced at the IL level, not prior to compilation. (It would be laughable if the security of the CLR was enforced only by the C# compiler rejecting "unsafe" code. I'd just write my own C# compiler that allowed it, or I'd whip out my IL assembler.)

    The "unsafe" marking of code occurs only at the source code level. Whether or not code is considered type-safe by the CLR is not determined by an arbitrary flag set by the developer; it's a function of the IL code itself. It needs to be that way, otherwise programs compiled with my evil compiler for my own non-type-safe language would slip through the cracks. Note that even if my IL code is actually type-safe, if the CLR's type-safety verifier can't prove it, it won't be considered type-safe.

    That being said, "unsafe" is just a compiler feature. Perhaps Bill Joy would have had nothing to say if Microsoft had decided to use a keyword other than "unsafe", like maybe "dont_generate_an_error_at_compile_time_if_the_cod e_inside_this_block_fails_the_type_safety_check_ev en_though_it_is_going_to_fail_when_the_CLR_tries_t o_run_it_in_a_context_that_requires_type_safety". (Actually you can achieve this if you don't mind adding a #define to your C# source and then running it through a C preprocessor first.)

    But why take my word for it? Check out an interesting study into C# and the CLR's security done by some students at Rice University at http://www.owlnet.rice.edu/~jsinger/comp527/propos al.html. They have a lot of detail there about tests they ran, as well as a good paper summing up their results.

    D

    1. Re:Bill Joy should have done some research. by jimfrost · · Score: 1
      C# is not tied to the CLR like Java is tied to the JVM. The CLR (Common Language Runtime) is designed to run IL code, and there are compilers for many different languages besides just C# that can generate IL. That said, it should be clear that the security of a C# program is not derived from the C# compiler. It comes from the CLR, so the security policy is enforced at the IL level, not prior to compilation.

      This is precisely the model that Java uses. In fact, the whole design of C# and the CLR is clearly derivative of the JVM design; Microsoft simply took Sun's design and did some retargetting and extension.

      It's also erroneous to say that the JVM and Java are tightly coupled. Java code can be natively compiled, or compiled to non-JVM bytecode representations like MSIL. Several native code compilers for Java do exist.

      Similarly, the JVM may run code that was not produced from Java source and there exist several Java bytecode compilers for other languages. I know of at least two (a C variant and Ada) and certainly it would not be hard to support Pascal, Modula-3, Lisp, or many other languages in part if not in whole.

      Joy's article is clearly self-serving, particularly when a direct analogue to "unsafe" exists in Java's "native" keyword. It is certain, though, that C#'s facility is a lot easier to use. Whether or not programmers actually will use it is something that only time will tell, but early reports are that it's enough of an extra hurdle that it's often easiest not to do so.

      --
      jim frost
      jimf@frostbytes.com
    2. Re:Bill Joy should have done some research. by silverbax · · Score: 1

      1. Will C# make money for Microsoft and other companies?
      Yes.
      2. Will the general public care that Microsoft costs businesses and consumers billions of doallars on security fixes?
      No.
      3. Will Microsoft actually atart caring about security?
      No.
      4. Will the general ( i.e., 'consumer' ) public think Microsoft's products are insecure?
      No.

    3. Re:Bill Joy should have done some research. by Anonymous Coward · · Score: 0

      "Code that runs outside the control of the CLR is referred to as "unmanaged" code. Unmanaged code by definition is not constrained by the security
      measures of the CLR, and is thus capable of obtaining unauthorized access to resources in the native environment via traditional attacks."
      ["Security in the Microsoft .NET Framework", An Analysis by Foundstone, Inc. and CORE Security Technologies]

      "The unsafe keyword specifies that the marked block will run in an unmanaged context."
      ["Inside C#", Tom Archer, Microsoft Press 2001]

  142. Backlashing and Frontlashing and Sideways Lashing by DaveWood · · Score: 3, Insightful

    It's funny that everyone here is saying Sun is spewing FUD and joking about Slashdot being rigidly anti-MS. As far as I can see, almost everyone here is rigidly pro-Microsoft and eager to heap abuse on Java and praise on Brave Microsoft for making the "Genius" C# and .NET.

    There's a tremendous amount of well-rated lies here about the article itself. It's really astounding in its volume - ranting on for pages about how Bill Joy is jealous, and C#'s pointers are totally safe, and Sun is making up lies about C#... "Insightful"! It's like some kind of geek guilt or something - we have to be hard on ourselves, and have a backlash against our backlash now?

    I prefer to actually look at the objective truth on a given day. What's the article about? Joy is saying that C# doesn't force you to be safe. It lets you choose. And the problem is that if you let people choose to be unsafe, then they sometimes will be unsafe, because it's easier, or faster, or because they don't know any better.

    Despite rampant misquoting here to the contrary, Joy wrote explicitly that he knows pointer-massaging code is marked "unsafe" in C#, and is recognized and treated differently by the CLR. It's right there in the article.

    The point is that it just brings us back to square one security-wise - to ActiveX. Break out your digital signatures. Do you trust this code? Yes or no. If you want to run it, you better. Some of it might be "unsafe." Once you start flinging pointer arithmetic around, you can stand up and piss right over the sandbox wall.

    So many choices. So much freedom. .NET is going to be asking your permission all the time. Let me tell you, I just spent the day with a secretary in a law office who was just wrapping her head around loading and saving documents. If her web browser asks her whether or not she "trusts" someone's code, she's going to just click a button at random no matter how many times I try to explain what to do.

    Joy's point is that in the context of network computing, certain kinds of flexibility are dangerous and ultimately destructive.

    I can just see all these rah-rah-C# people making the same kind of arguments I'm hearing about pointers for being able to do powerful word macros and having IE rendering emails. It's so powerful! "Just don't open any word documents from people you don't trust!" they say. Heh.

    What we've learned is that we can't dump this security dillemma on the world under the guise of "choice." We've made that mistake (MS certainly has) over and over again, and the result is the same every time. For something like .NET, without having ironclad and unequivocal guarantees - as Java can give you - you're setting yourself up to have another MS security disaster.

  143. Nasdaq uses Win2k, Shell uses Win2k by Otis_INF · · Score: 2

    I dunno, but Royal Dutch (Shell), one of the biggest oil companies in the world, uses Win2k worldwide in their wan (more than 70.000 machines), server, desktops, you name it.

    Nasdaq also uses win2k based solutions.

    Anyway, my NT server has now an uptime of 127 days and counting. Where are the reboots? I dunno, perhaps you don't know what you're doing, and considering your humourous remark about access I'm pretty sure you really don't have a clue.

    --
    Never underestimate the relief of true separation of Religion and State.
    1. Re:Nasdaq uses Win2k, Shell uses Win2k by micromuncher · · Score: 1

      Hmm yes... Access does page locking... I don't have a clue... heh.

      And as for exchanges... yes... heh I don't have a clue - all those S&P machines running Solaris and even (gasp) Linux with TIBCO or Smart Sockets... heh.

      And heh heh... Marathon Ashland running their entire pipeline accounting system with two tiered java apps... Dupont, Gulf, Arco (hell, they even still have Macs?!)... heh.

      You are funny. Bet you think OPC is hot stuff?

      If Bill had $1 for every time Windows crashed, Oh wait, He does!

      --
      /\/\icro/\/\uncher
  144. And where is MS' C# implementation 'bad' ? by Otis_INF · · Score: 2


    The major problem with C# isn't technical, the major problem is that there aren't any good implementations available yet (no, Microsoft's implementation isn't all that great yet) and that C# comes from Microsoft.

    Big words, and I don't see any proof of it. In what way is the C# implementation of MS bad? (and others thus good?) Seems like you're recylcing a lot of hot air without adding anything useful to the conversation.

    --
    Never underestimate the relief of true separation of Religion and State.
    1. Re:And where is MS' C# implementation 'bad' ? by markj02 · · Score: 2
      In what way is the C# implementation of MS bad?

      I didn't say it was "bad", I said "it isn't all that great yet". That primarily refers to the fact that performance in it is still lacking (relative to Java or C++). That's based on benchmarks that I did myself.

      Also, C#'s APIs are nowhere near as mature and complete as Java's; exposing COM and Win32 just isn't enough.

  145. You are the weakest link, goodbye by Anonymous Coward · · Score: 0

    That's a nice Microsoft marketing document. And Foundstone sounds like a completely unbiased 3rd party.

    The part you'll want to read in that document is the part about "unmanaged" code. Funny how short that section is, isn't it!

    I think we've found ourselves a Microsoft troll...here are some examples

  146. About Time by Anonymous Coward · · Score: 0

    Time for M$ to be on the recieving end of a little more FUD. B.J. has obvously been studying they're tactics.

  147. No suprise by Anonymous Coward · · Score: 0

    Gee, co-founder and chief scientist of Sun Microsystems thinks that C# and .NET are bad?

    Man... I never woulda thunk it.

    Too bad this is mindless progaganda not directed at informing people, but at encouraging people to stick with their assumptions and not even try a competing product to Sun's.

    His comments about "unsafe" code show his ignorance. The CLR applies the SAME rules to unsafe code as it does to safe code, it simply doesn't do the memory mangagment that it does with safe code.

    In other words, it's a lot easier to crash your application with unsafe code. But that's about it.

  148. So MS invented XML? by Anonymous Coward · · Score: 0

    err... no they didn't!

  149. what C# really means by Anonymous Coward · · Score: 1, Funny

    C# is supposed to be "C++++". Get it? Arrange the +'s in a certain way.

  150. Short-term improvements in Windows' reliability by jimfrost · · Score: 1
    Generally speaking, I agree with you. However:

    It turned out that when MS saw Unix and Linux as a threat, and when they decided that reliability was one of the biggest advantages that Unix/Linux offered, they took reliability seriously and made enormous progress in a relatively short period of time.

    No, not so short. Sure, it's short in the sense that Win2K and XP were reliable while Win9x/ME were not, but it's not short in that 2K and XP were directly derived from more than a decade of previous work on NT, and it in a less direct manner from significant previous work on VMS and Prism. As much as people harped on the unreliability of NT, even 3.1 was a vast improvement over all previous Microsoft operating systems. That was, however, the work of quite a few years. Security will be, too, particularly since they still have the albatross of backwards compatibility to deal with.

    The shift in priorities, however, can't be anything but good in the long term.

    --
    jim frost
    jimf@frostbytes.com
  151. Re:interpretation is the only way to guarantee saf by jimfrost · · Score: 1
    Interpretation is certainly not the only way to guarantee safety. It may be the easiest, but it's possible to take an arbitrary hunk of code and instrument it to introduce safety.

    This is not easy to do with random machine code (although several commercial products have existed for close to a decade that did a passable job on typical code, eg Purify and TestCenter) but with an intermediate representation that was specifically designed to make it easy, such as Java bytecodes, it's not difficult at all.

    And, more to the point, it can be done with much less drastic performance penalties than we see with interpreters. To see this in action simply compare the performance of interpreted Java to JIT-compiled Java. Moreover, if you're willing to pay a heavier compilation cost than is reasonable with a JIT, the performance penalty will be merely incremental.

    --
    jim frost
    jimf@frostbytes.com
  152. I like pointers by invid · · Score: 1

    Pointers are good. Sure, they're dangerous, but sometimes they are the only way out when you are trapped deep in some horribly designed legacy code.

    --
    The Moore-Murphy Law: The number of things that will go wrong will double every 2 years.
  153. Inexperienced fool by EnglishTim · · Score: 2

    Only baby programmers and script kiddies and VB wienies are afraid to handle pointers.

    You've evidently never programmed anything of any size, a notion that is backed up by a quote on your webpage: "We're studying for our Masters Degrees in Computer Science at NSU and hopefully we'll be finished on June 20, 2002."

    When you get out into the Big Bad World Of Real Employment(tm) you'll find that those cute little pointers that you're so fond of in your toy CS101 code have grown up into big, badly behaved monsters that will bite you at any opportunity.

    If you're doing a project of any complexity, keeping track of all your data pointers becomes a non trivial problem - more so when you start working with several other people on the same codebase. What is the lifetime of an object? whose responsibility is it to see that that object is destroyed? How do these rules change under faliure conditions? How do you ensure that all the rules you've put down are obeyed?

    Jeez, why do you think Smart Pointers have become increasingly popular?

    1. Re:Inexperienced fool by Random+Feature · · Score: 1

      Inexperienced? Shall I list my CV for you? C'mon..

      We didn't start our master's until last year. We've been in the "Big Bad Real World (tm) for YEARS. We've done shrink-wrap shit and enteprise shit. I've coded for AutoDESK, the government, a tax software company that shall remain nameless, among others.

      I don't need to justify my experience to you, but suffice it to say that I have NEVER had a problem with pointers and think that programmers who can't deal with them and don't do proper design in the first place aren't worth a damn.

      Pointers aren't the problem, people who don't know how to use them are.

      --
      I don't have a solution, but I certainly admire the problem.
    2. Re:Inexperienced fool by EnglishTim · · Score: 2

      So you've never had to track down an annoying bug that was to do with uninitialised memory, freed memory, bounds overflowing or memory leakage? Evidently I underestimated you.

      I'm not trying to say that programmers routinely have problems understanding pointers, but that there are many places in large complex programs where they make it very easy to make a mistake. They also often result in errors that do not show themselves up immediately, and in fact do not show up until after you've shipped the product...

    3. Re:Inexperienced fool by Random+Feature · · Score: 1

      Of course I have - it's a bitch. Yes, you are right. They are easy to make mistakes with.

      There are tools that make finding things like memory leaks and wild pointers and overflows. Some of them are damn good. NuMega springs to mind..

      I don't think you can catch all the errors before shipping. I think you can get most of them, but there are some configurations and interactions with other applications that you simply can't account for. I've never seen an error free application - not one that did anything, at least.

      There are times when it is absolutely necessary to use pointers. You don't want 5 layers of encapsulation between you and a NIC and you certainly don't want to slow down processing of packets by keeping your queues in highly complex data structures. How you manipulating that queue becomes the difference between 40Mbps and 10Mbps and pointer manipulation is the faster way to do that.

      General business apps - well, I could probably agree that people writing these types of apps don't need - and shouldn't - be messing with pointers.

      --
      I don't have a solution, but I certainly admire the problem.
  154. Actualy such beast exists. by jotaeleemeese · · Score: 1

    Some time ago, when Java was the fresh darling of the IT world, I was offered a job in a company doing just that: a virtual machine to run legacy COBOL programs in any modern platform.

    They seemed quite stressed, thus I gave them the miss...

    --
    IANAL but write like a drunk one.
  155. Worthless Information by Anonymous Coward · · Score: 0

    Would you accept a article written by Bill Gates on the failure of Java to solve the worlds computing problems? This article takes valid words and throws a Sun spin on them. You would think that the MS markething machine would have recognized that the tag "unsafe" would scare the uninformed.

    It is simple a new tech in its infancy. It currently does a great job of solving Windows problems and goes a long way toward removing COM installation nightmares. It also makes server side Web processing scream.

    Are there secruity problems? Most likely. Can Java be used maliciously? Absolutly.

  156. Security and Performance by DannyO152 · · Score: 1

    Supporters and detractors agree, I believe, that the most luscious piece of fruit in Microsoft's C#/CLR/IL/.net basket is language-independence. While many find that enticing because they believe they won't have to take a personal productivity hit while they learn and master new languages and idioms, an other, perhaps more important, advantage is that existing libraries do not need to be rewritten to move into the new platform. Since security in most languages is presumed to be a programmer rather than language/compiler/runtime responsibility, it follows that for a platform to be language independent and secure, mechanisms must be in place to hobble unsafe code, which must penalize performance and, perhaps, scalability. One alternative would be that the security is compromised in some way to maintain reasonable performance benchmarks. Another alternative is that some language features are rejected by the platform. I think Bill Joy was saying he would bet that the hobbling is compromised. Sun did have to deal with the leagacy/unsafe problem with JNI, so I believe he has an understanding of the implementation issues. I suspect it's more likely that performance and scalability issues will require serious adapters of the Microsoft platform to rewrite code using C#.

  157. God forbid you do anything powerful like... by Kymermosst · · Score: 2

    Write a just-in-time compiler for an emulator. You can't do this in Java, or any other "secure" language that doesn't let you write directly to memory, access it via pointers, and use pointers to functions in that memory.

    You will NEVER see fast, efficient emulators or just-in-time compilers written in any so-called "secure" language. Instead, you need a language like C, or assembler... or both.

    --
    "Alcohol, Tobacco, Firearms, and Explosives" should be a convenience store, not a government agency.
  158. And who cares about Bill Joys marketing here...? by joto · · Score: 2
    C# provides the ability to write unsafe code. In unsafe code it is possible to declare and operate on pointers, to perform conversions between pointers and integral types, to take the address of variables, and so forth.

    One of the most annoying aspects of java is that you can't do that. Java is the perfect lock-yourself-in language. If you want to escape, the only standard mechanism is JNI, which is completely useless (the verbosity and ease of failure when using JNI is mind-boggling, when I tried to use it a year ago, I eventually had to write a tool for generating JNI. What should have been a simple foreign function interface is really a complete mess.)

    If C# offers mostly the same as Java, but with added features for real-world programming, such as the ability to add a dirty hack where it's needed, without going through all the torture and pain that Java makes you suffer, then I and many other developers will be much more happy to use C# than Java.

    If all you care about is security, you wouldn't be using Java anyway, and you would certainly not download executable code over the web (applets). And if all you want is applets, then by all means, go ahead and use Java. But for people looking for something to use for enterprise-wide programming systems, having to integrate lots of legacy code, I'll bet C# will make a strong contender just because of this feature.

    True, making it simple to do unsafe things is potentially dangerous. But making it unecessarily complex to do simple things also adds complexity, which isn't good for security either.

  159. Always hit "yes" Re:So what? by RabidChipmunk · · Score: 1
    But I don't know if you understood me, I was commenting:

    Just like a Word file that asks if you want to run macros. How many users always know when they should say yes?


    Did I mix my threads? I thought I read earlier:

    How many users know they should always say yes?


    Which is closer to what most of the users I know have learned. "Just click 'OK'"
    --
    This is not a political statement. This is not legal advice. It's a frick'n Slasdot post. However: I'm Running For
  160. Re:Trustworthy Code MOD IT DOWN by infochuck · · Score: 1

    Difference between C# and ActiveX in this case is that in ActiveX, everything is "Unsafe" and you either take it or leave it. In Java, of course, everything is "safe". C# can go either way.

    My god, people... another +5 post that belies a complete lack of understanding of the subject a thand. Di you even read the articles? They aren't talking about unsafe as in unsafe controls (ie, controls not verified with a certiifcate server or utilizing APIs that can be damaging to the client) - they are talking about doing unsafe things in terms of variable and object manipulation. Use a pointer incorrectly in a C windows app, and windows crashes. Hence, it's "unsafe". Not as in potentially virus-ridden or whatever you took it to mean. Get a clue. I shouldv'e know better than to expect insightful comments about Windows technologies from slashdork readers.

  161. Re:Backlashing and Frontlashing and Sideways Lashi by Anonymous Coward · · Score: 0

    I second that and just want to add two quotes here ...

    "Code that runs outside the control of the CLR is referred to as "unmanaged" code. Unmanaged code by definition is not constrained by the security
    measures of the CLR, and is thus capable of obtaining unauthorized access to resources in the native environment via traditional attacks."
    ["Security in the Microsoft .NET Framework", An Analysis by Foundstone, Inc. and CORE Security Technologies]

    "The unsafe keyword specifies that the marked block will run in an unmanaged context."
    ["Inside C#", Tom Archer, Microsoft Press 2001]