3
Bubbles
4y

ASP.NET Core (MVC) is frustrating me.

I’m a big fan of ASP so far but I’m just struggling to understand a lot.

First off to use it you have to fucking memorize every class in the fucking framework and the functions within them. It just expects that I automatically know which classes I need to implement or inherit from and why, but if I don’t? I can fuck off. But this is also just a C# problem in general.

And it does so much for you and that bothers me so much. I was so excited to actually implement protection against SQL Injections, using HTTPS, validating logins, interacting with the SQL for the database but FUCKING NOPE BECAUSE IT DOES IT FOR YOU.

I don’t want my hand held I want to feel like I’m actually doing things and I want to learn how shit works and how it’s made. It’s just disappointing. I appreciate that it wants me to focus on the app and I will appreciate it a lot more when I’m done learning how everything works but I won’t actually get to understand how those features work or how I can implement them myself because it’s spoiling me too fucking much.

I guess I’m just gonna have to practice more. And don’t bother telling me to look at the documentation, I’ve never seen such a fucking piece of shit mess before I laid eyes upon the docs for C# & ASP

Comments
  • 1
    The docs are shit sure, using resharper/rider makes it a lot easier to bear

    If you want to do it 100% yourself, kick out entity framework, turn off https and configure everyting yourself
  • 1
  • 0
    but doesn't every language have many things you need to memorize?
  • 2
    @SoldierOfCode yeah but with this it’s just fucking endless and nothing is explained. I don’t know what it is, I don’t know why it’s being used or inherited from.

    When I’m going into a fresh project after the tutorial I’m gonna be sitting there wondering what the hell im even doing because I don’t because there’s too many questions and too many things I’m just expected to know

    I’ve been given a list of resources and most just say fucking use this and don’t question it
  • 2
    Unfortunately, you're coming in after 18 years of established community and implementations have built up on top of the platform.

    There's nothing saying you can't decouple all the niceties (EF, mvc middleware, hsts, https, etc). The thing is, the frameworks exist as the result of all that time spent by thousands of people building up libraries and agreed upon strategies for handling these common problems. They're already solved, conclusively and with infinite amounts of testing. Few people want to reinvent those wheels.

    Based on what you're saying, it sounds like you already understand the principles behind the things you want to do. If you want the barebones experience, just create a console application and you have a truly blank canvas; bind a TCP port, write an SSL module, manually read requests, process data, produce responses, install the System.Data.Common, SqlClient packages and write direct database transactions with full boilerplate. You can go full traction control off.
  • 3
    C# == magic happens a lot of the time.

    As a programmer I do not like 'magic happens'

    I like to see the dirty workings of the stuff I code.
  • 0
    @cervantes01
    https://goodreads.com/book/show/...

    Hit the books. He covers everything from msil/cil, to process execution model, to how memory management occurs, to complex pinning behavior, threads, mutexes/spinlock/semaphore/etc, expression compilation, and, yeah, everything. πŸ‘
  • 1
    @cervantes01 I completely agree

    @SortOfTested

    I understand why ASP is the way it is and the community has worked hard to create a wonderful tool and they’ve succeeded but I don’t know really anything about backend and I want to learn extremely bad and I really do like ASP and I am fine with coming back to learning the foundation but it cripples my ability to understand what’s happening.

    And just in general I’m massively afraid of tutorial he’ll and I really don’t want to be in ASP tutorial hell because this is something I really want to be great with.
  • 1
    @Bubbles
    I tell this to a lot of people when they first start. Read the book I linked to Cervantes, experiment with what you're reading. It'll help you get your head around things lexically and conceptually.

    Troelsen and another writer by the name of Andrew MacDonald are both excellent sources of books for the framework when you're starting.

    Tutorial hell is a great way of putting it; tutorial and video sites don't cover fundamentals, they want to sell subscriptions and in some cases bootcamps. Thankfully Dotnet has been around long enough that people like the aforementioned still exist ☺️
  • 1
    @SortOfTested It’s not that I don’t love the aspect of I can focus on only the application code but I’m just the kind of person that wants to know how everything works before I’m spoiled Yknow?

    I’ll definitely try out those resources, are they up to date with Core 3? If not do you have any that are?
  • 1
    @Bubbles
    I feel ya, I'm a first principles human as well

    They're current, Core is the way moving forward. .Net framework on windows is legacy after 4.7. That said, the language concepts are agnostic, and sparingly few libraries are windows only. (Disclaimer: I haven't deved on windows in years, so I'm a good barometer for that)

    Though I did link an old version, heres the current:
    https://apress.com/gp/book/...
  • 1
    @SortOfTested I’ll definitely check it out I appreciate it
  • 1
    @Bubbles
    Any time, any question πŸ‘
  • 0
    @SortOfTested I do eventually want to start from scratch like you said but that would be more of a project to teach me how it all works (and just to build my own skills) but what all would that entail?
  • 0
  • 0
    @Bubbles That's a pretty broad question.

    At its most generic, I'd advise writing a lot of small console apps to toy with language fundamentals (inheritance, interfaces, "primitives", classes, delegates, enums, collections, data structures, etc).

    From there is helps to understand how the high level .Net architecture works (Common Language Interface/Runtime, tiered memory management, core libraries).

    From there, look into I/O, Environment, encoding namespaces, threading( + Task, async/await), Linq/expressions, tuples, spans, pattern matching, etc.

    At this point overlay basic .net core-specific concepts and its registration patterns. Pay special attention to the basics of how it wires together (entrypoints, application configuration, builds).

    Once you have a firm grip on that, you'll be equipped to look at higher level framework tools like ASPNET Core and see things like, "Hey, middleware is just an async application event loop, and everything is written that way. Turns out it's just a really fancy TCP socket multiplexer."
  • 1
    @SortOfTested uh I was talking about the stuff you were listing off when talking about ASP like an SSL module, I’ve been using C# and working with the basics and intermediate stuff for a year now. I’m just new to Backend & Networking development 🀣 but I don’t know if I made that clear.

    I’m gonna assume it’s involving a bit of sockets since you said bind a TCP port, so l am also good to an extent I have some prior experience with sockets.
  • 0
    @Bubbles
    If you go full manual, yes, it does. Thankfully we have access to most of the tools the framework authors used to make the tools the templates are based on.

    You could bind a socket directly and handle the TCP protocol (https://bit.ly/2HffzA2), or use a TcpListener, which is a specialized socket class to autobind a socket on a given point (https://bit.ly/2SD09L6). The question for what you use is how much control do you need.

    When you get to the encryption, TLS essentially wraps the application layer data stream that flows through TCP. The other end understands the protocol. Manually, you would need to implement the actual TLS 1.2/3 protocol (https://tools.ietf.org/html/rfc5246). But that's a lot of work, and there's a class that implements SSL streams for you specifically, as an easier alternative (https://bit.ly/2OQgsDk).

    The last question is multiplexing calls. You don't really have to worry about that, because TCP uses a 5-tuple session identity, so it's implicit. You just run an async thread to "process request" at that point, compose an httpresponse, and you have yourself a basic, functional SSL webserver, using mostly the same tools MVC does. (with a lot less functionality and safety, however).
  • 1
    @SortOfTested this might sound painful but if I’m making something from scratch like this I’m going to use C πŸ˜… but I’m picking up what you’re throwing down
  • 1
    You have ASPophobia!!!
  • 0
    @sunilkhatri nice 🀣
Add Comment