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
Soricidus
Oct 21, 2010
freedom-hating statist shill

Cybernetic Vermin posted:

ok, to just spell this out instead: python has had a horrible track record of backwards compatibility. it is not a bad bet to avoid it for that reason, if you wish for any permanence in the things you put your time into.

I’m struggling to think of any decades-old languages where you can take old code and give it the latest versions of its dependencies and plug it into the latest runtime/compiler and expect anything but pain.

if you wish for permanence then you have to use fixed versions of everything, ideally with security backports if you can get them. this is universal. yes, python’s design means you can’t do this without virtualenvs or containers or similar, but that’s hardly unique to python.

Adbot
ADBOT LOVES YOU

graph
Nov 22, 2006

aaag peanuts
rhel8 and ububu 20 look pretty loving identical

Broken Machine
Oct 22, 2010

Soricidus posted:

I’m struggling to think of any decades-old languages where you can take old code and give it the latest versions of its dependencies and plug it into the latest runtime/compiler and expect anything but pain.

if you wish for permanence then you have to use fixed versions of everything, ideally with security backports if you can get them. this is universal. yes, python’s design means you can’t do this without virtualenvs or containers or similar, but that’s hardly unique to python.

you can probably do this with a lot of c

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

Nomnom Cookie posted:

serious q: i do a lot of infra dev at work and we're pretty happy with python 3.6 for that. you need a lovely little daemon to pipe metrics from elasticsearch to datadog or something, write 200 LOC of python and pop it in your kube cluster. easy peasy. what language is superior to python for this application?

python is probably the best language for stuff like this, don't change it

FlapYoJacks
Feb 12, 2009

graph posted:

rhel8 and ububu 20 look pretty loving identical

Ah but you see, one is RHEL, the other is a gigantic pile of garbage based on a random fork of Debian which is also quite bad.

FlapYoJacks
Feb 12, 2009

Poopernickel posted:

python is probably the best language for stuff like this, don't change it

This is the correct answer. Unless you need compiled code, Python is the winner 99% of the time.

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


the rough guideline i use for if i need to move from a python project is if i need to, no joke, make another file. if my script is becoming that unwieldy chances are it needs to move to some real language

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

Soricidus posted:

I’m struggling to think of any decades-old languages where you can take old code and give it the latest versions of its dependencies and plug it into the latest runtime/compiler and expect anything but pain.

if you wish for permanence then you have to use fixed versions of everything, ideally with security backports if you can get them. this is universal. yes, python’s design means you can’t do this without virtualenvs or containers or similar, but that’s hardly unique to python.

basically any of the core unix languages - C, shell-scripts, various DSLs like awk, groff, etc. C++ also, more or less. Also Perl if you're a graybeard or Tcl if you're a circuit hipster

Poopernickel fucked around with this message at 02:45 on Oct 23, 2020

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

Poopernickel posted:

Tcl if you're a hipster

i have to use tcl because it's the scripting language integrated into xilinx fpga tools and based on what i find when i google for poo poo, i cannot imagine a less hipste plang. it's graybeards all the way down

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

BobHoward posted:

i have to use tcl because it's the scripting language integrated into xilinx fpga tools

trap sprung

graph
Nov 22, 2006

aaag peanuts

nope

Share Bear
Apr 27, 2004

Beamed posted:

the rough guideline i use for if i need to move from a python project is if i need to, no joke, make another file. if my script is becoming that unwieldy chances are it needs to move to some real language


this is the real correct heuristic but i also give myself leeway at 1k lines of code

if its more than that it should be a real thing

Share Bear
Apr 27, 2004

Poopernickel posted:

basically any of the core unix languages - C, shell-scripts, various DSLs like awk, groff, etc. C++ also, more or less. Also Perl if you're a graybeard or Tcl if you're a circuit hipster

you dont have to care about this anymore unless youre doing embedded

you should care about the perf of your apps but the p lang jvm runtime just doesnt matter a lot

and odds are your bespoke csv or json parser skin for your db doesnt either

Nomnom Cookie
Aug 30, 2009



DoomTrainPhD posted:

Ah but you see, one is RHEL, the other is a gigantic pile of garbage based on a random fork of Debian which is also quite bad.

rip nbsd

FlapYoJacks
Feb 12, 2009

Share Bear posted:

this is the real correct heuristic but i also give myself leeway at 1k lines of code

if its more than that it should be a real thing

my guideline is if the script has more than just simple Shell commands. I don’t care how man lines long it is, if it’s all cats and greps then it should be a Shell script.

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

Beamed posted:

the rough guideline i use for if i need to move from a python project is if i need to, no joke, make another file. if my script is becoming that unwieldy chances are it needs to move to some real language

wait, are you seriously suggesting that python projects shouldn't be larger than one file? :pwn:

I just finished up a CLI tool for $dayjob that's currently 3.5kloc across 20 files, and I've got another one in the works.

Soricidus
Oct 21, 2010
freedom-hating statist shill
depends how you’re using it. if you put in the effort (proper tests, plenty of type hints, actual thought going into the design) then python is fine. if you’re just making GBS threads out code and thinking you’ll tidy it up later then python is going to cause you a world of pain.

Granite Octopus
Jun 24, 2008

Soricidus posted:

depends how you’re using it. if you put in the effort (proper tests, plenty of type hints, actual thought going into the design) then python is fine. if you’re just making GBS threads out code and thinking you’ll tidy it up later then python is going to cause you a world of pain.

this is true of literally any language?

all code is garbage

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
I have written beautiful code once. It's perfect, handles all exceptions properly, is easy to read, has very little indentation, does one thing and it does it well, is documented with help output and all. It covers a lot of edge cases without becoming complex and it uses no confusing language features.

It serves as great contrast to everything else. I read it sometimes and weep in despair.

Pile Of Garbage
May 28, 2007



Antigravitas posted:

I have written beautiful code once. It's perfect, handles all exceptions properly, is easy to read, has very little indentation, does one thing and it does it well, is documented with help output and all. It covers a lot of edge cases without becoming complex and it uses no confusing language features.

It serves as great contrast to everything else. I read it sometimes and weep in despair.

unsure whether this is hubris or arrogance. there is no good code, yospos bithc

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
everybody hits a point where they’ve written one (1) piece of software that is Good, and know that they never will manage it again

Penguissimo
Apr 7, 2007

major flowers for algernon energy

Nomnom Cookie
Aug 30, 2009



Granite Octopus posted:

this is true of literally any language?

all code is garbage

some languages are easier to refactor than others, especially when written idiomatically. you can write a nasty 10 kloc pile of code manipulating nested maps of maps of lists of maps with no tests or comments whatsoever in java, but you’re going against the grain. python makes it a lot easier to think that you’re doing something reasonable when in fact you’re just creating a terrible mess

Sapozhnik
Jan 2, 2005

Nap Ghost
Java has only recently gained a record type feature and even then you still have to initialize them using positional constructor arguments which really sucks.

There are nasty code-generating workarounds like AutoValue, but again you're either using positional constructor args or you're using builders and can't check if you actually completely initialized the object until runtime.

Nomnom Cookie
Aug 30, 2009



Sapozhnik posted:

Java has only recently gained a record type feature and even then you still have to initialize them using positional constructor arguments which really sucks.

There are nasty code-generating workarounds like AutoValue, but again you're either using positional constructor args or you're using builders and can't check if you actually completely initialized the object until runtime.

oh are you one of those people who cries tears of blood if you see a getter in your codebase

Best Bi Geek Squid
Mar 25, 2016
i write dumb hobby things in python and it is friendly and nice 🤗

Share Bear
Apr 27, 2004

you can poo poo out bad code in any language and good code in any language

does it pay my bills? did nothing terrible befall someone due to how this was made? ship it

FlapYoJacks
Feb 12, 2009
I once interviewed for a position at a company that makes gas pumps. The ancient engineer I was going to replace proudly told me every variable in (his) codebase was a global and that he didn't need any tests because his code was tried and true tested in the field. :smug:

I cut the interview short and politely told the guy I was interviewing with that I wasn't interested in the position any longer and that the code base wasn't worth the hassle.

Perplx
Jun 26, 2004


Best viewed on Orgasma Plasma
Lipstick Apathy
some languages are just bad though, like php which is not even internally consistent with function names

FlapYoJacks
Feb 12, 2009

Perplx posted:

some languages are just bad though, like php which is not even internally consistent with function names

What's the issue? Just use mysql() mysqli()

Also use mysql_escape_string() mysql_real_escape_string() mysqli_real_escape_string();

It's easy!

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

hobbesmaster posted:

what should I be using to target cortex m4s and cortex m3s then? C? asm?

C

Soricidus
Oct 21, 2010
freedom-hating statist shill
cortices m3

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Poopernickel posted:

here, watch a C++ developer completely lose their grip on reality over the course of one article:

https://www.boost.org/doc/libs/1_74_0/libs/geometry/doc/html/geometry/design.html

all C++ people are eventually turned into this by their insantity-causing language

this is like the code equivalent of Zalgo text

Soricidus
Oct 21, 2010
freedom-hating statist shill
which programming languages support zalgo variable names? just curious

hobbesmaster
Jan 28, 2008

DoomTrainPhD posted:

I once interviewed for a position at a company that makes gas pumps. The ancient engineer I was going to replace proudly told me every variable in (his) codebase was a global and that he didn't need any tests because his code was tried and true tested in the field. :smug:

I cut the interview short and politely told the guy I was interviewing with that I wasn't interested in the position any longer and that the code base wasn't worth the hassle.

i'm guessing this wasn't an 8 bit microcontroller

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Soricidus posted:

which programming languages support zalgo variable names? just curious

Swift

FlapYoJacks
Feb 12, 2009

hobbesmaster posted:

i'm guessing this wasn't an 8 bit microcontroller

Am335x sitara running Linux. :v:

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

Soricidus posted:

which programming languages support zalgo variable names? just curious

>>> i̢n͡ͅv͍̯o̤̭k̟͞e̗͞ = "yospos"
>>> print(i̢n͡ͅv͍̯o̤̭k̟͞e̗͞)
yospos

Too much Zalgo breaks python:

>>> Yͨ̅O̤ͤS͊̀P̓̇Oͬ̈S̈́̂ = "bithc"
File "<stdin>", line 1
Yͨ̅O̤ͤS͊̀P̓̇Oͬ̈S̈́̂ = "bithc"
^
SyntaxError: invalid character in identifier

hobbesmaster
Jan 28, 2008

DoomTrainPhD posted:

Am335x sitara running Linux. :v:

then everything isn't a global! a shameful greybeard

Adbot
ADBOT LOVES YOU

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Antigravitas posted:


>>> i̢n͡ͅv͍̯o̤̭k̟͞e̗͞ = "yospos"
>>> print(i̢n͡ͅv͍̯o̤̭k̟͞e̗͞)
yospos

Too much Zalgo breaks python:

>>> Yͨ̅O̤ͤS͊̀P̓̇Oͬ̈S̈́̂ = "bithc"
File "<stdin>", line 1
Yͨ̅O̤ͤS͊̀P̓̇Oͬ̈S̈́̂ = "bithc"
^
SyntaxError: invalid character in identifier


here's a nickel kid, get yourself a real computer


╰─>$ swift
Welcome to Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1).
Type :help for assistance.
1> let i̢n͡ͅv͍̯o̤̭k̟͞e̗͞ = "yospos"
i̢n͡ͅv͍̯o̤̭k̟͞e̗͞: String = "yospos"
2> print(i̢n͡ͅv͍̯o̤̭k̟͞e̗͞)
yospos
3> let Yͨ̅O̤ͤS͊̀P̓̇Oͬ̈S̈́̂ = "bithc"
Yͨ̅O̤ͤS͊̀P̓̇Oͬ̈S̈́̂: String = "bithc"
4> print(Yͨ̅O̤ͤS͊̀P̓̇Oͬ̈S̈́̂)
bithc

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