|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
On February 11 2011 23:13 Morfildur wrote:Show nested quote +On February 11 2011 22:46 Cambium wrote:On February 11 2011 22:41 10or10 wrote:On February 11 2011 22:32 Morfildur wrote:On February 11 2011 13:04 Cloud wrote:On February 11 2011 12:59 iMbc wrote: I have a question...
I'm fairly new to programming and i'm learning c# and I was wondering what kind of stuff should I start with? IMHO certainly not c# :p. You don't wanna start out with a language designed for structured teams of developers and even less a language designed for programming windows apps (the horror). You won't be able to be nearly as productive as with more powerful languages. Python/scheme are better places to start. Resources for Python: * http://www.amazon.com/gp/product/1887902996* Tutorials on python.org * http://www.norvig.com/index.html <- Really cool stuff, not really for a beginner but it might inspire you, also good for lisp (Scheme is a lisp dialect) Resources for Scheme: SICP (Challenging, requires a lot of dedication but well worth it) Book is free, you can google it. The little schemerPython is powerful, well documented, well recognized, widely used. Scheme is clean and small, completely lacks a syntax, probably best language to learn about actual programming without needing to learn so much about the rules of the language itself. Pick one, study the tutorials, find the community of that particular language (most important) and become a part of it. I do all my private development in C#, including linux applications. Calling C# a Windows/Microsoft-Only language only shows that people never tried to learn about it. I also found it to be a far more productive language than any other i've tried (including python, ruby, scheme, java,...). I wouldn't recommend starting with scheme, it's a very complex language and even though i like the functional programming i found it to be very... problematic when used in a pure functional environment. I very much prefer the functional extensions of C#, though, yes, i found them a lot more useful after trying scheme for a while and learning the functional thought patterns. Python is a nice language, it's ok to learn it and definatly won't hurt for private programming. It's a growing language but for professional development i don't see a market, it won't help you much if you want to find a job with the language of your choice, though it will teach you a lot of design and style aspects that will help you develop better in other languages (as do C# and Ruby). I've only worked with C, C++ and Java, a part from some scripting langauges, and want to know in what way do you find C# more productive than Java? Yea I'm curious about this too. In my past experiences, C# was only useful with VS building front-end windows apps. I know you can write server code with it too, but I never understood/researched the advantages of using it over Java. Other advantages of C# compared to java: Functional extensions, first class functions, common namings of methods and functions in the .NET library (depending on which java array class you use, it's either .size(), .getLength(), .length, .getCount(), .count(), .getLength(), ... i guess thats the drawback on being open source with no early concept), extension methods, ... Functional extensions: For example if i want the ID properties of all customer objects in an array where the customer registered before 2011 (which reminds me, C# properties are really cool, Python has similar, Java doesn't): Oh, did i mention that the last time i had to use Javas date handling libraries i nearly had to scream because of how complex and unlogical it was? calendar... uhm... yes.... hope for you java folks they improved on that. Oh, and if we want to make that multi-threaded because the sourceArray is very big... we have to use third party libraries in Java or write a lot of code. C# multi-threaded (.NET 4.0): IEnumberable<Int32> results = sourceArray.AsParallel().Where(c => c.RegisteredDate < (new DateTime(2010, 1, 1)).Select(c => c.ID); Extension methods: I recently had the case that i wanted to have the position of units on a map, i stored them as instances of the Point class. I later had the case where i wanted to calculate the distances between units, so instead of creating a new class and using that everywhere, i simply created a "PointExtensions" class and added a GetDistanceTo() method to the original Point class. Oh, did i mention that visual studio 2010 is simply the best IDE i've ever used? Neither eclipse, netbeans, kdevelop, etc even comes close. I had to write Java for a year, but my knowledge is still limited and dated, if anyone wants to correct me i always welcome to learn something new, but imho C# is just a more modern language, though you still pay for it by knowing less about what happens in the background.
These are all language nuisances, and I'm sure such things exist in C# as well (I just don't use them enough). Yes, I agree, some things in Java are complete garbage (like date, generics, primitive autoboxing, and lack of functors), but complaining about these issues is downright pointless. I was more curious about the possible security/performance/portability reasons backing your claim.
Also, VS is absolute terrible if you have a large project, it takes forever to load, build and run. And don't even get me started on loading the designers if they are interlaced with other designers.
|
EDIT: If you would dabble in java, to be effective/productive you should really learn proper OO design to utilize the language to its max.
I've always found that pushing OOP early turns people into bad programmers. My first "language" was -very- bad PHP, from which I learned the basics of flow control, passing arguments and calling functions, etc. This evolved into writing my own functions / reducing redundant code by faking namespaces (PHP has them NOW but didn't before PHP version 5.3?) which turned into all out OOP programming using MVC-like frameworks. And I still find OOP to be completely unnecessary overhead at times. But this experience carried over when learning C and Java -- I had a very good understanding of both procedural and OOP styles and didn't have any problems getting either to do what I needed until getting better at both in terms of style / general language knowledge.
Although I have to say, going from implicit type casting to more strict types? Yeah, that was an interesting transition. (In PHP if I have $i = "1" (string), I can do $ans = $i + 2 and $ ans will be 3. Java will throw an exception and the C compiler will say "f you, dude. no wai."
|
On February 11 2011 23:26 Cambium wrote:Show nested quote +On February 11 2011 23:13 Morfildur wrote:On February 11 2011 22:46 Cambium wrote:On February 11 2011 22:41 10or10 wrote:On February 11 2011 22:32 Morfildur wrote:On February 11 2011 13:04 Cloud wrote:On February 11 2011 12:59 iMbc wrote: I have a question...
I'm fairly new to programming and i'm learning c# and I was wondering what kind of stuff should I start with? IMHO certainly not c# :p. You don't wanna start out with a language designed for structured teams of developers and even less a language designed for programming windows apps (the horror). You won't be able to be nearly as productive as with more powerful languages. Python/scheme are better places to start. Resources for Python: * http://www.amazon.com/gp/product/1887902996* Tutorials on python.org * http://www.norvig.com/index.html <- Really cool stuff, not really for a beginner but it might inspire you, also good for lisp (Scheme is a lisp dialect) Resources for Scheme: SICP (Challenging, requires a lot of dedication but well worth it) Book is free, you can google it. The little schemerPython is powerful, well documented, well recognized, widely used. Scheme is clean and small, completely lacks a syntax, probably best language to learn about actual programming without needing to learn so much about the rules of the language itself. Pick one, study the tutorials, find the community of that particular language (most important) and become a part of it. I do all my private development in C#, including linux applications. Calling C# a Windows/Microsoft-Only language only shows that people never tried to learn about it. I also found it to be a far more productive language than any other i've tried (including python, ruby, scheme, java,...). I wouldn't recommend starting with scheme, it's a very complex language and even though i like the functional programming i found it to be very... problematic when used in a pure functional environment. I very much prefer the functional extensions of C#, though, yes, i found them a lot more useful after trying scheme for a while and learning the functional thought patterns. Python is a nice language, it's ok to learn it and definatly won't hurt for private programming. It's a growing language but for professional development i don't see a market, it won't help you much if you want to find a job with the language of your choice, though it will teach you a lot of design and style aspects that will help you develop better in other languages (as do C# and Ruby). I've only worked with C, C++ and Java, a part from some scripting langauges, and want to know in what way do you find C# more productive than Java? Yea I'm curious about this too. In my past experiences, C# was only useful with VS building front-end windows apps. I know you can write server code with it too, but I never understood/researched the advantages of using it over Java. Other advantages of C# compared to java: Functional extensions, first class functions, common namings of methods and functions in the .NET library (depending on which java array class you use, it's either .size(), .getLength(), .length, .getCount(), .count(), .getLength(), ... i guess thats the drawback on being open source with no early concept), extension methods, ... Functional extensions: For example if i want the ID properties of all customer objects in an array where the customer registered before 2011 (which reminds me, C# properties are really cool, Python has similar, Java doesn't): Oh, did i mention that the last time i had to use Javas date handling libraries i nearly had to scream because of how complex and unlogical it was? calendar... uhm... yes.... hope for you java folks they improved on that. Oh, and if we want to make that multi-threaded because the sourceArray is very big... we have to use third party libraries in Java or write a lot of code. C# multi-threaded (.NET 4.0): IEnumberable<Int32> results = sourceArray.AsParallel().Where(c => c.RegisteredDate < (new DateTime(2010, 1, 1)).Select(c => c.ID); Extension methods: I recently had the case that i wanted to have the position of units on a map, i stored them as instances of the Point class. I later had the case where i wanted to calculate the distances between units, so instead of creating a new class and using that everywhere, i simply created a "PointExtensions" class and added a GetDistanceTo() method to the original Point class. Oh, did i mention that visual studio 2010 is simply the best IDE i've ever used? Neither eclipse, netbeans, kdevelop, etc even comes close. I had to write Java for a year, but my knowledge is still limited and dated, if anyone wants to correct me i always welcome to learn something new, but imho C# is just a more modern language, though you still pay for it by knowing less about what happens in the background. These are all language nuisances, and I'm sure such things exist in C# as well (I just don't use them enough). Yes, I agree, some things in Java are complete garbage (like date, generics, primitive autoboxing, and lack of functors), but complaining about these issues is downright pointless. I was more curious about the possible security/performance/portability reasons backing your claim. Also, VS is absolute terrible if you have a large project, it takes forever to load, build and run. And don't even get me started on loading the designers if they are interlaced with other designers.
Security is always in the hands of the programmer. I don't see anything where C# and Java should function differently. Codewise they get both converted to bytecode which can be reverse engineered. Don't see any difference there.
Performance is hard to measure, my subjective experience is that C# is faster in many operations and slightly slower in others, but YMMV. Benchmarks are rarely significant since they usually show just one part of performance (and depending on what language the person likes, the part that performs best in his language of choice).
Portability... the server for the game i wrote, which uses a multi-threaded, embedded webserver which is included in .NET, has several processing threads and uses JSON serialized from the objects to transfer the data was compiled on my windows PC (my desktop runs windows because i'm too lazy to dualboot), copied to the Linux (CentOS) Server, started with "mono GameServer.exe" and ran immediatly and perfectly. For GUI Applications the Windows.Forms will obviously not work, but there is Gtk# which i haven't used, but heard that it should work flawlessly. I have no experience with it though.
I usually prefer programmer performance to application performance, and those annyoing things in java you mentioned yourself often reduce the programmer performance a lot. Yes, application performance is important, but if the programmer can finish his job in one third of the time he can still use another third of the time for optimizing and is still below the deadline.
VS2010 runs fine for me, it starts up faster than eclipse or netbeans, which i used for java, and the programs i have compile in about 1-2 seconds and the integrated unit testing framework is quite nice to use, too. Might be just my small (<10k LoC) private projects tough.
EDIT: Many people mistake C#/.NET for ASP.NET... ASP.NET _is_ horrible. I will not argue on that, it simply is.
On February 11 2011 23:46 Zipp wrote:Show nested quote +EDIT: If you would dabble in java, to be effective/productive you should really learn proper OO design to utilize the language to its max. I've always found that pushing OOP early turns people into bad programmers. My first "language" was -very- bad PHP, from which I learned the basics of flow control, passing arguments and calling functions, etc. This evolved into writing my own functions / reducing redundant code by faking namespaces (PHP has them NOW but didn't before PHP version 5.3?) which turned into all out OOP programming using MVC-like frameworks. And I still find OOP to be completely unnecessary overhead at times. But this experience carried over when learning C and Java -- I had a very good understanding of both procedural and OOP styles and didn't have any problems getting either to do what I needed until getting better at both in terms of style / general language knowledge. Although I have to say, going from implicit type casting to more strict types? Yeah, that was an interesting transition. (In PHP if I have $i = "1" (string), I can do $ans = $i + 2 and $ ans will be 3. Java will throw an exception and the C compiler will say "f you, dude. no wai."
Many people misunderstand OOP and teach the wrong principles first. OOP is not "put everthing in classes", the far more important parts are "Information hiding", "Encapsulation" and "Abstraction". I have to write PHP at work and work with legacy applications that are extremely tightly coupled and sometimes 5'000 lines (not exaggerated) without a function call and lots of "if ($some_condition == 1){...} elseif ($some_condition == 2) {...} elseif ....... repeated on 20 different places. That could have been reduced to 1 line in proper OOP design. In a recent object some programmers tried to use OOP... and created a class "Functions" with lots of "public static" methods... lots of fun to be had...
|
Java and C# are pretty much equally bad. Both lack some essential features and are dumbed down (compared to more complicated, but much more mighty languages such as C++) in order to be more secure for worse programmers. I'm not sure about C# anymore since I last used it about 4 years ago, but you can't even overload operators in Java. No template programming in either, plus algorithms which are memory-management heavy are a complete and total hell in both C# and Java - performance wise (due to garbage collection and lack of pointer arithmetics). By the way a really minor point that always bothered me greatly with both languages is the lack of a possibilty to separate definition and implementation of classes.
What makes them actually useful are the standard libraries and IDEs which are provided with them (Most people use eclipse for Java and Visual Studio for C#), plus Java is more or less platform independent (requires virtual machines on clients though).
As such they are nice for mediocre software engineers and software architects who need some codemonkeys to code their carefully designed code-structure, and of course in general for GUI designers, because of Swing and Windows Forms (even though I personally think that the swing GUI looks really ugly), but even after working with all 3 languages (Java, C#, C++) extensively, I have always and will always prefer C++.
|
ASP .NET is good if you use mvc ^^, MVC 3 with the razor syntax is actually quite awesome and really cuts down on dev time. Web forms are terrible tho.
Also I never had a problem with vs on large projects, I don't really find it that slow compared to other IDE's (I find netbeans performance worse on similar size projects, havent used it in a while tho). Also resharper rules xD
|
On February 12 2011 00:38 heishe wrote:As such they are nice for mediocre software engineers and software architects who need some codemonkeys to code their carefully designed code-structure, and of course in general for GUI designers, because of Swing and Windows Forms (even though I personally think that the swing GUI looks really ugly), but even after working with all 3 languages (Java, C#, C++) extensively, I have always and will always prefer C++.
Personal preference is one thing, but declaring that C# and Java are for medicore or unskilled developers and C++ is for experts is naive. Each language has its own pros and cons that make them suitable in different situations. Just like choosing the proper algorithm or architecture for your project, picking a programming language is very much a design decision with trade-offs that you need to weigh appropriately.
I would venture to say that many people think C++ is the "best" language for their project when in reality C# or Java are a better choice since it will save them significantly in productivity and maintainability (over any possible performance gains with C++).
|
On February 12 2011 01:32 Kambing wrote:Show nested quote +On February 12 2011 00:38 heishe wrote:As such they are nice for mediocre software engineers and software architects who need some codemonkeys to code their carefully designed code-structure, and of course in general for GUI designers, because of Swing and Windows Forms (even though I personally think that the swing GUI looks really ugly), but even after working with all 3 languages (Java, C#, C++) extensively, I have always and will always prefer C++. Personal preference is one thing, but declaring that C# and Java are for medicore or unskilled developers and C++ is for experts is naive. Each language has its own pros and cons that make them suitable in different situations. Just like choosing the proper algorithm or architecture for your project, picking a programming language is very much a design decision with trade-offs that you need to weigh appropriately.
I didn't say "it is for", I said "they're nice for". Of course skilled and smart developers can also use Java and C#, but they have no reason to do so unless they're either heavily depending on "compile once, run everywhere"-type of platform independence or they're designing a GUI-heavy program (like your average business application for example, which is pretty much the main reason why both Java and C# are most often used in all the software development companies that develop business applications for other companies).
Your general point is true, the problem is, neither C# nor Java have any advantages at all over C++, except in the cases that I stated, but a lot of disadvantages. If you disagree, feel free to make some specific examples. What you say is almost exactly what I hear from Java users when I tell them that I don't like Java for reason xyz.
Your second paragraph is also way to general, be more specific please:
On February 12 2011 01:32 Kambing wrote: I would venture to say that many people think C++ is the "best" language for their project when in reality C# or Java are a better choice since it will save them significantly in productivity and maintainability (over any possible performance gains with C++).
What do you mean by "save productivity and maintainability"? What kind of facilities (with exceptions of the ones that I already stated) do either of those languages have over C++?
Maintainability and productivity is almost exclusively decided by software architecture ("code design") and in that area C#, Java and C++ are almost exactly the same (they even have the same syntax in 99% of all cases), safe for the fact that you don't have template programming (by far the biggest advantage in terms of productivity when used by a programmer that understands templates and knows how to use them) in Java and C#.
edit: Actually, C# and Java both have a built-in for each loop. Haha, but that's all I can think of, and even that is very minor and will be added to C++ this year or next.
|
This discussion is not productive at all.
People who like to use Java will say Java is the best and blablabla, people who like to use C++ will say C++ is the best blablabla, same for C# and all other languages.
The maintainability is much more attached to software engineering than the language you are actually going to use.
|
To argue which programming language is the best is meaningless, as they depend on the problem you wish to solve.
Programming languages are just tools to have in your toolbox.
I believe a great programmer should know several, and when to use them. Languages one should know include c++, java, python, haskell, erlang, lisp, oz. And possibly "assembler" so one understands what compilers actually does and how.
It is also important to know algorithms, and programming paradigms like dynamic programming, linear programming, concurrent programming etc.
|
|
On February 12 2011 03:46 Eventh wrote: To argue which programming language is the best is meaningless, as they depend on the problem you wish to solve.
In general yes, but for this discussion it's simply not true, as we're not talking about languages in general, but about Java, C# and C++, with Java and C# being highly similar to C++, just with less features.
You guys are producing the same meaningless statements over and over again. Try to reason please, and don't just put general statements like the one I quoted out there. A basic argument should consist of thesis and reasoning/proof (and an example doesn't hurt). All you are doing is putting thesises out there with no backup at all.
Come on. Name one thing that's objectively better about the Java or C# language than in C++.
|
On February 12 2011 05:00 heishe wrote: Name one thing that's objectively better about the Java or C# language than in C++. Java RMI, and all you get for free with built in reflection.
|
On February 12 2011 05:00 heishe wrote:Show nested quote +On February 12 2011 03:46 Eventh wrote: To argue which programming language is the best is meaningless, as they depend on the problem you wish to solve.
In general yes, but for this discussion it's simply not true, as we're not talking about languages in general, but about Java, C# and C++, with Java and C# being highly similar to C++, just with less features. You guys are producing the same meaningless statements over and over again. Try to reason please, and don't just put general statements like the one I quoted out there. A basic argument should consist of thesis and reasoning/proof (and an example doesn't hurt). All you are doing is putting thesises out there with no backup at all. Come on. Name one thing that's objectively better about the Java or C# language than in C++.
In general, there's no objective measure we can apply to programming languages because most language are able to express any computation (that is actually computable). So the right question to ask is not "can you do X" in a programming language but instead "how well can you implement X" which is strictly subjective (with answers being a mix of verbiage, lines of code, expertise, understandability, etc.).
But I'll bite anyways (with the above caveat) with the obvious example. Complete garbage collection is the major benefit that Java and C# provides over C++ within the family of C-like languages. Good programming practices in C++ such as smart pointers or approximate GC libraries alleviate much of the burden of manual memory management, but not all of it.
The caveat is that, e.g., in Java, with garbage collection you gain automatic memory management at the cost of easy deterministic cleanup (which you obtain in C++ through raii). Since Java only provides non-deterministic clean-up via finalizers, you are forced into the try-finally pattern which is itself brittle, e.g., the following code always cleans up after s1 and s2 unless dispose() also throws an exception.
try { // ... } finally { s1.dispose(); s2.dispose(); }
C# gets around this by providing built-in support for the dispose pattern via the using construct:
using (Socket s1 = /* ... */, Socket s2 = /* ... */) { // ... } /** * dispose is automatically called once we leave the block similarly * to how the destructor of a stack-allocated C++ object is always * called once the object leaves scope. */
|
be happy with c++ and ignore the fact that every language has its own pros and cons, it will change nothing important.
|
On February 12 2011 05:36 Kambing wrote:Show nested quote +On February 12 2011 05:00 heishe wrote:On February 12 2011 03:46 Eventh wrote: To argue which programming language is the best is meaningless, as they depend on the problem you wish to solve.
In general yes, but for this discussion it's simply not true, as we're not talking about languages in general, but about Java, C# and C++, with Java and C# being highly similar to C++, just with less features. You guys are producing the same meaningless statements over and over again. Try to reason please, and don't just put general statements like the one I quoted out there. A basic argument should consist of thesis and reasoning/proof (and an example doesn't hurt). All you are doing is putting thesises out there with no backup at all. Come on. Name one thing that's objectively better about the Java or C# language than in C++. In general, there's no objective measure we can apply to programming languages because most language are able to express any computation (that is actually computable). So the right question to ask is not "can you do X" in a programming language but instead "how well can you implement X" which is strictly subjective (with answers being a mix of verbiage, lines of code, expertise, understandability, etc.). But I'll bite anyways (with the above caveat) with the obvious example. Complete garbage collection is the major benefit that Java and C# provides over C++ within the family of C-like languages. Good programming practices in C++ such as smart pointers or approximate GC libraries alleviate much of the burden of manual memory management, but not all of it. The caveat is that, e.g., in Java, with garbage collection you gain automatic memory management at the cost of easy deterministic cleanup (which you obtain in C++ through raii). Since Java only provides non-deterministic clean-up via finalizers, you are forced into the try-finally pattern which is itself brittle, e.g., the following code always cleans up after s1 and s2 unless dispose() also throws an exception. try { // ... } finally { s1.dispose(); s2.dispose(); }
C# gets around this by providing built-in support for the dispose pattern via the using construct: using (Socket s1 = /* ... */, Socket s2 = /* ... */) { // ... } /** * dispose is automatically called once we leave the block similarly * to how the destructor of a stack-allocated C++ object is always * called once the object leaves scope. */
Automatic garbage collection is only an advantage if you're a bad code designer. It has no upside except for making the lives of bad programmers easier, but it has the downside (as I already said a few posts up) of being a MAJOR slowdown in classes and algorithms which rely on the constant creation (and eventually destruction) of new objects.
It saves the need for typing a few extra lines of code (and I really mean just a few. If you constantly have the need to delete tons of pointers in the destructor of a class, you're doing something wrong), but that is almost entirely irrelevant in practical circumstances. The average software engineer probably creates something like 10 lines of code per hour, since the vast majority of time is spending thinking (unless you're in a structure where you're a codemonkey under someone who designs the broad picture of the code, in which case, as I already pointed out, Java and C# are good for you and your boss, the actual software engineer).
And in the very near future, Java and C# will fall even farther behind in that department, as C++ is introducing Rvalue references, and together with that, move semantics and perfect forwarding.
On February 12 2011 05:36 Eventh wrote:Show nested quote +On February 12 2011 05:00 heishe wrote: Name one thing that's objectively better about the Java or C# language than in C++. Java RMI, and all you get for free with built in reflection.
Alright, I wasn't aware of that.
|
Modern software becomes bigger, development of new software raises because markets/ppl/industries/whatever need new software and here you have your biggest advantage over c++: bug-resistance
the chance of producing bugs is alot higher with c++ compared to c#, java, because of the nature of the languages o.c., especially memory organisation produces bugs... besides technical differences this is a huge factor in a time where speed isnt that much of a factor because of faster cpu's and all that stuff that belongs to it...
programming languages have huge success because they give ppl what they need at a given time, in this case easy oop-able languages are more effectively in large software-projects than c++, different requirements - different languages , thats simply all.
time = money, garbage collectors safe time, also for good programmers, especially in large projects...
mfg
|
On February 12 2011 06:07 heishe wrote: Automatic garbage collection is only an advantage if you're a bad code designer. It has no upside except for making the lives of bad programmers easier, but it has the downside (as I already said a few posts up) of being a MAJOR slowdown in classes and algorithms which rely on the constant creation (and eventually destruction) of new objects.
It saves the need for typing a few extra lines of code (and I really mean just a few. If you constantly have the need to delete tons of pointers in the destructor of a class, you're doing something wrong), but that is almost entirely irrelevant in practical circumstances. The average software engineer probably creates something like 10 lines of code per hour, since the vast majority of time is spending thinking (unless you're in a structure where you're a codemonkey under someone who designs the broad picture of the code, in which case, as I already pointed out, Java and C# are good for you and your boss, the actual software engineer).
What you just described was garbage collection as it was understood by the software engineering community in the 90s. Putting aside the C++ bravado, today people understand that regardless of how good you are at programming, manual memory management is a difficult problem that can have a profound impact on not just writing code (as you are fixated on), but also testing said code and having confidence that it meets specification. Not to mention that much of the slowdown that you are talking about can be dealt with indirectly (e.g., in Java with flyweights) or directly (e.g., in C# with struct/value types).
This doesn't make garbage collection superior to manual memory management. It simply means that there is a significant set of trade-offs to be considered when choosing Java or C# over C++. But definitely writing off garbage collection as a crutch is short-sighted.
On February 12 2011 06:07 heishe wrote: And in the very near future, Java and C# will fall even farther behind in that department, as C++ is introducing Rvalue references, and together with that, move semantics and perfect forwarding.
The performance benefits from value sharing are entirely orthogonal to those gained by garbage collection.
|
On February 12 2011 06:33 Willes wrote: Modern software becomes bigger, development of new software raises because markets/ppl/industries/whatever need new software and here you have your biggest advantage over c++: bug-resistance
the chance of producing bugs is alot higher with c++ compared to c#, java, because of the nature of the languages o.c., especially memory organisation produces bugs... besides technical differences this is a huge factor in a time where speed isnt that much of a factor because of faster cpu's and all that stuff that belongs to it...
programming languages have huge success because they give ppl what they need at a given time, in this case easy oop-able languages are more effectively in large software-projects than c++, different requirements - different languages , thats simply all.
time = money, garbage collectors safe time, also for good programmers, especially in large projects...
mfg
That isn't necessarily true. C++ is an older language and as such, components you'd use (aka other people's code and well known solutions to problems) will be extensively documented.
No matter what language you use you will always have bugs. Garbage collectors, like time spent coding, aren't major issues if you are a Software Engineer. It's nice to have but isn't going to make someone that isn't experienced in programming better.
|
On February 12 2011 07:01 Ace wrote:Show nested quote +On February 12 2011 06:33 Willes wrote: Modern software becomes bigger, development of new software raises because markets/ppl/industries/whatever need new software and here you have your biggest advantage over c++: bug-resistance
the chance of producing bugs is alot higher with c++ compared to c#, java, because of the nature of the languages o.c., especially memory organisation produces bugs... besides technical differences this is a huge factor in a time where speed isnt that much of a factor because of faster cpu's and all that stuff that belongs to it...
programming languages have huge success because they give ppl what they need at a given time, in this case easy oop-able languages are more effectively in large software-projects than c++, different requirements - different languages , thats simply all.
time = money, garbage collectors safe time, also for good programmers, especially in large projects...
mfg That isn't necessarily true. C++ is an older language and as such, components you'd use (aka other people's code and well known solutions to problems) will be extensively documented. No matter what language you use you will always have bugs. Garbage collectors, like time spent coding, aren't major issues if you are a Software Engineer. It's nice to have but isn't going to make someone that isn't experienced in programming better.
I agree with you that the overall average bug rate for C++ code is not necessarily higher than in other languages. However, I think the real point of Willies's post is that garbage collectors remove whole classes of bugs from the equation which simplifies design and testing.
But definitely garbage collection does not make you a better or worse programmer. It is a tool that can make your life easier (as long as you are aware of and accept the downsides) so you can focus on the problem at hand rather than the infrastructure to solve that problem.
|
On February 12 2011 05:36 Eventh wrote:Show nested quote +On February 12 2011 05:00 heishe wrote: Name one thing that's objectively better about the Java or C# language than in C++. Java RMI, and all you get for free with built in reflection.
And to add on the train of one-off language features:
Type-safe querying arbitrary data sources with linq. Type-safe language interoperability (with other .NET languages, e.g., VB, C++, and F#). Built-in support for serialization of objects (via [serializable] in C#, or the Serializable interface in Java). Related to reflection (kind of): type dynamic:
// Typechecks fine but will throw an exception at // runtime if d does not have a f() member. int foo(dynamic d) { d.f(); }
|
|
|
|