Register to reply

C++, java, or python programming

by Nair
Tags: java, programming, python
Share this thread:
Nair
#1
Mar24-12, 12:48 PM
P: 6
i know this topic has been discussed, but i would really want a direct reply and soon
Do i have to learn java or c++ in order for me to learn how to be a hacker?... good intentions off course, for security and privacy needs... please let me know. Thank you.
Phys.Org News Partner Science news on Phys.org
World's largest solar boat on Greek prehistoric mission
Google searches hold key to future market crashes
Mineral magic? Common mineral capable of making and breaking bonds
cepheid
#2
Mar24-12, 01:28 PM
Emeritus
Sci Advisor
PF Gold
cepheid's Avatar
P: 5,197
I would say that starting out by learning a low-level language in which you actually have to worry about things like data types and memory allocation is better than starting out with high-level language where such things are abstracted away from you. The former case forces you to think about what's actually going on.
M Quack
#3
Mar24-12, 01:41 PM
P: 660
+1

Get a good basis in C (for example), then C++ will be a piece of cake. Java has quite dropped out of fashion, I'd prefer Python to that.

Nair
#4
Mar24-12, 02:08 PM
P: 6
C++, java, or python programming

awesome.. thanks guys...
Hobin
#5
Mar25-12, 07:16 AM
P: 194
I respectfully disagree.

Having used all three, I say you should start with Python. Apart from being the easiest to learn, it's also much easier to actually learn to become a programmer in Python. Because, first of all, you spend much less time doing lower-level stuff and thus more time actually producing useful code; second, the other two forcing you to think about what's actually going on on a lower level is *not* useful for a beginner. You don't *need* to know what's 'actually happening in the CPU' if you want to learn programming - if that's what you want to learn, start with assembly. Personally, I found it much easier to first learn good programming and *then* learn how the bits and bytes moved around, not to mention that the latter actually only becomes useful *after* you've gained some proficiency in programming.
Max.Planck
#6
Mar25-12, 09:26 AM
P: 127
C++ is an extremely versatile language, if you want, you don't need to use all the low level C stuff, you can start out just using STL and later picking up pointers etc. later. There is also a lot of learning material available for C++ and a large community, but this of course is valid for JAVA and Python as well.
What do you eventually want to accomplish?
Nair
#7
Mar25-12, 12:20 PM
P: 6
Quote Quote by Hobin View Post
I respectfully disagree.

Having used all three, I say you should start with Python. Apart from being the easiest to learn, it's also much easier to actually learn to become a programmer in Python. Because, first of all, you spend much less time doing lower-level stuff and thus more time actually producing useful code; second, the other two forcing you to think about what's actually going on on a lower level is *not* useful for a beginner. You don't *need* to know what's 'actually happening in the CPU' if you want to learn programming - if that's what you want to learn, start with assembly. Personally, I found it much easier to first learn good programming and *then* learn how the bits and bytes moved around, not to mention that the latter actually only becomes useful *after* you've gained some proficiency in programming.
thanks man... I'm using a website called codeacademy... really helps a lot....
Nair
#8
Mar25-12, 12:26 PM
P: 6
Quote Quote by Max.Planck View Post
C++ is an extremely versatile language, if you want, you don't need to use all the low level C stuff, you can start out just using STL and later picking up pointers etc. later. There is also a lot of learning material available for C++ and a large community, but this of course is valid for JAVA and Python as well.
What do you eventually want to accomplish?
my facebook , computer has been hacked, so I want to learn how to secure my browsers, files and so on....
Max.Planck
#9
Mar25-12, 12:52 PM
P: 127
Quote Quote by Nair View Post
my facebook , computer has been hacked, so I want to learn how to secure my browsers, files and so on....
Then you should study how browsers, networks, operating systems etc work. Learning to program will not make you an expert in the field of security, although it's crucial if you want to make tools yourself.

But from this description seems you should 1) use strong passwords 2) use security software firewall/antivirus.
Hobin
#10
Mar25-12, 01:11 PM
P: 194
Quote Quote by Nair View Post
my facebook , computer has been hacked, so I want to learn how to secure my browsers, files and so on....
You don't need to know programming for that. Use strong passwords, DON'T reuse your passwords, and don't try to install every little piece of software you find on the web.
DaleSwanson
#11
Mar30-12, 01:08 AM
P: 351
A 'hacker' is a term so generic and overused that it almost has no meaning. If I had to define a hacker I define it as someone with a deep understanding of how computers work, with a drive to constantly learn more.

This is similar to a car mechanic. Generally if one has an interest in cars one will spend a lot of time trying to figure out how they work, taking them apart, and making improvements. Eventually they will build up more and more knowledge. There will be no point at which they are suddenly a mechanic (ignore professional mechanics for this analogy, as realistically no one is going to employ you as a hacker).

If you have a deep interest in how computers work you will seek out knowledge and eventually develop an equally deep understanding. If you simply want to learn what is necessary to protect yourself online, then there are plenty of simple guides online that you can search for. In either case, realize you will never be done. New technologies and attacks come out every day.

The whole of human knowledge is at your finger tips. Just start searching for how things work. Start with an article like this:
http://en.wikipedia.org/wiki/HTTP_Secure

Read that, and open up in new tabs anything you don't understand or that sounds like it might be interesting. Do that with every article.

Here is a great site for tech Q&As:
http://security.stackexchange.com/

Read through a lot of questions. Use the search function. Here is a good search to get you started:
http://security.stackexchange.com/se...avoid%20hacked
Hurkyl
#12
Mar30-12, 01:46 AM
Emeritus
Sci Advisor
PF Gold
Hurkyl's Avatar
P: 16,092
Quote Quote by M Quack View Post
+1

Get a good basis in C (for example), then C++ will be a piece of cake.
Aaah no!! Among programmers, C programmers are one of the richest sources of terrible C++ programmers.

There's an old joke:
A "real" programmer can write Fortran code in any language
referring to the tendency of a programmer who is very fluent in Fortran and no other language to continue programming using Fortran idioms no matter what programming language he's using. This tends to result in lots of unnecessary effort to produce code that is very out-of-place, and thus meshes poorly with other features of that language and is difficult for programmers of that language to maintain.

This isn't limited to Fortran, of course; that's just the joke's origin. The particular combination of fluent C programmers writing in C++ is rather notorious for both how easy it is to trigger this behavior as well as how dramatic the effect is -- C++ as used by C programmers is practically an entire different language than C++ as used by C++ programmers!
Pythagorean
#13
Mar30-12, 02:04 AM
PF Gold
Pythagorean's Avatar
P: 4,262
Quote Quote by Hurkyl View Post
Aaah no!! Among programmers, C programmers are one of the richest sources of terrible C++ programmers.

There's an old joke:
A "real" programmer can write Fortran code in any language
referring to the tendency of a programmer who is very fluent in Fortran and no other language to continue programming using Fortran idioms no matter what programming language he's using. This tends to result in lots of unnecessary effort to produce code that is very out-of-place, and thus meshes poorly with other features of that language and is difficult for programmers of that language to maintain.

This isn't limited to Fortran, of course; that's just the joke's origin. The particular combination of fluent C programmers writing in C++ is rather notorious for both how easy it is to trigger this behavior as well as how dramatic the effect is -- C++ as used by C programmers is practically an entire different language than C++ as used by C++ programmers!
So what's the alternative? Only ever learn one programming language in your life?

or more start with high-level and then move towards low-level?

I honestly think it's a matter of taste, style, and purpose.
M Quack
#14
Mar30-12, 02:35 AM
P: 660
I am very familiar with the joke and the essay it came from.

http://en.wikipedia.org/wiki/Real_Pr...27t_Use_Pascal

However, I have seen people that know only high-level languages like Python, Java or C++, and that write code that looks OK at first look, but that runs rather slowly. When you check you find tons and tons of unnecessary instances of objects being created and deleted all over the place, and these guys have no clue where they come from...

You can of course write rather efficient code in C++, but you have to be careful and understand what the compiler does. The beauty of C is that there are no such things going on behind your back.

To confirm your point, I plead guilty to writing C-style code in C++. 20 year old habits are hard to kill. I am struggling to do the same in Python, however :-)
ektrules
#15
Mar30-12, 03:10 AM
P: 46
Although the OP seems to just want to know how to secure his computer, I'll offer my opinion for future reference.

If you want to "hack" or "crack" in the sense of security related issues, you're probably going to want to focus on low-level programming languages, and really get a thorough understanding how things work at this level. So, you'd probably want to learn C, C++, and especially assembly. Assembly will be required to reverse engineer proprietary code to find vulnerabilites like potential buffer overlows, and stuff like that.

Of course, this depends on the kinds of things you want to mess with. For example, if you want to mess around with web apps, you'd want to know more about JavaScript, Java, PHP, Ruby, SQL, Apache, Linux, or IIS.

Keep in mind that it will take a long time to gain enough understanding to become a proficient "hacker" or security professional. Like many skills, the "10,000 hour rule" probably applies.

Hacking is using creativity to make a system behave in a way it was not intended. This is harder than just programming a system in a straigforward manner, and requires a very deep understanding of the nuts and bolts of the system.

Oh, and just to join in on ripping on Fortran:
"FORTRAN's tragic fate has been its wide acceptance, mentally chaining thousands and thousands of programmers to our past mistakes."

Dijkstra's always a good source for funny quotes :)
Nair
#16
Mar30-12, 07:25 AM
P: 6
hmm.. ok thanks guys... ill take this all into consideration. And yes i know it will take me a long long time to learn to be... what i have in mind to be... just want to know where and what to start with.
jtbell
#17
Mar30-12, 08:13 AM
Mentor
jtbell's Avatar
P: 11,621
Quote Quote by M Quack View Post
However, I have seen people that know only high-level languages like Python, Java or C++, and that write code that looks OK at first look, but that runs rather slowly.
That's a valid point. In the end, a good, well-rounded programmer has to be able to work easily and well at both high and low levels. The question here is which level a person who knows nothing about programming yet, should start at.

The answer surely depends somewhat on the person's own learning style, but I lean towards starting at a high level and working one's way down. First learn the basic constructs and techniques that apply in most any procedural programming language: variables, basic I/O, if-statements, loops, procedures/subroutines (and the general ways of passing data to/from them), techniques for effectively decomposing a complex problem into smaller parts, basic techniques for organizing large amounts of data (arrays, lists, strings, etc.).

When I taught C++, I used "C++ style" I/O streams instead of C-style I/O, and the standard library containers like vectors and strings instead of C-style arrays and char* "strings" for most of the course, because then I didn't have to introduce pointers until later in the course, after the students were (hopefully) already comfortable with the basic concepts.
Hobin
#18
Mar30-12, 08:42 AM
P: 194
Quote Quote by M Quack
However, I have seen people that know only high-level languages like Python, Java or C++, and that write code that looks OK at first look, but that runs rather slowly. When you check you find tons and tons of unnecessary instances of objects being created and deleted all over the place, and these guys have no clue where they come from...
*shrugs* I don't really think it's that important. To quote from ESR's Hacker Howto:
C is very efficient, and very sparing of your machine's resources. Unfortunately, C gets that efficiency by requiring you to do a lot of low-level management of resources (like memory) by hand. All that low-level code is complex and bug-prone, and will soak up huge amounts of your time on debugging. With today's machines as powerful as they are, this is usually a bad tradeoff — it's smarter to use a language that uses the machine's time less efficiently, but your time much more efficiently. Thus, Python.
I very much agree with him on that point. For most applications, the availability of system resources really isn't much of an issue. This obviously doesn't mean that people who want to be good programmers can do with only learning high-level languages, but neither does it mean that a low-level language is a must for programmers, per se. Especially if you're not going to create kernels, videogames or other very computation-intensive applications.

Also, when did C++ become a high-level language? C++ is, as far as I'm aware, intermediate-level! (C++ compilers can use inline-assembly, which can make an application architecture-dependent, which makes it middle-level.)

Quote Quote by jtbell View Post
When I taught C++, I used "C++ style" I/O streams instead of C-style I/O, and the standard library containers like vectors and strings instead of C-style arrays and char* "strings" for most of the course, because then I didn't have to introduce pointers until later in the course, after the students were (hopefully) already comfortable with the basic concepts.
I agree that it's best for most students to see some text on the screen before starting with pointers. On the other hand, pointers are extremely important, so it might be practical to introduce them sooner rather than later.


Register to reply

Related Discussions
Python VS Java Programming & Computer Science 13
Python Programming Assignment Engineering, Comp Sci, & Technology Homework 3
Programming in Python Programming & Computer Science 22
Java or Python Computing & Technology 13
Python/Perl/PHP versus Java Computing & Technology 27