If you learn Java or C++ you automatically have learned C. Besides the preprocessor and the linker. And... cough cough cough. C is not much used in the air space industries, besides what your "Aerospace engineer" thinks.
C programmers are not highly payed. Depending on region Java and C# developers are payed highest. E.g. in London area C# developers with banking/finance experience earn about $1000 per day. C developers in Europe not even make half of that. OTOH C# is not very popular in Germany, we mostly do Java here. So you also can earn good money with C# skills in Germany, about $750 a day. (Not popular means: traditionally not many projects were done in C#... now as those projects exist, the market has a serious demand for C# developers but they are not there)
(And honestly: why would anyone pay a C developer a premium price? C is a super simple language. It does not require particular skills)
and buffer overflows are usually trivial to prevent, and even actively search for possibilities Says the one who never programmed one?
If you only program in your small world then avoiding them is relatively simple. As you are AWARE that there could be a buffer overflow.
As soon as you have to treat data coming from the outside, that is a different matter. Most people are NOT AWARE that this here: /*
* Doc:
* buffer will be \0 terminated when read from disk
* buffer will be \rs terminated when read from network
* size will always be below 255 (max size 254)
*/ struct Data { int size; char* buffer; };
is a candidate for a buffer overflow (or other "corruptions") if you read said Data from a network or a file.
What kind of for loop are you writing after you read the "size" info and allocated "buffer = malloc(size)"?
Do you read "size" bytes, risking to not read enough and continue reading later at the wrong spot in the stream? Or do you read till "end of stream" (either \0 or \rs) hence reading to much and running over the buffer? Obviously you you have to check for both...
So first question in a CS course would be: "erm! why would I have to check for length/size and terminator? Why would they be different?"
You would wonder how many raised eyebrows it causes if you simply answer: "because the data you read was not written by you(your program)".
You see: people write the "write function" and the "read function"... and have tests for both. And they never come to the idea (by themselves) that they also have to be able to read data someone else has written to disk (with a different program).
So no: buffer overflows are not a simple thing to avoid. Because you have to jump out of the box of your mind.
Discipline and self control needs to be taught, or acquired by experience. Experience means making mistakes and learning from it, which bottom line means: you have to realize you made a mistake, or worse, someone has to point it out to you! No one wakes up in the morning after he had read "programming language X" manual and suddenly knows what kind of discipline and self control he needs to use to work in that language (with its libraries).
Knowing what a buffer overflow is and knowing how to program so that you avoid it, are two different things. Actually avoiding it is then again another matter, because you have to wake up in that situation and tell your self: "oh, this is actually a situation where a buffer overflow could occur!" (Or insert any other simple weakness)
It is much simpler and sane to delegate that problem to a library developer. Sometimes however you are the library and application developer in the same person.
Anyway, I rather use a language that "works" instead of C were you need "discipline" and "self control" and get blamed by others that you lack those character properties because yo made a simple bug which never had happened in a different language.
You know: most people would feel rather insulted if you tell them: "you lack discipline", "you lack self control" (even if it is true, lol, but we are not about to visit the anonymous alcoholics, or are we?)
and black box libraries they don't know what do behind the scenes.
That is exactly the point about a black box library. You should not need to know what is going on in it.
No, they don't need hand holding. If they needed to know what is going on in the black box: then they would need hand holding.
Unless you have read the most basic C manuals, you usually don't need to know how strlen() and strcpy() is implemented. Fortunately or unfortunately however they make good examples about the strength (the weakness is never mentioned) of C idioms.
Strlen and strcpy are (should be) just black boxes. And the relevant C++ str library functions are for me black boxes, I never looked at them. Why the funk should I?
(Funny: strlen and strcpy are in my dictionary, they are not red underlined... when did I do that?)
Attitudes like this are why people need a computer 600,000 times faster with 262144 times the memory in order to load something just to check their e-mail. I don't use Rust. I use Go Uh! You are hardcore! I use a Mail.app
start all these projects in Python and Java that have no place being written in an interpreted language. Care to point one out? For most people doing programming at home Python e.g. is an excellent language. And as you seem to live under a rock: Java is no longer interpreted, since u.. o... 1995 or so?
C never lost its place, and won't for the foreseeable future. For system programming it's not just unparalleled, it's often just simply indispensable. I guess you have a different idea what "system progaming" is than most people. System programming is not done in C since decades. You probably mean the remains of embedded programming where people are forced to use extremely small micro controllers for extremely simple tasks. The biggest "system programming" project that still is mostly done in C (instead of C++) is probably the linux kernel.
Computers are not people, they are electrical devices with bits and bytes, and sometimes you just need a language that embraces that rather than tries to hide it like its some dirty secret. True. But exaggerated. So I allowed myself to emphasize "sometimes" by making it bold. The last time I needed some bit fizzling in "Java" was when I wrote a SWEET16 emulator in Groovy. In other words: I work with Java since 1995... and more or less exclusively with Java (and other JVM languages) since roughly 2000. In that time I never was part of a commercial project where any line of code I wrote or glanced over needed a bit operation. With Java only having signed types, they are a pain in the ass anyway.
You do know that java byte code is only an interims representation and that the VM compiles the byte code to native code?
Bottom line I would expect Go and Java be equally fast... however benchmarks are always only measuring niche parts of a language.
Remember when people arguing against C++ claimed that virtual (member) functions where only half as fast as non virtual ones? They did their benchmarks with empty function bodies and and no function arguments. It turned out that the vtable dispatch and call of a virtual function costs about 1.7 the time of a direct call. As soon as you add a few parameters and have a function with a few lines of code, that speed difference drops down to an arbitrary low value close to 1.0.
Using more memory or more disk space is not inefficient. A la contrair: it is nearly always more speed efficient than using less.
The historic reason why people tried to use less memory and less disk space is simple: there was not more available. Bottom line it does not matter at all if you squeeze your smartness to put a data structure and the relevant algorithms into the smallest amount as possible (of memory and disk space) or if you rather use your smartness to develop a maintainable, extendable, scaling, multi threaded/multi session distributed algorithm. If you are smart enough you can do both, but most people for some odd reason believe that programmers focusing on the former are smarter than the ones focusing on the later.
I disagree.
Hint: load a small C program on various *nix systems. Then check how much swap space the tiny program occupies, then ponder why that varies from *nix system to system and then ponder more, why some *nix systems allocate a huge "process space" in the swap space while the program only needs a few megabytes (a few as in significantly below 10MB)
Do you even know how a device driver works? There is no fucking difference if I write a device driver in Python or Java, with the small pitfall that Java can not access memory directly (unless it uses unstable features or is on an embedded VM) so one would write a small JNI stub to do that, if one really wanted.
There are kernels written in Java or Modula 2, or Oberon or Eiffel.
The language has absolutely nothing to do with device drivers or kernels.
If you can not program, you shoot yourself into the foot with any language. Just because some people program in C does not make them smarter. IMHO most C programmers are actually not very smart, or they would go for a more interesting, better payed job where thy can put their smartness on the problem domain and not on the programming language.
Have you actually ever seen a "coding style" guideline for a majour C project? It consists to 95% out of "what not to do" and how to "do it instead". For that you usually have a compiler or Lint like tool, not a guidline and a code review about if the braces are put correctly or the constants in an "if (const == value)..." is always on the left side of the ==.
I have met idiots coming from C who demanded we do the same in Java... idiots, because it is brain dead to stick to habit without taking your brain and _think_
Anyway, if you love C so much and hate C++/Java/C# come to Germany... demand on stupid C embedded developers is big here.
But be prepared to get silly questions asked like: "how big is a char, short, int, long in C?" You would be surprised how many decade old C programmers can not answer this correctly.
My C career was relatively short. Programming around 1986/1987 on Apple 2's in Aztec C (which was K&R C, with manuals only in english and I was not that good in english at that time, considering that the vocabulary was centered around computer terms, which we never had in school). Took me nearly 2 month, probably longer, to realize that the C compiler does no real type checking at all and just compiled down what ever bollocks I had written. (It did not even have "prototypes", you annotated the types after the closing ")" of the function arguments and before the opening '{' of the function body, I have no idea (don't remember) if that was completely ignored or partly taken as a hint) Then again I started to study CS in 1987 and got immediately a job at the university as half Unix Admin and half C programmer. I basically only wrote one majour C program at that time. A GUI in SUN's OpenView for a Prolog program. Luckily that was a more advanced but still not ANSI C compiler (the sun compiler obviously, took still 4 or 5 years until most of the institutes switched to GNU C/C++). Anyway, in school I learned Pascal, at the university I convinced my Tutor that I already can Pascal and that I want to do my assignments in Modula 2 (on Macs). In private I switched immediately to C++ around 1989, realizing that C always only would be a "portable assembler" I avoided it where ever I could. Unfortunately again (besides Apple's C++ under MPW, the unix shell on Mac OS) I had to used a crippled version of C++ (no MI e.g.) called Think C, later bought by Symantec. Job wise I had shifted from "C programer" to unix admin, meanwhile. Funnily I rarely ever met a C programmer that was significantly better in C than I was (I am) with my mediocre experience.
If we only had a C++ compiler compiling to the JVM, I probably would still only use C++. So I'm now stuck in the Java/Scala/Groovy corner:D However the "programming model" in terms of H and Cpp files and linking etc. is quite archaic, and I prefer the concepts of Java, aka everything is a DLL, classpath, class loader real reflection over RTT... but I miss true MI and true templates and true operator overloading.
If you eat a western diet, you get 5 - 10 times the amount of salt you "need" without any need to use a salt shaker. The idea "I did not get enough salt" is utter nonsense, unless you live on a special diet and avoid every standard food you would get in a shop or restaurant.
It is even simpler. In the real world a specimem of bacteria does not livve alone, there are other bacteria around it. If one of them breaks up the long sugars, all of them can feed on on it.
Well, I explain it to you AGAIN: France is producing about 75% of its power with non CO2 producing means (60% nuclear, 15% wind,solar and water). Germany is producing about 52% of its power by non CO2 producing means (38% wind, solar, biomass and water 14% nuclear). So France has a chunk of 25% of its electricity produced by CO2 producing means and Germany a chunk of 48%. This is less than a factor of 2. Considering that France is using ages old coal plants as supplements and Germany brand new ones the difference is probably between 1.5 and 1.75.... this is far away from your proclaimed factor of ten.
Everyone with 2 brain cells had grasped that his information source is wrong and were not jumped on that wagon and posted this nonsense on/.
So: Germany does not produce electricity with ten times the CO2 production of France per kWh. If you believe otherwise: you are an idiot. Even if Germany would produce 100% of its electricity via coal/gas/oil it still would only be a factor of four!
I hope you are not working in a business where math skills or the lack there off costs life.
No, why would I? How many days/weeks would it take to assemble a SWAT team for a simple thing like a house hold hostage situation? The local police can handle that just fine, without Special Forces.
No idea why you are so hostile. Your link does not show what you think it does. The base URL of the PDF I linked is a good starting point for your research. But alas, as you seem to lazy, I look up for you a credible source of the weekly/daily wind production for 2016/2017. Will take a few days...
Exactly, Linux or macOS (OS X). However right now I consider to finally get a mobile WiFi box (a small WiFi enabled device with a SIM card to connect to cellular networks).
Every country with a working government and society has SWAT teams. But as the name originally suggested: Special Weapons And Tactics. Those are only needed in terrorist attacks, plane hijackings, or bank robberies with hostages. In a phone call like that, in Germany probably the next best police car having officers with wests would stop by.
No, they wouold not. First of all to 'manage' that you need pranxters that call for SWATs on police families. Most likely that would imediatly ring bells. If not and a few officers shoot family members of other officers, they simply put out a new law: death penalty to pranxters that cause a death.
Well, I lost track about what we are talking. The web site you link is not showing the day by day wind production. It shows two selected grid operators and how much wind/solar they feed into their grids. That has absolutely nothing to do with the amount of wind/solar power is fed into the whole german grid. So no idea about what you want to talk.
And you want to push a nonsense agenda and are not even aboe to read the link you sent. THAT LINK ACTUALLY SHOWS A HEALTHY DIET. And not the nonnsense diets comming from the US we were talking about.
Well,
joking aside there is a quite complete and portable Pascal: https://www.freepascal.org/
If you learn Java or C++ you automatically have learned C. Besides the preprocessor and the linker. ... cough cough cough. C is not much used in the air space industries, besides what your "Aerospace engineer" thinks.
And
C programmers are not highly payed. ... now as those projects exist, the market has a serious demand for C# developers but they are not there)
Depending on region Java and C# developers are payed highest.
E.g. in London area C# developers with banking/finance experience earn about $1000 per day.
C developers in Europe not even make half of that.
OTOH C# is not very popular in Germany, we mostly do Java here. So you also can earn good money with C# skills in Germany, about $750 a day. (Not popular means: traditionally not many projects were done in C#
(And honestly: why would anyone pay a C developer a premium price? C is a super simple language. It does not require particular skills)
and buffer overflows are usually trivial to prevent, and even actively search for possibilities
Says the one who never programmed one?
If you only program in your small world then avoiding them is relatively simple. As you are AWARE that there could be a buffer overflow.
As soon as you have to treat data coming from the outside, that is a different matter. Most people are NOT AWARE that this here:
/*
* Doc:
* buffer will be \0 terminated when read from disk
* buffer will be \rs terminated when read from network
* size will always be below 255 (max size 254)
*/
struct Data {
int size;
char* buffer;
};
is a candidate for a buffer overflow (or other "corruptions") if you read said Data from a network or a file.
What kind of for loop are you writing after you read the "size" info and allocated "buffer = malloc(size)"?
Do you read "size" bytes, risking to not read enough and continue reading later at the wrong spot in the stream? Or do you read till "end of stream" (either \0 or \rs) hence reading to much and running over the buffer? Obviously you you have to check for both ...
So first question in a CS course would be: "erm! why would I have to check for length/size and terminator? Why would they be different?"
You would wonder how many raised eyebrows it causes if you simply answer: "because the data you read was not written by you(your program)".
You see: people write the "write function" and the "read function" ... and have tests for both. And they never come to the idea (by themselves) that they also have to be able to read data someone else has written to disk (with a different program).
So no: buffer overflows are not a simple thing to avoid. Because you have to jump out of the box of your mind.
Discipline and self control needs to be taught, or acquired by experience. Experience means making mistakes and learning from it, which bottom line means: you have to realize you made a mistake, or worse, someone has to point it out to you!
No one wakes up in the morning after he had read "programming language X" manual and suddenly knows what kind of discipline and self control he needs to use to work in that language (with its libraries).
Knowing what a buffer overflow is and knowing how to program so that you avoid it, are two different things. Actually avoiding it is then again another matter, because you have to wake up in that situation and tell your self: "oh, this is actually a situation where a buffer overflow could occur!" (Or insert any other simple weakness)
It is much simpler and sane to delegate that problem to a library developer. Sometimes however you are the library and application developer in the same person.
Anyway, I rather use a language that "works" instead of C were you need "discipline" and "self control" and get blamed by others that you lack those character properties because yo made a simple bug which never had happened in a different language.
You know: most people would feel rather insulted if you tell them: "you lack discipline", "you lack self control" (even if it is true, lol, but we are not about to visit the anonymous alcoholics, or are we?)
Hypocrite much?
and black box libraries they don't know what do behind the scenes.
That is exactly the point about a black box library. You should not need to know what is going on in it.
No, they don't need hand holding. If they needed to know what is going on in the black box: then they would need hand holding.
Unless you have read the most basic C manuals, you usually don't need to know how strlen() and strcpy() is implemented. Fortunately or unfortunately however they make good examples about the strength (the weakness is never mentioned) of C idioms.
Strlen and strcpy are (should be) just black boxes. And the relevant C++ str library functions are for me black boxes, I never looked at them. Why the funk should I?
(Funny: strlen and strcpy are in my dictionary, they are not red underlined ... when did I do that?)
Attitudes like this are why people need a computer 600,000 times faster with 262144 times the memory in order to load something just to check their e-mail. I don't use Rust. I use Go
Uh! You are hardcore!
I use a Mail.app
start all these projects in Python and Java that have no place being written in an interpreted language. .. o ... 1995 or so?
Care to point one out?
For most people doing programming at home Python e.g. is an excellent language.
And as you seem to live under a rock: Java is no longer interpreted, since u
C never lost its place, and won't for the foreseeable future. For system programming it's not just unparalleled, it's often just simply indispensable.
I guess you have a different idea what "system progaming" is than most people. System programming is not done in C since decades. You probably mean the remains of embedded programming where people are forced to use extremely small micro controllers for extremely simple tasks. The biggest "system programming" project that still is mostly done in C (instead of C++) is probably the linux kernel.
Computers are not people, they are electrical devices with bits and bytes, and sometimes you just need a language that embraces that rather than tries to hide it like its some dirty secret. ... and more or less exclusively with Java (and other JVM languages) since roughly 2000. In that time I never was part of a commercial project where any line of code I wrote or glanced over needed a bit operation. With Java only having signed types, they are a pain in the ass anyway.
True. But exaggerated. So I allowed myself to emphasize "sometimes" by making it bold.
The last time I needed some bit fizzling in "Java" was when I wrote a SWEET16 emulator in Groovy. In other words: I work with Java since 1995
You do know that java byte code is only an interims representation and that the VM compiles the byte code to native code?
Bottom line I would expect Go and Java be equally fast ... however benchmarks are always only measuring niche parts of a language.
Remember when people arguing against C++ claimed that virtual (member) functions where only half as fast as non virtual ones? They did their benchmarks with empty function bodies and and no function arguments. It turned out that the vtable dispatch and call of a virtual function costs about 1.7 the time of a direct call. As soon as you add a few parameters and have a function with a few lines of code, that speed difference drops down to an arbitrary low value close to 1.0.
There is no reason a driver written in Go is slower than one written in C/C++, and the same is true for kernels.
Using more memory or more disk space is not inefficient.
A la contrair: it is nearly always more speed efficient than using less.
The historic reason why people tried to use less memory and less disk space is simple: there was not more available. Bottom line it does not matter at all if you squeeze your smartness to put a data structure and the relevant algorithms into the smallest amount as possible (of memory and disk space) or if you rather use your smartness to develop a maintainable, extendable, scaling, multi threaded/multi session distributed algorithm. If you are smart enough you can do both, but most people for some odd reason believe that programmers focusing on the former are smarter than the ones focusing on the later.
I disagree.
Hint: load a small C program on various *nix systems. Then check how much swap space the tiny program occupies, then ponder why that varies from *nix system to system and then ponder more, why some *nix systems allocate a huge "process space" in the swap space while the program only needs a few megabytes (a few as in significantly below 10MB)
And what exactly did you want to say?
Do you even know how a device driver works? There is no fucking difference if I write a device driver in Python or Java, with the small pitfall that Java can not access memory directly (unless it uses unstable features or is on an embedded VM) so one would write a small JNI stub to do that, if one really wanted.
There are kernels written in Java or Modula 2, or Oberon or Eiffel.
The language has absolutely nothing to do with device drivers or kernels.
If you can not program, you shoot yourself into the foot with any language. Just because some people program in C does not make them smarter. IMHO most C programmers are actually not very smart, or they would go for a more interesting, better payed job where thy can put their smartness on the problem domain and not on the programming language.
Have you actually ever seen a "coding style" guideline for a majour C project? It consists to 95% out of "what not to do" and how to "do it instead". For that you usually have a compiler or Lint like tool, not a guidline and a code review about if the braces are put correctly or the constants in an "if (const == value) ..." is always on the left side of the ==.
I have met idiots coming from C who demanded we do the same in Java ... idiots, because it is brain dead to stick to habit without taking your brain and _think_
Anyway, if you love C so much and hate C++/Java/C# come to Germany ... demand on stupid C embedded developers is big here.
But be prepared to get silly questions asked like: "how big is a char, short, int, long in C?"
You would be surprised how many decade old C programmers can not answer this correctly.
My C career was relatively short.
Programming around 1986/1987 on Apple 2's in Aztec C (which was K&R C, with manuals only in english and I was not that good in english at that time, considering that the vocabulary was centered around computer terms, which we never had in school).
Took me nearly 2 month, probably longer, to realize that the C compiler does no real type checking at all and just compiled down what ever bollocks I had written. (It did not even have "prototypes", you annotated the types after the closing ")" of the function arguments and before the opening '{' of the function body, I have no idea (don't remember) if that was completely ignored or partly taken as a hint)
Then again I started to study CS in 1987 and got immediately a job at the university as half Unix Admin and half C programmer. I basically only wrote one majour C program at that time. A GUI in SUN's OpenView for a Prolog program.
Luckily that was a more advanced but still not ANSI C compiler (the sun compiler obviously, took still 4 or 5 years until most of the institutes switched to GNU C/C++).
Anyway, in school I learned Pascal, at the university I convinced my Tutor that I already can Pascal and that I want to do my assignments in Modula 2 (on Macs).
In private I switched immediately to C++ around 1989, realizing that C always only would be a "portable assembler" I avoided it where ever I could. Unfortunately again (besides Apple's C++ under MPW, the unix shell on Mac OS) I had to used a crippled version of C++ (no MI e.g.) called Think C, later bought by Symantec. Job wise I had shifted from "C programer" to unix admin, meanwhile.
Funnily I rarely ever met a C programmer that was significantly better in C than I was (I am) with my mediocre experience.
If we only had a C++ compiler compiling to the JVM, I probably would still only use C++. So I'm now stuck in the Java/Scala/Groovy corner :D ... but I miss true MI and true templates and true operator overloading.
However the "programming model" in terms of H and Cpp files and linking etc. is quite archaic, and I prefer the concepts of Java, aka everything is a DLL, classpath, class loader real reflection over RTT
In most C projects 80% of the code is for testing.
No idea in what world you live.
If you eat a western diet, you get 5 - 10 times the amount of salt you "need" without any need to use a salt shaker.
The idea "I did not get enough salt" is utter nonsense, unless you live on a special diet and avoid every standard food you would get in a shop or restaurant.
It is even simpler.
In the real world a specimem of bacteria does not livve alone, there are other bacteria around it.
If one of them breaks up the long sugars, all of them can feed on on it.
That in case of infecctions 60% of the involved die is nonsense,
Not even lung pneumona has such a high death rate.
Well, ,solar and water). .... this is far away from your proclaimed factor of ten.
I explain it to you AGAIN:
France is producing about 75% of its power with non CO2 producing means (60% nuclear, 15% wind
Germany is producing about 52% of its power by non CO2 producing means (38% wind, solar, biomass and water 14% nuclear).
So France has a chunk of 25% of its electricity produced by CO2 producing means and Germany a chunk of 48%.
This is less than a factor of 2. Considering that France is using ages old coal plants as supplements and Germany brand new ones the difference is probably between 1.5 and 1.75
Everyone with 2 brain cells had grasped that his information source is wrong and were not jumped on that wagon and posted this nonsense on /.
So: Germany does not produce electricity with ten times the CO2 production of France per kWh. If you believe otherwise: you are an idiot. Even if Germany would produce 100% of its electricity via coal/gas/oil it still would only be a factor of four!
I hope you are not working in a business where math skills or the lack there off costs life.
No, why would I?
How many days/weeks would it take to assemble a SWAT team for a simple thing like a house hold hostage situation?
The local police can handle that just fine, without Special Forces.
No idea why you are so hostile. ...
Your link does not show what you think it does.
The base URL of the PDF I linked is a good starting point for your research.
But alas, as you seem to lazy, I look up for you a credible source of the weekly/daily wind production for 2016/2017.
Will take a few days
Exactly, Linux or macOS (OS X).
However right now I consider to finally get a mobile WiFi box (a small WiFi enabled device with a SIM card to connect to cellular networks).
Every country with a working government and society has SWAT teams.
But as the name originally suggested: Special Weapons And Tactics. Those are only needed in terrorist attacks, plane hijackings, or bank robberies with hostages.
In a phone call like that, in Germany probably the next best police car having officers with wests would stop by.
No, they wouold not.
First of all to 'manage' that you need pranxters that call for SWATs on police families. Most likely that would imediatly ring bells. If not and a few officers shoot family members of other officers, they simply put out a new law: death penalty to pranxters that cause a death.
iOS is run by ARM.
Half of Android is.
Rasbery Pi are run on ARM.
Well,
I lost track about what we are talking.
The web site you link is not showing the day by day wind production. It shows two selected grid operators and how much wind/solar they feed into their grids. That has absolutely nothing to do with the amount of wind/solar power is fed into the whole german grid.
So no idea about what you want to talk.
Fraunhover is a good starting point to get informations about german grid(s): https://www.ise.fraunhofer.de/...
And you want to push a nonsense agenda and are not even aboe to read the link you sent.
THAT LINK ACTUALLY SHOWS A HEALTHY DIET. And not the nonnsense diets comming from the US we were talking about.