|
C# has first-class functions, LINQ, awesome language/framework support for threads and asynchrony, and the best IDE on the market. Java feels like it's stuck in the stone ages after working with C# for so long.
|
# ? Oct 2, 2013 19:59 |
|
|
# ? Jun 8, 2024 09:33 |
|
I agree, I think C# is a whole generation ahead on language features compared to Java. My point was really just that despite being aware that Java is a fine language and ecosystem and working in its spiritual successor for the last several years I'm constitutionally incapable of reading Java code.Dietrich posted:I have very few complaints about C# as an ecosystem. The only real WTF I've run into in the core framework had to do with reading non-blocking I/O from a Process object. The API System.Diagnostics.Process provides is a catch-22. I don't remember the exact details but it was something like you either have to block and guarantee you get all the bytes it's outputting or you can not block but there's no guarantee you get all the bytes, no indication you did or did not get all the bytes, and the handle is dead immediately after polling it once. I suspect the wtf has its roots in something crazy Win32 is doing that the .NET layer couldn't adequately abstract around but it's the only place I've run into .NET where it feels like MS threw up their hands and said gently caress it who needs to do this anyway. edit: actually that's not true. WCF, especially the first release in .NET 3.0 had its share of complaints, including breaking the IDispose contract for all generated service clients. WCF also had a problem, common in the MS ecosystem, where they ship a comprehensive framework to last generation's solutions just in time for the next generation of How Things Are Done to take over (e.g. WCF shipped out of the box for SOAP over every protocol imaginable just in time for the rise of lightweight POX/REST services over HTTP to become the new thing). Dr Monkeysee fucked around with this message at 20:20 on Oct 2, 2013 |
# ? Oct 2, 2013 20:13 |
|
The problem with C# is Windows.
|
# ? Oct 2, 2013 20:16 |
|
Use Mono.
|
# ? Oct 2, 2013 20:17 |
|
Mono is still/was significantly(?) less good than the CLR, though. For example, I know I've heard of code that works great in C# having terrible memory leaks in Mono because its GC could only detect dead objects as actually dead if they had no connections to anything, including other dead objects. Basically, it was strait-up reference counting in the dumbest possible way. Maybe they've fixed that by now, but it wasn't more than 2 years ago that I read this. Hell maybe they were using an old version of Mono - the point is that it's not 100% on all platforms just because of Mono like Java is because the JVM is everywhere. Now I'm wondering why the original Mono team didn't target the JVM :\
|
# ? Oct 2, 2013 20:26 |
|
Mono 3 was released about 2 months ago and one of their major bullet points is a complete overhaul of GC. It's definitely not 100% but it's pretty good in many cases. These days they seem to be focusing mostly on cross-platform mobile development which sounds like a pretty good niche. Unfortunately MS are butts about certain parts of the framework so some stuff is just missing or poorly reverse-engineered because ~*fair use restrictions*~. The relationship to the open-source community is something Sun got very right about Java and MS is still really haphazard and of several minds about. It's a bit of a licensing mess. Munkeymon posted:Now I'm wondering why the original Mono team didn't target the JVM :\ My completely uneducated guess is .NET IL and Java Bytecode don't have enough in common to make this viable. A .NET assembly written on the MS CLR will run without recompilation on the Mono CLR and vice-versa. I doubt that would be possible if Mono's "CLR" was the JVM. Dr Monkeysee fucked around with this message at 20:39 on Oct 2, 2013 |
# ? Oct 2, 2013 20:33 |
|
Well Java has one over C# in that enums can have properties, methods and constructors, which can be handy sometimes. Re: C#, the 1.0/2.0 APIs feel a bit janky or inconsistent in parts. Some methods return strings, some methods return DirectoryInfo/FileInfos, it's not obvious from the name if something will return a trailing slash or what, the full Win32 api for process manipulation isn't exposed in the Process class, so if you need some specific functionality, holy balls you end up writing a lot of extern stuff and re-implementing the Process class (which is not easy). There's no nice way of taking the redirected Console.Out and Console.Error (which aren't actually STDOUT/STDERR annoyingly) and merging them so the output is definitely in the order they were written to. More recently, I think the async/await and TPL is a bit leaky in terms of abstraction - there's lots of subtleties going on under the hood that you need to understand and you can easily end up screwing yourself over unintentionally (think of ConfigureAwait synchronization deadlocks when you use TPL code in a GUI.) Lack of customisation around the JIT or the GC. The relatively massive penalties incurred in short lived .NET apps if you try to access the ConfigurationManager.AppSettings. Not being able to change the default app domain's DLL search path. Interactions between app domains being fairly messy and an absolutely stellar way to gently caress yourself over with type serialization issues if you don't know what you're doing. Custom exceptions (so deriving from Exception) not being Serializable by default, leading to misleading exceptions if an exception crosses an app domain boundary (for the love of god, never write custom exceptions). Libraries and their handling of Xml namespaces, including the default one. The 1.0 library is bad, but the XDocument / XPath stuff isn't much better. NamespaceTableManager and all that bollocks. 99% of the time, we don't care. WPF needs streamlining and bugs being fixed in controls (Accordion control in designer mode has been broken for years now, throws NREs). Language features / extensions to make multi-field validation, or edit/revert/mark as unsaved not a complete PITA full of boilerplate to do. I very much enjoy working with C#, but I do sometimes wish they could throw out a lot of the window and start again.
|
# ? Oct 2, 2013 20:44 |
|
The whole W*F generation of frameworks all seem to suffer from severe architecture astronautics, now that I think about it. WCF, WPF, etc. are (or were) all very difficult to use out of the box for anything useful and are generally unhelpful when things go sideways. However I've always found the core framework to be clean and straight-forward (except some of the pre-generics stuff). Milotic posted:Well Java has one over C# in that enums can have properties, methods and constructors, which can be handy sometimes. You can get around this for many use cases via extension methods. It's not as full-featured as Java enums though.
|
# ? Oct 2, 2013 20:50 |
|
Monkeyseesaw posted:The whole W*F generation of frameworks all seem to suffer from severe architecture astronautics, now that I think about it. WCF, WPF, etc. are (or were) all very difficult to use out of the box for anything useful and are generally unhelpful when things go sideways. Windows Workflow Foundation was the flakiest piece of crap ever and was even flakier when added to SharePoint (which also suffers from architecture astronautics and being firmly in the ASP.NET WebForms camp rather than the MVC camp). WPF always suffered from issues whereby something that you think would be easy or even built into a default control, turned out to be super-hard. And the whole DependencyObject/DependencyProperty malarkey was a bad abstraction. I get that they allegedly did it for performance, but WPF perf is kinda bad anyway, but you end up having to do lots of boilerplate around DO/DPs which wasn't always easy to remember. Biggest issue with WPF is that drag/drop and similar user interactions don't behave exactly the same as Windows Explorer - you had to write custom code to approximate it. I think Microsoft have gotten a lot better at this stuff recently. Doing out of band releases means things can be polished and don't hold up VS releases and vice versa. (Also there is a bigger expectation that libraries can change fairly dramatically until the first proper RC)
|
# ? Oct 2, 2013 21:04 |
|
Monkeyseesaw posted:The whole W*F generation of frameworks all seem to suffer from severe architecture astronautics, now that I think about it. Don't ever look into EF. That is a convoluted bag of suck. Yes, let's replace something that actually worked for quick and dirty applications with something that will take you hours to configure.
|
# ? Oct 2, 2013 21:08 |
|
Monkeyseesaw posted:Mono 3 was released about 2 months ago and one of their major bullet points is a complete overhaul of GC. It's definitely not 100% but it's pretty good in many cases. These days they seem to be focusing mostly on cross-platform mobile development which sounds like a pretty good niche. Unfortunately MS are butts about certain parts of the framework so some stuff is just missing or poorly reverse-engineered because ~*fair use restrictions*~. I keep hoping that someone at Microsoft will get a clue and organize a team that does nothing but work on Mono all day under pseudonyms. quote:My completely uneducated guess is .NET IL and Java Bytecode don't have enough in common to make this viable. A .NET assembly written on the MS CLR will run without recompilation on the Mono CLR and vice-versa. I doubt that would be possible if Mono's "CLR" was the JVM. I wasn't thinking it'd be a compile-once-run-everywhere solution but at least they'd have the language on a solid, mature VM instead of spending 8(?) years getting theirs close. E: thought about it and it should have been possible, given an open source C# -> JBC compiler to write an open source MSIL decompiler (like ILSpy) and chain them together into a fragile, undebuggable C# to JVM compilation suite Then you could work on going straight from MSIL to JBC because if you can go from MSIL -> C# -> JBC, you should be able to skip the first step. Munkeymon fucked around with this message at 21:53 on Oct 2, 2013 |
# ? Oct 2, 2013 21:12 |
|
Dessert Rose posted:Don't ever look into EF. That is a convoluted bag of suck. EF meaning Entity Framework? It really doesn't take hours. What version are you thinking of? It's gotten more streamlined since 4.0, but even 4.0 was easy if you use the Wizard. In fact I would consider it the go to choice for quick and dirty CRUD applications driven by humans (it's less suited to read-heavy server apps). What specific issues are you thinking of?
|
# ? Oct 2, 2013 21:52 |
|
Soricidus posted:or Python (it's much more likely that a random computer will have a JVM than a Python interpreter) Why not just freeze the Python program into a binary? And I'd look into C# more, but I don't see a way to program C# on OSX...edit: Oh Mono exists.
|
# ? Oct 2, 2013 22:48 |
|
Milotic posted:EF meaning Entity Framework? It really doesn't take hours. What version are you thinking of? It's gotten more streamlined since 4.0, but even 4.0 was easy if you use the Wizard. In fact I would consider it the go to choice for quick and dirty CRUD applications driven by humans (it's less suited to read-heavy server apps). What specific issues are you thinking of? Maybe I'm just averse to using wizards to generate a bunch of code for me, but it seemed a lot more heavyweight when all I wanted to do was grab some objects out of a database with some foreign key relationships. I mean, it worked, I just felt like L2SQL took me less effort to get working. The wizard is hard to use when you're writing code on a machine that doesn't have direct access to the DB you're trying to code against, for one. I had to dump the DB and restore it to a local SQL instance first. Dessert Rose fucked around with this message at 23:02 on Oct 2, 2013 |
# ? Oct 2, 2013 22:59 |
|
If you don't have a DAL and you're using EF over multiple solutions, you're going to have a bad time. I know.
|
# ? Oct 2, 2013 23:42 |
|
Soricidus posted:I seriously use Java to write client software today. Distributing Python and Java are pretty similar in that both require some sort of runtime environment. I don't see how it's reasonable to expect a user to have access to a JRE but not expect them to have access to a Python interpreter Or as Pollyanna said, if you're worried about it then create a binary
|
# ? Oct 3, 2013 05:40 |
|
OSX even comes with Python installed.
|
# ? Oct 3, 2013 06:12 |
|
Monkeyseesaw posted:My completely uneducated guess is .NET IL and Java Bytecode don't have enough in common to make this viable. A .NET assembly written on the MS CLR will run without recompilation on the Mono CLR and vice-versa. I doubt that would be possible if Mono's "CLR" was the JVM. Well, there's IKVM which allows you to call Java code from .NET. One of our clients considers it to be a sensible and production-ready project. I have no idea if the converse (running .NET on the JVM) is possible or how hard it would be. It's a weird feeling, opening up a C# file to see things like code:
|
# ? Oct 3, 2013 08:17 |
|
I would really love Mono becoming an official MS-supported runtime and it really would be a way to push .NET forward. Alternative: Take the official CLR and port it to all relevant platforms. Shame it won't happen
|
# ? Oct 3, 2013 08:53 |
|
A developer at my job has decided based on some thing he got off the web that all our python scripts should have this:code:
|
# ? Oct 3, 2013 10:12 |
|
Bognar posted:Microsoft's own web hosting software is incorrectly classifying Microsoft's own browser. So our application would send Set-Cookie headers, IE 10 would send them back on each request, but IIS would completely ignore them - thus rendering IE 10 users unable to log in.
|
# ? Oct 3, 2013 11:32 |
|
Bognar posted:Holy hell I hate Microsoft. Was the horror that your 'upgrading the server' downgraded the server software to something older than 5 years old? (I'm assuming on the older server it worked and therefore was running IIS 7.5 or above which was released with Windows 7/Server 2008SP2?)
|
# ? Oct 3, 2013 14:35 |
|
Check out my school java project, kinda shows what the level was there: http://pastebin.com/WDA6GrLJ Sad thing is, I'm not much better now. Edit: Also just noticed all the comments are in scandinavian moon language except the one at the top. Edit 2: It's a terrible shmup, btw. Cached Money fucked around with this message at 19:20 on Oct 3, 2013 |
# ? Oct 3, 2013 19:17 |
|
Cached Money posted:Check out my school java project, kinda shows what the level was there: http://pastebin.com/WDA6GrLJ To be fair, my version of tetris from school was probably about as good as this. Everyone is terrible while they're still in school.
|
# ? Oct 3, 2013 23:24 |
|
Cached Money posted:Check out my school java project, kinda shows what the level was there: http://pastebin.com/WDA6GrLJ Anal Asteroider? God, I really should just bite the loving bullet and learn Java. I just hate how it's so verbose, it's like the Aspergers of programming languages. At least once I'm done I can move on to Scala. edit: quote:In Java, every line of code that can actually run needs to be inside a class. Pollyanna fucked around with this message at 23:51 on Oct 3, 2013 |
# ? Oct 3, 2013 23:48 |
|
Heavy_D posted:Was this the occasion they were parsing only the first character after the string "IE " to determine the browser version, and so concluding it was "IE 1"? Should've called it IE A.
|
# ? Oct 3, 2013 23:53 |
|
Pollyanna posted:I just hate how it's so verbose, it's like the Aspergers of programming languages. Sounds like someone has never heard of Ada.
|
# ? Oct 4, 2013 00:09 |
|
https://www.youtube.com/watch?v=xrIjfIjssLE
|
# ? Oct 4, 2013 00:10 |
|
quote:This is the entry point of our Java program. the main method has to have this exact signature in order to be able to run our program: What in god's name is the reason for keeping this crap? Could it somehow not get any more efficient or something? Why does everything have to be a class?! All I want to do is print Hello World, come on. Also, the interactive tutorial on learnjavaonline.org errors out when you try to complete the exercise. Bodes well for me.
|
# ? Oct 4, 2013 00:28 |
|
Well, you see, object-oriented purity therefore everything must be a class, however practical considerations therefore static methods.
|
# ? Oct 4, 2013 00:31 |
|
I love how there are numerous projects out there dedicated to writing for Java in completely different language. Not even Java users like Java.
|
# ? Oct 4, 2013 00:41 |
|
Pollyanna posted:What in god's name is the reason for keeping this crap? Could it somehow not get any more efficient or something? Why does everything have to be a class?! All I want to do is print Hello World, come on. Because it's not a scripting language? Single-file scripts or REPL might be nice for beginners, but Java is better off by enforcing that structure. e: Pollyanna posted:I love how there are numerous projects out there dedicated to writing for Java in completely different language. Not even Java users like Java.
|
# ? Oct 4, 2013 00:45 |
|
Pollyanna posted:What in god's name is the reason for keeping this crap? Could it somehow not get any more efficient or something? Why does everything have to be a class?! All I want to do is print Hello World, come on. They are magical incantations to make the code run faster.
|
# ? Oct 4, 2013 01:00 |
|
Most compiled languages have some sort of machinery needed to write a main method. Hardly a coding horror.
|
# ? Oct 4, 2013 01:02 |
|
I guess I just don't really understand what's so special about Java aside from the JVM. That or I'm just clueless. This might be the fabled difference between functional and object-oriented programming.rrrrrrrrrrrt posted:Most compiled languages have some sort of machinery needed to write a main method. Hardly a coding horror. What's wrong with writing in a higher-level format then using a program to convert it to pre-compile code?
|
# ? Oct 4, 2013 01:03 |
|
Pollyanna posted:I guess I just don't really understand what's so special about Java aside from the JVM. That or I'm just clueless. This might be the fabled difference between functional and object-oriented programming. That's... exactly what you're doing. Would you rather write the JVM bytecode directly? edit: There isn't anything special about Java aside from the JVM. Java is a warty, mediocre (though probably overly-maligned) programming language. The JVM, on the other hand, is one of the most sophisticated, mature and widely-spread programming platforms in existence. leftist heap fucked around with this message at 01:08 on Oct 4, 2013 |
# ? Oct 4, 2013 01:06 |
|
rrrrrrrrrrrt posted:That's... exactly what you're doing. Would you rather write the JVM bytecode directly? Cool. So why not write in another language like Scala, Jython or Clojure and have that run on the JVM instead?
|
# ? Oct 4, 2013 01:14 |
|
Pollyanna posted:Cool. So why not write in another language like Scala, Jython or Clojure and have that run on the JVM instead? Because Java isn't inherently bad? You can write bad java, but you can write terrible code in any language. Not every line of java is Enterprise AbstractFactoryImplInterface bullshit, and I never run into that in my day-to-day work. Hell, most of your earlier complaints are minor squabbles that apply to all lower-level languages. The funny thing is, your complaints are based around "Efficiency", but most of these restrictions and annoyances only exist to make the language run as efficiently as possible.
|
# ? Oct 4, 2013 01:23 |
|
Pollyanna posted:Cool. So why not write in another language like Scala, Jython or Clojure and have that run on the JVM instead? I don't know? Why aren't YOU using one of those languages? They will all require similar boilerplate to get an executable main method: In Clojure: code:
code:
|
# ? Oct 4, 2013 01:31 |
|
|
# ? Jun 8, 2024 09:33 |
|
Pollyanna posted:What in god's name is the reason for keeping this crap? Could it somehow not get any more efficient or something? Why does everything have to be a class?! All I want to do is print Hello World, come on.
|
# ? Oct 4, 2013 01:57 |