• What Are You Working On? April 2015
    1,741 replies, posted
C# where have you been all my life? For the last 5 years, my work has put me on projects that required me to write everything from Java back-end software, to PHP-based web portals, to C and C++ for embedded hardware. Today I started a project that required me to write a process simulator in C#. And... I think I'm in love. This language seems to combine all the strong aspects of the languages I am familiar with. Java's Objected Oriented stuff, PHP's easy syntax for iteration and such, and the runtime speed of C/C++... Not to mention the documentation on MSDN is some of the best I've used. This project is going to be a breeze!
[QUOTE=Krahn;47537885]C# where have you been all my life? For the last 5 years, my work has put me on projects that required me to write everything from Java back-end software, to PHP-based web portals, to C and C++ for embedded hardware. Today I started a project that required me to write a process simulator in C#. And... I think I'm in love. This language seems to combine all the strong aspects of the languages I am familiar with. Java's Objected Oriented stuff, PHP's easy syntax for iteration and such, and the runtime speed of C/C++... Not to mention the documentation on MSDN is some of the best I've used. This project is going to be a breeze![/QUOTE] You forgot to point out how wonderful Visual Studio is. Without a doubt my favorite IDE.
[QUOTE=Lord Fear;47537935]You forgot to point out how wonderful Visual Studio is. Without a doubt my favorite IDE.[/QUOTE] Yes! It's amazing! Okay, the installation took bloody ages, but it's a very nice IDE. I'm going to have to use the GUI builder at some point as well. Kind-of looking forward to trying that out.
[QUOTE=Berkin;47536449][img]http://i.imgur.com/q2iHjzO.png[/img][/QUOTE] [code]$ rantfortune[/code] [editline]16th April 2015[/editline] [QUOTE=Xystus234;47536617]You think the code you write is bad, I just dug up this gem I wrote 6 months ago... [CODE]// Deer lord[/CODE] jesus christ[/QUOTE] I like to keep old projects to remind me of how much I've progressed. I keep finding examples of stuff like projects that did stuff [url=https://github.com/Mechazawa/Python-Teamspeak-interface/blob/master/Teamspeak.py]from the ground up instead of just using something like twisted[/url], locking up when an exception is thrown, [url=https://github.com/Mechazawa/Doger/blob/master/doger.dasm16]poorly written assembly[/url], [url=http://git.shodan.me/Minimalist/]general poor code[/url], [url=http://www.wiremod.com/forum/finished-contraptions/23725-tic-tac-toe-game.html]"lets test every possibility manually"[/url], [url=http://www.wiremod.com/forum/finished-contraptions/23707-simple-trajectory-projectile-calculator.html]not counting in all variables[/url], etc. I have an entire folder on my desktop with old code just to remind me of what not to do. [editline]16th April 2015[/editline] [QUOTE=ZaroX;47537773]So I'm trying to work with the API of our national railway network infrastructure caretaker in The Netherlands as a side project because I don't learn shit in college. I wrote an HttpHelper and XMLHelper to unzip .kmz files that are returned after making a GET request. Then I read through the entire .kml file and store the coordinates in my own datatypes. I could have used some kind of big library for displaying all ArcGIS layers on a JavaFX map or something, but I'm just interested in the actual paths. --IMAGE-- Here you see exactly a 1000 points plotted on Google Maps, I'm still trying to figure out how to get different data sets. --IMAGE-- I'm very happy with the accuracy, so hats of to them:) [b]Edit:[/b] Oh and these points are not stored individually but in relation to eachother, so I know exactly to which track they belong. I only have to find another way to display them in Google Maps. Now I just copy pasted a string representation in [url=http://www.darrinward.com/lat-long/]this[/url] map tool :v:[/QUOTE] A nice map with the current positions of all trains would be neat. Especially when you're waiting for one. That may or may not arrive.
[QUOTE=geel9;47534217]I think all of our loved ones / family members call us geniuses.[/QUOTE] And you have people who call you genius for putting fried potato in hamburger. I am working on 4 in a row bot currently.
[QUOTE=Fourier;47538088]{...} putting (a) fried potato in hamburger.[/QUOTE] That's pretty genius
[QUOTE=Krahn;47537885]C# love[/QUOTE] C# is my favorite too! It just sucks that it doesn't have pattern match system and doesn't supports functions inside functions :(.
[QUOTE=Fourier;47538384]C# is my favorite too! It just sucks that it [...] doesn't supports functions inside functions :(.[/QUOTE] It's a little nasty but: [csharp]string Foo(string bar) { Func<string> func = () => { return "u wot " + bar + "?"; }; return func(); }[/csharp]
C# has been pretty frustrating for me, though that's what happens when I use Python exclusively for too long. Scope and function / class types are confusing, I need to go back and try starting the Linda.com course again so I actually know what I'm doing.
[QUOTE=Ziks;47538396]It's a little nasty but: [csharp]string Foo(string bar) { Func<string> func = () => { return "u wot " + bar + "?"; }; return func(); }[/csharp][/QUOTE] I'm personally not a fan of nested definitions like that. I've been writing software for a very long time now, and I've never found myself needing to do that. Of course, because it's not my style, doesn't mean it's [i]wrong[/i] or anything. I just find it to impair the readability of my code. [QUOTE=benjgvps;47538506]C# has been pretty frustrating for me, though that's what happens when I use Python exclusively for too long. Scope and function / class types are confusing, I need to go back and try starting the Linda.com course again so I actually know what I'm doing.[/QUOTE] Think of scope as a room and functions/variables as items in a room. You can't use an item from room A, if you are in room B, without moving/passing it over beforehand. Imagining that made things "click" for me, way back. Of course, then you get things like object/dependency injection which makes a mess of that mindset...
[QUOTE=Fourier;47538384]C# is my favorite too! It just sucks that it doesn't have pattern match system and doesn't supports functions inside functions :(.[/QUOTE] [url]https://msdn.microsoft.com/en-us/library/018hxwa8%28v=vs.110%29.aspx[/url] [editline]16th April 2015[/editline] [QUOTE=Ziks;47538396]It's a little nasty but: [csharp]string Foo(string bar) { Func<string> func = () => { return "u wot " + bar + "?"; }; return func(); }[/csharp][/QUOTE] Isn't that C#6 syntax? Doesn't C#5 still need the delegate keyword? [csharp]string Foo(string bar) { Func<string> func = (Func<string>)delegate() { return "u wot " + bar + "?"; }; return func(); }[/csharp]
[QUOTE=Krahn;47538575]I'm personally not a fan of nested definitions like that. I've been writing software for a very long time now, and I've never found myself needing to do that. Of course, because it's not my style, doesn't mean it's [i]wrong[/i] or anything. I just find it to impair the readability of my code.[/QUOTE] Yeah I wouldn't recommend using it, I was just demonstrating that it was possible. [QUOTE=Mega1mpact;47538630]Isn't that C#6 syntax? Doesn't C#5 still need the delegate keyword?[/QUOTE] It should work from at least C# 3.5 [editline]16th April 2015[/editline] There should be no need to do the cast too: [csharp]string Foo(string bar) { Func<string> func = delegate() { return "u wot " + bar + "?"; }; return func(); }[/csharp]
[QUOTE=Fourier;47538088]And you have people who call you genius for putting fried potato in hamburger. I am working on 4 in a row bot currently.[/QUOTE] What the fuck, man? [editline]16th April 2015[/editline] [QUOTE=Krahn;47538575]I'm personally not a fan of nested definitions like that. I've been writing software for a very long time now, and I've never found myself needing to do that. Of course, because it's not my style, doesn't mean it's [i]wrong[/i] or anything. I just find it to impair the readability of my code. [/QUOTE] I've used it rarely in PHP -- defining a sorting function for usort if it's incredibly simple. I've used it exactly once in C#.
[url=http://pastebin.com/MHkmY8Ys]Did someone say nested definitions?[/url]
So I'm basically done with the Twitch bot I made. I am however thinking of rewriting it, because right now it's just spaghetti code. I probably should've written it correctly from the start. Is it worth rewriting it to familiarize myself with how it should be done instead of taking the easy way out? Common people I need some motivation here. .___.
[QUOTE=Fourier;47538088]And you have people who call you genius for putting fried potato in hamburger.[/QUOTE] offtopic, but have you tried rösti in a hamburger? it's the best [editline]16th April 2015[/editline] in other news i'll probably get back to working on my game when I'm done with GTA V. school-wise, working on HTML. shit's easy.
[QUOTE=Krahn;47537885]C# where have you been all my life? For the last 5 years, my work has put me on projects that required me to write everything from Java back-end software, to PHP-based web portals, to C and C++ for embedded hardware. Today I started a project that required me to write a process simulator in C#. And... I think I'm in love. This language seems to combine all the strong aspects of the languages I am familiar with. Java's Objected Oriented stuff, PHP's easy syntax for iteration and such, and the runtime speed of C/C++... Not to mention the documentation on MSDN is some of the best I've used. This project is going to be a breeze![/QUOTE] After jumping ship from Java as my preferred personal language this January, I can't really imagine going back. I find myself being able to express what I'm trying to do with much fewer lines in C#. Plus, it's very nice to see Microsoft still adding worthwhile improvements to the language. I also remember running one of my console applications with Mono over SSH on Debian for the first time. Hell, I haven't even mentioned how decent WPF has been for learning and working with. For all intents and purposes this post makes me sound like a fanboy, but if it means being able to write much nicer code - then by all means I'm guilty.
[QUOTE=geel9;47539138]I've used it rarely in PHP -- defining a sorting function for usort if it's incredibly simple. I've used it exactly once in C#.[/QUOTE] A custom compare function sounds like an inline lambda. I don't really see a reason to give it a name. Unless you're saying you've used lambdas exactly once in C#.
[QUOTE=Dr Magnusson;47537841]Hopefully some day we all find love like that.[/QUOTE] I used to have this really cool ménage à trois going on with Jesus and Gregor but ever since The Stanley Parable I don't hear much from Jesus and I'm not sure what Gregor is up to but we agree we should do something. I secretly want them to be contributors to Planimeter projects like Grid/VA. [editline]16th April 2015[/editline] Since Gran PC is swinging with another crowd now, any Lau hackers are welcome to pair up with me and my shenanigans. :v: [editline]16th April 2015[/editline] I miss those guys.
My only gripe with C# is being locked into Microsoft's ecosystem. I would write a web app for Fore and host it on my website instead, but my website is run on a Linux box so I can't use ASP.NET and I don't think there are any third party libraries to make fully HTML web apps that can run code in DLLs. Although if I'm wrong, I will be glad to be proved so.
[QUOTE=Ziks;47538749] There should be no need to do the cast too: [csharp]string Foo(string bar) { Func<string> func = delegate() { return "u wot " + bar + "?"; }; return func(); }[/csharp][/QUOTE] looks like lambda != delegate [img]http://i.imgur.com/o9hYfRZ.png[/img]
[QUOTE=Protocol7;47539549]My only gripe with C# is being locked into Microsoft's ecosystem. I would write a web app for Fore and host it on my website instead, but my website is run on a Linux box so I can't use ASP.NET and I don't think there are any third party libraries to make fully HTML web apps that can run code in DLLs. Although if I'm wrong, I will be glad to be proved so.[/QUOTE] Yeah, but that's ASP.NET, not C#. You could implement a cross platform web framework in C# as you could with any other language.
[QUOTE=Protocol7;47539549]My only gripe with C# is being locked into Microsoft's ecosystem. I would write a web app for Fore and host it on my website instead, but my website is run on a Linux box so I can't use ASP.NET and I don't think there are any third party libraries to make fully HTML web apps that can run code in DLLs. Although if I'm wrong, I will be glad to be proved so.[/QUOTE] There's Mono which should have most of the functionality for ASP.NET. And we'll most likely see either an official release of the .NET for Linux or at least a fork of it now that .NET was made open source.
[QUOTE=Protocol7;47539549]My only gripe with C# is being locked into Microsoft's ecosystem. I would write a web app for Fore and host it on my website instead, but my website is run on a Linux box so I can't use ASP.NET and I don't think there are any third party libraries to make fully HTML web apps that can run code in DLLs. Although if I'm wrong, I will be glad to be proved so.[/QUOTE] *some* versions of ASP.net work with mono. [url]http://www.mono-project.com/docs/web/aspnet/[/url]
[img]http://vgy.me/TsR27s.png[/img] Working on a Lua++ thing so I can use lua to write hacks for games! :)
[QUOTE=Darwin226;47539577]Yeah, but that's ASP.NET, not C#. You could implement a cross platform web framework in C# as you could with any other language.[/QUOTE] That's what I meant with Microsoft's ecosystem, though. I *can* make shit cross platform, but it's a hell of a headache compared to deploying directly and setting up some IIS shit. [QUOTE=Lord Fear;47539591]There's Mono which should have most of the functionality for ASP.NET. And we'll most likely see either an official release of the .NET for Linux or at least a fork of it now that .NET was made open source.[/QUOTE] [QUOTE=Mega1mpact;47539592]*some* versions of ASP.net work with mono. [URL]http://www.mono-project.com/docs/web/aspnet/[/URL][/QUOTE] Forgot to mention that my website is just done through cPanel so I don't have access to any terminals or anything, but it does look like maybe I can get Mono installed using Apache? Worth a try! edit: I should also mention I am otherwise a .NET and C# fanboy since that's what I use at work. It's a dream to write anything with Visual Studio and ReSharper and C# code is always just so easily readable and clean.
[QUOTE=P1raten;47539275]So I'm basically done with the Twitch bot I made. I am however thinking of rewriting it, because right now it's just spaghetti code. I probably should've written it correctly from the start. Is it worth rewriting it to familiarize myself with how it should be done instead of taking the easy way out? Common people I need some motivation here. .___.[/QUOTE] Do something else, something new and try to make that beautiful.
[QUOTE=andrewmcwatters;47539523]I used to have this really cool ménage à trois going on with Jesus and Gregor but ever since The Stanley Parable I don't hear much from Jesus and I'm not sure what Gregor is up to but we agree we should do something. I secretly want them to be contributors to Planimeter projects like Grid/VA. [editline]16th April 2015[/editline] Since Gran PC is swinging with another crowd now, any Lau hackers are welcome to pair up with me and my shenanigans. :v: [editline]16th April 2015[/editline] I miss those guys.[/QUOTE] Yeah, progging with others is cool. I haven't done it in a while though. I'd love to help you with your project, but I mainly do C++. Wouldn't mind making some games in C++ though with someone though, if anyone's interested.
[QUOTE=Darwin226;47539577]Yeah, but that's ASP.NET, not C#. You could implement a cross platform web framework in C# as you could with any other language.[/QUOTE] You are absolutely not locked into the Microsoft eco-system with ASP.net. Mono has supported MVC for some time and starting with ASP.net 5 (aka "vNext", still in beta), Linux and OS X are first-class citizens. ASP.net was the main reason the CoreCLR got open sourced in the first place.
[QUOTE=SteveUK;47539888]You are absolutely not locked into the Microsoft eco-system with ASP.net. Mono has supported MVC for some time and starting with ASP.net 5 (aka "vNext", still in beta), Linux and OS X are first-class citizens. ASP.net was the main reason the CoreCLR got open sourced in the first place.[/QUOTE] My worry is being able to control everything I need with cPanel; but that's probably not an issue, since my webserver is still Apache and I'm just a newbie webadmin.
Sorry, you need to Log In to post a reply to this thread.