The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
but at the core of this ecosystem is the project itself with resources, objectives and requirements that (for usually good reasons) exclude the use of Java or PHP or bash or (in extreme cases) computer science itself and mandate coding in C or C++. all there is (apart from silicon, wire and electrons) is a compiler. and where did the compiler come from? somebody ported it using C or C++ and a bit of assembler.
at the end of the day, I find the real challenge comes when I have to 'turn away from' C++ and use C, or 'turn away from' from boost and use STL, or 'turn away from' templates and use macros or 'turn away from' OpenGL and use DirectX or 'turn away from' BSD and use GPL.
turning away from .NET feels like ignoring the existence of a cow in a paddock down the road. it's there. it might provide me with milk or butter one day, but I don't really need it unless I need it. it goes moo.
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
I like C++ because "you get what you pay for:" the "expensive" features of the language cost you nothing, in memory or execution time, until you elect to use them. Inasmuch as my domain is real-time in resource-poor environments, that's a major consideration.
I also like C++ because the third-party class libraries I use are all available in source code, which simplifies debugging and performance monitoring. Though each of them includes an option to build and deploy it as a DLL, I've never been tempted.
Finally, I like C++ because it's non-proprietary: Microsoft can't wrench its specification out from under us without incurring a reaction that the company can't afford. That's all the reason I need for preferring C++ to the "incredibly more powerful and convenient" C# / .NET combination, a trap far too many software engineers have failed to appreciate.
(This message is programming you in ways you cannot detect. Be afraid.)
That's all the reason I need for preferring C++ to the "incredibly more powerful
and convenient" C# / .NET combination, a trap far too many software engineers
have failed to appreciate.
Exactly. Basic lifecycle management of a C++ object is not so much different from that of a managed object, especially if you implement and use IDisposable. A garbage collection certainly does not help me very much and its absence would be no obstacle for me. And I still admire the 'productivity' of certain (Java) developers who helplessly tried to tweak the garbage collector's configuration for months when they had a memory leak.
Anyway, I would love to reuse my code for once, instead of constantly struggling to keep up with Microsoft's constant changes. Using languages and libraries that are not under the control of a single company looks like the right way.
I earn my money, or rather used to before becoming management, in Java/.Net/custom script toolsets for bespoke hardware and a little C occasionally, but despite never having touched it professionally, I find it the best language to satisfy my need as a programmer to learn, study and understand computing, and I find it fortifies my knowledge when dealing with all other areas of computing. I find it encourages polyglotism, as an anchor into C functions as well as all OOP languages (in one form or another). I also find that the literature (particularly historic) is more scientific, and less "wishy-washy" than other languages, and I prefer to learn in this manner. None of this, java in 21 days, rubbish, but academicly useful books at a time when the OOP paradigm was being invented as a useful and functioning mechanism for complex solutions (And along with the seminal C book, the best language reference book). Partly because of that, C++ is the best way (IMO) to learn frameworks, client-server, windows (and the not-windows full-screen shenanigans of today) managers, resource-sharing, memory management issues, and so, so much more. I would, and do, recommend that everyone learns C++ (And high and low level OOAD as a parellel task) even if they don't intend to use it in their day to day activity.
i like the fact thats it is a programming language that doesn't wish to be you mommy. What i mean by this is that c++ lets you do things your way... I am not a rule breaker in coding but i want that freedom to sometimes dirty patch something.
Modern languages tend to give you "the way" to write code their way(no use of pointers, garbage collection etc)... the only thing that makes you write code in a certain way in c++ is to get better results and this is what makes the difference between programmers and users...
a programmer knows why he does what he does... a user lets the "program/language" to tell him what to do and just obeys...
AND in case you are a "create empty project" programmer c++ is just the thing ...
In short, I think there are way better alternatives for .NET developer then C++.
Speaking for myself, if I ever was to move away from .NET, it would only be to another "managed" language - Java, Python, Ruby, PHP, etc. Java still scores #1 on Tiobe index after all, and I don't see it changing anytime soon. It feels almost like C# 2.0 so it won't be too hard moving to Java and Android development, I would miss LINQ dearly tho . I agree wholeheartedly on the definition of C++ as crude tool which is still perfectly viable to create masterpieces with. The problem is, that it's way too easy to become addicted to comfortable refined tools and become dependent on them. Moving from .NET to C++ feels like moving from comfortable city apartment with electric lights, hot water and other conveniences along with modern city infrastructure to stone cave in a middle of wilderness with only wooden stick in hands I know the language, and if asked to write something in C++, I will do it and will try my best to do it good - but I will hate every moment of writing C++ code with a passion. The only "native" language I will ever try is Objective-C (Josh Smith's experience on the matter is quite encouraging), and this is only if someone gives me iMac AND iPhone as a gift, because Apple computers are ridiculosuly overpriced in my country. Android development has one distinct advantage over iOS development tho - if Google does something incredibly stupid and kills Android and/or abandons Java, you can still just go and write Java elsewhere, while Obj-C is neither wanted nor needed by anyone outside of Apple and I have a distinct feeling that people are only using it because it's the only option for iOS developemnt (read: because Apple forces it down their throats ) and they will be happy to forget it when/if Apple ship drowns.
Moving from .NET to C++ feels like moving from comfortable city apartment with electric lights, hot water and other conveniences along with modern city infrastructure to stone cave in a middle of wilderness with only wooden stick in hands
I loved your analogy, it cracked me up
But I think you may be missing one point. You don't need to move away from .net to use C++. It's just another tool to be used for another job. A lot of you want to do can be accomplished by both, but many tasks are better accomplished with one tool rather than the other.
For example, you can't go to managed language if you're designing a kernel-mode driver. Or you can use an unmanaged component for your managed framework to perform performance dependent task. Say you're developing a real time image processing application. Chances are that you'd be better off with C++ (not saying it's the only option).
One thing that I love about C++ is how it integrates easily with native hardware instructions, you can even have pure assembly instructions inside a C++ code block
It's so amazing that it's quite rewarding when you see blinking hardware lights just the way you programmed it to. It's a very satisfying experience.
I had the opportunity to interface with hardware through C# and .net, but it is not the same thing and you can only go so far.
Of course, using C++ to develop a full blown enterprise application with rich UI can be really, really painful. That's why you should always choose the right tool for the job. And I just love when the right tool for the job is C++
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
---- Our heads are round so our thoughts can change direction - Francis Picabia
I have never been involved in writing kernel-level software, software for microcontrollers, or game development, so I think I just never got to harness full power of C/C++ in it's natural sphere of application. My only encounter with C++ apart from university was with "full blown enterprise application with rich UI" (although it did use some 3D data visualization), and I guess this took it's part in forming my bias against it
They actually aired a radio programme today (Radio 1) where they asked British people if they would be voting and who they would be voting for. It was shocking how many people replied obviously believing they could vote in the American Election. I blame it on the amount of coverage it's getting over here. I hope
That is actually understandable though, considering the sheer geographic size and clout that America carries. I think if I was American I wouldn't give a sh*t who was the British PM either, in fact I would probably wonder why they needed a PM as they have a Queen.
I always hear and read a lot of clamoring about the electoral college being antiquated yet I don't get it. Maybe the failure is that people think the U.S. is a democracy and it isn't, and it never was. It is a hybrid between a democracy and a republic in order to address the short-comings of each and highlight the strengths of both.
If I were to address the flaws in the electoral college, I would suggest, that instead of it be winner take all as it is in most states, that the vote be broken up by district. Then there would be no more battleground States and every State and every district would be important. Imagine, how some States feel because they just don't matter in an election. Or worse, imagine living in Florida and having the entire region shut down repeatedly during elections because of "Presidential Security".
I live in CA, and my vote doesn't amount to spit, even though it has the #1 economy in the US, and Ohio's is 8th. yet because of population per capita, someone from Ohio's vote has more weight than mine.
If the presidential election were decided by popular vote, then all these factors wouldn't matter.
If the presidential election were decided by popular vote, then all these factors wouldn't matter.
Then candidates would concentrate even more heavily on densely populated regions, safely ignoring huge swaths of the country. It would make election corruption even more enticing in those areas. Moreover, if you've lived long enough, you know that what state has what influence changes drastically. A further analysis can show that many "contested" elections wouldn't have been so had the candidate done more in, and won, another state.
Possibly, but the flaw in the current system is that we're forced to leave it up to 'electors' to decide who's going to be president. It's a system designed in the beginning because the government thought you & I were to stupid to decide who should be president.
No, it was a system designed to prevent corruption. Moreover, the electors are randomly chosen. They don't simply get together and decide who will be president regardless of what the vote was.
Kevin Marois wrote:
It's a system designed in the beginning because the government thought you
Not true. Read the federalist papers and about Madison and the founding fathers. "the government" didn't think anything; the people created the government and did so understanding the very real flaws of direct democracy.
Then candidates would concentrate even more heavily on densely populated regions, safely ignoring huge swaths of the country. It would make election corruption even more enticing in those areas.
Ummm... since the number of electoral college votes each state gets depends entirely on population I don't see how it changes anything. It's the all or nothing BS that most states practice that is just plain wrong. I live in central Illinois and due to Chicago's sickening corruption and devotion to the Democratic party I am completely disenfranchised when it comes to my vote for POTUS.
Government is not reason; it is not eloquent; it is force. Like fire, it is a dangerous servant and a fearful master. ~ George Washington
Because if the state doesn't matter and only population does, candidates would simply concentrate on density. Your point about Illinois is valid, but if the presidential vote were entirely popular, a comparable thing would happen with the entire country. Thus my proposal that some electoral votes be winner take all and some be proportionate to the state. How the proportionate votes would be done is the question (though doing it by congressional district would be better than nothing. On the other hand, I can see Illinois redrawing it's districts so they always have a portion in Chicago. Such a scheme was proposed in Utah, but failed to get traction. Make redistricting fair and I'm on board.)
It's important to understand that this would change campaigning, so simply retroactively applying new rules to past elections for analysis is kind of bogus.
(I grew up in upstate New York so I know the feeling of having one or two metropolitan areas dominate state politics. We often had serious discussions about the viability of kicking New York City out of the state. [New York City has threatened to leave the state. Every time, the rest of the state says "would you please?", but it never happens since NYC needs that tax revenue.])
The problem there is some districts, like one in my state, would become an even more insane battleground. It would actually make most states and districts matter even less, not more. (This is the problem with going with just the popular vote; it would effectively disenfranchise small and low relatively populated regions.)
I like the electoral college because it reinforces the concepts of federalism. One compromise would be to mesh the two; each state would receive two plus the number of districts electoral votes. Two votes would be winner takes all, the remainder would be proportioned state-wide (not by district to avoid the above problem.)
Then again, as a federalist, I think a lot of these problems would become non-issues if the federal government had less power--why corrupt a congress person if he or she has no real expansive power?
Actually, it would do the opposite of disenfranchising small districts. If you look at a State with a major metropolitan split, Georgia is a good example. Currently Atlanta basically decides the State. (9,815,210 residents of Ga, 5,268,860 Atlanta Metro) If Ga has 16 electoral votes, in the current system, and a Candidate takes Atlanta by a wide margin but loses the rest of the State the candidate would still expect 16 electoral votes, effectively disenfranchising the rest of Ga. If, however, it were split based on districts the same candidate could get 9 leaving 7 for the other candidate. That is a much better representation in my book.
Don't forget, that while your premise could hold true, district lines are usually drawn in such a way that this kind of disenfranchisement is very difficult to achieve. And other than in the South were the Federal overlords still cause gerrymandering, the usual requirement for district lines is normal city/governmental boundaries.
In Utah the effect would be opposite. Most districts lean heavily toward one side or the other. Presidential candidates would continue to safely ignore those districts (as they do mine.)
I do like the idea of having some votes be given to the state as a whole and some votes be proportioned; I just haven't found a proportioning scheme I like and which is reasonably immune to gaming. Given how gerrymandering affects every state, sometimes to absurd degrees, I don't see how this wouldn't be gamed as well. The best solution I've heard of is to greatly increase the number of congressional districts, which would diminish the advantage of gerrymandering and make this more viable.
(Then again, incumbents of all stripes will do nothing to diminish their power in any way, so I expect nothing to happen.)
Ennis Ray Lynch, Jr. wrote:
the usual requirement for district lines is normal city/governmental boundaries.
You really believe this? There is no requirement for drawing lines; it's almost always up to the state legislature to do whatever they want. And they do in every state.
I already did, yesterday (mail ballots are so much more convenient). I do live in a swing state, but I mostly voted in an attempt to cause some trouble - marijuana legalization is on the ballot and I want it to pass to see what the federal government will do in reaction (it's basically legal here anyways, getting a medical exemption is just a matter of asking for it).
Plus it's money for schools, and the political ads against it annoy me ("usage by children ages 12-25 will double!").
21-25: It would be legal for them, so who cares (also: not children)
18-20: I don't really care if they do, they're old enough to make a decision and take the legal risks (also: still not children)
12-17: I'm guessing the above two groups will more than double, making a very small growth here (finally made it into the children range!), plus they get the benefits of the tax.
I'm a new American (ex-pat Brit) and I studied heavily for my citizenship exam (which turned out to be rather simple) so of course I voted. I have to believe (1) my vote could make a difference, and (2) having learnt about American politics, I should join in.