|
You last visited: Today at 08:58
Advertisement
Learn the C with Shodan
Discussion on Learn the C with Shodan within the C/C++ forum part of the Coders Den category.
04/26/2017, 23:49
|
#1
|
elite*gold: 0
Join Date: Apr 2017
Posts: 2
Received Thanks: 4
|
Learn the C with Shodan
Hello, many poeple asked me before about C, it is hard to learn or not ? hmm seriously if you dont like the simplicity it will be easy to learn if you are motivated, anyways, just let me know if you want some easy/simple/medium/hard exercise.
Regards
|
|
|
09/06/2017, 23:35
|
#2
|
elite*gold: 0
Join Date: Aug 2013
Posts: 65
Received Thanks: 16
|
Dont learn "programming languages" per se. Learn programming. When you start study programming for real, you will soon realise all languages are 99% the same. All have if statements, loops, booleans etc. What changes is the paradigm for example, java is more used for object oriented type of problems. While C is used for dealing with imperative programming, which means its easier to use it on lower level problems like operative systems.
But that doesnt mean you cant use C to object oriented, it's just harder.
What you should do is first learn the concept of what programming is, then I recommend python to beginners, because it's such an easy language and yet so powerful.
|
|
|
09/07/2017, 11:28
|
#3
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
|
Quote:
Originally Posted by rokkialo23
Dont learn "programming languages" per se. Learn programming. When you start study programming for real, you will soon realise all languages are 99% the same. All have if statements, loops, booleans etc.
|
This is only true if you don't count any functional or logical programming languages. As soon as you are using Haskell, all your knowledge about C or Java is just useless.
Quote:
|
What changes is the paradigm for example, java is more used for object oriented type of problems. While C is used for dealing with imperative programming, which means its easier to use it on lower level problems like operative systems.
|
First a programming language has multiple paradigms, not only one. Second you mixed up the terminology. Both, Java and C, are imperative, Java is Object oriented while C is procedural. And lastly, C is used for low level problems, because it is a compiled language which can be used to optimize very well, which is partly due to its paradigms (not so different from machine code) but mostly due to the fact that it is a compiled language. You can also use C++ to write an operating System, or Pascal, Ada, D, and so on, while in Java it's completely impossible.
Quote:
|
But that doesnt mean you cant use C to object oriented, it's just harder.
|
There is no OOP in C. You can Simulate objects in C, but that due to the turing completeness of C. You can also simulate objects in SQL, because SQL is also turing complete, same for Brainfuck. But neither SQL nor Brainfuck nor C are OOP.
Quote:
|
What you should do is first learn the concept of what programming is, then I recommend python to beginners, because it's such an easy language and yet so powerful.
|
C isn't hard either. You can start with any language you like, in my opinion there is no hard or easy language, there are only different learning curves. If you are an impatient person, who want to have great results after a short period of time, you are right, Python might be better fitted than C, but if you are patient enough, you can also start of with C, it might take a little longer till you can write the great software you like (even so I don't think anyone who does not want to build hardware based software should start learning C, this language just sucks)
|
|
|
09/07/2017, 17:35
|
#4
|
elite*gold: 0
Join Date: May 2015
Posts: 700
Received Thanks: 444
|
Quote:
|
There is no OOP in C. You can Simulate objects in C, but that due to the turing completeness of C. You can also simulate objects in SQL, because SQL is also turing complete, same for Brainfuck. But neither SQL nor Brainfuck nor C are OOP.
|
What he probably wants to say is that OOP is not just possible in C in theory, but also practical enough to be used by huge real world applications (e.g. GNOME, GTK, Gimp).
As long as you can't name real world applications that simulate OO in SQL or Brainfuck, I'd say that your comparison is unfair.
|
|
|
09/07/2017, 19:01
|
#5
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
|
Quote:
Originally Posted by algernong
What he probably wants to say is that OOP is not just possible in C in theory, but also practical enough to be used by huge real world applications (e.g. GNOME, GTK, Gimp).
As long as you can't name real world applications that simulate OO in SQL or Brainfuck, I'd say that your comparison is unfair.
|
Well not really, the examples you gave are standard procedural programming like it exsisted since Algol and therefore is older than the oop idea. but the core essence of oop is the binding of functionality to the dataset, which is not in the means of C.
|
|
|
09/09/2017, 15:00
|
#6
|
elite*gold: 0
Join Date: Aug 2013
Posts: 65
Received Thanks: 16
|
You can do object oriented in assembly boy. You can do object oriented with a turing machine. How can I dont do it with C? It's just harder boy.
|
|
|
09/09/2017, 16:10
|
#7
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
|
Quote:
Originally Posted by rokkialo23
You can do object oriented in assembly boy. You can do object oriented with a turing machine. How can I dont do it with C? It's just harder boy.
|
No, you seem to have a clear misunderstanding what OOP means. It's true, that a truing complete language can simulate any other Turing complete language, therefore you can simulate OOP in C. But the key word is to simulate. OOP is a language paradigm, which describes the composition of datatypes with functionality. A language either has this paradigm or not. Like the english language can express the same as the Japanese, this doesn't mean that the Japanese gramma can be used within an english sentence.
A turing machine doesn't support different Types, as the working alphabet is a single Set. You can simulate types, but you will never have a type system in a turing machine.
This is the difference between equivalence and equality. The means might be equivalent as they both are Turing complete, but not equal, as there is clearly no OOP in C.
|
|
|
09/09/2017, 17:03
|
#8
|
elite*gold: 0
Join Date: Aug 2013
Posts: 65
Received Thanks: 16
|
Quote:
Originally Posted by warfley
No, you seem to have a clear misunderstanding what OOP means. It's true, that a truing complete language can simulate any other Turing complete language, therefore you can simulate OOP in C. But the key word is to simulate. OOP is a language paradigm, which describes the composition of datatypes with functionality. A language either has this paradigm or not. Like the english language can express the same as the Japanese, this doesn't mean that the Japanese gramma can be used within an english sentence.
A turing machine doesn't support different Types, as the working alphabet is a single Set. You can simulate types, but you will never have a type system in a turing machine.
This is the difference between equivalence and equality. The means might be equivalent as they both are Turing complete, but not equal, as there is clearly no OOP in C.
|
The alphabet of a turing machine is a single set I agree.
But in a set you can include other sets. {{..},{--}} See this is only one set, including two sets.
|
|
|
09/09/2017, 18:42
|
#9
|
elite*gold: 0
Join Date: May 2015
Posts: 700
Received Thanks: 444
|
Quote:
Originally Posted by warfley
Well not really, the examples you gave are standard procedural programming like it exsisted since Algol and therefore is older than the oop idea. but the core essence of oop is the binding of functionality to the dataset, which is not in the means of C.
|
Yet it is practical to write code in C that is object oriented. It is not practical to do the same in SQL or your other analogies.
|
|
|
09/10/2017, 15:36
|
#10
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
|
Quote:
Originally Posted by algernong
Yet it is practical to write code in C that is object oriented. It is not practical to do the same in SQL or your other analogies.
|
I still don't know what you mean with object oriented code in C.
The typical procedural coding style since user defined types (so since Algol) is something like this:
Code:
typedef struct { ... } Datastruct;
typedef Datastruct* PDatastruct;
int foo(const PDatastruct dataRef, otherparams) {
if (!dataRef) return -1; // invalid dataset
// Do something with dataRef as dataset
}
And inheritance was realized using prefixes in structs:
Code:
typedef struct { ... } ParentStruct;
typedef { ParentStruct prefix; ... } MyStruct;
or using unions:
Code:
typedef struct { ...; union { ... } childElements } MyStruct
This was long before the idea of OOP even existed. Than some day, some developer thought: It's pretty stupid to always need to add an extra param for a data reference, and the need to check if it's nil. Also inheritance using prefixes or unions is pretty confusing, and increases the chances of errors. So why not letting the compiler do it for you.
And with this the idea of OOP was born, which got first really implemented in Smalltalk.
So calling the old procedural style OOP is like calling a caterpillar a butterfly, as the essential development, which is the least required minimum to be called that, is missing.
Otherwise, what is the point in discriminating between procedural and OOP style, as, if you can call the old style OOP, this would be the same.
Quote:
Originally Posted by rokkialo23
The alphabet of a turing machine is a single set I agree.
But in a set you can include other sets. {{..},{--}} See this is only one set, including two sets.
|
Yeah but than you still have only one type, the type of the Set. The big point of types is, that many different types are just a substitution for different types. Take for example char and bytes. 'A' == 65. This is in a Turing machine not directly possible, as a Set can't hold 2 equal values (by definition). This can be simulated, using a substitution rule, but than it's still the equality <> equivalence problem
|
|
|
09/10/2017, 16:15
|
#11
|
elite*gold: 0
Join Date: Aug 2013
Posts: 65
Received Thanks: 16
|
I dont understand, the guy who programmed java had to program it in some language (I assume C), the code that was able to programa Java can be translated to direct machine commands (assembly) and any program can be translated into a turing machine.
If I get a simple inheritance program, lets say class geometric figure includes class triangle and class circle (example) that is the OOP paradigm, and i can translate that into c and in turn into assembly, and into a turing machine. How can it not be able to do OOP paradigm in c?
|
|
|
09/10/2017, 17:03
|
#12
|
elite*gold: 46
Join Date: Oct 2010
Posts: 782
Received Thanks: 525
|
Quote:
Originally Posted by rokkialo23
I dont understand, the guy who programmed java had to program it in some language (I assume C), the code that was able to programa Java can be translated to direct machine commands (assembly) and any program can be translated into a turing machine.
If I get a simple inheritance program, lets say class geometric figure includes class triangle and class circle (example) that is the OOP paradigm, and i can translate that into c and in turn into assembly, and into a turing machine. How can it not be able to do OOP paradigm in c?
|
Of course you can simulate OOP (or any other paradigm) in any language. The point warfley tried to make is that some languages support OOP out of the box and have special syntax and what not for OOP (and those are the language you should call OOP languages). Other languages (like C) dont have stuff like inheritance or interfaces (but you can still simulate that). If we all would use your argument, then any language would fit all paradigms. Haskell would then be a OOP language, because Haskell eventually gets lowered to machine code and thats turing complete and thus haskell must be an OOP language (hint: haskell actually isn't a OOP language).
|
|
|
09/10/2017, 17:33
|
#13
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
|
Quote:
Originally Posted by rokkialo23
I dont understand, the guy who programmed java had to program it in some language (I assume C), the code that was able to programa Java can be translated to direct machine commands (assembly) and any program can be translated into a turing machine.
If I get a simple inheritance program, lets say class geometric figure includes class triangle and class circle (example) that is the OOP paradigm, and i can translate that into c and in turn into assembly, and into a turing machine. How can it not be able to do OOP paradigm in c?
|
A language paradigm has nothing to do with the result, it's about getting to the result. Only because you can either walk to the grocery store, or take the car, this doesn't mean walking equals driving.
As I said the key word is simulation. If i start the iPhone simulator from within xCode, I can test apps like on an iPhone, but my Mac is still a Mac, and not an iPhone.
When you are talking about OOP, procedural programming, or logic programming, you are not talking about the programs you write, but the grammar of the language you are using. Like I said, the english and the Japanese language can both express the same, both can be used to describe an object, or to guide you a path. But the english grammar still differs vastly from the Japanese, and using the Japanese grammar to build an english sentence can not work.
And thats why there are two different words for this, on the one hand we have the equivalence, which describes the relationship between two objects that share some of the same attributes. For example if you take the modulo to 2 from every number, each even number will result to 0, each odd to 1. Therefore you can say every even number is equivalent regarding the modulo to 2, same for each odd number. Regarding languages you can say, if you categorize them by power, each Turing complete language is equivalent regarding the power. But you can also categorize to Operating systems they run on, than every language you can compile for windows would be equivalent.
On the other hand is the equality, a special type of equivalence, which describes if two objects are the same. So you could the the equivalence regarding every possible attribute.
And saying that Assembly is OOP would be true if Assembly and for example Java would be equal. But they are only equivalent regarding Power. Regarding for example their paradigms they are not equivalent.
|
|
|
09/10/2017, 17:44
|
#14
|
elite*gold: 0
Join Date: Aug 2013
Posts: 65
Received Thanks: 16
|
Thanks for explaining. I understand now.
|
|
|
09/10/2017, 23:55
|
#15
|
elite*gold: 0
Join Date: May 2015
Posts: 700
Received Thanks: 444
|
Quote:
Originally Posted by warfley
I still don't know what you mean with object oriented code in C.
The typical procedural coding style since user defined types (so since Algol) is something like this:
Code:
typedef struct { ... } Datastruct;
typedef Datastruct* PDatastruct;
int foo(const PDatastruct dataRef, otherparams) {
if (!dataRef) return -1; // invalid dataset
// Do something with dataRef as dataset
}
And inheritance was realized using prefixes in structs:
Code:
typedef struct { ... } ParentStruct;
typedef { ParentStruct prefix; ... } MyStruct;
or using unions:
Code:
typedef struct { ...; union { ... } childElements } MyStruct
This was long before the idea of OOP even existed. Than some day, some developer thought: It's pretty stupid to always need to add an extra param for a data reference, and the need to check if it's nil. Also inheritance using prefixes or unions is pretty confusing, and increases the chances of errors. So why not letting the compiler do it for you.
And with this the idea of OOP was born, which got first really implemented in Smalltalk.
So calling the old procedural style OOP is like calling a caterpillar a butterfly, as the essential development, which is the least required minimum to be called that, is missing.
Otherwise, what is the point in discriminating between procedural and OOP style, as, if you can call the old style OOP, this would be the same.
|
I'm writing from the following stance: OOP (or programming paradigms in general) isn't about syntax or language features, but how we organize and design code.
This stance seems to be right:
Quote:
A programming paradigm is a style, or “way,” of programming.
Never use the phrase “programming language paradigm.”
A paradigm is a way of doing something (like programming), not a concrete thing (like a language). Now, it’s true that if a programming language L happens to make a particular programming paradigm P easy to express, then we often say “L is a P language” (e.g. “Haskell is a functional programming language”) but that does not mean there is any such thing as a “functional language paradigm”.
|
Quote:
Programming paradigm (in this course)
A pattern that serves as a school of thoughts for programming of computers
|
With this in mind, object oriented code is independent from the language it is written in. OOP languages like Java offer syntactical sugar to explicitly support the OO paradigm. This, however, doesn't mean that every Java code is object oriented.
Oder explizit nochmal:
Quote:
|
This was long before the idea of OOP even existed. Than some day, some developer thought: It's pretty stupid to always need to add an extra param for a data reference, and the need to check if it's nil. Also inheritance using prefixes or unions is pretty confusing, and increases the chances of errors. So why not letting the compiler do it for you.
|
Das ist doch quasi die Definition von Syntax Zucker und hat nichts mit irgendwelchen Paradigmen zu tun. Zuerst kommt das Paradigma, dann die Sprache, mit der man das komfortabler anwenden kann.
|
|
|
 |
|
Similar Threads
|
[Selling] learn 2 learn (Kurs)
08/24/2015 - Trading - 1 Replies
Hey,
da in vielen Teilen Deutschlands langsam wieder die Schulzeit beginnt (und ich das heute erfahren durfte), damit auch die Lernezeit wieder beginnt, wollte ich euch folgendes Vorstellen.
Und zwar ist das Lernen heute überall notwendig. Vom Leben als Schüler, zum Auszubildenden oder Studenten, bis hin zum Beruf -überall muss gerlernt werden.
Meistens ist es aber dann so, dass es schwer ist, die ganzen Infos in seinen Schädel zu bekommen.
Dafür ist dieser Kurs. Ich bin...
|
How to use/work with shodan ?
07/24/2015 - Off Topic - 4 Replies
Hallo epvp,
Ich bin mir nicht sicher in welchem Forum genau ich diese Frage nun stellen sollte, deshalb mach ich es einfach mal hier. Und zwar wollte ich fragen, ob mir jemand erklären kann wie ich mit shodan arbeiten kann, sprich Kameras etc. finden und "hacken". Wäre lieb wenn ihr mich auf Skype adden könntet und mir das dort erklären könntet.
Skype: der.bozz66
MfG
-_-BoZz-_-
|
All times are GMT +1. The time now is 08:59.
|
|