I would suspect that most viruses these days are not low level programs. Most are simply exploitative hacks. The person who makes the virus simply discovers a way to abuse features of existing software to do something that was never intended by the writers. The hard part is not writing the virus but finding the hole to exploit, which may be subtle and require some reverse engineering to discover.
I would tend to agree, actually.
The point is, I freakin' love C++. It's highly flexible, and it's quite fast. I don't believe that all programming languages are created equal. Many of the higher level languages are used for more specific kinds of programs, to which they are very efficient to use. I'm surprised by the negative view of C++ by other people ITT.
I'm surprised you perceive other people's balanced comments as a "negative view of C++" while you continue to say things like "Java sucks" and "C# is pathetic".
There is a reason those languages are in widespread use.
All virii are exploitative hacks. Even early ones needed to exploit security vulnerabilities to, for example, write to other programs' address spaces. This is the type of thing AspieRogue was referring to when he said a low level language was needed to write a virus.
I'm surprised you perceive other people's balanced comments as a "negative view of C++" while you continue to say things like "Java sucks" and "C# is pathetic".
There is a reason those languages are in widespread use.
I've heard that many hardc0re programmers and compuSci buffs have a very long opinion of Java. I've heard from some inside sources that Java was specifically create to catch bugs that no-so-good programmers would miss. Java is mainly used for internet programming as well as cellphone apps. I'm allowed to have my opinions, aren't I?
Not true. High-level languages can do this through API calls like WriteProcessMemory. Lots of malicious C++ programs still have to use WriteProcessMemory because pointers only allow you to write to memory in your process's own virtual address space. You can't use C file pointers to write past the end of one file and into another. File pointers are just a pointer to a FILE struct which contains a file handle for system calls along with other stuff used by the runtime library. They are not a pointer to a specific location on your disk. Under the hood, your C runtime library just makes system calls to write and read files, and the system calls obviously won't trash the file system. On linux, you can get raw disk access by opening the disk device (i.e. /dev/sda) with any language's file IO capabilities. On Windows you need a CreateFile API call, which you can do from any language.
But now I'd like to hear from MyFutreSelfnMe about how a virus can be written without pointers.
Effectively all languages have reference types, handles, or something along those lines. When you say pointers, I guess you are talking non-type safe pointers, which you can do arithmetic on and cast to different pointer types. It's worth noting that C# actually has these types of pointers, but you can only use them in an explicitly-declared unsafe environment and only run the compiled assembly under full-trust. However, there is almost no good reason for user-land code to use an unsafe pointer instead of a type-safe reference. You do not need unsafe pointers to treat code as data, and you don't necessarily need to treat code as data to write a self-replicating program.
I'm sure from a business perspective, other languages can be far more safe and efficient to develop in than C/C++, at least for most practical applications. I think it's more from a recreational perspective that some people prefer a lower level language. There's more control and elegance, even if it means more tedious work and debugging time than if you used a higher level language that hides more things under the hood. It's kind of like how people who find driving a car to be a recreational activity almost always prefer manual transmission to automatic, whereas I really don't give a crap as long as the car gets me from point a to point b without breaking down. Automatic transmission has a bonus in that it frees up my right hand to more easily sip my coffee in stop and go traffic without being a danger to other drivers. In both cases arguing over which is better is a waste of time.
As an beginner in C++, i learn it by web and the website tell me to write this for practice:
.cpp:
#include "MaFenetre.h"
MaFenetre::MaFenetre() : QWidget()
{
setFixedSize(300, 150);
m_bouton = new QPushButton("Quitter", this);
m_bouton->setFont(QFont("Comic Sans MS", 14));
m_bouton->move(110, 50);
// Connexion du clic du bouton à la fermeture de l'application
QObject::connect(m_bouton, SIGNAL(clicked()), qApp, SLOT(quit()));
m_aPropos = new QPushButton("A Propos", this);
m_aPropos->setFont(QFont("Comic Sans MS", 14));
m_aPropos->move(119,90);
QObject::connect(m_aPropos, SIGNAL(clicked)), qApp, SLOT(aboutQt()));
}
header:
#ifndef DEF_MAFENETRE
#define DEF_MAFENETRE
#include <QApplication>
#include <QWidget>
#include <QPushButton>
class MaFenetre : public QWidget // On hérite de QWidget (IMPORTANT)
{
public:
MaFenetre();
private:
QPushButton *m_bouton;
QPushButton m_aPropos;
QPushButton m_quitter;
};
#endif
the problem i get many errors and i follow instructions. Here we go with compilator errors:
![]()
Don't have the time to go through the rest, but in the line above, it should be
SIGNAL(clicked())
as second argument.
QPushButton m_aPropos;
QPushButton m_quitter;
You probably want to make m_aPropos and m_quitter pointers as well (just like you did with m_bouton).
Don't have the time to go through the rest, but in the line above, it should be
SIGNAL(clicked())
as second argument.
QPushButton m_aPropos;
QPushButton m_quitter;
You probably want to make m_aPropos and m_quitter pointers as well (just like you did with m_bouton).
Thanks dude all works. Stupid errors throught. Lol i forget pointers yeah i was needed to point this
C++ is a great language in my opinion! I've been working with Java and other languages for years, but I personally always prefer to write in C++. I feel a little bad if I don't have the power, insight and control which C++ gives to me as a programmer.
_________________
Your Aspie score: 155 of 200
Your neurotypical (non-autistic) score: 47 of 200
You are very likely an Aspie
I'm surprised you perceive other people's balanced comments as a "negative view of C++" while you continue to say things like "Java sucks" and "C# is pathetic".
There is a reason those languages are in widespread use.
I've heard that many hardc0re programmers and compuSci buffs have a very long opinion of Java. I've heard from some inside sources that Java was specifically create to catch bugs that no-so-good programmers would miss. Java is mainly used for internet programming as well as cellphone apps. I'm allowed to have my opinions, aren't I?
A main goal of Java back then (circa 1996) was portability. It also had a huge library built into the language.
Also, many of those "hard core" programmers wrote many bugs as well. If they wrote a program and it crashed or encountered memory corruption, they don't have room to talk.
I think "far more" is an exaggeration - C++ has a higher learning curve, but IMO much of that learning curve is spent learning things that make you a generally better programmer. Once you've mastered C++ I don't believe it takes significantly longer to write an application in it. Cleaning up after yourself is the main difference. Other languages' GCs work, but do have a performance impact and there are some powerful things you can do with C++'s scope based deletion that are hard to implement in other languages. Beyond that, I don't think "higher level" languages have many arguments in their favor. Java does have a performance overhead, you can see that on Android devices where the ingenious solution to avoiding "CPU diversity" issues was for everything to be done in Java. They're noticeably slower than iOS devices in a variety of situations. Performance issues are one of the leading reasons why Java was short lived as a web app development language and is now relegated to the 90s and to corporate intranet apps at companies who hire developers that don't care.
As for GUI, I don't know why, but I've never seen a Java app that I felt had a very refined UI. Including OpenOffice, which has been in development for what, more than a decade?
Do not eat or drink anything while driving.
I prefer C++ to Java, but it is not easy to make the interface in win32 with Visual C++ Express because the no MFC and no resource editor. In java anything created using swing looks a bit unhealthy. And using gtk and qt on windows is not better than java. But I like java to write rapidly some programs and they can run on any platform that support java. But for making software for a specific platform and for speed of execution and resource utilisation determinism C++ is better.
That's a ridiculous limitation. Why is MS even trying to capitalize on their compiler?
http://suite101.com/article/vc-express- ... tor-a21264
I have seen far better looking UIs using Qt on Windows than I have using Java. It's been 14 YEARS since I've used Qt though so I don't remember how the API is.
GTK is a writeoff. Having to launch an X server on Windows, they might as well have not bothered porting to Windows if the port is going to be like that.
