C++, java, or python programming

In summary: I totally disagree. 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... I totally disagree.
  • #1
Nair
6
0
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.
 
Technology news on Phys.org
  • #2
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.
 
  • #3
+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.
 
  • #4
awesome.. thanks guys...
 
  • #5
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. :wink:
 
  • #6
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?
 
  • #7
Hobin said:
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. :wink:

thanks man... I'm using a website called codeacademy... really helps a lot...
 
  • #8
Max.Planck said:
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...
 
  • #9
Nair said:
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.
 
  • #10
Nair said:
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. :smile:
 
  • #11
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/search?tab=votes&q=avoid hacked
 
  • #12
M Quack said:
+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!
 
  • #13
Hurkyl said:
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.
 
  • #14
I am very familiar with the joke and the essay it came from.

http://en.wikipedia.org/wiki/Real_Programmers_Don't_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 :-)
 
  • #15
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 :)
 
  • #16
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.
 
  • #17
M Quack said:
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.
 
  • #18
M Quack said:
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.)

jtbell said:
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.
 
  • #19
Random, uncontrolled creation and annihilation of instances is at least as important a source of bugs and crashes as badly managed pointers and manual memory allocation are - in my opinion, I have seen plenty of examples.

The waste of compute time is indeed irrelevant for most codes on most of today's machines, with the notable exception of graphics and image processing. For writing 2-3 pages long programs, the language hardly makes any difference.

However, there is now a proliferation of low-powered machines with realtively little memory (smartphones and pads, embedded machines, Arduinos, Rasberry Pies etc) where you have to be a bit more careful with your resources. One can only hope that the libraries for image shuffling etc were written by "real programmers".

Requiring beginners to manage pointers to deal with basic string operations is indeed a bit steep on the learning curve. But as far as I know, it has not killed anyone yet. That a string has a length, and that you have to provide memory space for that should be required knowledge for each programmer, even if in Python you never really get exposed to such details.

Just my personal opinion.
 
  • #20
M Quack said:
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...
This reminds me of one of my favorite quotes. I can't find the amusing version, so I'll cite the more serious version by Knuth:
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified​

The beauty of C is that there are no such things going on behind your back.
Not true. The compiler still does lots of things behind your back. I know at least one programmer (who is rather good at various assembly languages) who frequently laments the C compiler doing things he didn't want.
 
  • #21
I started with high-level specialized matlab, then went to C because I have large non-linear high-dimensional ODEs that take weeks and sometimes months to reach a steady state.

Im hoping to get a massive efficiency increase out of C. Also, matlabs odd solver was using an interpolation step on solutions and because of the sensitive nature of these systems (they're chaotic) it would give different results if I used the last state as my new initial state. It took me a while to figure that out and find a work around.

I might have saved months of research time if I would have started with C, where I know exactly what my program is doing.
 
  • #22
Keep in mind the massive efficiency loss in Java. Because of how it's run, it runs really slowly compared to many other languages. (This is from the concept of being able to run one file anywhere, as opposed to compiling and then running anywhere. It requires you to effectively launch a virtual machine to run Java. Efficiency loss.)
 
  • #23
Hobin said:
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. :wink:
+1, yes start with Python. It is generally easy to find and speed up/replace the CPU intensive parts *later*, when the time comes.
 
  • #24
Whovian said:
Keep in mind the massive efficiency loss in Java. Because of how it's run, it runs really slowly compared to many other languages. (This is from the concept of being able to run one file anywhere, as opposed to compiling and then running anywhere. It requires you to effectively launch a virtual machine to run Java. Efficiency loss.)

You're either massively exaggerating, or you haven't used java in the last 10 years. :smile: The last time I paid any attention to the comparison (which was a long time ago), for a "typical" computationally intensive program, the expected difference was as small as java taking just 50% longer to do the calculation.

Also, you might be interest in the concept of just-in-time compilation.
 
  • #25
Sorry. Must've gotten flawed information. :)
 
  • #26
Pythagorean said:
I started with high-level specialized matlab, then went to C because I have large non-linear high-dimensional ODEs that take weeks and sometimes months to reach a steady state.

Im hoping to get a massive efficiency increase out of C. Also, matlabs odd solver was using an interpolation step on solutions and because of the sensitive nature of these systems (they're chaotic) it would give different results if I used the last state as my new initial state. It took me a while to figure that out and find a work around.

I might have saved months of research time if I would have started with C, where I know exactly what my program is doing.

In my experience the best way to get a massive efficiency increase is to find a massively more efficient algorithm, rather than try to make a massively more efficient implementation of the same algorithm in a different language. Remember the high level algorithms in Matlab (like its ODE solvers) have been coded by experts, and you are unlikely to beat them. On the other hand if you are using the "wrong" solver algorithm leading to unneccessarily small time steps etc, a better algorithm may give you a speed up of 2 or 3 orders of magnitude, whatever language you code it in.
 
  • #27
Matlab handles that with the interpolation step, which adjusts the step size to your tolerance constraints, but that causes issues with sensitive systems, so I lose that efficiency gain; it wasn't made with my system in mind (I have tried all the MATLAB solvers).

Also, since it's scientific research, it's more reliable to use something colleagues and reviewers know and trust (ie runge kutte).

I'll let you know how it goes, but people who have done thus before report a 3x increase in speeds, which make my month wait time 10 days days.
 

What is the difference between C++, Java, and Python programming?

C++, Java, and Python are all popular programming languages, but they have distinct differences. C++ is a low-level language, meaning it provides more control over computer hardware and memory. Java is an intermediate-level language that is known for its portability and its use in building web applications. Python is a high-level language that is known for its simplicity and readability. It is often used in scientific computing, data analysis, and artificial intelligence.

Which language is best for beginners?

Many people consider Python to be the best language for beginners. It has a simple and intuitive syntax that makes it easy to learn and understand. Additionally, Python has a large and supportive community, with plenty of online resources and tutorials available for beginners.

What are the main applications of C++, Java, and Python?

C++, Java, and Python have a wide range of applications. C++ is commonly used for developing operating systems, video games, and high-performance software. Java is often used for building web applications, mobile apps, and enterprise software. Python is popular in fields such as data science, machine learning, and web development.

Can you mix and match C++, Java, and Python in a project?

Yes, it is possible to mix and match these programming languages in a project. For example, you could use C++ for the core functionality of a project, Java for the user interface, and Python for data analysis. However, it is important to consider compatibility and integration issues when combining multiple languages in a project.

Which language is better for performance, C++, Java, or Python?

C++ is generally considered to be the fastest of these three languages, as it is a compiled language and allows for more direct control over hardware. Java and Python are both interpreted languages, which can lead to slower performance. However, this difference may not be significant in many applications, and performance can also depend on the specific implementation of the code.

Similar threads

  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
3
Views
985
  • Programming and Computer Science
Replies
1
Views
705
  • Programming and Computer Science
Replies
8
Views
832
  • Programming and Computer Science
Replies
5
Views
794
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
17
Views
1K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
5
Views
912
Back
Top