fair. there’s a lot of only kinda gun fun stuff after that side from the good stuff. i gave up at math.
- 0 Posts
- 131 Comments
but where is the couple kissing?
Yes, ish. There are aspects of it that are really valuable, and fit some use cases extremely well. But, in some senses, yes. Like any DBMS, you’ve got to know it’s strengths and weaknesses. And if you do, there are definitely circumstances where you’d choose it over others. But not always.
This is kinda absolute BS at this point, though.
Mongo has acid transactions, and has for years now. Although this is only within the same database, there are plenty of dbms (including rdbms) that don’t support cross-database transactions.
Mongo also, since time immemorial, has had “write concern” to ensure that it’s written to disk (to the journal) before the transaction is completed.
points at blurry image of vehicle in background
enhance!
fair enough. My personal opinion might be that it’s evil, but perhaps that’s because I expected some kind of order.
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
1·5 months agoYes, because
In the first kind of language, the thought process is basically: I have the flow of execution, starting at the top of the file. If I want to make a library, I should build the things I want to build, then get out of the way.
Note the “I have the flow of execution”, and the “if I want to build a library”.
If you just want to build an executable, do as you wish, you already have the flow of execution.
If you want to build a library, make the relevant classes and functions and get out of the way (i.e., no IO, no long-running tasks).
If you want to combine them, use the main name check - or, make a package and do entry points that way. Either way works, because both can fulfill the goal of staying out of the way of those importing this as a library.
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
1·5 months agoindeed.
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
5·5 months agoIt simply swaps some things around to make things more confusing, then goes into an infinite loop (whether or not you import or execute it standalone). it’s no different than just including in the global scope:
while True: passI was kinda lazy with the fuckery, tbh. I could have gotten much more confusing, but don’t have too much time today. :-)
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
7·5 months agoI always use
if "__main__" == main: __main__()…and earlier in the code:
def __main__(): while True: pass main = "__main__"This helps to prevent people from arbitrarily running my code as a library or executable when I don’t went them to.
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
5·5 months agoAll code needs to have an entry point.
For Python and some other languages, this is the start of the file.
For other languages, this is a special function name reserved for this purpose - generally, “main”.
In the first kind of language, the thought process is basically: I have the flow of execution, starting at the top of the file. If I want to make a library, I should build the things I want to build, then get out of the way.
In the other kind of language, the thought process is basically: I am building a library. If I want to make an executable, I should create an entry point they the execution starts at.
The debate is honestly pretty dumb.
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
1·5 months agoDue to the oneness of all things, I refuse to distinguish between library code and executable code. One and Zero are arbitrary limitations.
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
111·5 months agoYeah, this is it.
What’s hacky about an introspective language providing environment to all of the executing code, so that the coder can make the decision about what to do?
It would by hacky if Python decided “We’ll arbitrarily take functions named “main” and execute them for you, even though we already started execution at the top of the file.”
For C, this is less so. The body of the file isn’t being executed, it’s being read and compiled. Without a function to act as a starting point, it doesn’t get executed.
bastion@feddit.nlto
Programmer Humor@programming.dev•Python needs an actual default function
13·5 months agoisn’t that just normal usage? …or, did I just whoosh and you were sarcastically saying that?
bastion@feddit.nlto
Programmer Humor@programming.dev•Which of these javascript expressions is false?
9·6 months agonah, it’s more fun this way.
The alignment of the language and the alignment of the coder must be similar on at least one metric, or the coder suffers a penalty to develop for each degree of difference from the language’s alignment. This is penalty stacks for each phase of the project.
So, let’s say that the developer is a lawful good Rust
zealotPaladin, but she’s developing in Python, a language she’s moderately familiar with. Since Python is neutral/good, she suffers a -1 penalty for the first phase, -2 for the second, -3 for the third, etc. This is because Rust (the Paladin’s native language) is lawful, and Python is neutral (one degree of difference from lawful), so she operates at a slight disadvantage. However, they are both “good”, so there’s no further penalty.The same penalty would occur if using C, which is lawful neutral - but the axis of order and chaos matches, and there is one degree of difference on the axis of good and evil.
However, if that same developer were to code in Javascript (chaotic neutral), it would be at a -3 (-6, -9…) disadvantage, due to 2 and 1 degree of difference in alignment, respectively.
Malbolge (chaotic evil), however, would be a -4 (-8, -12) plus an inherent -2 for poor toolchain availability.
…hope this helps. have fun out there!
bastion@feddit.nlto
Programmer Humor@programming.dev•Which of these javascript expressions is false?
161·6 months agoI love the two lonely downvotes on this.
Automatically
increasesdecreases/escalates defcon once every 24h in which no texts are exchanged, unless you hit “snooze”.
I was just about to say that I’d be raising an error, not returning a string.
I see you understand the code well.