Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
HoboMan
Nov 4, 2010

i like whitespace it makes things easier to read :ohdear:

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

also thank you cinci for doing the needful and making a new thread. it had been almost 6 months since the last thread got in a tabs v spaces slapfight

HoboMan
Nov 4, 2010



:colbert:

HoboMan
Nov 4, 2010

Lutha Mahtin posted:

make the HQ in MSP and i will work for you. and/or i will be an unpaid hype-man because i do not have actual job experience touching codes

i suggest this because wisconsin is still a bit :chloe: atm

yeah this except i am the codemaster :c00lbutt:

HoboMan
Nov 4, 2010

yeah... in 2003

HoboMan
Nov 4, 2010

MALE SHOEGAZE posted:

thanks to whoever recommended the emulator101 tutorial it's great. should probably thank the person who wrote it. hope they like bitcoins.

oh no

HoboMan
Nov 4, 2010

ok i am having some terrible programming problems and stackoverflow is worthless. i have a .net api endpoint that sends an email to whoever's boss or some poo poo after they submit something for record keeping. i moved the email to get sent on a separate thread because the email server was slow as gently caress and it really shouldn't return an error to the user if their submission went through but the email failed to send. i just wrapped the email stuff in a Task.Run() and that seems to mostly work but any thrown exceptions in there seem to get lost to time and not logged. i'm guessing it's some threading thing???

HoboMan
Nov 4, 2010

Finster Dexter posted:

You have to be careful with tasks and exceptions. It's easy to lose them, especially if you aren't awaiting or calling .Wait() on the task. If the email is not sending and you want to know why, you can't really do a fire-and-forget Task.Run(). You gotta await that thing and see if the task had any exceptions.

ugh, can't i just catch and log the exception in the task?

HoboMan
Nov 4, 2010

Finster Dexter posted:

In other words, let the frontend guys worry about it lol

but i am also that guy!!!

HoboMan
Nov 4, 2010

my code as it stands

C# code:
public IHttpActionResult SubmitForm([FromBody]string json)
{
    var purchaseOrder = JsonConvert.DeserializeObject<PurchaseOrder>(json, defaultSettings);
    using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["myDatabase"].ConnectionString))
    {
        try
        {
            // submit the info into the database
        }
        catch(SqlException e)
        {
            logger.error(connection , "Exception saving purchase order", e);
            return InternalServerError();
        }
    }
    Task.Run( () =>
        {
            using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["myDatabase"].ConnectionString))
            {
                try
                {
                    // send email
                    logger.debug(connection , "Sent email");
                }
                catch(Exception e)
                {
                    logger.error(connection , "Exception sending email", e);
                }
            }
        });
    return Ok();
}
"Sent email" will get logged, but if i hard code an exception in the try block "Exception sending email" will not get logged.

e: i literally just added the using and Task.Run blocks around the existing try-catch that was there.

e2: i forgot to include the try-catch for the json parsing, but you get the idea

HoboMan fucked around with this message at 20:39 on Oct 11, 2018

HoboMan
Nov 4, 2010

jeffery posted:

he has an exception programmed in the a.i. to override the blockade of his suicide

:hmmyes:

HoboMan
Nov 4, 2010

huh?

HoboMan
Nov 4, 2010

yeah. i am a real bad developer but after fumbling around with the big frameworks for a while i have come to the conclusion it is still faster, easier, and more maintainable to just do everything myself

HoboMan fucked around with this message at 15:49 on Oct 18, 2018

HoboMan
Nov 4, 2010

i just want to loving make stuff, not spend literal days debugging my dang toolchain

HoboMan
Nov 4, 2010

Finster Dexter posted:

I know I'm lttp for js spa talk, but at the risk of shaggaring I have the horrible opinion that asp.net core mvc with plain ol' razor views is the pinnacle of webdev right now. I want server-side rendering and jfc get nodejs away from me eww gross

The worst thing MS dotnet team has done in a while, is rolling all the frontend js poo poo into the default templates.

The age of webassm can't get here fast enough.

i was considering posting this but i was afraid of it being too shaggar of an opinion

HoboMan
Nov 4, 2010

besides not being a relational database, is there anything especially bad about mongodb in particular?

HoboMan
Nov 4, 2010

q: does redux actually do anything???
like im trying to test it out and i can't even figure out what im supposed to do with it

e: posting on POS page

HoboMan
Nov 4, 2010

pseudorandom posted:

Of course, if you want to skip javascript you could just compile Rust to wasm. :getin:

my former coworker was making a framework for this.
also a javasript to rust converter.
bless his heart.

HoboMan
Nov 4, 2010

but also: apps are slow and i hate it.

HoboMan
Nov 4, 2010

yeah i am also a v terrible javascript programmer, but i got the sense that adding redux wasn't really doing anything except adding a bunch of boilerplate that makes my code hard to read

in exchange i get... a state machine i mostly had to make myself?

HoboMan
Nov 4, 2010

there's a vs 2019 now????
i just got approval to move projects to 2017!

HoboMan
Nov 4, 2010

i get to pick all the tech for a brand new webapp! :toot:



i have to pick all the tech for a brand new webapp :ohdear:

HoboMan
Nov 4, 2010

Powerful Two-Hander posted:

maybe just avoid angular though??

do it all in c# mvc op, it owns

this is very tempting, but i also have the chance to include angular on my resume.

literally every interviewer: "i see you have react experience, and that's great we are looking for that, but do you have any angular experience as well?"
me: "no"
them: *clearly disappointed* "hmmmm"

HoboMan
Nov 4, 2010

my new job will pay for it so can anyone recommend a tutorial service?

HoboMan
Nov 4, 2010

i prefer wikihow!!!

HoboMan
Nov 4, 2010

*mentored other developers

HoboMan
Nov 4, 2010

i will say that if you are doing pure CRUD and your objects are strictly just tables then an ORM lets you skip doing a lot of manual mapping and can be good.

however this use case is actually pretty rare unless you are very careful in your requirements and initial design. (also you may have to manually map stuff anyways because gently caress you, arbitrary business rules)

HoboMan
Nov 4, 2010

guess who got two thumbs and found plaintext passwords in the database?

HoboMan
Nov 4, 2010

animist posted:

hows that going for you

asked the client about it and the client says they are using "microsoft" for the application validation so don't worry about it

HoboMan
Nov 4, 2010

me, a terrible programmer, after doing a few months of making a poo poo react app and now learning the absolute basics of angular: "theres actually zero difference between react & angular. you imbeciles. you loving morons"

HoboMan
Nov 4, 2010

redleader posted:

same, but i don't do any sort of computer touching outside of work

HoboMan
Nov 4, 2010

so this is my first new app in several years. can anyone recommend a logging or error handling framework for a angular.net project?

in my experience so far error handling and logging has been "none, but maybe make a bespoke thing if you need it" so i would like to do better now that i have the chance.

HoboMan
Nov 4, 2010

i guess back end for now. for all i know about angular right now it might already have a built-in logging service.

i see that .net core has a logging thing, it any good? it looks extremely basic

HoboMan
Nov 4, 2010

thanks i will check out serilog

in other baby's first modren project news i have now made 8 files for a simple get endpoint so everything is nice and decoupled with services and interfaces but i don't know what to actually unit test.
i mean i could verify my service correctly returns my object from the mock data service but like this feels roughly equivalent to having
code:

var foo = 2 + 2;
asset.eq(foo, 4);
as a test

HoboMan
Nov 4, 2010

man, the imposter syndrome is real at my new job. i killed it at my last job and my new manager keeps talking about how smart i must be and how everyone at my old company only had the highest praise for me, but i don't know anything about dev process or achetecture. i can make lovely code slightly less poo poo and that's all really

HoboMan
Nov 4, 2010

aaaaaaand im fired

HoboMan
Nov 4, 2010


HAHA, no wait, load balancing software?
you working on that system that went down a couple weeks ago and got my loving flight delayed by a couple hours?

HoboMan
Nov 4, 2010

aaaaaaaand im hired

HoboMan
Nov 4, 2010

guy here likes to inert into the db via stored procedures where there is only one augment which is an xml blob of whatever you are updating/inserting.
it skips having to do an explicit mapping and lets the same proc handle any number of items, but it still feels wrong despite not having anything specific to point to.
what terrible thing am i missing?
or is this fine?

e: the xml blob is automagically parsed and the data properly put in the appropriate columns, not just jammed in the db

HoboMan fucked around with this message at 18:02 on Apr 25, 2019

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010


hell yeah

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply