• lime!@feddit.nu
    link
    fedilink
    English
    arrow-up
    86
    arrow-down
    1
    ·
    5 days ago

    how tf would a missing semicolon result in a http server error

    • stinky@redlemmy.com
      link
      fedilink
      English
      arrow-up
      60
      ·
      4 days ago

      In ASP.NET applications, specifically in ASP.NET Web Forms and ASP.NET MVC (pre-Core), the compilation process is dynamic and happens at runtime if source files like .cshtml, .aspx, and .cs files are present on the server.

      ASP.NET uses just-in-time (JIT) compilation for views (.cshtml, .aspx, .ascx, etc.) and sometimes for code-behind files (.cs). When a request hits a page, ASP.NET dynamically compiles these files into temporary assemblies.

      If there’s a syntax error, missing semicolon, incorrect type, or any other compilation issue, the process will fail and throw a 500 error.

      • lime!@feddit.nu
        link
        fedilink
        English
        arrow-up
        12
        ·
        4 days ago

        why would you use asp in an introductory course

        even if you have like a student learning platform so they don’t have to install anything, surely it would wrap the code that’s submitted so it doesn’t crash the application

        • stinky@redlemmy.com
          link
          fedilink
          English
          arrow-up
          11
          ·
          4 days ago

          my guess is he had all the boilerplate written, and was using a single line or two of “working code” to show what the technology was capable of

          but it’s 4chan greentext so it could be fake and gay

    • merc
      link
      fedilink
      arrow-up
      16
      ·
      4 days ago

      If the web server is implemented in any of the languages that require semicolons.

        • taladar
          link
          fedilink
          arrow-up
          11
          ·
          4 days ago

          For the same reason our OS memory management class was in Java, a language without pointers, because some idiot decided all courses had to be standardized on the same language because the industry says they need people who know that language now.

        • merc
          link
          fedilink
          arrow-up
          7
          ·
          4 days ago

          As one step of building a bigger project that demonstrates something web-ish.

      • sugar_in_your_tea
        link
        fedilink
        arrow-up
        2
        ·
        3 days ago

        Nodejs exists. Here’s a JS snippet that would throw an exception:

        for (x = 0; x < 5 x++)
        {} 
        
      • lime!@feddit.nu
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 days ago

        if your server runs user-submitted code server side, that’s a paddlin

        • Black616Angel@discuss.tchncs.de
          link
          fedilink
          arrow-up
          3
          ·
          4 days ago

          It never said user code.

          This could as well be an intro to php and the server may be set to not show errors and instead just fail.

          The lecturer then writes some code, forgets a semicolon and gets a 500.

      • Echo Dot@feddit.uk
        link
        fedilink
        arrow-up
        1
        arrow-down
        2
        ·
        4 days ago

        If the file failed to compile the server wouldn’t execute it because a file wouldn’t be created. A compile error stops the process, It doesn’t result in a corrupted output, since that would be really stupid.