|
Share Bear posted:black, mypy, and flake8 rule, great tools use em all the time
|
# ? Feb 3, 2021 20:48 |
|
|
# ? Oct 5, 2024 08:17 |
|
my goodness high dpi stuff on windows is a bit of a mess. like its very clearly dramatically better than just a few years ago, but still. also, how the hell can i test any of this. horrible
|
# ? Feb 3, 2021 21:42 |
|
Some of the blackisms turned me off when I evaluated it, like the quote switching and the way it determines line breaking for the max width. But I have been evaluating yapf a bit and it seems pretty good out of the box, though I upped the line width. The new employee under me has really taken ownership of getting styling right in the Python repo, which has been great.
|
# ? Feb 3, 2021 21:48 |
|
Bloody posted:my goodness high dpi stuff on windows is a bit of a mess. like its very clearly dramatically better than just a few years ago, but still. if ur talking about how to fix it for your winforms app, its just bad. i ended up disabling dpi awareness and letting windows scale everything and that seemed to fix most issues, but if you're using the form editor on a high dpi machine it still is sucks.
|
# ? Feb 3, 2021 21:58 |
|
jesus WEP posted:youre already a great tool for using python in the first place lmao Share Bear fucked around with this message at 22:14 on Feb 3, 2021 |
# ? Feb 3, 2021 22:12 |
|
Shaggar posted:if ur talking about how to fix it for your winforms app, its just bad. i ended up disabling dpi awareness and letting windows scale everything and that seemed to fix most issues, but if you're using the form editor on a high dpi machine it still is sucks. yeah our baseline right now is disabled and we dont use the form editor, my mission is to figure out how to enable it some day. i think the answer is: rewrite 95% of the ui in wpf and host 2 ultra custom controls that already know how to zoom (& so are trivial to add dpi support to) in WindowsFormsHosts
|
# ? Feb 3, 2021 22:57 |
|
someone was clever and made one form in our winforms app in wpf and every time that loads for the first time it takes like 5 seconds. it also had really hosed dpi handling and i dont remember how i fixed it. if you do something clever like that you should probably see if you can preload the wpf components so it doesnt murder your app the first time the user loads one.
|
# ? Feb 3, 2021 23:27 |
|
yeah we're a hybrid app already so there's either poo poo that's handling that in places or we just yolo it idk
|
# ? Feb 4, 2021 00:25 |
|
Bloody posted:yeah we're a hybrid app already so there's either poo poo that's handling that in places or we just yolo it idk sml idc/idgaf tbqh not that I blame you
|
# ? Feb 4, 2021 00:46 |
|
Bloody posted:yeah our baseline right now is disabled and we dont use the form editor, my mission is to figure out how to enable it some day. i think the answer is: rewrite 95% of the ui in wpf and host 2 ultra custom controls that already know how to zoom (& so are trivial to add dpi support to) in WindowsFormsHosts You're supposed to rewrite it as a local webserver with a react ui duh.
|
# ? Feb 4, 2021 00:51 |
|
with our app at some point in the next year or so we're gonna start overhauling it and im considering converting it to a webapp with fully server side application state. the idea being when dumbass users close the browser they can just go back to the webapp and be immediately back where they were. i dont know if the current team is right for it tho.
|
# ? Feb 4, 2021 00:59 |
|
allowing both single- and double-quotes for strings in a language is wrong
|
# ? Feb 4, 2021 05:58 |
|
Yeah, the whole idea behind black is that you relinquish control over your formatting and let black do the formatting for you. It may have some oddities that bother you, but it’s better than manual formatting your files, and it can be automated.
|
# ? Feb 4, 2021 06:03 |
|
Shaggar posted:with our app at some point in the next year or so we're gonna start overhauling it and im considering converting it to a webapp with fully server side application state. the idea being when dumbass users close the browser they can just go back to the webapp and be immediately back where they were. you gonna store the state in sql server? ive done this in an app layer and it's ok but kind of annoying to do updates
|
# ? Feb 4, 2021 06:06 |
|
id still use sql server for the actual data that matters, but idk what i'd use to store the application state. could be sql, could be something less persistent. idk if its even worth while as a concept since it may end up being too much of a pain in the rear end trying to maintain every piece of UI state to make it work.
|
# ? Feb 4, 2021 06:16 |
|
DoomTrainPhD posted:Yeah, the whole idea behind black is that you relinquish control over your formatting and let black do the formatting for you. It may have some oddities that bother you, but it’s better than manual formatting your files, and it can be automated. "gently caress you, follow the style guide" was go's best idea. static linking was the other good idea. shame about the rest of the language but what can you do
|
# ? Feb 4, 2021 06:19 |
|
Shaggar posted:id still use sql server for the actual data that matters, but idk what i'd use to store the application state. could be sql, could be something less persistent. idk if its even worth while as a concept since it may end up being too much of a pain in the rear end trying to maintain every piece of UI state to make it work. sounds like you're talking about DIY'ing viewstate and also persisting it
|
# ? Feb 4, 2021 06:23 |
|
Nomnom Cookie posted:"gently caress you, follow the style guide" was go's best idea. static linking was the other good idea. shame about the rest of the language but what can you do Agreed on all counts.
|
# ? Feb 4, 2021 06:26 |
|
cool av posted:allowing both single- and double-quotes for strings in a language is wrong singles are for keying a dictionary. doubles for everything else
|
# ? Feb 4, 2021 06:52 |
|
the important part about allowing single and double quoted strings is to have subtly different semantics for each the next important part is to add a dozen other kinds of string literals with various spellings, making your single and double quote differences seem downright hostile in comparison
|
# ? Feb 4, 2021 07:39 |
|
pokeyman posted:the important part about allowing single and double quoted strings is to have subtly different semantics for each At least this is not widespread. I'd talk more but I'm debugging this weird dockerfile issue where the CMD line refuses to work due to some invisible, nigh indiscernible reason.
|
# ? Feb 4, 2021 09:41 |
|
Nomnom Cookie posted:"gently caress you, follow the style guide" was go's best idea. static linking was the other good idea. shame about the rest of the language but what can you do
|
# ? Feb 4, 2021 09:52 |
|
Shaggar posted:id still use sql server for the actual data that matters, but idk what i'd use to store the application state. could be sql, could be something less persistent. idk if its even worth while as a concept since it may end up being too much of a pain in the rear end trying to maintain every piece of UI state to make it work. do you actually need to go so far as to persist the state? seems like 99% of the advantage would be in just keeping sessions alive until memory pressure forces the oldest ones to close. and depending on the number of clients just having enough memory to make this largely indistinguishable from indefinitely.
|
# ? Feb 4, 2021 10:19 |
|
Nomnom Cookie posted:"gently caress you, follow the style guide" was go's best idea. static linking was the other good idea. shame about the rest of the language but what can you do rust tried to copy 'go fmt' and then let you define your own style rules
|
# ? Feb 4, 2021 11:52 |
|
my stepdads beer posted:rust tried to copy 'go fmt' and then let you define your own style rules are there at least default rules most people wouldn't tinker with?
|
# ? Feb 4, 2021 12:01 |
|
I didn't even know you could change the cargo fmt rules lol
|
# ? Feb 4, 2021 15:50 |
|
pokeyman posted:the important part about allowing single and double quoted strings is to have subtly different semantics for each i absolutely hate this aspect of python there's "raw" strings, typically used for regexes but only offer that backslashes are literal characters code:
code:
you can have the template logic by using the .format() method applicable to any string instead code:
black is good, useful, and helps pay my bills Share Bear fucked around with this message at 15:58 on Feb 4, 2021 |
# ? Feb 4, 2021 15:54 |
|
DoomTrainPhD posted:Yeah, the whole idea behind black is that you relinquish control over your formatting and let black do the formatting for you. It may have some oddities that bother you, but it’s better than manual formatting your files, and it can be automated. Fundamentally I'm on board with that, but I still gotta look at it, so if I'm going to get something auto-formatted I don't want it to do changes that I think look dumb or mess with the ergonomics of development. In my (brief) evaluation, yapf does a better job of letting you have a few knobs for that, while still preventing devs from going off the rails.
|
# ? Feb 4, 2021 16:00 |
|
Share Bear posted:i absolutely hate this aspect of python I love fixing "thing: {} other thing{} similar-sounding-thing{} over{}and{}over{}and{}over{}".format(can, you, keep, track, of, all, these.positional, arguments) calls that are completely unreadable because my teammates think new features are inherently unreadable. Versus f""thing: {can} other thing{you} similar-sounding-thing{keep} over{track}and{of}over{all}and{these.positional}over{arguments}" Not knowing where a variable is even going to be decomposed to or what format arguments go with it, or anything, it's frustrating as hell and totally unusable.
|
# ? Feb 4, 2021 17:14 |
|
calling format strings "less readable" is ridiculous
HappyHippo fucked around with this message at 17:32 on Feb 4, 2021 |
# ? Feb 4, 2021 17:25 |
|
also i do like the idea of simply prepending the strings with a letter vs having a bunch of different quotes with different abilities, like ` or ' or " or """ meaning different things which is not to say that python is free of that, with """ and all.
|
# ? Feb 4, 2021 17:30 |
|
HappyHippo posted:calling format strings "less readable" is ridiculous yeah, mega agreed for a one-parameter format i guess who cares (hell, you can even use the % syntax idgaf) but if you have multiple things to format the other alternatives get gross really fast, especially if the parameter appears multiple times in the template fstrings are one of the best things to happen to python and if they had included them in python 3 i bet a lot of python 2ers would've switched (because i have upgraded projects from 3.something to 3.7 specifically for the glory of fstrings
|
# ? Feb 4, 2021 17:32 |
|
and it isn't magic, it just turns it into a string the same way anything else would with str() or repr() if you use !r
|
# ? Feb 4, 2021 17:35 |
|
My favorite is Groovy with its single- and double-quote strings where if you use the wrong one to index into a java.util.Map, it'll only ever return null, because one of those strings uses GString as its class. Also, GString lol
|
# ? Feb 4, 2021 17:38 |
|
Corla Plankun posted:and it isn't magic, it just turns it into a string the same way anything else would with str() or repr() if you use !r Actually, no. It's literally just transformed behind the scenes into string.format(locals()). Which means that it's doing all the string formatting stuff that string.format always does, precision, casting, padding, all depends on the formatting arguments you provide.
|
# ? Feb 4, 2021 17:42 |
|
PHP has broken me because anytime I see double quotes I just assume some magic interpolation is going to happen.
|
# ? Feb 4, 2021 17:43 |
|
ikanreed posted:I love fixing "thing: {} other thing{} similar-sounding-thing{} over{}and{}over{}and{}over{}".format(can, you, keep, track, of, all, these.positional, arguments) calls that are completely unreadable because my teammates think new features are inherently unreadable. you can also do that with code:
ikanreed posted:Actually, no. It's literally just transformed behind the scenes into string.format(locals()). Which means that it's doing all the string formatting stuff that string.format always does, precision, casting, padding, all depends on the formatting arguments you provide. that's magic man, i'm going to have explicit code as much as i can Share Bear fucked around with this message at 18:12 on Feb 4, 2021 |
# ? Feb 4, 2021 18:06 |
|
Share Bear posted:you can also do that with if you dont like magic dont use python tbh, f-strings are great
|
# ? Feb 4, 2021 18:15 |
|
Nomnom Cookie posted:if you dont like magic dont use python tbh, f-strings are great they're actually not and you're all wrong also thinking about the magic i do like and i wonder what list comps get turned into, should look into that
|
# ? Feb 4, 2021 18:16 |
|
|
# ? Oct 5, 2024 08:17 |
|
f-strings look like c#'s $strings which are great. only time to use string.format is when you have some localized string to stuff with numbers or w/e
|
# ? Feb 4, 2021 18:24 |