personally i dont like it...is just for the standard..adn experince.....
Printable View
personally i dont like it...is just for the standard..adn experince.....
Perl you don't have a lot of problems you do with C and C++. First you don't have to predeclare your variables, though you can, and I usually do, and you can set it up so that you have to.
(use strict;)
It is not required next, you don't have to int this float that. I hated that about C. Everything in perl is a floating point number unless you want to make it an interger.
Which you would just put int in front of it like printf int("%f, &*******"); There are plenty of things that I prefer over perl as to C and C++. Though sadly enough, I am going to have to pick my C and C++ books back up soon, school requires that I learn them, and use them. So you guys will see plenty of threads from me bitching about how I hate C++ in about 3 or 4 months, it usually takes a class about that long to get to the point, of the language where I have forgotten everything.
Oh well.
Though yeah, perl is the way to go for beginning programmers, and experienced alike. It really is a easy language to learn. I personally don't want to go back to C. Though there are something's that perl kind of sucks at. (Mainly the compiler thing with perl. It is a kind of sucky thing.) (If your wondering what I mean, perl is an interpreted language, but what happens with the code is, that it is compiled then interpreted everytime it is ran.) (Now the reason this sucks is, you can't run perl code without an interpreter.) (Sidenote, that's not true, there is a program called perl2exe, that compiles perl code.)(There is also something that comes standard with perl called perlcc. It is the perl compiler, you can compile your programs with it. So that you don't need the interpreter.)
What is it you don't like about perl? Please elaborate, for I would love to hear your grand explanation.
(Damnit Angelic, now you have perl on my head, and I am going to be thinking about the language for the next 10 mins, about every little nic and nac of the language.)
It's funny...the very things you dislike about C....are the very things I like about it. :) It offers so much more control than other languages, in my experience. It's not messy, not too verbose, and extremely flexible.Quote:
Originally posted here by whizkid2300
Perl you don't have a lot of problems you do with C and C++. First you don't have to predeclare your variables, though you can, and I usually do, and you can set it up so that you have to.
(use strict;)
It is not required next, you don't have to int this float that. I hated that about C. Everything in perl is a floating point number unless you want to make it an interger.
Which you would just put int in front of it like printf int("%f, &*******"); There are plenty of things that I prefer over perl as to C and C++. Though sadly enough, I am going to have to pick my C and C++ books back up soon, school requires that I learn them, and use them. So you guys will see plenty of threads from me bitching about how I hate C++ in about 3 or 4 months, it usually takes a class about that long to get to the point, of the language where I have forgotten everything.
Oh well.
Though yeah, perl is the way to go for beginning programmers, and experienced alike. It really is a easy language to learn. I personally don't want to go back to C. Though there are something's that perl kind of sucks at. (Mainly the compiler thing with perl. It is a kind of sucky thing.) (If your wondering what I mean, perl is an interpreted language, but what happens with the code is, that it is compiled then interpreted everytime it is ran.) (Now the reason this sucks is, you can't run perl code without an interpreter.) (Sidenote, that's not true, there is a program called perl2exe, that compiles perl code.)(There is also something that comes standard with perl called perlcc. It is the perl compiler, you can compile your programs with it. So that you don't need the interpreter.)
What is it you don't like about perl? Please elaborate, for I would love to hear your grand explanation.
(Damnit Angelic, now you have perl on my head, and I am going to be thinking about the language for the next 10 mins, about every little nic and nac of the language.)
Yeh, it kind of forces you to write readable code lol. Thanks a lot for the fast replies, I think I'll stick with C++ now. I thought it might have been outdated because it was made years ago, where as java was made not to long ago. I have experience with True BASIC, but I didn't stick with that to long because it was just to boring, I also have experience with some of the web programming langauges, but now I wanna learn a good language and stick with it. I have the Dev C++ 4 compiler, it's free. What do you guys think about that compiler? Also, here is a simple block of code, it just calculates your yearly salary with tax deducted and all based on your hourly wage. The problem is that when I run it, sometimes my whole computer freezes up and I have to restart my computer. Anyone else have similar problems?
Heres the code:
int main()
{
int a;
int i, j, p, c;
float x, d;
i = 40;
j = 4;
p = 12;
x = 0.33;
cout << "What is your hourly wage?" << "\n";
cin >> a;
c = a * i * j * p;
d = a * i * j * p * x;
d = c - d;
cout << "Based on your hourly wage, and assuming you work in illinois, your yearly salary is: " << d << "\n";
cout << "\a"; //this rings the terminal bell
system("PAUSE");
return 0;
}
you should look into the tutorial files in here....there are tons of info....
and the system calls does somethig like you where in a command promp ad typed that....
and that's what it does...to freeze...
you can use getch() or getche() thery are in stdio.h .....the act like cin ..but captures only one key stroke....
Well, I need to capture more then one key stroke...
math, I will say this. Programming is an Art Form, IMHO. And when you are trying to make a sloppy picture, that looks great but isn't the best drawn thing in the world, you look for perl.
When you are making that masterpiece picture that you want everyone to see, and you want everyone to look at and say what a marvel. You use C.
Now I will say this much, even simple things in C, take forever to do. I once was working on a port scanner in C, I think I was up to about 500+ lines of code.
Now that same thing in Perl, I can do under about 200. Depending on how much I want to add.
If you are going to be quick and dirty, use perl. If you want that masterpiece, that everyone believes was touched by good, use C or C++.
Oh and as a side note, when a language was made does not have anything to do with how good it will be, or how good it will be for a task.
C is probably one of the most used languages ever written. (Probably fighting with BASIC) But nonetheless, it is a great language, many things are written in it, the *nix kernel is written in it. (Though there is a Linux distro were the kernel is written in perl.)
The windows kernel is written in it.
Duck: C++ is defintely the way to go, but you must get into good programming practice. The one that I noticed was your lack of commenting. I don't have a clue what the different variables in your program mean. Also, since they do hold significant values (i.e. not a simple variable to control a loop), then they should have significant names. Other than that, I see nothing wrong with your code, nor do I see why it would freeze your system. The first thing that comes to mind is running Windows Update to make sure this isn't an issue that has been addressed.
A_T
P.S. Bloodshed Dev C++ is the best compiler I have seen for Windows. Stick with it, but make sure you get the updates for that as well. I believe it is at version 4.9.8 or something close, so it is beta, unless you got 4.0.
I got 4.0, they are in beta testing of a 5.0 I think. So if it isn't my code, and it isn't the compiler... then it must have something to do with that spyware I got a little while ago, I got well over 200 things of spyware because I accidently clicked "yes" on a pop up lol. Took me 5 hours to get all of it off, but I still see signs of it on, like system resources being at 50% or even 100%! But I ran spybot, avast!, adaware, and cwshredder, and they didn't find anything after they got rid of the 200+ things... Oh well, I guess this thread isn't about my spyware problem lol.
I guess I should add more comment tags;)
The reason it freezes your terminal is because the bell ring for Dev C++ is jacked up, or atleast it was last time I used it. That would always happen.