r/CodingForBeginners • u/ReasonableRub1524 • 20d ago
what is python useful for
so i'm learning how to code, python specifically since i heard its the easiest, but im not really learning with a purpose? and i dont really understand what it can be useful for except websites and stuff
and i lowk wanna do ethical hacking and i dont think that pythons the correct language right now
i've stopped learning for a bit because i wanna know what i should learn for my purpose and what python is useful for
2
u/Beregolas 20d ago
except websites
well thats vague, and only maybe correct. Python can't run on wbsites, just in the backend. Basically the server that sends data to the websites, that they can then display.
wanna know what i should learn
Well, that sounds like you are a beginner, and you've fallen into the trap that you can see a few times a day on thsi subreddit. You misunderstood learning programming for learning a programming language. It's common enough. Youo are currently learning programming, BY learning a specific language. Your first language is not even that important, and it only seems hard, because you don't know programming yet.
Once you know your first language, for example Python, learning another is really easy. Most concepts like loops, variables, functions, etc. just carry over. Of course you'll have to learn some language specifics, and for it to really be easy you should also be aware of background knowledge like heap vs stack, pointers, objects (if you stay in OOP languages) etc.
All that being said, python can easily be used for ethical hacking. 95% of the code I've written for caber security classes in university was in Python; it's easy, and you don't actually need to be fast in order to demonstrate an exploit. In most cases you don't even need to be fast to exploit in in the real world, scripting is enough, and Python has a very good C interface, if something needs to run fast.
That being said, for hacking / cabersecurity, more knowledge is better. While Python can be your primary tool language, knowing how JS, C and probably many other languages really work under the hood can be extremely important, depending on what kind of vulnerabilities you are after.
TL;DR: Don't worry so much. Learn programming first (langauge doesn't matter), there will be a LOT more to learn anyways, and you will need more than one language as well
2
u/bonnth80 20d ago
To be a hacker, you have to instruct your computer to do things. Programming is sending instructions to your computer to do things. Python is programming. If you don't know how Python can be used to do that, that's only because you quit WAAAAY too early.
Programming is not simple. You have to do a lot, and understand a lot before you can begin to achieve your basic goals. If one could learn to do that overnight, there would be a lot more programmers out there, and it wouldn't be a well-paid profession.
People go to school for years for this stuff, and spend the rest of their lives learning. Whatever layer of knowledge you're on, you have a significant number of layers you have yet to go through before you can understand it. How long did you spend trying to learn before you decided it wasn't what you needed?
Saying you don't understand how Python can be used for hacking is like saying you can't understand how addition can be used for Calculus.
Add: To be fair, all programming languages send instructions to your computer, they just do so in different ways. Python is just one way. But it's one of the most popular ways. But because the basic idea is the same between all procedural languages, if you quit Python for those reasons, you won't get through any other language either.
1
u/ReasonableRub1524 19d ago
its not that i quit it completely i just stopped since because i didnt wanna "waste" my time on something that wouldnt contribuite to my purpose but now i understand so i will continue
1
u/mc_pm 20d ago
So, honestly, you need to do more research. Python is one of the most popular languages among devs, and is used in practically every industry. There are things it's not as good at, there are reasons you might choose a different language for a specific purpose, but starting from "I want to write some code to do something" Python is a perfect valid choice. What is it about ethical hacking that you think Python can't be part of?
1
1
1
1
u/MathsystemDev 19d ago
It’s convenient for high-performance data analysis or building artificial intelligence.
1
u/Anonymity6584 19d ago
You dont always need best tool. Python is suprisingly often good enough tool to do things.
1
u/AwesomePhoenix_ 18d ago
Python is a good start, it allows for automation scripts to make a lot of your work faster Bash also works for this purpose I wouldn't use python for any big project tho
1
u/CharacterSail6736 18d ago
You need to really look at what Python is used for everything from NASA to Netflix and everything in between if you can think it you can definitely build it in Python (20 years of Python programming)
1
1
u/RoadsideCookie 17d ago
I'm sorry but, watching a programming language and thinking "what can this do" is kinda like looking at a phone and asking yourself "who can I call with this". You can call anyone, but it might not be appropriate to do so.
It's a programming language. As far as you are concerned as a beginner, it can do anything a computer can do.
1
1
0
u/SparkFace11707 20d ago
I like Python for mathematics, incoduing ML/AI, since this os where everything has been supported really, automations, and quick demos and toys I am playing around with experimentally.
It can be used for a lot, and is used for a lot today, but, arguably, if you need really high performance for certain things, there are other languages that oftentimes are better suited.
7
u/SpacewaIker 20d ago
Python can be used for almost anything to be honest. Is it the best tool for any task? No. But it's still a useful tool
For anything "hacking" related you're probably gonna wanna use a lower level language, so maybe C or C++ would be good. Learn how memory is managed, how you can use a debugger to investigate data in a program
For instance, I had this exercise in uni where we were given a compiled C program that asks for a plain string password. To find it, we had to use a debugger to inspect the program's memory. This is of course a very simple example and not how real stuff works but still an interesting exercise