Most degrees are useful, some just require you to be really good at the field. The problem is that said philosopher was more mediocre, otherwise he would not have had the problem. There are professors of philosophy around, and they make a decent living. But if there is a need for 10 new professors of philosophy every year, and about the same number of good positions in the industry for these people, and you have 10000 students each year of which most are not very good, because being good at philosophy is actually pretty damn hard and requires a very specific talent, then anybody with a basic grasp of numbers can see where the problem is.
Incidentally, on a different scale, we have the same problem with all the CS and related degrees: This is a very hard field and most people with a degree are not really any good at it. Hence, for example, most coders do not earn well, have bad job security and it gets worse when they get older (and have failed to stay current). As soon as you look at the small group of people that _are_ good at it though, you find that they do not really have all those problems, but can select what they want to work on and are paid well. Of course, because they are in a small sub-market, finding a job can take a bit (same for those that want to hire them), but that is to be expected.
The overall problem is that the modern information society cannot distribute its wealth by the "work" metric anymore for most of its members, because the work these people can do has not much worth anymore and, in the long run, will have no with at all anymore. Of course there are a lot of people that put their hand in the sand about this, despite it being glaringly obvious. The longer this goes on, the more painful the eventual adjustment will be.
A yes, the mindset where it is always somebody else that is at fault. Being a victim is so much more comfortable than looking for what oneself has done wrong and changing things for the better. Instead one can lie back and expect "society" to care for one, because one is a victim and deserves that, no need to change anything in ones failed approaches or even re-evaluates ones view of the world.
The problem with this parasitic mind-set is that it stops working when there are more than a few thinking this way.
And talk about the low expectations people apparently have of themselves these days. No wonder almost nobody is willing to go though a stressful and demanding education. And the education offers adapt to the customers as a result.
The modern work environment cannot reward hard work, because the type of work you can work hard at and increase productivity by that does not have a lot of worth anymore. The type of work that is actually valuable stops increasing in productivity around 30-40 hours a week, and productivity per week _drops_ after that. This has, incidentally, been known since the time of Henry Ford, since he and others at that time did research into how to get the most productivity out of their workers in order to maximize profits. Turns out that this peak is pretty much at 8h/day for 5 days of the week for manual labor and 6h/day for 5 days a week for mental work. For some types of mental work that requires a lot of insight, it is even lower. Now the really astonishing thing (at that time) is that if you work more, you produce less value _overall_. And the other astonishing thing is that the modern corporate world thinks these results are somehow not valid anymore, despite human nature not having changed much (if at all). This utter stupidity sucks the productivity right out of people.
Hence it is absolutely no surprise that you are getting nowhere at 70h per week. You have terrible efficiency and your time is not worth much per hour.
Actually, working hard has not cut it for quite some time. If you do not work smart, you will not get anywhere. As a compensation, if you manage to work smart (most do not), you can work less hard than you used to need to for the same outcome. If you just work hard these days, you will work yourself into the ground and then be replaced by a machine or some person that is willing to do the same even cheaper.
The reality is that 50 years ago, there were vast numbers of jobs that any idiot could do, and thanks to the new deal and unions, those jobs paid well enough to live on.
Well yes. Society has failed to adjust sufficiently to changes circumstances. The only ones to blame for that are the individuals that have failed to realize that however. It is not a surprise in any way that modern society requires far more insight, education and flexibility from its members than it used to. It is what was predicted and did constantly happen since the start of the industrial age. It was extremely obvious. Yet droves of people chose to be intellectually lazy and just expected to float on hard work by others. That does not work when more than a smaller minority does it. What it does though, is that it creates a lower-class of people that will never get anywhere in life. A lower-class that has absolutely no understanding that, as a class (not individually), it created its current situation by itself. And a class that falls for the first demagogue that tells it that others are at fault.
Now Trump cannot actually make things much worse or much better. He has far less influence on things than he thinks and massively less influence than he claims to have. The processes that can make things better or worse are running in the multiple decades for significant changes. The only thing Trump can to is prevent the stupid from seeing reality for a few more years and that delays fixing anything for those additional years, making the lower-class just a bit larger and the problem just a bit less solvable. I do believe however that Hillary would have done just the same, likely with a little less catering to the stupid, the angry and the arrogant. The difference would not have mattered much. The US presidential election was lost for basically everybody as soon as the candidates were selected.
Indeed. They let themselves believe the lies, because then they could just be angry at others and never even start to find fault with themselves. Hence absolutely nothing will get better. If people stop striving to better themselves, then a country dies. Whether that is because they have stopped to realize that in the end it is up to them and demanding things never has made them magically materialize, or whether it is because improving their education and skills does not pay off anymore, because the rich have taken over and are preventing most others from getting anywhere. The sad thing is that the people that voted for Trump are mostly the same people that would have badly needed an entirely different candidate.
Now, a large part of the reason Trump got into power is of course the really bad alternative. But it is highly telling of the overall failure of society that these two really bad candidates ever got to be candidates. And it is highly telling who actually expects Trump to make things better for them, despite extreme indicators to the contrary. The average person understands almost nothing. Add bad education, arrogance and a culture of blaming it on others and you have a catastrophe in progress.
If you expect a general string-copy function in a language like C that does not really have native strings, but just a convention in the native libraries, than the problem is in your side. Incidentally, if you expect a "strNcpy" to be general, then there is an even bigger problem on your side, as there is no way to generically shorten a string to a given length. There is always a range to chose from. What you probably want is strdup(), which indeed does copy any string, but it does not copy into a provided bufferer, which is the whole point of the str*cpy functions.
Seriously, C is not a beginners language. Go play with Java or the like and stop complaining about things you do not understand.
The design of strncpy is not bad, it is specialized. This is not a function to be used for every case of a string copy. Now, the only thing you could accuse strncpy realistically of is bloating the API. But the C string API is small enough for that to not really matter.
It is a poor manager who hires incompetent coders in the first place and it is a poor coder who is incompetent.
You do not "fix" coders. You let those that can do it well do their thing and tell the other to stay the hell away from it. Poor coders have negative productivity and there are a lot of them around. That needs to stop.
Attempts to "fix" the problem by fudging the buffer and setting characters are just asking for fencepost errors. Not to mention the performance penalty for needlessly zeroing out any empty space after the string.
No, they are not. They are what you do if you are competent. There is no "fudging" here, just sound practices. This is however C not Java, so do not expect a nice verbose safety net. Your proposal of "copyTeminatedStringTo_UNTERMINATED_memoryBuffer()" already shows that you may know some C, but you do not get it at all. For starters, the first part of the name is wrong as strncpy can and will be used to copy non-terminated strings. Also, the termination is never the task of a buffer, so the second part of the name is just as wrong. Please leave and go to your walled garden where everything is safe an nice (and a slow memory-hog), we real coders have work to do.
It is the "Silver Bullet" mindset. Its proponents think that if they just had the right magic tool, all problems would go away. Well, Brooks published "No Silver Bullet" in 1986, and these people are not only clueless and incompetent, they are unaware of history. This is just as true today as it was back then. There is no silver bullet, no magic language or tool that will ever make a wannabe a competent engineer. On the other hand, competent engineers can be slowed down by sub-optimal tools, but that is about it.
For any competent coder that understands how the machine actually works, this is a very reasonable assumption. And, in addition, it is documented in the second sentence describing srtncpy in the man-page under Linux, for example. How this can be called "hidden" or even a "gotcha" is beyond me. Of course there is this one large class of incompetents where it is always somebody else's fault.
" Warning: If there is no null byte among the first n bytes of src, the string placed in dest will not be null-terminated."
If you think they are "hidden", then you seem to have some problem with reading comprehension. So really, to strncpy one byte longer and zero the last one. If that is beyond your skills, please stay away from C.
Indeed. And maybe the one most important thing about C plus Unix is that the number of special things you need to learn and understand is limited.
Sure, once you tackle, say, socket programming for the first time, it is tricky and obscure. But once you have it, it will stay the same forever, and you do not need to re-learn it all the time because every more abstract language hides features, translates behavior and adds its own things. So far I have not found any abstraction of such concepts that did not make things worse, once you moved past toy examples.
Hence, sure, C has a really steep learning curve. But it stops pretty soon and then you need to understand algorithms and concepts and the problem that you want to solve, and C is merely the tool that does not stand in your way, unlike so many other programming languages.
Hahaha, joke is on you! I use Python with embedded C modules for most things I do these days. Yes, if you are really skillful, you can have the best of both worlds.
Unlike languages targeted at barely competent programmers (like Java), C demands insight and understanding or things break very fast. That will always limit its popularity. On the other hand, those few that have the skills will continue to use it, because nothing else gives you remotely the same power and simplicity. Sure, glue-code where performance does not matter is better written in a scripting language like Python, but for the actual work nothing beats C written by somebody that knows what they are doing.
C++ is actually a barely usable monster. It adds nothing real except complexity, also because its OO model is fundamentally broken and inefficient. Sure, C can benefit from some libraries like safe string handling, but that is it. So, no, C is not "morphing" into C++ at all.
C is responsible for the vast majority of stray pointer and buffer overrun vulnerabilities. Together with SQL injection and macros, it's making computing unsafe. C++ ameliorates the problem but does not eliminate it.
That is unmitigated bullshit. The language is not the reason for these problems, the coders are. Only a completely clueless person would blame a hammer for its ability to break things.
C/C++ are low-level languages used to implement everything else. There is no direct replacement. We desperately need one. What's the holdup, folks?
There is no "holdup". It cannot be done any other way. Either you have the power of C and then you also have the destructive power, or you don't, and then you cannot do the things C can do.
I had a look at Rust and could only ask: why isn't this twenty years further along by now? Oh, and... what's with that huge embedded runtime?
Simple: Rust is far less useful than its proponents claim. When you actually need its full power, you have to go to an "unsafe" model, and then it is about a save as C. Hence rather invest in learning C well, than going to a tool where you usually have a safety-net, but when you need to do without you do not have the experience to do so. The whole model is flawed fundamentally. It is not the tool, it is who wields it.
There are quite a few things that cannot be reasonably done in any other language. Also, because it is closest to the machine without being assembler, any real IT expert will have C-skills. It makes a world of difference.
Most degrees are useful, some just require you to be really good at the field. The problem is that said philosopher was more mediocre, otherwise he would not have had the problem. There are professors of philosophy around, and they make a decent living. But if there is a need for 10 new professors of philosophy every year, and about the same number of good positions in the industry for these people, and you have 10000 students each year of which most are not very good, because being good at philosophy is actually pretty damn hard and requires a very specific talent, then anybody with a basic grasp of numbers can see where the problem is.
Incidentally, on a different scale, we have the same problem with all the CS and related degrees: This is a very hard field and most people with a degree are not really any good at it. Hence, for example, most coders do not earn well, have bad job security and it gets worse when they get older (and have failed to stay current). As soon as you look at the small group of people that _are_ good at it though, you find that they do not really have all those problems, but can select what they want to work on and are paid well. Of course, because they are in a small sub-market, finding a job can take a bit (same for those that want to hire them), but that is to be expected.
The overall problem is that the modern information society cannot distribute its wealth by the "work" metric anymore for most of its members, because the work these people can do has not much worth anymore and, in the long run, will have no with at all anymore. Of course there are a lot of people that put their hand in the sand about this, despite it being glaringly obvious. The longer this goes on, the more painful the eventual adjustment will be.
A yes, the mindset where it is always somebody else that is at fault. Being a victim is so much more comfortable than looking for what oneself has done wrong and changing things for the better. Instead one can lie back and expect "society" to care for one, because one is a victim and deserves that, no need to change anything in ones failed approaches or even re-evaluates ones view of the world.
The problem with this parasitic mind-set is that it stops working when there are more than a few thinking this way.
And talk about the low expectations people apparently have of themselves these days. No wonder almost nobody is willing to go though a stressful and demanding education. And the education offers adapt to the customers as a result.
The modern work environment cannot reward hard work, because the type of work you can work hard at and increase productivity by that does not have a lot of worth anymore. The type of work that is actually valuable stops increasing in productivity around 30-40 hours a week, and productivity per week _drops_ after that. This has, incidentally, been known since the time of Henry Ford, since he and others at that time did research into how to get the most productivity out of their workers in order to maximize profits. Turns out that this peak is pretty much at 8h/day for 5 days of the week for manual labor and 6h/day for 5 days a week for mental work. For some types of mental work that requires a lot of insight, it is even lower. Now the really astonishing thing (at that time) is that if you work more, you produce less value _overall_. And the other astonishing thing is that the modern corporate world thinks these results are somehow not valid anymore, despite human nature not having changed much (if at all). This utter stupidity sucks the productivity right out of people.
Hence it is absolutely no surprise that you are getting nowhere at 70h per week. You have terrible efficiency and your time is not worth much per hour.
Working hard has not worked for a long time now.
Actually, working hard has not cut it for quite some time. If you do not work smart, you will not get anywhere. As a compensation, if you manage to work smart (most do not), you can work less hard than you used to need to for the same outcome. If you just work hard these days, you will work yourself into the ground and then be replaced by a machine or some person that is willing to do the same even cheaper.
The reality is that 50 years ago, there were vast numbers of jobs that any idiot could do, and thanks to the new deal and unions, those jobs paid well enough to live on.
Well yes. Society has failed to adjust sufficiently to changes circumstances. The only ones to blame for that are the individuals that have failed to realize that however. It is not a surprise in any way that modern society requires far more insight, education and flexibility from its members than it used to. It is what was predicted and did constantly happen since the start of the industrial age. It was extremely obvious. Yet droves of people chose to be intellectually lazy and just expected to float on hard work by others. That does not work when more than a smaller minority does it. What it does though, is that it creates a lower-class of people that will never get anywhere in life. A lower-class that has absolutely no understanding that, as a class (not individually), it created its current situation by itself. And a class that falls for the first demagogue that tells it that others are at fault.
Now Trump cannot actually make things much worse or much better. He has far less influence on things than he thinks and massively less influence than he claims to have. The processes that can make things better or worse are running in the multiple decades for significant changes. The only thing Trump can to is prevent the stupid from seeing reality for a few more years and that delays fixing anything for those additional years, making the lower-class just a bit larger and the problem just a bit less solvable. I do believe however that Hillary would have done just the same, likely with a little less catering to the stupid, the angry and the arrogant. The difference would not have mattered much. The US presidential election was lost for basically everybody as soon as the candidates were selected.
People voted anger, not intelligence.
Indeed. They let themselves believe the lies, because then they could just be angry at others and never even start to find fault with themselves. Hence absolutely nothing will get better. If people stop striving to better themselves, then a country dies. Whether that is because they have stopped to realize that in the end it is up to them and demanding things never has made them magically materialize, or whether it is because improving their education and skills does not pay off anymore, because the rich have taken over and are preventing most others from getting anywhere. The sad thing is that the people that voted for Trump are mostly the same people that would have badly needed an entirely different candidate.
Now, a large part of the reason Trump got into power is of course the really bad alternative. But it is highly telling of the overall failure of society that these two really bad candidates ever got to be candidates. And it is highly telling who actually expects Trump to make things better for them, despite extreme indicators to the contrary. The average person understands almost nothing. Add bad education, arrogance and a culture of blaming it on others and you have a catastrophe in progress.
If you expect a general string-copy function in a language like C that does not really have native strings, but just a convention in the native libraries, than the problem is in your side. Incidentally, if you expect a "strNcpy" to be general, then there is an even bigger problem on your side, as there is no way to generically shorten a string to a given length. There is always a range to chose from. What you probably want is strdup(), which indeed does copy any string, but it does not copy into a provided bufferer, which is the whole point of the str*cpy functions.
Seriously, C is not a beginners language. Go play with Java or the like and stop complaining about things you do not understand.
The design of strncpy is not bad, it is specialized. This is not a function to be used for every case of a string copy. Now, the only thing you could accuse strncpy realistically of is bloating the API. But the C string API is small enough for that to not really matter.
This will be the difference between an insecure mess and something that just works, as the old appliances used to...
It is a poor manager who hires incompetent coders in the first place and it is a poor coder who is incompetent.
You do not "fix" coders. You let those that can do it well do their thing and tell the other to stay the hell away from it. Poor coders have negative productivity and there are a lot of them around. That needs to stop.
Attempts to "fix" the problem by fudging the buffer and setting characters are just asking for fencepost errors. Not to mention the performance penalty for needlessly zeroing out any empty space after the string.
No, they are not. They are what you do if you are competent. There is no "fudging" here, just sound practices. This is however C not Java, so do not expect a nice verbose safety net. Your proposal of "copyTeminatedStringTo_UNTERMINATED_memoryBuffer()" already shows that you may know some C, but you do not get it at all. For starters, the first part of the name is wrong as strncpy can and will be used to copy non-terminated strings. Also, the termination is never the task of a buffer, so the second part of the name is just as wrong. Please leave and go to your walled garden where everything is safe an nice (and a slow memory-hog), we real coders have work to do.
It is the "Silver Bullet" mindset. Its proponents think that if they just had the right magic tool, all problems would go away. Well, Brooks published "No Silver Bullet" in 1986, and these people are not only clueless and incompetent, they are unaware of history. This is just as true today as it was back then. There is no silver bullet, no magic language or tool that will ever make a wannabe a competent engineer. On the other hand, competent engineers can be slowed down by sub-optimal tools, but that is about it.
For any competent coder that understands how the machine actually works, this is a very reasonable assumption. And, in addition, it is documented in the second sentence describing srtncpy in the man-page under Linux, for example. How this can be called "hidden" or even a "gotcha" is beyond me. Of course there is this one large class of incompetents where it is always somebody else's fault.
"man strncpy" explains the gotchas:
" Warning: If there is no null byte among the first n bytes of src, the string placed in dest will not be null-terminated."
If you think they are "hidden", then you seem to have some problem with reading comprehension. So really, to strncpy one byte longer and zero the last one. If that is beyond your skills, please stay away from C.
"IDE"? What is that? Is that like some poor-man's version of Emacs with man-pages integrated?
Indeed. And maybe the one most important thing about C plus Unix is that the number of special things you need to learn and understand is limited.
Sure, once you tackle, say, socket programming for the first time, it is tricky and obscure. But once you have it, it will stay the same forever, and you do not need to re-learn it all the time because every more abstract language hides features, translates behavior and adds its own things. So far I have not found any abstraction of such concepts that did not make things worse, once you moved past toy examples.
Hence, sure, C has a really steep learning curve. But it stops pretty soon and then you need to understand algorithms and concepts and the problem that you want to solve, and C is merely the tool that does not stand in your way, unlike so many other programming languages.
Rust and Go cannot cut it. When you really need full control, they are just as unsafe as C, but they are not as clean or clear.
Hahaha, joke is on you! I use Python with embedded C modules for most things I do these days. Yes, if you are really skillful, you can have the best of both worlds.
Unlike languages targeted at barely competent programmers (like Java), C demands insight and understanding or things break very fast. That will always limit its popularity. On the other hand, those few that have the skills will continue to use it, because nothing else gives you remotely the same power and simplicity. Sure, glue-code where performance does not matter is better written in a scripting language like Python, but for the actual work nothing beats C written by somebody that knows what they are doing.
C++ is actually a barely usable monster. It adds nothing real except complexity, also because its OO model is fundamentally broken and inefficient. Sure, C can benefit from some libraries like safe string handling, but that is it. So, no, C is not "morphing" into C++ at all.
C is responsible for the vast majority of stray pointer and buffer overrun vulnerabilities. Together with SQL injection and macros, it's making computing unsafe. C++ ameliorates the problem but does not eliminate it.
That is unmitigated bullshit. The language is not the reason for these problems, the coders are. Only a completely clueless person would blame a hammer for its ability to break things.
C/C++ are low-level languages used to implement everything else. There is no direct replacement. We desperately need one. What's the holdup, folks?
There is no "holdup". It cannot be done any other way. Either you have the power of C and then you also have the destructive power, or you don't, and then you cannot do the things C can do.
I had a look at Rust and could only ask: why isn't this twenty years further along by now? Oh, and... what's with that huge embedded runtime?
Simple: Rust is far less useful than its proponents claim. When you actually need its full power, you have to go to an "unsafe" model, and then it is about a save as C. Hence rather invest in learning C well, than going to a tool where you usually have a safety-net, but when you need to do without you do not have the experience to do so. The whole model is flawed fundamentally. It is not the tool, it is who wields it.
There are quite a few things that cannot be reasonably done in any other language. Also, because it is closest to the machine without being assembler, any real IT expert will have C-skills. It makes a world of difference.
Have you really overlooked that this is a 3-phase attack? If so, you do not have what it takes to even comment on this competently.