Alt-Tab works very fine for alternating between a small number of windows, regardless of the total number, because they are hold in a LIFO stack. What I have seen from Linux users is that they tend to minimize their windows to get them away from blocking the screen, this would indeed ruin Alt-Tab as minimizing puts the window in the bottom of the Alt-Tab stack.
And of course all my windows are maximized, I do not like the tangled mess created by partially overlapping windows.
There is no such language as C/C++. These are two totally different languages, especially regarding type safety, compile-time diagnostics and automated resource management, and the Linux developers have chosen the hard one.
To shoot fish in a barrel the zero-terminated C strings was made to save one length-prefix byte and has cost the world a bazillion times more than the Y2K problem and every non-C programming language has abandoned it. But okay, that's an inherited problem.
Seriously, where do you see zero-terminated C strings in C++? It's not an inherited problem, it's a compatibility feature when interfacing C code.
My biggest gripe with C++ is that it's an OOP language without an object oriented memory model, unless you religiously follow RAII as a pattern or trace every execution path when the code changes you will have crazy leaks all over as you create and destroy objects.
No, C++ is not an OOP language (it just supports it to some extent), and yes, you need to follow RAII throughout and that's the one single most major strength of the language!
Particularly since there's no major platform pushing it, on Windows it's C#, on Mac/iOS it's Swift and in the enterprise and on Android it's Java, the embedded market is C and the web is pushing Javascript everywhere: But who's pushing for more C++? Almost nobody, as far as I can see.
That's a major point in favor of C++. It won't go away the next year because some company has decided to switch their preferred framework to some new strangely named new thing, or the language somehow gets sold to a megacorp who really does not care about it.
You say it's a language for experts, who can afford an expert for every change? How do you become an expert, if a junior C++ developer will fail spectacularly? What I'm saying is that just because it's challenging doesn't mean you're an expert, it just means you're doing it the hard way.
Not all software needs to be written in C++. But there are a lot of things which can be and are written in C++, including interpreters for all those new fancy languages.
If the servers get compromised then it's game over. That's the same with paper ballots, if the central office is corrupt then there is no trust in the results. It is true that there needs to be some trust in the state officials; electronic voting would probably not work in some other countries where 146% voter turnout or 99% single party wins are common. But that's not the problem with paper or technology, it's the problem with the state.
For detecting that there is something fishy happening you don't need 80% coverage. Even a handful of mismatches would create a huge media storm (assuming free press) and a detailed investigation would be started. The same would happen if the election results would not resemble any pre-election predictions or polls.
Paper ballots regularly get miscounted, intentionally or unintentionally. In totalitarian countries it's also easy to fake the paper ballots, any reports would be just ignored or silenced (see e.g. http://www.nytimes.com/2012/03... ). But this would require silenced press.
Estonia is currently at the 12-th place in the press freedom index (out of 180), which is a very different situation from e.g. Russia (place 148) or even US (place 46). What works in one country may not work in another.
All PCs are insecure, whether used with card readers or not.
That's why in Estonia you can double-check via a physically independent channel (smartphone app) that your vote reached the server correctly. Worked fine for me at the recent elections.
Yes, selfish pricks like you are indeed the reason the ad landscape has become so hostile. Excellent point.
I do not understand. It does not matter if I do not see ads or if I just ignore them, there will be the same zero benefit for the sellers/advertisers, so there is no rational reason for them to be against ad blockers.
Categorising one of the most important images of the 20th century with child pornography is a problem. A big one.
Except it is not pornography. Pornography is defined as printed or visual material containing the explicit description or display of sexual organs or activity intended to stimulate sexual excitement.
Now if somebody really believes a photo of napalm victims is intended to stimulate sexual excitement, then I agree this person might have some big problems indeed.
Speaking of readability, here's an entertaining one I've been seeing more of in C:
if (result == SUCCESS)
versus
if (SUCCESS == result)
The rationale behind the second is that you don't end up accidentally assigning SUCCESS to result (eg, if (result = SUCCESS)). But I know that I find it weird to look at it the other way around. I want to know if the result was successful, not if successful was the result. Maybe it's an english thing.
I know that Xcode has been putting up warnings/errors for code that does assignments in if-statements and saying that if you really want to do that, wrap it in an extra layer of parentheses (eg, if ((booleanResult = Do_Something()))). I'm not sure this is somehow more clear that you're doing the assignment...
In proper C++ this would be
if (bool booleanResult = Do_Something()) {
or more usefully
if (AClass foo = PrepareFoo()) {
DoSomethingWith(foo);
}
This does not generate those assignment warnings, is in the right order for readability and does not need obscure extra parens.
In professional software development, the general idea is clear: if any non-functional change in a source code file makes it more readable and more maintainable, then it's good, and vice versa. You write the thing once and it has to be maintained for years. This is actually called code refactoring, which is part of several methodologies.
Code refactoring may mean either adding or deleting code. There ought to be a golden middle point somewhere where the code is neither too verbose nor too condensed.
There is a slight complication in that not every person agrees what is the most readable form for a program, but in general it's best to imagine that you may have a total autobiographical amnesia in the next day and still need to understand what the program does.
So, memcpy() does not work in C++?
Did not know that.
Or strcpy() for that matter? Ah: you want to imply that one should use std::string?
Sorry, regarding buffer overruns C++ is as vulnerable as C.
memcpy() and strcpy() are not found in proper C++ programs (there is no need for them).
Anyway, memcpy is not the cause for buffer overruns. Buffer overruns appear when two pieces of code get confused about what is the actual size of the buffer. In C++, the actual size is stored right there inside the buffer object (e.g. std::vector or std::string), so the probability of confusion is greatly reduced.
strcpy() is vulnerable because it relies on the buffer size stored somewhere else in addition to the buffer management (i.e. malloc()), and these two locations may get inconsistent and cause confusion and bugs. Luckily, there is about zero reason to use strcpy() in C++.
Of course one can compile what is basically C code by a C++ compiler, but this does not mean one could not do better in C++, or that C++ is somehow tainted by allowing C code. One can write buggy code in any language, writing buggy C code in C++ is just one easy way to do that.
Nevermind managed execution to avoid buffer overruns and other "memtrashing" failures that have been a huge security clusterfuck over the last few decades...
I believe you have mixed up C++ with some other language. C++ does not have any such buffer overrun issues (unless you treat it as "C with classes", of course).
I was having a debate with several high ranking programmers on SO about needing to mark an INT volatile or having to use Interlocked atomic writes to make sure the class variable gets flushed to memory after the method call finishes.
Indeed, there is no need for that. You need to sync only if something must get visible to another thread.
My argument is that unless the method discards the data or inlines the method call, the method has to eventually flush the data from registers back to memory before returning control.
As written, this statement seems indeed either insane or tautological. I am not surprised SO people were baffled.
Now that.Net code is on GitHub, it turns out Microsoft's own code for stuff like semaphores are written exactly the way I proposed.
A semaphore is a totally different thing than an ordinary user-defined class object.
Perhaps you could give an example of Open Source software you think needs a special class of user called "tinkerer"?
Try compiling three year old scientific software written in academia without either a programmer or a sysadmin (either should fulfill the role of "tinkering" with software).
I know the sentiment. The only thing worse than open-source software from academia is closed-source software from academia. We ended up putting it in a separate background process so when it crashes we can try to run it again a couple of times.
Making some program open-source does not magically increase its quality, and being in academia does not magically turn professional scholars into professional programmers. Nothing new here.
In the article there are a lot of comparisons to doctors. Like, how you can become a doctor by spending 7 years in a medical school, etc, whereas in programming you do not have a clear path.
To my mind, this only proves that nobody really questions the qualification of the doctor. The patients are (or considered to be) not qualified to do that, so unless you are very bad, you can carry out a successful doctor career without really mastering the skills. I am sure in no way can all people become good doctors if they spend 7 years in medical schools, and the same applies to programmers. The only difference is that for a computer program it is much easier to see if it works and who is responsible when it doesn't.
C/C++ is not suitable for anything which should never crash or return random results due to memory corruption.
Yes, it's 2015 and so it would be appropriate to realize that C and C++ are two totally different languages (where one of those is just capable to seamlessly compile most of the code written for the other).
They are for the most part really top-tier professionals who are trying to make the decision based on what is best for the US Government as an institution. Not influenced very much by politics. They are widely considered the "tenth justice," and really care about (1) whether the case is important, (2) whether the case presents the issues it's about well (i.e. is it a good vehicle for the issue), (3) whether the case has facts that are favorable for getting to what the government thinks is in its interest, etc...
Well, in this case they have clearly failed as the case is obviously very important (can overturn the whole concept of SDK-s) and is pretty clear-cut. So it appears the government thinks it's in its interest to sink the whole digital revolution. Well, considering that a moderate AI might perform better in their jobs, they might be right...
Alt-Tab works very fine for alternating between a small number of windows, regardless of the total number, because they are hold in a LIFO stack. What I have seen from Linux users is that they tend to minimize their windows to get them away from blocking the screen, this would indeed ruin Alt-Tab as minimizing puts the window in the bottom of the Alt-Tab stack.
And of course all my windows are maximized, I do not like the tangled mess created by partially overlapping windows.
There is no such language as C/C++. These are two totally different languages, especially regarding type safety, compile-time diagnostics and automated resource management, and the Linux developers have chosen the hard one.
revert accidental mod
(undo misclick)
-- posting to undo accidental moderation --
To shoot fish in a barrel the zero-terminated C strings was made to save one length-prefix byte and has cost the world a bazillion times more than the Y2K problem and every non-C programming language has abandoned it. But okay, that's an inherited problem.
Seriously, where do you see zero-terminated C strings in C++? It's not an inherited problem, it's a compatibility feature when interfacing C code.
My biggest gripe with C++ is that it's an OOP language without an object oriented memory model, unless you religiously follow RAII as a pattern or trace every execution path when the code changes you will have crazy leaks all over as you create and destroy objects.
No, C++ is not an OOP language (it just supports it to some extent), and yes, you need to follow RAII throughout and that's the one single most major strength of the language!
Particularly since there's no major platform pushing it, on Windows it's C#, on Mac/iOS it's Swift and in the enterprise and on Android it's Java, the embedded market is C and the web is pushing Javascript everywhere: But who's pushing for more C++? Almost nobody, as far as I can see.
That's a major point in favor of C++. It won't go away the next year because some company has decided to switch their preferred framework to some new strangely named new thing, or the language somehow gets sold to a megacorp who really does not care about it.
You say it's a language for experts, who can afford an expert for every change? How do you become an expert, if a junior C++ developer will fail spectacularly? What I'm saying is that just because it's challenging doesn't mean you're an expert, it just means you're doing it the hard way.
Not all software needs to be written in C++. But there are a lot of things which can be and are written in C++, including interpreters for all those new fancy languages.
If the servers get compromised then it's game over. That's the same with paper ballots, if the central office is corrupt then there is no trust in the results. It is true that there needs to be some trust in the state officials; electronic voting would probably not work in some other countries where 146% voter turnout or 99% single party wins are common. But that's not the problem with paper or technology, it's the problem with the state.
For detecting that there is something fishy happening you don't need 80% coverage. Even a handful of mismatches would create a huge media storm (assuming free press) and a detailed investigation would be started. The same would happen if the election results would not resemble any pre-election predictions or polls.
Paper ballots regularly get miscounted, intentionally or unintentionally. In totalitarian countries it's also easy to fake the paper ballots, any reports would be just ignored or silenced (see e.g. http://www.nytimes.com/2012/03... ). But this would require silenced press.
Estonia is currently at the 12-th place in the press freedom index (out of 180), which is a very different situation from e.g. Russia (place 148) or even US (place 46). What works in one country may not work in another.
All PCs are insecure, whether used with card readers or not.
That's why in Estonia you can double-check via a physically independent channel (smartphone app) that your vote reached the server correctly. Worked fine for me at the recent elections.
Yes, selfish pricks like you are indeed the reason the ad landscape has become so hostile. Excellent point.
I do not understand. It does not matter if I do not see ads or if I just ignore them, there will be the same zero benefit for the sellers/advertisers, so there is no rational reason for them to be against ad blockers.
If I want to buy something, I will search for it.
oops, reverting accidental moderation
Categorising one of the most important images of the 20th century with child pornography is a problem. A big one.
Except it is not pornography. Pornography is defined as printed or visual material containing the explicit description or display of sexual organs or activity intended to stimulate sexual excitement.
Now if somebody really believes a photo of napalm victims is intended to stimulate sexual excitement, then I agree this person might have some big problems indeed.
Speaking of readability, here's an entertaining one I've been seeing more of in C:
if (result == SUCCESS) versus if (SUCCESS == result)
The rationale behind the second is that you don't end up accidentally assigning SUCCESS to result (eg, if (result = SUCCESS)). But I know that I find it weird to look at it the other way around. I want to know if the result was successful, not if successful was the result. Maybe it's an english thing.
I know that Xcode has been putting up warnings/errors for code that does assignments in if-statements and saying that if you really want to do that, wrap it in an extra layer of parentheses (eg, if ((booleanResult = Do_Something()))). I'm not sure this is somehow more clear that you're doing the assignment...
In proper C++ this would be
if (bool booleanResult = Do_Something()) {
or more usefully
if (AClass foo = PrepareFoo()) { DoSomethingWith(foo); }
This does not generate those assignment warnings, is in the right order for readability and does not need obscure extra parens.
In professional software development, the general idea is clear: if any non-functional change in a source code file makes it more readable and more maintainable, then it's good, and vice versa. You write the thing once and it has to be maintained for years. This is actually called code refactoring, which is part of several methodologies.
Code refactoring may mean either adding or deleting code. There ought to be a golden middle point somewhere where the code is neither too verbose nor too condensed.
There is a slight complication in that not every person agrees what is the most readable form for a program, but in general it's best to imagine that you may have a total autobiographical amnesia in the next day and still need to understand what the program does.
So, memcpy() does not work in C++? Did not know that.
Or strcpy() for that matter? Ah: you want to imply that one should use std::string?
Sorry, regarding buffer overruns C++ is as vulnerable as C.
memcpy() and strcpy() are not found in proper C++ programs (there is no need for them).
Anyway, memcpy is not the cause for buffer overruns. Buffer overruns appear when two pieces of code get confused about what is the actual size of the buffer. In C++, the actual size is stored right there inside the buffer object (e.g. std::vector or std::string), so the probability of confusion is greatly reduced.
strcpy() is vulnerable because it relies on the buffer size stored somewhere else in addition to the buffer management (i.e. malloc()), and these two locations may get inconsistent and cause confusion and bugs. Luckily, there is about zero reason to use strcpy() in C++.
Of course one can compile what is basically C code by a C++ compiler, but this does not mean one could not do better in C++, or that C++ is somehow tainted by allowing C code. One can write buggy code in any language, writing buggy C code in C++ is just one easy way to do that.
Nevermind managed execution to avoid buffer overruns and other "memtrashing" failures that have been a huge security clusterfuck over the last few decades...
I believe you have mixed up C++ with some other language. C++ does not have any such buffer overrun issues (unless you treat it as "C with classes", of course).
In the future, though, Microsoft could provide a QR code that leads to more specific information about what caused the computer freeze up.
Microsoft has not been able to provide useful error messages for the last 30 years, why should it be any different with QR codes?
It can have significant effects in countries where the people listed have made a public stance against offshores and such. For example, Putin ...
Unfortunately, this will have no effect on Putin. He might even win some more support as a clear victim of the evil western propaganda.
I was having a debate with several high ranking programmers on SO about needing to mark an INT volatile or having to use Interlocked atomic writes to make sure the class variable gets flushed to memory after the method call finishes.
Indeed, there is no need for that. You need to sync only if something must get visible to another thread.
My argument is that unless the method discards the data or inlines the method call, the method has to eventually flush the data from registers back to memory before returning control.
As written, this statement seems indeed either insane or tautological. I am not surprised SO people were baffled.
Now that .Net code is on GitHub, it turns out Microsoft's own code for stuff like semaphores are written exactly the way I proposed.
A semaphore is a totally different thing than an ordinary user-defined class object.
Forbes own September 2015 article that says ad blockers won't hurt online adversiing. http://www.forbes.com/sites/ro...
This article is now blocked as well!
Perhaps you could give an example of Open Source software you think needs a special class of user called "tinkerer"?
Try compiling three year old scientific software written in academia without either a programmer or a sysadmin (either should fulfill the role of "tinkering" with software).
I know the sentiment. The only thing worse than open-source software from academia is closed-source software from academia. We ended up putting it in a separate background process so when it crashes we can try to run it again a couple of times.
Making some program open-source does not magically increase its quality, and being in academia does not magically turn professional scholars into professional programmers. Nothing new here.
If you fuck up as a doctor, people die.
Yes, the do. For example, in Switzerland it is estimated that health care errors cause 1,000-plus deaths a year.
In the article there are a lot of comparisons to doctors. Like, how you can become a doctor by spending 7 years in a medical school, etc, whereas in programming you do not have a clear path.
To my mind, this only proves that nobody really questions the qualification of the doctor. The patients are (or considered to be) not qualified to do that, so unless you are very bad, you can carry out a successful doctor career without really mastering the skills. I am sure in no way can all people become good doctors if they spend 7 years in medical schools, and the same applies to programmers. The only difference is that for a computer program it is much easier to see if it works and who is responsible when it doesn't.
C/C++ is not suitable for anything which should never crash or return random results due to memory corruption.
Yes, it's 2015 and so it would be appropriate to realize that C and C++ are two totally different languages (where one of those is just capable to seamlessly compile most of the code written for the other).
to keep everyone sharp, the researchers made a contest out of it pitting the North American and European participants against each other.
So, who won?
They are for the most part really top-tier professionals who are trying to make the decision based on what is best for the US Government as an institution. Not influenced very much by politics. They are widely considered the "tenth justice," and really care about (1) whether the case is important, (2) whether the case presents the issues it's about well (i.e. is it a good vehicle for the issue), (3) whether the case has facts that are favorable for getting to what the government thinks is in its interest, etc...
Well, in this case they have clearly failed as the case is obviously very important (can overturn the whole concept of SDK-s) and is pretty clear-cut. So it appears the government thinks it's in its interest to sink the whole digital revolution. Well, considering that a moderate AI might perform better in their jobs, they might be right...