Please dont take this seriously guys its just a dumb meme I haven’t written a single line of code in half of these languages
Every programming language has it’s place.
JavaScript’s place is in hell.
I used to think Javascript was hell when I barely used it. Now I have to build with it regularly and… once in a while I’m just right about things.
Ever wanted to be somewhere inbetween java and JavaScript?
Yeah, that’s Groovy. Only it’s the wrong groove
What makes JavaScript so widely disliked? I know very little of it, and in skimming different stuff I think I’ve seen like a million different frameworks for it, so is that a part of it?
It was mostly made for simple scripts to embed on a website for animations and handling updates without refreshing whole page. Not to make a full portable client (browser) side app.
Hating JavaScript is mostly a meme, it’s just a programming language. But its very loose syntax, fact it’s often someone’s first programming language to learn and how most programs written in it nowadays are a hack build on top of a hack on top a hack makes this language easy to laugh at.
Latex: Problem -->
\def\please@#1#2#3#4{\e@kill#2#3{\me#1}#4@now}
-->Accurate. LaTeX is great, it makes you feel like you have superpowers compared to “office suite”-style software. But every once in a while you just run into some bullshit that feels like it’s stuck in 1985 and it completely breaks your flow. I remember wanting to make a
longtable
where text in the “date” column would be rotated by 90 degrees to leave more horizontal room for the other columns. It took me tworotatebox
es, aphantom
, avspace
, ahspace
and 40 minutes of my life to get the alignment right. Would probably have taken a duckduckgo search and three clicks in Libreoffice.btw what do you think about typst?
i only used it for simple stuff so far but it seems pretty fun and easy to useNever heard of it before, but might give it a try at some point. From the website, it seems like something halfway in between LaTeX and Markdown? Sounds exactly like what I need at times, tbh.
yeah it’s perfect for taking notes and stuff
My two cents, after years of Markdown (and md to PDF solutions) and LaTeX and a full two years of trying to commit to bashing my head against Word for work purposes, I’m really enjoying Typst. It didn’t take long to convert my themes, having docs I can import which are basically just variables to share across documents in a folder has been really helpful. Haven’t gone too deep into it but I’m excited to give it a deeper test run over the next little bit.
it makes you feel like you have superpowers compared to “office suite”-style software
Especially the installation process
I still have no idea how to exit the build process. It tells I need to type
H
or\end
but it also just lies. I find the easiest way is to invokeCtrl-Z
and then kill the background process, and theyounglingschildrenYeah, what the hell is up with that? I always just
echo | pdflatex
to make it shut up and exit on error. Maybe one day I’ll learn how to actually use that interactive compilation thing, but not today lol.wait how does your hack work?
So there are many different commands that compile LaTeX, right?
pdflatex
,pdftex
,latexmk
, etc. But they all do that thing where they ask for your input as soon as they encounter an error, right? Well, if you just pipe an emptyecho
command to them, it notices thatstdin
has reached end-of-file, and gives up trying to ask the user for input, and just exits on first error. So instead ofpdflatex mydocument.tex
, you can doecho | pdflatex mydocument.tex
and it won’t ask you for input if it sees an error, it’ll just exit. There’s probably a “proper” way to achieve the same behaviour, but I can’t be arsed to read the docs.Speaking of stupid TeX hacks, at one point I had a script called
latex_compile_and_install_packages_until_it_works.sh
. It’s essentially a loop that repeatedly tries to compile a document, searches the output of the compiler for anything that looks like a missing package error, and pipes it tosudo tlmgr install
. The “fuck it” of package management, arbitrary code execution exploit included!(Sorry for the screenshot, I lost the original script in text form, probably for the better)
Haha that’s brilliant! I have a similar script for Conda, where it tries to install R packages by first looking in bioconductor and then trying the rejects through conda-forge, and then the rejects from that are compiled from source or just outright rejected.
I would have thought you would have needed a
(while :; do echo; done) | pdflatex
or ayes "\end" | pdflatex
, i.e. something that repeatedly generates output. It’s actually quite elegant that pdflatex checks if stdin is already EOFtries to install R packages by first looking in bioconductor and then trying the rejects through conda-forge, and then the rejects from that are compiled from source
Just do all of these in parallel to maximise the change of installing the correct version
Funnily enough I had a similar problem but I wanted text instead of a date. In the end I used a solution similar to yours and adjusted each cell entry manually for hours. Feels like there should be a lot simpler solution for this problem in LaTeX. Glad I don’t need to use it anymore…
u/[email protected] suggested Typst as an alternative to TeX. I gave it a try, and I’m loving it so far. It even has built-in support for the rotated text thing https://typst.app/docs/reference/model/table . I’ve only used it for notes/homework so far, but I’m looking forward to seeing how it fares for more serious typesetting tasks.
That looks interesting, thanks for the ping. I will give it a try.
I got way too excited Lemmy parsed LaTeX for a second
Testing 123
$$ \sigma $$
aww…
You also need that usepackage just like python.
PHP: Problem ->
real_solution_for_real_this_time()
(real_solution_i_swear()
is unsafe and deprecated)Eh, your statement is accurate for PHP4 and still relevant up to PHP5.2… We’re on PHP8.3 now and PHP8.0 is now out of security updates. I know it’s trend to hate on PHP but you’ve got to at least update your materials to var-vars… it’s like knocking node for having
substr()
andsubstring()
.trend to hate on PHP
2 years ago I tried to give a drupal project the ci/cd makeover (i.e. containers, test-deployments, reproducable builds, etc)… that’s when my hate was freshly renewed.
At this point I think it’s ok to let a dead language die and move on to something else (anything else, really)
PHP: Problem -> Laravel -> Solution
Ahem: Problem -> Laminas -> Solution
mysql_real_escape_string
missing the stage of C where it’s all incomprehensible bitfucking with comments like “this works, i do not know why it works, do not touch this”
Real fast inverse square root algorithm hours
That one is not that complicated if you don’t think about the math. It’s basically just if we interpret the float as int and add a magic number we have a good estimation.
From what I remember at least, it’s been a little while since I implemented it.
I was more thinking of the comments which are pretty much exactly what you said (“incomprehensible bit hacks” followed by “what the FUCK?”)
I had this in CSS.
CSS isn’t as bad these days if you use Flexbox. Debugging floats and absolute/relative positioning was a nightmare in comparison.
On the other hand, it made webpages way less flexible.
Like yesterday (i have the browser not in fullscreen, for reasons) on my 16" fullhd notebook, webdev couldn’t imagine that someone would use his site in a ~1000px browser window, sidebars left and right, the main content about 20 characters wide squeezed inbetween. So i pressed f12 and deleted the sidebars. But the content was still 20em wide, because of flexbox.
C should show some overflow corruption of the problem graphic.
Perl:
Problem -> $ @ % <=> <> =()= => ; qw() ])} select(undef, undef, undef, 0.25) =~ tr/.?\w\sREg3xfr0mhe|l/foo/g; $|++ &homebrewedFunction(%$ref, $_ , @_ ) -> solution
Source: I mainly code in perl. I like it, but I’ll be the first to admit that it’s not a beautiful language.
I was about to make an entry for lisp here, but I don’t have enough parentheses to draw the path to the solution.
https://www.foo.be/docs/tpj/issues/vol4_4/tpj0404-0015.html
The Perl Poetry Contest - The Perl Journal, Winter 1999
#!/usr/bin/perl
#
# asylum.pl
# by Harlclose (youreyes);
bind (yourself, fast);while ($narcosis) {
exists $to($calm);
not calm;
}accept the, anesthesia;
seek the, $granted, $asylum’
and wait;stat ically;
unlink and listen (in, $complicity);
for (a, little) {
system (“sync hronicity”);
}Over the top tone: “Pretty sure that won’t compile.
modulo what you get from the filehandle called
=
isn’t an lvalue that can be put through the Goatse operator that I’m aware of.”But seriously(?), I’m almost certain that’s not how that would be parsed.
=
isn’t a valid bareword, so Perl would choke on the spaceship operator not being a term… I think.After testing… It’s worse. I think it’s parsing
<>
as theglob
operator and=
as a filespec.For those who don’t know Perl:
Because of its appearance,
<=>
really is called the spaceship operator (at least, when it can be parsed as an operator and not whatever happened above).=()=
by comparison has unofficially been called Goatse. If you don’t know what Goatse is, find out at your own risk. If you do know, you can see why this particular pseudo-operator was given that name.And if you’re still reading,
=()=
is a pseudo-operator because it’s not actually parsed as part of the syntax. It’s literally an assignment operator=
followed by an empty list()
followed by another assignment operator=
, providing list context to the outside of the equals signs that wouldn’t otherwise be there.[Why are you still still reading?] Context is important in Perl. If a function returns a list of values (which is something Perl functions can do) and you try to store the result in a scalar variable, replacing the usual
=
with=()=
will store the number of elements returned rather than the last element of the list.It’s not supposed to be compilable. It’s more intended as a list of weird looking (but valid and useful) perl stuff.
As for the goatse operator, I’ve mostly used it for counting amount of regex matches.
Oh, and I forgot the diamond operator. Added.
I was hired twice to write Perl, both times switched my department to something else after a few years.
Perl is good for command line processing, and absolutely god awful read-only magic hacks. Nothing else.
Perl is fine, provided that you never have to touch someone elses code.
Or yours
No. My code is perfect. It’s all of the others who write bullshit.
- Every perl dev ever
Be honest: you just mashed your fist on the keyboard, didn’t you?
I personally never understood how anyone could find Perl appealing or even “good” to program in, probably because I could never understand wtf the code was meant to do
C: “Segmentation fault.”
Where?
C: 🤷🏻
C: gestures vaguely everywhere
C++: “You just pointed to all of me.”
Then you open the core file with GDB and hope the stack is not smashed.
I don’t know why, but I still can’t open a core file without going I’m in. I don’t do QA, though, and so tinkering with final breath of my program frozen in time maintains some novelty.
gdb ->
where
python is like that. someone waay smarter than you have already done this 10 years ago.
Idk I still like writing my own stuff purely pythonic when I can. Pythons syntax is the most “fun” and “natural” for me so I find it fun. Like doin a sudoku puzzle
That’s true of basically all problems you deal with in programming. Unless you’re truly bleeding edge you’re working on a solved problem. It’ll be novel enough that you can’t out-of-the-box it but you can definitely use the tools and paths everyone else has put together.
Part of why I like kotlin as a language. It has so many tools built right in.
C# Solution -> .sln
(brought to you by .net gang)
OK rust made me laugh
Yeah that one got me too. Rust has tons of c libs wrapped in safe rust.
I was mainly thinking about how so many Rust projects advertise very loudly that they’re written in Rust. Like, they would have
-rs
in the name, or “in Rust” as part of their one-line description. You rarely see this kind of enthusiasms for the the language in other languages. Not a bad thing by the way! And also there’s the “rewrite it in rust” meme, where people seem to take perfectly functional projects and port them to Rust (again, not a bad thing! Strength in diversity!)Yeah, no python package has “py”, JavaScript “.js” or java “java”. None at all.
For Python I think there’s an actual point though: A lot of Python projects are user friendly wrappers for pre-compiled high-performance code. It makes sense to call something “py<SomeKnownLibrary>” to signal what the library is.
Well, it’s the same in rust, that’s why I agree more with the first interpretation.
There is an existing solution in C/C++, just make some binding and call it *.rs
Both python and rust use py and rs in the same way, to signal that it’s the python/rust version of that library.
Of course, there are exceptions, but that’s what usually happens.
Check Julia then, .jl everywhere
I’d even say Rust is python but gone through
format!("{}-rs", problem)
C --> segfault --> new problem
Sry, the best I can do on mobile
🙉 it’s perfect!
It’s good
The line between problem and solution for C should be 30 miles long.
…with 19 bugs 9 of which are exploitable.
And one bug that one person found once but is not reproducible
So the developers claim, but the users still encounter it, and the bug report stays open for 22 years … possibly more.
It lacks a lot of malloc() 🤣
and not enough frees
i feel like javascript could also be
Problem -> solution -> 3 days pass -> all dependencies had breaking changes made -> problem
Python one is accurate. Most of our problems are solved by importing a library and writing the line, librarySolver.importedFunction.SolveMyProblem()
def main(): Print(‘thanks librarySolver’)
Advent of code 2023 day 24 part 2. Z3 solver saved the day on that one.
Now I have PTSD every time I see an hailstorm.
So many solver solutions that day, either Z3 or Gauss-Jordan lol. I got a little obsessed about doing it without solvers or (god forbid) manually solving the system and eventually found a relatively simple way to find the intersection with just lines and planes:
- Translate all hailstones and their velocities to a reference frame in which one stone is stationary at 0,0,0 (origin).
- Take another arbitrary hailstone (A) and cross its (rereferenced) velocity and position vectors. This gives the normal vector of a plane containing the origin and the trajectory of A, both of which the thrown stone must intersect. So, the trajectory of the thrown stone lies in that plane somewhere.
- Take two more arbitrary hailstones B and C and find the points and times that they intersect the plane. The thrown stone must strike B and C at those points, so those points are coordinates on the line representing the thrown stone. The velocity of the thrown stone is calculated by dividing the displacement between the two points by the difference of the time points of the intersections.
- Use the velocity of the thrown stone and the time and position info the intersection of B or C to determine the position of the thrown stone at t = 0
- Translate that position and velocity back to the original reference frame.
It’s a suboptimal solution in that it uses 4 hailstones instead of the theoretical minimum of 3, but was a lot easier to wrap my head around. Incidentally, it is not too hard to adapt the above algorithm to not need C (i.e., to use only 3 hailstones) by using line intersections. Such a solution is not much more complicated than what I gave and still has a simple geometric interpretation, but I’ll leave that as an exercise for the reader :)
That is a great explanation of how you solved it, thanks! I should go back to it and conquer that puzzle properly without a solver. Or at least try.
deleted by creator
for the ones missing the marvelous HTML, I gotchu bro:
<problem />
Add css, and the problem looks really pretty now
Problem
Obligatory “Hyper Text Markup Language is a markup language, not a programming language”
HTML+CSS Has been turing complete for some time now.
See, you added the CSS part, that was not part of the original comment.
that’s fair but, they are quite intertwined
Which is why it was just an obligatory comment from pedantic me. Just a light correction.