New around here? Register your SA Forums Account here!

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
fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Private Speech posted:

broke: copy code from an open source repo
woke: make a script to do it for you
bespoke: make it automatically update and put it in your build process

that's some next level nightmare fuel right there

yeah a lot of package managers support git repos now.

the real cool one is that javascript variant that can update your github dependencies at runtime instead of at build. forget what its called

Adbot
ADBOT LOVES YOU

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


fart simpson posted:

yeah a lot of package managers support git repos now.

the real cool one is that javascript variant that can update your github dependencies at runtime instead of at build. forget what its called

I mean yeah that came to mind, but fair point

not that it's better

Bloody
Mar 3, 2013

elite_garbage_man posted:

ctps:
ready to quit the new job

senior engineers straight up copy code from other repos then scratch their heads when customers tell us poo poo just broke when one of the repos changes and we push builds out

prod code has absolutely no testing yet plays a role in life or death situations

managers never say no to customer requests

no direct IT or qa support so our team has the luxury of standing up all hardware and doing metrics collection for the customer. none of which is automated

every bug that crops up (which there are a lot of) must be fixed and shipped immediately without any testing, even if it’s not critical

hey at least the figgies are good

quit the job

The Fool
Oct 16, 2003


bob dobbs is dead posted:

its not even the previous thread title but i think running to belize should feature in all thread titles

it isnt even that great to visit lol

it has good beaches and the exchange rate is advantageous
they also speak english

I went in the 90's as a teenager and the thing that I remember the most is buying glass 1 liter bottles of sprite for $0.50

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
what's the c++ equivalent to java.time.Instant and NSDate?

c++17 is ok. c++20 may be ok

MrMoo
Sep 14, 2000

I always used a mix of std::chrono and boost::date_time, looks like C++20 is making the date handling less lovely,

https://en.cppreference.com/w/cpp/chrono

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I guess I want system_clock::time_point? looks like unix epoch with no leap seconds (de facto until c++20) which matches nsdate (modulo epoch) and java.time.instant by my reading

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme

pokeyman posted:

I guess I want system_clock::time_point? looks like unix epoch with no leap seconds (de facto until c++20) which matches nsdate (modulo epoch) and java.time.instant by my reading

depending on how you're using the time_point, you may want to look into the other C++11 clocks like monotonic_clock steady_clock. system_clock may be needs suiting for you of course.

Asleep Style
Oct 20, 2010

Any recs for python books for people who can already program? Most of the books on the market seem geared towards new programmers and I've seen enough explanations of for loops at this point

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
but these for loops can have an else block!!

animist
Aug 28, 2018
python seems really pretty and clean as long as you never interact with its internals or packaging system

Eldred
Feb 19, 2004
Weight gain is impossible.

Asleep Style posted:

Any recs for python books for people who can already program? Most of the books on the market seem geared towards new programmers and I've seen enough explanations of for loops at this point

Essential Python maybe? Or just read the docs, they're pretty good.

https://www.programming-books.io/essential/python/

Soricidus
Oct 20, 2010
freedom-hating statist shill
everything’s a hash table, including modules and types. but they’re not all mutable, thank god.

indentation instead of braces. it’s fine.

scoping is hosed up and anonymous functions can only contain a single expression because guido sucks.

that concludes this lecture on python for people who already know how to code.

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
if you dip into numpy land, you have basically dipped into fortranland but if you gently caress up in a specific way you run python vm code and eat a 500x perf loss

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine
also functional operators are made intentionally a pain to use because their use is discouraged, like lambdas

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine
also the std library has no sorted data structure that is nice to use. you are supposed to call a functions on top of a sorted list, lomarf

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
lotsa deec 3rd party dealios

generally, python has the best lib quality for an astounding variety of domains, especially less technical poo poo, cuz domain experts who dont think of themselves as computer touchers end up doin poo poo in python

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine
some stuff is getting better. dataclasses are not bad if you want something like records and if you make them frozen you can even use them as dict keys

CarForumPoster
Jun 26, 2013

bob dobbs is dead posted:

lotsa deec 3rd party dealios

generally, python has the best lib quality for an astounding variety of domains, especially less technical poo poo, cuz domain experts who dont think of themselves as computer touchers end up doin poo poo in python

I can edit word docs and print them in just a few lines in python

yippee

The Fool
Oct 16, 2003


I regularly create xls files with python

gonadic io
Feb 16, 2011

>>=
now i'm thinking about using the rust/python compat to take advantage of the much better ecosystem for tasks like this. at least i'm in the right thread.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

i dislike python. thanks for reading.

animist
Aug 28, 2018
if you are writing more than 100 lines you probably want mypy. it'll give you static type checking and good autocomplete. however, mypy type definitions probably don't exist for 3/4 of the libraries you're using.

also, sometimes you have to use strings instead of identifiers to refer to types. type checking isn't built into the language; the interpreter and the type checker have subtly different scoping rules.

Python code:

from typing import Union

# this type checks, but errors at runtime
def log(value: StringOrInt) -> None:
   print(value)

# this works though
def log(value: "StringOrInt") -> None: 
   print(value)

StringOrInt = Union[String, Int]

this also happens whenever you try to refer to a class from one of that class's methods. fun.

also, the language is unable to leverage type information for performance (because it's just a bandaid on top of an untyped system). so your code will still run 100x slower than if you used a language with braces.

in conclusion mypy is a land of contrasts

animist fucked around with this message at 04:09 on Jul 10, 2020

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
if you guve a poo poo about perf use numpy or write in different language

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
one of the special things about python is the fact that its the only normal people lang with a really good property based testing library, called hypothesis. use the hell out of it, it good as hell

Corla Plankun
May 8, 2007

improve the lives of everyone
i don't get why people want typed python. if you need help keeping track of the typed of objects, your script is too big and you should switch to a big boy language imo

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Corla Plankun posted:

i don't get why people want typed python. if you need help keeping track of the typed of objects, your script is too big and you should switch to a big boy language imo

because types are good

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

if your writing more than probably 10 lines you want a real language imo

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
writing in a typed lang will not save you from being a terrible programmer, only the oblivion of death can do that

Bloody
Mar 3, 2013

more langs need numpy scipy and most of all matplotlib

Bloody
Mar 3, 2013

though I'd actually rather have ggplot2

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
you need to get real numerics peeps on board and they are real fuckin weird peeps

if you only have numerics peeps in a lang you get R, lol

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

fart simpson posted:

if your writing more than probably 10 lines you want a real language imo

Truman Peyote
Oct 11, 2006



my company's main software is all written in python. thousands of lines of code at least

i don't work on that project usually

Xik
Mar 10, 2011

Dinosaur Gum

bob dobbs is dead posted:

writing in a typed lang will not save you from being a terrible programmer, only the oblivion of death can do that

you're wrong op, i'm a real poo poo programmer and strong typing makes me slightly less poo poo

Soricidus
Oct 20, 2010
freedom-hating statist shill

bob dobbs is dead posted:

writing in a typed lang will not save you from being a terrible programmer, only the oblivion of death can do that

no, but it’ll make it more obvious where you and your terrible programming colleagues have hosed up

sometimes type haters try to argue that testing works just as well. it probably does in theory. the problem is that tests are programs, and the people who write them are the same terrible programmers

Xarn
Jun 26, 2015
By the same argument, types will also be bad tho.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Xarn posted:

By the same argument, types will also be bad tho.

Code bad, but there is a lot less code in one type checker than in a million test suites for a million individual projects.

redleader
Aug 18, 2005

Engage according to operational parameters

animist posted:

if you are writing more than 100 lines you probably want mypy. it'll give you static type checking and good autocomplete. however, mypy type definitions probably don't exist for 3/4 of the libraries you're using.

also, sometimes you have to use strings instead of identifiers to refer to types. type checking isn't built into the language; the interpreter and the type checker have subtly different scoping rules.

Python code:
from typing import Union

# this type checks, but errors at runtime
def log(value: StringOrInt) -> None:
   print(value)

# this works though
def log(value: "StringOrInt") -> None: 
   print(value)

StringOrInt = Union[String, Int]
this also happens whenever you try to refer to a class from one of that class's methods. fun.

also, the language is unable to leverage type information for performance (because it's just a bandaid on top of an untyped system). so your code will still run 100x slower than if you used a language with braces.

in conclusion mypy is a land of contrasts

hahah gently caress, it's worse than i thought

Adbot
ADBOT LOVES YOU

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



yea the stringly typed forward annotations are so bad

apparently cant be fixed without rewriting module import from the ground up

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