Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am curious as to how people port open source projects such as Lucene and Hibernate from Java to .NET? Is it a simple matter of using the Java Language Conversion Assistant 2.0 released by Microsoft?
Unfortunately, there's usually a much greater effort involved for projects that large. What's efficient in one language may not be in another, and more importantly what exists in one language may not in another. NHibernate for example took years to port over, and they're still doing it (albeit adding features the whole time, like Linq).
It's usually a matter siting down and porting classes one by one, optimizing where possible, changing structures where needed. Things like generics, aliases and boxing all change in the port. Then, after you get it all over, there's often lots of optimization still left to be done (of course this is optional...), maybe it's events, maybe it's statics and extension methods, could be anything your new language/platform offers that the old one didn't.
Think of it this way, why are you porting it to .Net? I'd wager to say you're in one of two situations, one you're stuck using .Net because of work (doh, sorry!) or you like .Net because it offers you some advantage. In the second category that means you chose it over Java, so in porting you'd want to take advantage of whatever features that made you choose .Net in the first place.
Like Nick said it is not that simple. A lot more than just porting code is involved, especially if the architecture of the application you want to port isn't that great. You want to use the features of the language you are porting to, and sometimes they are design decisions that you might change, because they don't seem right to you. I am not going to reiterate what Nick said, but would like to add the following.
I would recommend following the development of Noda Time, which is Jon Skeet's attempt to port Joda Time from Java to .Net. Jon is actually documenting the experience on the following blog:
http://noda-time.blogspot.com/
I would recommend following the blog, the google groups page for this project, and google code project. The google groups and code page links can be found on one of the posts on the blog.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am attempting to create my own version of a cryptocurrency by using a BlockChain in a P2P network. I would like users to access my website then download an executable that allows them join the network and mine for currency. I also would like my website(c#) to display the updated ledger of the blockchain. I have done a lot of research, with little success, attempting to understand how to construct the P2P network.
What would be the recommended language to construct this executable? Are there any tutorials or examples that are suggested? In addition, how would my website access the universal ledger? Is it feasible to have my website's server also join the P2P network, or should the P2P network continuously send the ledger to my server?
I believe this is language agnostic. Any language that can be built on different platforms. Actually, I saw a book about blockchain implementation in python. But also there are courses on Java.
Blockchain is a very complex technology to understand not to mention inventing something like that with C# language.
I might want to start with Ethereum which uses solidity language similar to JavaScript.
If you would like to use C#, you might want to look at Nethereum (.Net integration library for Ethereum).
As Dmitry mentioned this is language agnostic.
Regarding C#: we have Bitcoin and Stratis full node implementations in .NET, which may be your best reference. As Win said, it's a complex technology, so expect years of development until you can roll out a buggy alpha version, assuming you are doing it alone.
You may also want to get some experience first, for that, take a look at the book: Programming the Blockchain in C#.
Then go and try building your product based on the above mentioned reference implementations.
What would be the recommended language to construct this executable?
Historically lazy altcoin devs just cloned Litecoin and changed some parameters so C++ is what most alts are written in, but again: it's language agnostic.
In addition, how would my website access the universal ledger?
That's your smallest problem. If you succeed to roll out an alt, then by the time you will know it.
The choice of language depends on networking requirements and validation requirements.
For a completely decentralized use case, faster cryptographic verification is a need & thus languages native to the machine offer a speed advantage (like c++, golang).
If there is any element of centralization like private blockchain, permissioned blockchain, premined, asset-backed token, virtual machine blockchains like evm, colored coin etc. then access control and development requirements overtake permissionless and security requirements & thus language with available human resource should be chosen like c#, java etc.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am writing a software suite which is essentially composed of two separate applications in C# .Net using WPF. Although they may look a little bit different they essentially work like a lite version and a full version of the same software package. The full version contains all of the functionality of the lite version.
I had previously done this by creating two separate applications which share a class library where all the common user controls go. But i am now wondering if there is any better design for this kind of architecture.
I was even thinking of creating one application and at runtime let it decide which version it was going to work as.
Could anyone with any experience with this type of problem please point me in the right direction.
Keep it Simple
My rule of thumb is whenever possible keep solution as simple as possible. That being said I would use the same composition you are using.
Usually break up projects like this:
Application Logic: CompanyPrefix.ProjectPrefix.Core, CompanyPrefix.ProjectPrefix.Data...etc.
Applications : CompanyPrefix.ProjectPrefix.ApplicationType.App, so some examples :
CompanyPrefix.ProjectPrefix.Web.App
CompanyPrefix.ProjectPrefix.Console.App
CompanyPrefix.ProjectPrefix.Wcf.App
Since you have two Wcf Apps might want to do something like
CompanyPrefix.ProjectPrefix.Wcf.Lite.App
CompanyPrefix.ProjectPrefix.Wcf.App
So in this example both CompanyPrefix.ProjectPrefix.Wcf.App and CompanyPrefix.ProjectPrefix.Wcf.Lite.App point back to CompanyPrefix.ProjectPrefix.Core or wherever your business logic is.
About Dynamically Loading Assemblies
There is a way to dynamically load your libraries at runtime, but unless you're dealing with a modularized system of independent components would recommend against it.
If your heart is set on it there are a lot of resources on MSDN, would probably start here. Article about loading assembly into current application domain.
Come Up with a Checklist
One thing I find helpful is to come up with a checklist to help me make decisions in case I ever get stuck. Usually ends up being something like:
Does this have business value?
Does this make debugging harder?
What are the Pros and Cons of doing it a new way versus the way I have done this in the past?
This isn't my exhaustive list but explains the point. This can really help too when you have a group of people that are largely sticking with choices for personal reasons that don't have any grounding, as well as a tool to use when you get stuck to make a decision and go with it
Dealing with Application Logic Changing (Write Clean Code)
Coming up with an over-complicated "never need to recompile entire application again" is a mistake I have made in the past. You're still going to need to deploy and compile something.
Most important thing about dealing with changes in application is to
Have Code on Source Control (most important)
Write Clean Code
Write Tests
Write Documentation ( I know no one likes to do this )
Write some more Tests
What will consume most of your time when dealing with application changes is debugging so focus on reducing the amount of time you spend debugging not a amount of time you spend compiling and deploying
For Deployment setup Continuous Integration
If you have the ability to setting up CI would eliminate 99% of the hassle of changing the application. You lose a day or two setting things up for the first time, but it is well worth it.
Check out TeamCity and Travis CI
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm probably going to take some heat for this question. But I'd like to know how to address this problem. So here goes.
I program (to different levels of competence - admittedly) in various languages. I have dabbled with C#, and it seems quite a nice language (reminds me A LOT of Java and C++). The problem is that I have what can only be described as a pathological distrust of all things from the Redmond company - as a result of experiences too many to enumerate here.
I am a great believer in open source software (GPLd or otherwise) - and am an avid consumer and contributer to many Open Source projects.
My questions are the following:
.Net can ostensibly be run on Linux using mono - but is anyone actually using such a setup in production?
It seems to me that almost every (half year?) or so, a new version of the language is pushed out - (I don't know whether the new versions are backward compatable). In any event, if you take other languages e.g. C/C++, Python etc, the 'versioning' is far and few between - therefore it provides a more 'stable' environment for the developer. It seems (in my mind at least) that learning/using C# is going to be a never ending learning curve every six months - I am not sure if I have the wherewithal to commit so much to any one particular language.
To summarize, I am trying to balance the pros and cons of learning/using .Net (and C# in particular, which looks like a beautiful language), but if I do, I want to deploy on Apache/Linux (with either mySQL or PostgreSQL backend) - as opposed to IIS/Windows/SQLServer.
Is this a pipe dream (running .Net/C# on Linux), or is someone out there actually using it in production?
While C# does change periodically, it's more along the lines of 18-24 months than 6 months. Moreover, the C# team is very conscientious around making the changes as backward compatible as possible. (There will always be potential breakage when new conversions are introduced etc, but this is mostly a problem with corner cases such as overloading in the inheritance hierarchy.) You don't have to learn everything to do with the latest version... and in the case of C# 4, if you don't do COM and you don't want to use dynamic typing, there's not very much to learn anyway. The enhancements for C# 2 and 3 were much larger, of course - but then they brought much larger benefits too.
As for whether Mono is used in production - the Mono project itself has a list of companies using Mono.
There's a good list to be found at http://mono-project.com/Software and http://mono-project.com/Companies_Using_Mono one good example "Electronic Arts used it to power Sims3."
New C# versions are pushed out at a quite good pace but the underlying VM specification haven't changed since standardization, backwards compatibiltiy between language versions isn't a problem but you need to target the correct Runtime Version but that's the exact same problem you'd have with Java.
The weakest part of the .Net ecosystem is probably that open source haven't progressed as far as in the Java sphere but things seems to slowly be improving, uptake and contributions will only help that. There's much good stuff comming out of the Alt and Progressive .Net camps in that regard.
The Wikipedia page for C# shows that your feelings about frequency of new language versions are far from the truth. Certainly the MS way has always been to keep up the flow rate of new technologies - see for example Joel's old essay Fire and Motion - but there's rarely a compelling business reason to keep up with the latest shiny. But the existence of that strategy on MS's part is no reason to keep you from using what is as you say a very nice language, which is independently standard-ised.
If you really want to do web development and host it on linux, .Net / Mono ain't your best choice.
Although ASP.Net seems to run (WebForms that is), ASP.Net MVC (2) does not, at least not flawlessly, so it depends on how well you know Linux to work around bugs that will arise.
Personally, I found it easier to just learn Ruby and use Ruby on Rails than to work around awkward bugs regarding ASP.Net MVC with Mono.
For desktop clients, Mono is a viable alternative.
As for C#: In my opinion it is a nice language too and with the .Net framework it is really productive for windows clients. The changes aren't that bad and you don't have to use every shiny new feature, but you can.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've started looking into a few larger server-app frameworks that would be able to support desktop client interfaces as well as web interfaces, and have really zero'd down on the two obvious ones: J2EE and .NET. From a language standpoint, feature standpoint, portability standpoint, etc...I am pretty comfortable with my understanding of the two products. I'll keep it simple in saying that for the most part, either would fit the need well enough based on my initial analysis.
Where things are a pain though is in finding a good comparison from engineers who have spent a better part of the decade working with one, the other, or both. The undocumented frustrations that youwont get from Sun, Microsoft or a book.
A Google search turns up plenty of results, but most are from 2002-04. Suffice to say, plenty has changed since. J2EE is suposed to have gotten a lot simpler and .NET is supposed to have gotten a lot more feature rich.
Is anyone aware of more current comparisons (in the last two years) that might be worth reading?
Have you seen these?
http://en.wikipedia.org/wiki/.NET_Framework#.NET_vs._Java_and_Java_EE
http://en.wikipedia.org/wiki/Comparison_of_the_Java_and_.NET_platforms
http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java
Since you say 'desktop' before you said 'web', i can assume that the desktop side of this application is more important. .Net has a definite advantage in making desktop apps, Java really doesn't have this as an advantage.
Having said that, i'd just go with whichever your dev team has more experience in.
Java EE has certainly changed a lot. The biggest changes that you'll want to be aware of are Spring and the new EJB3 spec.
Spring is not part of Sun's Java EE standard. It's the crystalization of Rod Johnson's consulting experience into a framework for POJO development that's gotten a lot of traction. And, just for reference, there are versions of Spring for both Java and .NET. Likewise for Hibernate, a popular ORM tool.
EJB3 has taken a great deal from Spring and Hibernate. You can use EJB3 with Glassfish or JBOSS or WebLogic.
Another idea that you'll want to keep in mind is web services. These are distributed web components that can work with any client, Java EE or .NET, desktop or browser. I think their chief benefits are the emphasis on messages and hiding the back end implementation details. If you write web services, your clients don't have to know or care whether they're written in Java or .NET.
Web services work well with rich Internet clients like Flex and Silverlight. They can help to keep your options open.
Sorry, I can't speak from personal experience about .NET.
This is a real "apples and oranges" type question.
Generally speaking I'd rather do desktop development in .Net. If I did it in Java I'd probably favour Eclipse SWT or Netbeans RCP over Java Swing.
For serverside programming you can use either. I'm not a huge fan of Windows as a server platform (over Linux) and the Java stack is essentially free, which is particularly useful in terms of start-up costs (Bizspark notwithstanding).
The biggest thing about Java server apps isn't really J2EE anymore. It's Spring. You'll probably find more Java web apps running with Tomcat and Spring than you do full J2EE stack apps (generally meaning including EJB).
EJB3 has gone POJO like Spring is.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I feel I'm a well rounded programmer, I'm comfortable in C# and java (several large projects with both) but I tend to use C++ for most applications when I have a choice. (and sometimes R,Python, or Perl as appropriate..)
But I am astounded to see the popularity of C# here on SO. There are 18500 C# topics, more than C, C++, and java combined. I've never felt C# as having such an impact in the companies I've worked with but the SO popularity of C# is undeniable.
My question:
Why is C# so popular on Stack Overflow? My question is not so much a SO question as a desire to understand C#'s current acceptance/growth compared to C++ and java.
Possible explanations for the popularity:
C# is truly that popular and accepted in industry, it's everywhere!
SO is not typical, it seems to have attracted a disproportionate number of C# users
C# has more questions/confusions that tend to need community help to solve
Microsoft (maybe on its forums?) encourages people to use SO for questions
The first explanation is likely the reason, but I just haven't felt that popularity in the real world!
What's your reason you discuss C# topics here?
I think the founders of SO are .Net gurus. Most of the people who follow their blogs found out about the site, and started coming here. The original user base was probably pretty .Net/C# focused.
I also think that C# is the preferred language in .Net with it's interop and ability to use old C and C++ code. Those familiar with C, C++, and Java can easily get a useful application built and working in C#, and be pretty certain it will run on any system with the proper .Net framework installed.
And, C# sounds cool.
I wrote about the popularity of C# on another thread, but to discuss why it's popular on SO, I'd say others have the right of it. C# is popular here because most of the people who first came to SO did so following Jeff Attwood's blog. That's certainly how I came here.
The thing is, SO really is language neutral, even if it's written in C#. Both Jeff and Joel have programmed in other languages and are hardly bigots when it comes to language; they just chose C# because it really is an amazing language to program in.
Comparing C# to Java and C++, the growth has been astounding. C# when it was first introduced was basically Java with a better GUI library (Win.Forms beats the ever-lovin' snot out of Swing any day, IMO, and WPF is heads-and-shoulders above both) and a few extra concepts, the biggest of which was delegates and properties as first-class citizens. Since then it's grown meteorically, constantly adding newer and better things. The entire concept of LINQ has drastically changed the way I approach iterations; couple that with WCF for contract-based inter-process/computer communications and WPF for a truly amazing way to build GUIs, and you've got a rock-solid language and library.
Hell, WCF alone makes .NET the correct enterprise/SOA choice.
By contrast, Java hasn't released a new version in, what, 5 years?
C# is innovating. Java is stagnating. C++ is... well let's call it "stable", shall we? The newest version, which is dubbed "C++0x" will soon need to be called "C++1x". The features that are planned require so many changes to the runtime that you're almost going to have Java or C# when you're done anyway so why bother?
Finally, to answer your last question, I come here to answer questions about any topic. I mostly prefer to deal with abstract problems rather than language-specific issues, but I'm always willing to help regardless of language. Just because I love C# doesn't mean it's all I know. :)
I think it's a combination of reasons 2 & 3. From what I've seen, C# is not as popular as Java, and it's probably not as popular as C++.
From where I live, most people use Java, followed by CPP, followed by C#.
Is atypical.
C# is very popular but StackOverFlow is by no means a reflect of the industry-wide.
Dup: Why is there such a large percentage of C# questions?
Related: Why does Ruby seem to have fewer projects than other programming languages?
I've mostly avoided C#, because (a) I've got a silly prejudice about that glandular freak of a program loader masquerading as an operating system — I just don't do Windows, and (b) because it's so much like Java that I have trouble keeping them apart in my head.
That said, there's a lot of C# being done, and if I weren't an old crank it'd probably be a good language.
The thing is that C++ is riding without training wheels. This makes it much better for some things — I helped build the AS/400 operating system in C++, bare metal up — but not as good for the sort of application programming most people do most of the time.
I guess that is partly due to people knowing of the site thru Jeff Atwood's blog, and Joel Spolsky's website.
Although their writings are not technology specific, it has a slant towards MS stack and hence the site is popular among developers working on MS suite of tools/languages.
Once the site becomes more popular and gets ranked high in google for questions on other tools, it will have more questions on those topic as well.
It really just depends if you plan on working with windows. If you like Linux or mac better then you probably want to use another language (although you could use Mono.NET). I just use C# because of 3 main reasons:
Easy to learn
Easy to use
Easy to deploy
But if you like a different language better then use it. Right now I'm learning C so that I can help contribute to some of my favourite open source linux apps.