• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:25
CEST 08:25
KST 15:25
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed9Weekly Cups (July 7-13): Classic continues to roll2Team TLMC #5 - Submission extension2Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
Who will win EWC 2025? RSL Revival patreon money discussion thread Esports World Cup 2025 - Brackets Revealed Team TLMC #5 - Submission extension The GOAT ranking of GOAT rankings
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
BW General Discussion Flash Announces (and Retracts) Hiatus From ASL Starcraft in widescreen BGH Auto Balance -> http://bghmmr.eu/ A cwal.gg Extension - Easily keep track of anyone
Tourneys
Cosmonarchy Pro Showmatches [Megathread] Daily Proleagues CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile CCLP - Command & Conquer League Project The PlayStation 5
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Stop Killing Games - European Citizens Initiative Russo-Ukrainian War Thread Summer Games Done Quick 2025! Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 2024 - 2025 Football Thread NBA General Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 550 users

The Big Programming Thread - Page 35

Forum Index > General Forum
Post a Reply
Prev 1 33 34 35 36 37 1031 Next
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.
Cambium
Profile Blog Joined June 2004
United States16368 Posts
February 11 2011 14:26 GMT
#681
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 schemer

Python 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.
When you want something, all the universe conspires in helping you to achieve it.
Zipp
Profile Joined February 2009
United States5 Posts
Last Edited: 2011-02-11 14:47:56
February 11 2011 14:46 GMT
#682
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."
hello world.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2011-02-11 15:35:52
February 11 2011 15:28 GMT
#683
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 schemer

Python 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...
heishe
Profile Blog Joined June 2009
Germany2284 Posts
Last Edited: 2011-02-11 15:51:01
February 11 2011 15:38 GMT
#684
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++.
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
wO-ZiGouNeT
Profile Joined January 2011
United Kingdom21 Posts
February 11 2011 15:38 GMT
#685
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
Kambing
Profile Joined May 2010
United States1176 Posts
Last Edited: 2011-02-11 16:36:14
February 11 2011 16:32 GMT
#686
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++).
heishe
Profile Blog Joined June 2009
Germany2284 Posts
Last Edited: 2011-02-11 18:13:04
February 11 2011 18:10 GMT
#687
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.
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
February 11 2011 18:27 GMT
#688
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.
"When the geyser died, a probe came out" - SirJolt
Eventh
Profile Joined March 2010
Norway45 Posts
February 11 2011 18:46 GMT
#689
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.
DanceSC
Profile Blog Joined March 2008
United States751 Posts
February 11 2011 19:57 GMT
#690
If you are looking into game programming through C# with XNA check out http://riemers.net/
Dance.943 || "I think he's just going to lose. There's only so many ways you can lose. And he's going to make some kind of units. And I'm going to attack him, and then all his stuff is going to die. That's about the best prediction that I can make" - NonY
heishe
Profile Blog Joined June 2009
Germany2284 Posts
Last Edited: 2011-02-11 20:01:55
February 11 2011 20:00 GMT
#691
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++.
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
Eventh
Profile Joined March 2010
Norway45 Posts
Last Edited: 2011-02-11 20:52:08
February 11 2011 20:36 GMT
#692
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.
Kambing
Profile Joined May 2010
United States1176 Posts
February 11 2011 20:36 GMT
#693
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.
*/
Willes
Profile Joined April 2010
Germany199 Posts
February 11 2011 20:41 GMT
#694
be happy with c++ and ignore the fact that every language has its own pros and cons, it will change nothing important.
heishe
Profile Blog Joined June 2009
Germany2284 Posts
February 11 2011 21:07 GMT
#695
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.
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
Willes
Profile Joined April 2010
Germany199 Posts
Last Edited: 2011-02-11 21:36:44
February 11 2011 21:33 GMT
#696
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
Kambing
Profile Joined May 2010
United States1176 Posts
Last Edited: 2011-02-11 21:54:18
February 11 2011 21:53 GMT
#697
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.
Ace
Profile Blog Joined October 2002
United States16096 Posts
Last Edited: 2011-02-11 22:07:50
February 11 2011 22:01 GMT
#698
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.
Math me up, scumboi. - Acrofales
Kambing
Profile Joined May 2010
United States1176 Posts
February 11 2011 22:15 GMT
#699
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.
Kambing
Profile Joined May 2010
United States1176 Posts
Last Edited: 2011-02-11 22:53:10
February 11 2011 22:25 GMT
#700
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(); }
Prev 1 33 34 35 36 37 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3h 36m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 238
mcanning 42
StarCraft: Brood War
Zeus 1144
Noble 33
Bale 7
PianO 0
Dota 2
ODPixel398
NeuroSwarm111
canceldota0
League of Legends
JimRising 779
Counter-Strike
Stewie2K1137
Super Smash Bros
Mew2King114
Other Games
summit1g13069
WinterStarcraft337
Trikslyr39
SortOf18
Organizations
Other Games
gamesdonequick3179
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH391
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota213
League of Legends
• Rush2208
• Lourlo1592
Upcoming Events
Replay Cast
3h 36m
WardiTV European League
9h 36m
ShoWTimE vs sebesdes
Percival vs NightPhoenix
Shameless vs Nicoract
Krystianer vs Scarlett
ByuN vs uThermal
Harstem vs HeRoMaRinE
PiGosaur Monday
17h 36m
uThermal 2v2 Circuit
1d 9h
Replay Cast
1d 17h
The PondCast
2 days
WardiTV European League
2 days
Replay Cast
2 days
Epic.LAN
3 days
CranKy Ducklings
4 days
[ Show More ]
Epic.LAN
4 days
CSO Contender
4 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
5 days
Online Event
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Liquipedia Results

Completed

2025 ACS Season 2: Qualifier
RSL Revival: Season 1
Murky Cup #2

Ongoing

JPL Season 2
BSL 2v2 Season 3
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Championship of Russia 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Disclosure: This page contains affiliate marketing links that support TLnet.

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.