|
Red Mike posted:The only "big" thing in my mind besides that would be if you're having to work with legacy/specific tech where VS works correctly and Rider sometimes breaks. You mentioned Blazor, but even with Razor I've had nothing but issues in bigger projects. For example, right now in Rider I've got a .cshtml without anything fancy except for a local function used for templating; that just breaks the parsing so Rider keeps insisting there's wrong symbols/it won't build, but it builds it fine. Apparently it's RIDER-34875 which has been open for 2 years and isn't any closer to a fix (and has an unsuitable workaround). Yeah I think I might have had something similar with Rider: it was convinced I had an error somewhere when the code was actually fine. Despite that I think I'm pretty much settled on Rider. It's just a nicer and smoother experience. I'm also forcing myself to address all of its little yellow warnings and suggestions which is probably making me a better programmer I dunno. The only thing I'm missing is the VS feature I was talking about where it suggests whole lines for you: https://devblogs.microsoft.com/visualstudio/type-less-code-more-with-intellicode-completions/ It's really useful and I wish Rider had something similar. I found this but it looks like overkill and it's not available yet: https://plugins.jetbrains.com/plugin/17718-github-copilot Thanks for the tips.
|
# ? Feb 1, 2022 11:28 |
|
|
# ? Jun 8, 2024 02:09 |
|
fps_nug posted:just spent my first serious 5 hours since high school learning programming, decided to start with c# for no other reason than accessibility. I learned on python and now that I have an incredibly rudimentary knowledge do you guys have any ideas of where to go from here? How do you usually find you learn best, and what do you hope to do/achieve once you have reached your target level of programming capability? For a good general-purpose thing to learn about, I would suggest getting acquainted with LINQ, how the generic collection classes in System.Collections.Generic work, and how to write iterator methods (the equivalent of generator functions in Python). You could also learn about the differences between value and reference types in C#, and how to define your own classes/structs that implement IEquatable and IComparable and can be used as dictionary keys.
|
# ? Feb 1, 2022 12:54 |
|
fps_nug posted:just spent my first serious 5 hours since high school learning programming, decided to start with c# for no other reason than accessibility. I learned on python and now that I have an incredibly rudimentary knowledge do you guys have any ideas of where to go from here? I simp hard for C# and would insist that it's both a strong starting language and a language that does basically All The Things™ well. Some of it's buttery smoothness is lost if you leave the Windows platform, but Core is honestly in a pretty good spot - it's less of a problem then it used to be (unless you want to build interface). If you want to build Desktop apps on Windows, WPF is pretty outstanding and is my favorite UI framework by a mile. If you want to just do general CLI tooling, just learning more about the C# language will give you great returns. If you want to do web stuff, you can go the ASP.NET route, but I'm unsure if that's the 'optimal play', but if you enjoy it, do that! For desktop apps, I think WPF can be intimidating as you start to learn it, but it's really not that bad once you start getting into it, and unlocking the ability to build apps is very powerful, both for personal tools and tools for others. I'd highly encourage it if you are interested. Regardless of the specifics of what you want to do, the answer is to find something you think you want to build and build it. Build *anything*. Solve the problems one at a time and be willing to suck at it for awhile. Canine Blues Arooo fucked around with this message at 19:53 on Feb 1, 2022 |
# ? Feb 1, 2022 19:50 |
|
fuf posted:Despite that I think I'm pretty much settled on Rider. It's just a nicer and smoother experience. I'm also forcing myself to address all of its little yellow warnings and suggestions which is probably making me a better programmer I dunno. I've been using Rider exclusively for the past couple years now, and while I still don't find it as nice/smooth (other than not being incredibly slow to start up/open things) I'm definitely happy with it as is. That said, I would try to investigate what the yellow warnings/suggestions mean before you apply them, because it has in the past suggested I do some ridiculous/pointless things and chatting to other people it seemed the consensus was "oh yeah we tend to downgrade those to a non-warning" for a good quarter of the ones that default to visible warnings. Although fair point, the subset that got downgraded in my last enterprise job was different than the subset that got downgraded in my gamedev job. So could just be domain-specific.
|
# ? Feb 1, 2022 23:19 |
|
fps_nug posted:just spent my first serious 5 hours since high school learning programming, decided to start with c# for no other reason than accessibility. I learned on python and now that I have an incredibly rudimentary knowledge do you guys have any ideas of where to go from here? How to learn/teach this stuff remains the question of the ages and I have never found a satisfactory solution. Some of the key elements I have found useful in both learner and teacher roles have been: 1. Have a goal that is interesting to you. Do you play computer games? Maybe make a "skill tree planner". Do you enjoy watching sports? Perhaps a "team/player statistics tracker" might be interesting. Most important is to have a meaningful goal that is not just "learning <insert technical thing X>". 2. Get constant feedback. This can be hard if you are just doing self-study and I have no good suggestions here. There is some "Code Review Stack Overflow" that I have seen but the feedback given there can be all over the place and is not really consistent because it comes from different people all the time (there are many ways to do things correctly but it can be hard to drive in many directions at once). As a poor substitute to feedback, you can read coding forums/websites where non-newbies post and try to understand how they think. Read The Daily WTF and see if you can figure out why the code is a WTF. As for the specifics in the C# unvierse - ASP.NET Core (which includes Razor) seems pretty universally applicable these days as everyone makes web apps for everything. It has been a long time since I have seen anyone do serious GUI stuff in .NET but maybe that is because most people are just doing web apps now? I have never seen .NET taken seriously for mobile apps. Blazor is the hot new entrant for web GUI but not yet a grown-up, just something to keep an eye on - but all signs point to increasing adoption, so learning Blazor might be a good way to get a foot in the door ahead of the pack, before other .NET engineers stumble into it. If you are new to C#, keep a constant vigil for .NET Framework versus .NET Core - a lot of tutorials/materials/guides from years ago will be talking about .NET Framework which is a legacy branch of the .NET family. Starting with version 5, they dropped the "Core", so anything 5+ is safe and future-proof (except Entity Framework 6 which is actually part of the legacy tree). Similarly, "ASP.NET" is legacy junk, "ASP.NET Core" is the modern goodness. When it doubt, look at timestamps or ask around.
|
# ? Feb 2, 2022 06:51 |
|
Canine Blues Arooo posted:I simp hard for C# and would insist that it's both a strong starting language and a language that does basically All The Things™ well. Some of it's buttery smoothness is lost if you leave the Windows platform, but Core is honestly in a pretty good spot - it's less of a problem then it used to be (unless you want to build interface). I have this with .Net in general. I like the tooling, I like the languages. Sometimes it feels like .Net succeeds despite MS though. As for languages: I prefer F# over C#. It is just such a well designed language. Giraffe is nice, Fable is awesome.
|
# ? Feb 2, 2022 08:38 |
|
C# feels like a bad thing that has had so many manhours spent on it that it has become good. F# is a good thing that hasn't had that many manhours spent on it.
|
# ? Feb 2, 2022 08:54 |
|
Thank you guys very much! I kind of want to start using unity to increase my knowledge, my main goal is creating simple games at first. I do think reading other code and learning in reverse is a good way for me to get a little more knowledgeable. I mostly learn by doing but its hard not having an available mentor who can look at my code and tell me when I'm doing something wrong or inefficiently
|
# ? Feb 3, 2022 07:33 |
|
Going back to this:raminasi posted:Does the culture-specific overload do what you need? Not really. I'm trying to mimic Python's version of this which doesn't have any notion of a cultural context from what I can tell. I have something else that may be a little simpler to swallow since it just involves reading and not transforming (yet). I wanted to try to do a faithful detection of whether a string would comply with Python's own isalpha. That's described as such (the comment is telling): code:
|
# ? Feb 3, 2022 08:11 |
Case folding is a particular algorithm/transformation specified by the Unicode standard, yes, and it isn't quite the same as an "uppercase" or "lowercase" function, which is by definition human language sensitive. Searching I find this: https://github.com/dotnet/corefxlab/pull/2637 But I can't figure out where this is supposed to be implemented or available. The PR says it's merged nearly 3 years ago, but I don't see any trace of it in the .NET 5 or 6 library. Maybe System.Text.CaseFolding is available as a NuGet package?
|
|
# ? Feb 3, 2022 08:55 |
|
fps_nug posted:Thank you guys very much! I kind of want to start using unity to increase my knowledge, my main goal is creating simple games at first. I do think reading other code and learning in reverse is a good way for me to get a little more knowledgeable. I mostly learn by doing but its hard not having an available mentor who can look at my code and tell me when I'm doing something wrong or inefficiently Unity is nice, I like to work with it. It has problems and Unreal is doing some cool stuff, but for just getting stuff on screen and coding Unity is pretty cool to work with. It helps that you can just load .Net DLLs into the engine.
|
# ? Feb 3, 2022 09:19 |
|
I've always assumed that Unity programming would involve a lot more mathematics, because it's about moving objects in space. Is that roughly correct? It's always scared me for that reason compared to good ol' web apps.
|
# ? Feb 3, 2022 10:45 |
|
fuf posted:I've always assumed that Unity programming would involve a lot more mathematics, because it's about moving objects in space. Is that roughly correct? It's always scared me for that reason compared to good ol' web apps. Not really, most of the math has functions for doing the tricky stuff. You will need to do some Vector math but it is pretty simple (move, rotate etc.). Until you start writing shaders, but there is a Graph for it now that works like the node setup from Blender. A lot of movement and collision will also be taken care of by the physics engine. You will get the hang of it.
|
# ? Feb 3, 2022 12:38 |
|
Ok, how the gently caress do you get the request body in a .netCore3.1 api controller? Or just the form part of the request body. Everything I'm finding online starts and ends with saying to add this to startup.cs code:
I can assign the context in the app.Use() part to a static class variable and access it from anywhere, but that seems like the world's second worst idea, only bested by getting involved in a land war in Asia. Jesus gently caress it should not be this hard.
|
# ? Feb 3, 2022 15:39 |
|
ControllerBase has Request which has both Form and Body? Are you not inheriting from ControllerBase?
|
# ? Feb 3, 2022 16:20 |
|
Kyte posted:ControllerBase has Request which has both Form and Body? Well I feel dumb, mainly because I thought it wasn't going to work because VS2022, while often amazing, also slaps red squiggly lines all over valid poo poo. Did a rebuild and the lines went away. Thanks, I'm a dope.
|
# ? Feb 3, 2022 16:30 |
|
Note that accessing the request body from inside the Controller only happens after the request has been authenticated, authorized, parsed and mapped to the right method and arguments. If you want to detect malformed request bodies or paths and other 4xx poo poo, it's too late to do that from the controller, you need to inject a middleware. I've had exactly that problem - we needed to prove that it was the third party sending hosed-up request bodies, and we needed the original raw request, not just the 400 error description. So when you want to read the body as a middleware, you don't have the nice object, just the raw request stream. And as Timeberlake noticed, ASP.NET Core really doesn't want you touching the poop, it wants to keep the request stream nice and un-buffered and one-way-only so that it can stay on top of the benchmarks. The EnableBuffering() tells Asp.NET to do the inefficient thing, but it still only exposes the request as a raw stream - the buffering just means that you aren't permanently "burning" the request by reading from the the stream. Here's how I logged request bodies when necessary: code:
NihilCredo fucked around with this message at 11:07 on Feb 4, 2022 |
# ? Feb 3, 2022 16:51 |
|
I'd just like to say it's pretty amazing what an absolute pig VS2022 is when it comes to resources.
|
# ? Feb 3, 2022 19:23 |
|
nielsm posted:Case folding is a particular algorithm/transformation specified by the Unicode standard, yes, and it isn't quite the same as an "uppercase" or "lowercase" function, which is by definition human language sensitive. Case folding is tracked by this issue, and there's some more discussion here. The gist is that the .NET team is reluctant to maintain globalization functionality themselves, and if they were going to expose APIs for case folding, they'd likely call into the ICU library provided by the OS, probably with some workarounds for older versions of Windows.
|
# ? Feb 3, 2022 20:22 |
|
I ended up looking around some more for Unicode related stuff. I didn't see anything online where a System.Text.CaseFolding or whatever existed but I admit I didn't go hunting in the NuGet GUI in Visual Studio. I did independently wind up at the same page nielsm found (but only after they pointed it out so they get founder's credit). I have a bunch of these functions I was trying to implement. I'm implementing Python string functions in C# for a facsimile Python string class. So there's a pile of these. Some other things that are built into the Python string include title casing, and case reversing. Then there are various detection for alphanumeric, alphabet, and the like. I ended up looking at the IronPython 3 source and saw they just assumed basic US stuff. Like, their tolower() implementation just used the .NET string's ToLower(). So I gave up. I wasn't signing up to solve all these Unicode problems and so I just cover it with an American flag. There's another similar situation with the different formatting functions and delimiters.
|
# ? Feb 3, 2022 21:04 |
|
Is there a market for WPF developers anymore?
|
# ? Feb 3, 2022 22:43 |
|
aperfectcirclefan posted:Is there a market for WPF developers anymore? There definitely is. I get pretty frequent emails from all sorts of folks asking for WPF developers. It's definitely not as common as, say, React or [fotm frontend JS framework], but jobs certainly exist.
|
# ? Feb 3, 2022 22:55 |
|
That's rad. I have a soft spot for desktop apps still and I never want them to die.
|
# ? Feb 3, 2022 23:13 |
|
Not quite a .NET question but I'm betting this crowd will have an opinion. When hiring a developer on contract (hourly billing), is it expected that they have their own Visual Studio subscription? I'm adding them to Azure DevOps, and I have to choose between "Basic" access level (use up one of my developer seats), or "Visual Studio Subscriber" (they have their own subscription). I'm comparing this to any other contractor I might hire, a plumber/electrician/etc would bring their own specialized tools to the job site. It would be silly for an electrician to expect every job site they visit to have a multi-meter they can use. Shouldn't I expect that a developer bring their own tools too? In other words, shouldn't they just bake their costs (a computer, electricity for their computer, internet access from their house, Visual Studio license) into their hourly rate? Edit: The contract doesn't say anything about who provides which tools, an oversight on my part (all previous contractors just had their own VS subscription). The question stands though, would you expect to see wording about VS subscriptions in a development contract? epswing fucked around with this message at 17:01 on Feb 4, 2022 |
# ? Feb 4, 2022 16:51 |
|
I would expect a contractor to supply everything they need (since they're just there to solve your problem), and an employee to be provided everything they need.
|
# ? Feb 4, 2022 17:03 |
|
In the sole case where you are requiring the contractor to use specific tools, then I would expect you to provide said tools. Otherwise, if they're hired to write .NET code, then I would expect them to have their own license for whatever editor they want. Which could be VS2022, could be Jetbrains Rider, could be Notepad + dotnet watch build for that matter. Speaking of which - does Azure DevOps specifically require the contributor to use Visual Studio? You can't contribute with just git plus a web ui for the other stuff like issues and code reviews? E.g. what if you want to use Azure DevOps for a Java project?
|
# ? Feb 4, 2022 17:16 |
|
NihilCredo posted:Speaking of which - does Azure DevOps specifically require the contributor to use Visual Studio? You can't contribute with just git plus a web ui for the other stuff like issues and code reviews? E.g. what if you want to use Azure DevOps for a Java project? VS is not required. At minimum DevOps is just git repos + pull request management. epswing fucked around with this message at 18:28 on Feb 4, 2022 |
# ? Feb 4, 2022 17:34 |
|
NihilCredo posted:Speaking of which - does Azure DevOps specifically require the contributor to use Visual Studio? You can't contribute with just git plus a web ui for the other stuff like issues and code reviews? E.g. what if you want to use Azure DevOps for a Java project? You can buy licenses separately, you just happen to get free usage if you already own VS. It's not "you need VS to use Azure DevOps", it's "you get it for free if you use VS" New Yorp New Yorp fucked around with this message at 17:39 on Feb 4, 2022 |
# ? Feb 4, 2022 17:36 |
|
NihilCredo posted:Speaking of which - does Azure DevOps specifically require the contributor to use Visual Studio? You can't contribute with just git plus a web ui for the other stuff like issues and code reviews? E.g. what if you want to use Azure DevOps for a Java project? There are no device or language restrictions in azure DevOps. We have a couple of old Java projects with ci in our devops no issue (well, outside of it just being Java) also a few c# projects, and a iOS swift app. You can do pretty much everything from the web. VS and vscode (and rider) both have great integrations though that make it real easy to work with.
|
# ? Feb 4, 2022 18:11 |
|
insta posted:I would expect a contractor to supply everything they need (since they're just there to solve your problem), and an employee to be provided everything they need. Not really, if they want me to use a specific tool, they can pay for it.
|
# ? Feb 4, 2022 18:50 |
|
Mr Shiny Pants posted:Not really, if they want me to use a specific tool, they can pay for it. True, I was just thinking in the case of "I need a C# dev to implement this feature or fix these bugs" kind of consulting. If I were in that situation and was told to use XYZ product I didn't already own, I would buy myself a copy of it and bill them for it as part of my other pricing. I would then retain ownership of this product for the next time I was asked to use it.
|
# ? Feb 4, 2022 19:00 |
|
Mr Shiny Pants posted:Not really, if they want me to use a specific tool, they can pay for it. In my case the contract states "code will be submitted to the Client’s source-control repository according to Client’s delivery preferences" so the "specific tool" in this case is DevOps (not VS nor a subscription to it). As New Yorp mentioned, it happens that if one has a VS subscription they get a seat in DevOps for free. My assumption (driven by past experience) was that a .NET contractor would use Visual Studio and have a subscription, but that may not always be the case (there are other IDE options). So, fair enough, I'll pay for the DevOps seat.
|
# ? Feb 4, 2022 19:11 |
|
epswing posted:So, fair enough, I'll pay for the DevOps seat. I wouldn't. They want you to use their tooling, they can pay for the licensing for it. [edit] Think of it like this: If they wanted you to use Jira and ServiceNow in addition to Azure DevOps, would you pay for the licensing costs for those, too? It's reasonable for you to bring your own developer tools. It's unreasonable for you to pay licensing costs for their SaaS service usage. New Yorp New Yorp fucked around with this message at 21:46 on Feb 4, 2022 |
# ? Feb 4, 2022 20:49 |
|
New Yorp New Yorp posted:I wouldn't. They want you to use their tooling, they can pay for the licensing for it. I think you got the story backwards, I'm the employer. The "you" you're describing is the developer, as far as I can tell. When I say "I'll pay for the DevOps seat" I mean I the employer will pay for the contractor's SaaS service usage. (I.e. I agree with you.)
|
# ? Feb 4, 2022 22:05 |
|
I'm trying to throw together a quick function to do a one-time throwaway thing and I'm not sure how to inject the configuration into the function method itself. I'd like to make this easy on the guy who's going to have to set it up because the fewer instructions I have to hand him the better (because I'll have to repeat myself a bunch 😒), so I want to make it so he can just copy some settings from another thing. To that end, I wanted to just read some un-prefixed values out of the config inside the Function method but I can't figure out how to get injection to bind the IConfiguration. Function looks like C# code:
C# code:
|
# ? Feb 4, 2022 23:13 |
|
Function method bindings are separate from the dependency injection container, if you want an available IConfiguration instance, you'll have to make it so that the class/function isn't static and inject IConfiguration into the class constructor
|
# ? Feb 4, 2022 23:18 |
|
Potassium Problems posted:Function method bindings are separate from the dependency injection container, if you want an available IConfiguration instance, you'll have to make it so that the class/function isn't static and inject IConfiguration into the class constructor Not with Azure Functions. They're static and injected at the function-level.
|
# ? Feb 4, 2022 23:34 |
|
I don't know what you mean, and maybe it's changed with .NET 5/6, but the way function parameter bindings happen (i.e., ILogger, Trigger-specific arguments like a service bus message or HTTP request object) isn't aware of the dependencies you wire up in Startup.cs, which is why the op is getting binding errors. You have to have a non-static function in a non-static class and wire up the constructor to take a dependency on IConfiguration.code:
|
# ? Feb 4, 2022 23:46 |
|
epswing posted:VS is not required. At minimum DevOps is just git repos + pull request management. So why did I have to wait to have a VS sub attached to my account in the client's DevOps before I could see the repo page? I'm honestly curious.
|
# ? Feb 5, 2022 00:30 |
|
|
# ? Jun 8, 2024 02:09 |
|
Kyte posted:So why did I have to wait to have a VS sub attached to my account in the client's DevOps before I could see the repo page? I'm honestly curious. DevOps comes with X free seats (I think 5?), beyond which the admin needs to pay for additional seats. Unless they’re VS subs in which case there’s no charge. If you needed to provide your own VS sub I’d guess your client didn’t want to pay for your seat, which was my dilemma above. At least, that’s my understanding, I’m still new at DevOps, we’ve been using it for less than a year. epswing fucked around with this message at 01:07 on Feb 5, 2022 |
# ? Feb 5, 2022 00:51 |