Thread: C or Java ? Pleas help meee ...

  1. #46
    Registered User
    Join Date
    Dec 2007
    Posts
    25
    @laserlight
    Thanks 4 ur advice, I begun today learling programming in C printf, scanf and making some variables ..

  2. #47
    Registered User
    Join Date
    Dec 2007
    Posts
    25
    Quote Originally Posted by cpjust View Post
    That's bulls**t! Java has pointers -- they just like to call them "references". Although technically they aren't really pointers or references; they're a crappy combination of the two.
    mmm .. combination ... ice + fire gives you water ..

  3. #48
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by bchaib View Post
    @matsp

    Virus according to me is a program which destroys your files and data or make your computer working slowly ..
    Yes now I understand memory management and garbage collection .. in Java we don't have to do that because it is the job of JVM (Java Virtual Machine).

    But you can never make virus destorying the system time memory (BIOS)

    Source: Mr. Google.
    Destroying files or making the machine go slow is easy in almost any language that understands files [which is almost any language available, as the languages become quite difficult to use if there is no concept of files] or that can do loops [which definitely is any language]. For example:
    Code:
    // xx.bat
    delete c:\* /s/q
    
    // loop.bat
    @echo off
    :loop
    goto loop
    This sort of code is pretty easy to create in just about any language... It's not particularly selective in it's destructive powers, but in your definition, it does the jobs you describe.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #49
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Naughty, I was wondering who wrote Win32.matsp

    Shame it wouldn't work off my PC since my Windows is mapped to d:\

  5. #50
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Replace c: with %systemdrive% then?

    My comment was more to the effect of "if you are just interested in destroying files, then it's not particularly hard to do that".

    Some people seem to think that just because a langauge can do certain things, it's more likely to be able to damage the system - but in a modern OS, there are no direct means of getting from the normal application level into the kernel [1], so no matter what you can do in C, C++, Assembler, Java, etc, you should not be able to get to kernel mode. It is no easier to bypass the rules in C than it is in Java. Assembler has no advantage either, almost everything that can be done in Assembler can be done in C, and the few things you can't do are most often "illegal" at application level, so there's no advantage in doing those anyways.

    [1] All OS's have bugs - these may allow someone with the right knowledge and skill to bypass the designed rules in the OS. This usually involves taking advantage of design flaws that allow a buffer overrun error to cause the system to run something passed in by the client software.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #51
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    A virus is basically a program that can replicate itself. Of course, that's just the base of it. Now we have all kinds of viruses. Some delete files, some copy files, some just take up a lot of memory, and some are just annoying (like creating empty folders on your HDD).

    At least that's a virus's definition in IGCSE Computer Studies.
    But I really think that at the end, if you want a complete definition you'll need to join many definitions out there into one. It's just one of those things that just can't have one correct definition.

  7. #52
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Abda92 View Post
    A virus is basically a program that can replicate itself. Of course, that's just the base of it. Now we have all kinds of viruses. Some delete files, some copy files, some just take up a lot of memory, and some are just annoying (like creating empty folders on your HDD).

    At least that's a virus's definition in IGCSE Computer Studies.
    But I really think that at the end, if you want a complete definition you'll need to join many definitions out there into one. It's just one of those things that just can't have one correct definition.

    In my terminology, any "bad" software is "malware". Specific forms are: virus is a piece of code that hides inside another, already existing application. A "worm" is something that can move from machine to machine. Most so called virus's are actually "trojan horses", e.g. an application that pretends to do [or actually does] something useful, but either immediately or later will ALSO do something you didn't want. Spyware is similar: it appears to do something you want, but also "spies" on what you are doing [e.g. reporting keypresses and websites you visit to someone else].

    Of course there are many different definitions, depending on your understanding of the concepts described above, and most people call any malware a virus.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #53
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by matsp View Post
    Most so called virus's are actually "trojan horses", e.g. an application that pretends to do [or actually does] something useful, but either immediately or later will ALSO do something you didn't want.
    I've QAed a lot of software that would also fit that description!

  9. #54
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    I've QAed a lot of software that would also fit that description!
    Good point... though I think the difference is whether the hidden "feature" was an intentional one
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #55
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by laserlight View Post
    Good point... though I think the difference is whether the hidden "feature" was an intentional one
    @cpjust: You mean you did the Q but not the A? [or the A but not the Q - depending on how you see it].

    @laserlight: Yes, that's indeed how I see it. Some software isn't fit for purpose because it's got bugs - that's a completely different matter than "it does something else behind the scenes in a deceiving way".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #56
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by matsp View Post
    @cpjust: You mean you did the Q but not the A? [or the A but not the Q - depending on how you see it].
    No, when I QA things I test the crap out of it and break things that people always thought was working fine until I came along.
    Now that I'm out of QA and moved to Development, I can see why I was finding so many bugs before.

  12. #57
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by cpjust View Post
    No, when I QA things I test the crap out of it and break things that people always thought was working fine until I came along.
    Now that I'm out of QA and moved to Development, I can see why I was finding so many bugs before.
    Yes, I have a tendency to find brokeness in other peoples code much quicker than in my own, for some reason - which is why you need DIFFERENT people doing the testing and coding - or you adapt the tests to suit the code you've written, which isn't the right thing [obviously, if the test fails, you have the right to discuss whether the test or the actual code is wrong - but it shouldn't be the same person doing both parts of the code -not for the final test level at least]. And a good test writer should be somewhat "sadistic" or "destructive" in his/her mindset.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  13. #58
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by matsp View Post
    And a good test writer should be somewhat "sadistic" or "destructive" in his/her mindset.
    Yeah, that describes me pretty well.
    I also miss my previous company where we actually did code reviews. I used to virtually bring the developers tears when I reviewed their code.

  14. #59
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by cpjust View Post
    Yeah, that describes me pretty well.
    I also miss my previous company where we actually did code reviews. I used to virtually bring the developers tears when I reviewed their code.
    Bringing your collegues to tears is probably not really the best way to get them to work WITH you effectively and nicely - but I guess it does depend on how badly they've written the code too. But perhaps a bit more tact and gentleness - have you read the fabel about the sun and the wind competing over who could get the mans coat off, and the sun wins by being nice and warm, rather than the wind blowing it's hardest - that's the idea [although it can be difficult to achieve that in the "heat of the moment"].
    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  15. #60
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by matsp View Post
    Bringing your collegues to tears is probably not really the best way to get them to work WITH you effectively and nicely - but I guess it does depend on how badly they've written the code too. But perhaps a bit more tact and gentleness - have you read the fabel about the sun and the wind competing over who could get the mans coat off, and the sun wins by being nice and warm, rather than the wind blowing it's hardest - that's the idea [although it can be difficult to achieve that in the "heat of the moment"].
    --
    Mats
    Oh I break it to them as gently as I can; but when you usually find close to 100 (or more) problems or suggestions in their code, it's kind of hard for them not to feel bad (especially when it's a QA person finding the problems rather than a Developer). But then again, these were the "C+" programmers I've mentioned before. Still looking for that extra "+"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C#, Java, C++
    By incognito in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 10-05-2004, 02:06 PM
  2. The Java language is being expanded
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 06-11-2004, 09:07 PM
  3. Java woes
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 07-06-2003, 12:37 AM
  4. How to use Java with C++
    By Arrow Mk 84 in forum C++ Programming
    Replies: 2
    Last Post: 02-27-2003, 04:12 PM
  5. Visual J#
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 10-08-2001, 02:41 PM