Programming thread

  • 🔧 At about Midnight EST I am going to completely fuck up the site trying to fix something.
I name my master branch DD and all the feature branches are "lg"s.
bdsm_startup_dynamic.jpg


Polygamy will be the norm in PissEarth 2025. Chads will have harems of Stacies, and chubby dominatrices will have harems of incels whose autistic obsessions they exploit for great profit.
 
Man, the problem is SQL and trying to get consistency in a synchronous distributed system.
Tables are stupid, having more than one writer is stupid, putting the query engine in the server is stupid.
EAV GANG
I don't disagree with you. SQL is really showing it's age. Another think to consider is that SQL makes you use all raw datatype: foreign and public keys are the same thing as links or pointers.
 
  • Agree
Reactions: Shoggoth
I've heard that generally speaking a lot of the nastiness and pitfalls of old versions of PHP have been ironed out into a usable language, like for javascript. This gives me hope for the world that we can move towards languages being simply better (in a very broad and uncontroversial sense).
It's more like PHP has over the last decade embraced improvements from other ecosystems which have made it possible to write more modern code, but most of those things are still optional. For example, there's a form of strict typing, but it has to be intentionally enabled with the equivalent of a pragma directive at the top of each file with code for which you want it to be applicable. So while it's becoming increasingly possible to use PHP as a more modern OOP language and all the benefits that come along with that, it's still backwards-compatible enough for you to footgun yourself in exactly the same ways you can in PHP 4. Still, there's been some progress.

Have they deprecated their absurd choice for namespace separator (the backslash, as in "MyClass\MyThing") and used something sane instead yet?
Nope.

Context for those not familiar with PHP: Before OOP was embraced by the language, the period was selected as the concatenation operator, so "foo" . "bar" === "foobar". When OOP started getting added, they couldn't use the period for accessing object properties or methods, so they used -> instead; $foo->bar() in PHP is the equivalent of foo.bar() in Java, JS, and a million other languages. Similarly, they couldn't use dots to separate namespaces, so backslashes are used instead. Just gotta deal with it.

Which is best to code an online shop from scratch? I've heard asp.net is better than PHP.
Why would you code anything non-trivial like an online shop from scratch? Use an easily-modifiable pre-built system like WooCommerce, Magento, or Drupal Commerce and 90-95% of the work is done for you. Really security-critical stuff like payment processing is definitely not something that an amateur should attempt.
 
Similarly, they couldn't use dots to separate namespaces, so backslashes are used instead. Just gotta deal with it.
They could reuse -> (because why not?) or go with C++-ish ::, but noooooooooo, once again they had to do operators different that every other non-esoteric language. Like bunch of faggotretards they are.
 
They could reuse -> (because why not?) or go with C++-ish ::, but noooooooooo, once again they had to do operators different that every other non-esoteric language. Like bunch of faggotretards they are.
Good ol' Paamayim Nekudotayim was already in use to access static class constants and methods, such as ClassName::staticMethodName() and ClassName::CLASS_CONSTANT. And I don't think they could have reused either, because then it would get confusing: Namespace::ClassName::CONSTANT looks like you're trying to access a static constant on an instance of a class which is itself a static constant, and Namespace->ClassName->methodName() looks like you're trying to access a method on an object which is a property of another object. \Namespace\ClassName::CONSTANT isn't pretty but at least it's unambiguous.
 
Good ol' Paamayim Nekudotayim was already in use to access static class constants and methods, such as ClassName::staticMethodName() and ClassName::CLASS_CONSTANT. And I don't think they could have reused either, because then it would get confusing: Namespace::ClassName::CONSTANT looks like you're trying to access a static constant on an instance of a class which is itself a static constant, and Namespace->ClassName->methodName() looks like you're trying to access a method on an object which is a property of another object. \Namespace\ClassName::CONSTANT isn't pretty but at least it's unambiguous.
I'd like to point out to everyone that this (with no offense intended to @Least Concern) is exactly why PHP is such a shit language. Nothing was planned or designed ... it's a monstrosity of ideas bolted together by people who didn't know what they were doing when they started and they've been making "compromises" like these for two decades because their earlier dumb decisions screwed up any possibility of making and implementing better decisions later.
 
No fucking way that's even English. Many programming languages use the same syntax for getting a static member and namespace traversal. Java, Rust, Python, C++, and probably more all all do this.
It's Hebrew. Because that makes sense.
https://en.wiktionary.org/wiki/paamayim_nekudotayim said:
From Hebrew פעמיים נקודתיים‎ (“double colon”); introduced in the Israeli-developed Zend Engine 0.5 used in PHP 3. The correct word should be nekudatayim, but Israelis commonly say the word with this mistake.
 
I don't disagree with you. SQL is really showing it's age. Another think to consider is that SQL makes you use all raw datatype: foreign and public keys are the same thing as links or pointers.
The relational model is one thing. That's modelling and makes people literally square the circle. Most shit in life is not relations just like most shit in life is not objects. So the data model is a fuck and what we really need is graphs. BUT NEVERMIND THAT, which absolute monkey designed a language in plain text first and left specification down to the fucking implementer? There's even no execution model. The query engine and indices are opaque. Billions of dollars in damages because of that retarded decision.
SQL injection shouldn't have been an issue to begin with.
 
At the risk of offending any Common Lisp programmer about 2% as much as their scent is offensive, don't bother with CL. Clojure is actually good.
Hey before the rollback happened there was a site you linked (I think an emacs forum). Could you link it again?

I've been learning Clojure for the last couple weeks, a little bit obsessively. Honestly some of the most fun I've had programming in a while.

Is it worth investing time into learning emacs? I run VS Code with vim emulation and Calva (which has paredit), used to run vim. I messed around with Spacemacs for a week or so a little while ago but wished I had just gone with Doom Emacs after I had sunk time into a config. Spacemacs layers kind of suck and I'd rather just manage my own packages. I'm finding VS code to be working really well so far, and it's been great in the past for other things. I think the only noticeable difference that's making me lean towards trying out Emacs again is speed, VS Code can be a bit slow at times, at least compared to editing on Emacs.

I guess I'm already kind of convinced on switching for things like Org mode, magit, and clipboards, just need to find the time to dedicate myself to configuring it. Any other reasons that would push me to switch to Emacs?
 
  • Like
Reactions: Shoggoth
@Anstiv, not sure which website I linked to. Do you remember what it was about? Was it related to Emacs or Clojure?
I'm going slightly against the gain of "correct opinions" but Spacemacs has served me loyally and I'm glad I started off with it. Generally, Emacs has excellent Clojure tooling, but VS Code with Calva isn't bad, either. Pick whichever tool you like and work well with. I happened to fall into Spacemacs by way of necessity.
I'd also recommend not wasting time on configuring Emacs from scratch, from now. You want to work, not tune a machine. (maybe you do, then go ahead). Which is why I like the preconfigured distributions.
Org and magit are great. I'm not one of the people who manage their lives in org mode, but magit has been a godsend. It makes the hard things easy.
 
  • Informative
Reactions: Anstiv
Counterpoint - I gave up on emacs after years of using it. I never warmed up with elisp, all you're ever going to realistically do is use the modules of others and maybe slightly modify them. .org mode is basically just fancy formatting and tagging with way too many keybindings you can do yourself and the spreadsheet function feels awkwardly implemented and in practice, is IMO just not that useful.

After using for years pretty much every popular and unpopular text editor under the sun for *nixes and obsolete OSes I came to the conclusion a text editor has to be simple foremost and most importantly. If I can't grog the default keybindings in one sitting and/or it hasn't an inbuilt cheat table for the less common ones (it can't be 20 pages long though) it's not worth it to learn using it, as you'll never in a million years stick with it's more "advanced" features in reality. The only advanced functions you really need is macros, piping of text blocks externally (also the editor being usable inside a pipe without trickery is a plus) and the ability to define and redefine keybindings and attach them to macros and a regex search. With that you can pretty much write any extension you'll ever need in any language you'll ever want that isn't even attached to the editor. IMO, if you come to the point where you want to have scripts running inside the editor doing complex processing on the displayed text, you're probably approaching the problem from the wrong angle. I admit that it is a controversial standpoint not many will agree with but that's my personal experience and how I came to feel about all these often honestly really rather abstruse and crufty edtiors. It's pretty telling when a vast majority of users of a given text editor just use the same tiny subset of all features and the same unmodified scripts/plugins/whatever-you-call-it and configuring it by yourself is downright discouraged.

***

Lately I've been writing some device drivers in forth for some very low powered 8 bit and 16 bit systems. I really like forth and that's the only reason I'm using it but the old forth implementations are actually rather slow on some processors/use too many instructions for some very simple words, or lets say words that should be simple. I've been trying to implment something for a '79 AMD AM9511 which is basically a FPU but latencies caused by the rather slow forth are killing me and I'll probably end up writing the critical parts in assembler which is a pity, in a way, although it's cool how you can just redefine arithmetic symbols inside of forth that the FPU (or any other external hardware) is used seamlessly. In the same vein, It might make me look old but the performance from cheap as shit 2-bucks-a-piece microcontrollers still blows my mind every time. Some of them easily surpass some of the higher end systems of the 80s and early 90s, although a straightforward comparison is honestly not entirely fair in many cases. (btw. modern gforth is really fucking fast)
 
@Anstiv, not sure which website I linked to. Do you remember what it was about? Was it related to Emacs or Clojure?
I'm going slightly against the gain of "correct opinions" but Spacemacs has served me loyally and I'm glad I started off with it. Generally, Emacs has excellent Clojure tooling, but VS Code with Calva isn't bad, either. Pick whichever tool you like and work well with. I happened to fall into Spacemacs by way of necessity.
I'd also recommend not wasting time on configuring Emacs from scratch, from now. You want to work, not tune a machine. (maybe you do, then go ahead). Which is why I like the preconfigured distributions.
Org and magit are great. I'm not one of the people who manage their lives in org mode, but magit has been a godsend. It makes the hard things easy.
Maybe I'll try Spacemacs again. I found the layer for python to be very lacking, and I have to use Python for work (machine/deep-learning stuff), though theoretically I could do some of that work in Clojure (I'm considering it for an upcoming project).

I liked Spacemacs bindings+whichkey quite a lot though. I guess I'm inbetween because there are tradeoffs whichever I pick. VS Code's preconfigured extensions are really nice. Every once in a while I'll get fixated on the idea of customizing an editor a lot and then get burnt out. Most of my Vim config was written over like 5 days or so. So it's fun for that time, but then once I get bored of it, and then still have a bunch of things I need to adjust, it can be a little tiring.

The site you linked had emacs in the name of the site iirc.

I'll probably stick to VS Code. I found the setting in an extension I had that was slowing down my editor, so that's solved. Also, I need to use Windows for work, which is terrible, and Emacs through WSL2 is okay, but WSL2 can be slow/have problems sometimes that I definitely do not want to spend work time on fixing.

I'm finishing up reading Brave and True today, and been doing Clojure Koans and 4clojure exercises (there's an archive). Any recommendations for what else to read to write real-world Clojure code, or learn common Clojure anti-patterns? I've been listening to a lot of the Rich Hickey / Clojure Conj talks which are really interesting.
 
Back