I was writing a python script today to scrap reddit and generate a list of transexuals and hamas simps for me to block and it was nothing but pain.
Why you ask?
Because python does nothing to warn you what error your code can throw or even if it can throw an error. In D (the far superior langue) you can tag your code @nothrow
and if your code can throw any error you've not handled the compiler will throw an error. This allows for good, safe, trustworthy code the likes of which you will never get from gaython
No instead you'll write a try except for every case you can think of just to have it throw one you didn't, give up and use pokemon exception like a jr!
The case for @nogc
is even simpler, my code is short lived enough that it simply doesn't need garbage collect. Instead I the almighty dev should be allowed to manually managed the memory thus ensuring I get the maximum amount of perforce.
I can't tell you how useful nogc
is in D.
!codecels embrace the D, it's the future
PS: rust and go are gay.
Jump in the discussion.
No email address required.
ALL RIGHTS RESERVED. DM for licensing info
Jump in the discussion.
No email address required.
I knew if I said python couldn't do something someone would do it for me!
!codecels the xkcd was right!
Jump in the discussion.
No email address required.
More options
Context
nothrow should do static analysis to ensure the annotated function cannot throw, i.e. adding a compile time errror condition. What you have here is more like the opposite of nothrow, ignoring even runtime errors
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Jump in the discussion.
No email address required.
More options
Context
Your code is perfect now and can never error. You're welcome.
Jump in the discussion.
No email address required.
More options
Context
Glad it works for you but the only D I'll be using is the one attached to me
Jump in the discussion.
No email address required.
If you program anything but Java and D ur a homo
Jump in the discussion.
No email address required.
Yeah I use Java(((script)))
Jump in the discussion.
No email address required.
You are a woman. Please join biofoids.
Jump in the discussion.
No email address required.
It's actually even worse than that, I use kotlin instead of Java
Jump in the discussion.
No email address required.
!cuteandvalid come get ur gurl
Jump in the discussion.
No email address required.
More options
Context
I have a friend who LOVES Kotlin. He even hangs out in a dev chat and helps professional programmers with their code- for free
Follower of Christ Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
never even heard of D. Is that a real language
Jump in the discussion.
No email address required.
https://dlang.org/
Jump in the discussion.
No email address required.
fake and straight
Jump in the discussion.
No email address required.
I will write metacode to write code to cut u
Jump in the discussion.
No email address required.
if it isn't in Assembly then I'm just gonna assume anything you write is just talking about how much you want to suck my peepee (because ur gay)
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
D is cool, Java is GenericTrashFactoryBuilderImpl
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
Instead of @nothrow maybe just write better code?
Jump in the discussion.
No email address required.
More options
Context
Skill issue. Simply don't write bad code and you won't run into errors.
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
i agree
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Just use except for your gay little block list script. Who fricking cares what exception it is? Is a team of devs going to have to maintain this? Do you have an ops team that has to understand it running it for you? No? Then shut the frick up about your autismo language and use what gets the job done (always Python, maybe java or C++ occasionally)
Jump in the discussion.
No email address required.
Using python is pretty gay either way but there are respectable enterprise languages out there that don't involve falling for a meme language
Jump in the discussion.
No email address required.
Python is gay but it's the clear choice for quick scripts or scientific/ml so I use it (with my butt plug in)
Jump in the discussion.
No email address required.
It just pains me to see large enterprise apps written in it
Jump in the discussion.
No email address required.
Several years ago my company paid an external team to write a business rules engine for us. They did it in Python. From the start it became the most resource-demanding deployment in our cluster - the infra team had to write special rules just for it, and it was refactored several times to split it into more containers to help it scale. We're finally now almost finished with a project to rewrite it entirely in golang.
All because some hotshot data analyst wanted to be able to update/add rules himself and was too smooth brained to learn any language but Python, and somehow strong-armed management into agreeing. Why none of our architects took him out behind the cafeteria to give him a man-to-man discussion with a baseball bat I'll never know.
!codecels it's 3:30am and I'm up questioning all my life choices I just need someone to read this to help me feel anything again ty
Jump in the discussion.
No email address required.
Sorry nibba, Python is the lingua franca of the AI future. Get on board the train or die in your Java shithole with the rest of the boomers.
Jump in the discussion.
No email address required.
Python is the lingua franca of the AI future
You're just saying this because you want to frick an AI
Jump in the discussion.
No email address required.
More options
Context
Yes just throw more cpu and ram at the problem and hope it'll work out in a few years, you suspendered mustachioed frappe sipping zoomers will never appreciate the art of hand-crafting an inner loop in assembly to eak out the last bit of performance from your Texas Instruments cpu. Take the L and suck on Deez nuts, no cap.
Jump in the discussion.
No email address required.
if err != nil
Golang is a garbage language Google invented to keep their rslur new grad devs from shooting themselves in the foot.Jump in the discussion.
No email address required.
I mean that's fair
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
They already rewrote it in rust
Furry rights are human rights
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Python is best understood as a "Jack of all trades, master of none" language. That said, written properly performance shouldn't be that bad. The problem is novice codecels getting away with writing shoddy code.
Jump in the discussion.
No email address required.
Yeah, and the other problem is management thinking that outsourcing a critical business app to people who don't understand our industry and who failed to get jobs anywhere productive will somehow result in better code.
Jump in the discussion.
No email address required.
Was this outsourced to by any chance?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Isn't that true for everything besides DSLs and maybe low level languages?
Jump in the discussion.
No email address required.
Not really, Python has a massive (and good) standard library for tackling most tasks. The third party libraries extend that further. You can comfortably make your full stack in Python, which can't be said for most languages. Problem is that while it can do it all, it doesn't do anything particularly well.
Jump in the discussion.
No email address required.
I see. I guess when you include an ecosystem in the definition of the language, this is true.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
I feel your struggle king
Jump in the discussion.
No email address required.
More options
Context
Python is the Excel of the CS world
Jump in the discussion.
No email address required.
More options
Context
What'd you rewrite it in?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Using a language without a solid type system on a codebase more than 3 people have to touch does sound awful, thankfully all the r-slurs at my company are in web front end so I never had to worry
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
It's been ten years since python was better than node for anything that doesn't use C bindings like tensorflow
Furry rights are human rights
Jump in the discussion.
No email address required.
I agree but dramatards aren't ready for that one yet
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
me
yes, me, myself and I
Future me
All very gay minus java.
Jump in the discussion.
No email address required.
I'm afraid the autism is terminal. A pair of programming socks and an IKEA shark have been shipped to your parents house
Jump in the discussion.
No email address required.
Me, the non IKEA shark, will also be at your parents house
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Transform your Marseys!
www.pastebin.com/Jj9URfVi
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
I didn't know people legitimately used D. I had only seen WalterBright shill it every HN comment he makes.
Follower of Christ Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.
Jump in the discussion.
No email address required.
More options
Context
This is how you work maxx. Run code wait for error and bug fix works extra well if ur code takes a while to run
Jump in the discussion.
No email address required.
More options
Context
Just use a bare except, r-slur. That will catch everything.
Jump in the discussion.
No email address required.
I AM NOT A JAP BOY, I DO NOT COLLECT POKEMON I DON'T WANT TO CATCH THEM ALL!
Jump in the discussion.
No email address required.
Then read the docs for whatever you're using and you'll know what to catch. This seems like a serious skill issue.
Jump in the discussion.
No email address required.
1x
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
I still wish there was syntax to have a "bare except" (that catches everything) but assign it to a variable so you can print/log it. Always struck me as odd that you couldn't do that.
Jump in the discussion.
No email address required.
But you can? Just catch BaseException or whatever?
Jump in the discussion.
No email address required.
Is it absolutely guaranteed that anything you can possibly throw derives from that?
Jump in the discussion.
No email address required.
I thought if you throw anything other than exception it becomes a type error.
Jump in the discussion.
No email address required.
huh TIL
I'm so used to C++ where they let you throw literally fucking anything.
Jump in the discussion.
No email address required.
It was different in python 2 where I think there's one oddity where you can throw an old style class without a type error. Python 3 it should catch everything, but be warned you should probably handle keyboard interrupts separately if you have the try in a long running loop.
Jump in the discussion.
No email address required.
tbh my "catch anything" blocks are typically reserved for the top level, where I simply want to log it before exiting rather than just vomiting some shit to the console. I think in the past I resorted to something like a bare except and then inspecting some special
exc_info
or other type that got you the "current" exception.Thankfully I've never had to seriously use python 2 and can freely tell any developers at my job who request python 2 support to get bent.
Jump in the discussion.
No email address required.
Bare except and using exec info to get the stack trace and exception would probably work too, just more effort.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
1. "My code doesn't throw exceptions" isn't the same as "my code is correct"
2. In a short running script, using a garbage collector will likely be faster than using a manual allocator. A good GC can use a bump allocator which won't actually trigger a full collection, but something like
malloc
will use a free list, which does have overhead and can fuck with your cache.Also: having a nogc annotation means you can't use a moving collector, which makes the parts of your code that do use the GC less efficient
Jump in the discussion.
No email address required.
9/10s the way there
Which is why you @nogc everything
Jump in the discussion.
No email address required.
Why would I want to slow down my own program for no reason?
Jump in the discussion.
No email address required.
to prove ur 10x
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
What's even the point? Python doesn't even have strict type checking (there's the type hints which are useful but are more for documentation and IDE auto completion than anything else). Why would you need strict throw specifiers?
imo if you're writing a complicated project in python you're doing it wrong, but I still think it's the best language for small to (some) mid-sized stuff, where performance doesn't really matter.
Jump in the discussion.
No email address required.
More options
Context
This is a lack of experience problem, AKA "skill issue".
Jump in the discussion.
No email address required.
More options
Context
Exceptions are normal control flow in python, it's how iterators signal that they're empty or that a key in a dict doesn't exist. This is especially funny since they refused to implement goto, but encourage gotos up the stack.
That said, while nothrow and nogc are useful in smaller to mid-size projects, they are severely limited in big codebases or when you have dependencies (exactly when they'd be the most useful). They especially start to be a major hassle once you want to introduce higher order functions or callbacks.
Jump in the discussion.
No email address required.
More options
Context
Even D doesn't have @nogc
Enjoy no standard library calls!
Jump in the discussion.
No email address required.
write your own stdlib
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Is there any point to D in any form? I only ever hear about it when someone wants to bring up something mway more obscure than even goddarn lisp.
Doesn't Go fill its niche nowadays anyway?
Jump in the discussion.
No email address required.
if you enjoy
if err != nil
Jump in the discussion.
No email address required.
More options
Context
More options
Context