Programming thread

  • 🔧 At about Midnight EST I am going to completely fuck up the site trying to fix something.
Unless neovim changed something, cwlol works all the same.
Slightly different semantics, if your cursor is not on the first character of the word:
  • ciwlol changes the whole word surrounding the cursor.
  • cwlol changes from the cursor to the end of the word.
For example, ^ marks the starting cursor position:
Code:
cwlol  : kiwi farms
         ^
cwlol  : lol farms

ciwlol : kiwi farms
         ^
ciwlol : lol farms

cwlol  : kiwi farms
           ^
cwlol  : kilol farms

ciwlol : kiwi farms
           ^
ciwlol : lol farms

cawlol : kiwi farms
         ^
cawlol : lolfarms

The help describes iw as "inner word", and aw as "a word" (though sometimes I think of it wrongly as "around word" and then wonder why it doesn't include leading whitespace).
 
Last edited:
Slightly different semantics, if your cursor is not on the first character of the word:
  • ciwlol changes the whole word surrounding the cursor.
  • cwlol changes from the cursor to the end of the word.
For example, ^ marks the starting cursor position:
Code:
cwlol  : kiwi farms
         ^
cwlol  : lol farms

ciwlol : kiwi farms
         ^
ciwlol : lol world

cwlol  : kiwi farms
           ^
cwlol  : kilol farms

ciwlol : kiwi farms
           ^
ciwlol : lol farms

cawlol : kiwi farms
         ^
cawlol : lolfarms

The help describes iw as "inner word", and aw as "a word" (though sometimes I think of it wrongly as "around word" and then wonder why it doesn't include leading whitespace).
This is one of the things I love most about vim. I'm always learning something cool.

Man this sounds cool but arrow keys and non-modal editing are permanently burned into my mind (:_(
You would get the hang of the new workflow quickly. Now I find myself hitting caps lock (bound to ESC) and i if I'm editing a README online or something without a vim mode.

And vim emulation in bash and zsh is god-tier. Editing parts of a long-ass command takes minimal effort.
 
Last edited:
You would get the hang of the new workflow quickly. Now I find myself hitting caps lock (bound to ESC) and i if I'm editing a README online or something without a vim mode.
Yeah, if you just force yourself to use vim for a while it will get into your muscle memory.

Now you, too, will accidentally type "+yy into visual studio code all the time
 
HTML:
<!DOCTYPE html>
<html lang="en>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width initial-scale=1.0>
<link rel="stylesheet" href="./styles.css>
<title>The Nigger Zone</title>
</head>
<body>
<div id="nigger">
<h1>You are now in the nigger zone.</h1>
</div>
</body>
</html>

CSS:
body{
background-color: black;
width:100%;
height: 100%
margin: auto;
}

#nigger{
display: block;
width: 600px;
height: 300px
background: radial-gradient(black, red);
box-shadow: 0 0 20px red;
margin: auto;
}
h1{
font-family: Tahoma;
color: white;
text-align: center;
margin: auto;
}

Im learning web development. Can you guys rate my code?
 
Im learning web development. Can you guys rate my code?
  1. Your <html> tag is missing a closing quote, and "en" isn't a full language code.
  2. You forgot a closing quote in one of the attributes in your <meta> tag.
  3. You put "UTF-8" instead of "utf-8" in your charset meta tag. While the standard does accept the former, the lowercase form is more canonical.
  4. Add indentation.
  5. You forgot 2 semicolons in your CSS stylesheet.
Otherwise, it's pretty okay. I don't know that much about Web pages, so maybe there's some stuff I didn't see.
 
  1. Your <html> tag is missing a closing quote, and "en" isn't a full language code.
  2. You forgot a closing quote in one of the attributes in your <meta> tag.
  3. You put "UTF-8" instead of "utf-8" in your charset meta tag. While the standard does accept the former, the lowercase form is more canonical.
  4. Add indentation.
  5. You forgot 2 semicolons in your CSS stylesheet.
Otherwise, it's pretty okay. I don't know that much about Web pages, so maybe there's some stuff I didn't see.
I did type this out on my phone as a joke so that is why I probably missed some things but thank you for pointing out my mistakes.
 
I did type this out on my phone as a joke so that is why I probably missed some things but thank you for pointing out my mistakes.
You're welcome. I forgot something, however: Your font-family specification only specifies Tahoma and doesn't specify any fallback fonts. This could lead to unpredictable font choices on devices without that font.
 
I did type this out on my phone as a joke

Well, for others reading:
CSS:
body {
	background-color: black;
	width: 100%;
	height: 100%;
	margin: auto;
}
There's no need to set width & height to 100% as it's the default. Setting width & height on the body isn't advisable, as it's the root element of your actual content, which is why you often see <div id="wrapper">…</div>, so you can set styles on the body to be inherited, but then eg centre the content.

Speaking of which, margin: auto; is a way of centring an element, but of course there's nothing to centre if the element fills the container (100% width/height).

Your font-family specification only specifies Tahoma and doesn't specify any fallback fonts. This could lead to unpredictable font choices on devices without that font.
Yeah. Look up "font stacks" online and you'll find declarations that include fairly similar things on all platforms.

Otherwise seems fine.
 
These motions and operators are what make vi and its successors so great (especially the ] and } motions and their reverse counterparts}. You never have to move your fingers away from the main typing keys. Whenever I hear someone say he uses nano, I always think to myself "Man, this guy must love arrow keys." I would sooner shit in my own hand and clap than edit a big .conf file with it lol.

The only time I ever see nano is on a server where it rarely comes in to use when I amend a Git commit. If it happened any more often I would immediately configure Git to use Vim.

Then there is the sheer number of features and extensions Vim has over nano. With both you have the advantage of being able to edit files on almost any Linux installation without any additional packages (if you count the "minimal" Vim I often see), headless or not, but Vim is light-years ahead and if I weren't using Vim I'd be using Emacs for similar reasons.
 
The only time I ever see nano is on a server where it rarely comes in to use when I amend a Git commit. If it happened any more often I would immediately configure Git to use Vim.
Set your EDITOR environment variable to set the default editor across many programs including Git.

Fun fact: you can use vimdiff as your EDITOR with sudo -e to diff stuff like config files in /etc. This is handy with pacman's pacnew files.

With both you have the advantage of being able to edit files on almost any Linux installation without any additional packages (if you count the "minimal" Vim I often see), headless or not, but Vim is light-years ahead and if I weren't using Vim I'd be using Emacs for similar reasons.
It's crazy how even the original vi was lightyears ahead of every other editor way back then, and still sort of is with its derivatives.
 
Set your EDITOR environment variable to set the default editor across many programs including Git.

Thanks, I had forgotten about that

It's crazy how even the original vi was lightyears ahead of every other editor way back then, and still sort of is with its derivatives.

There were a few other visual editors before then but in any case it must have been a huge relief given what typically came before
 
I started programming in HTML, Java script, & CSS. Then transitioned into C & Python etc etc. Everyone has their own first language, to learn basics, then they go on. While programming languages differ, I’ve always kept a special place in my heart for HTML, as that’s what I used to learn the rules of computer language(s.)

What do you think about HTMX? The X/ Twitter account is kind of funny & kind of obnoxious. I loathe most of “tech twitter” because of the hypocrisy of many techies who all virtue signal certain politics, rail against “wrong think,” & generally act like a bunch of followers. When looking at it as a majority group, it makes me want to vomit in my mouth how stupid it all seems. When I followed more accounts in tech circles on twitter, I noticed some things that are not easy to go along with.

What really got me ignoring most of them was when the Drop Kiwi Farms people (iirc) were trying to hack the site, & a breech occurred that Null was able to prevent new data loss from, all these “big” security “researchers” & shit like that, were gloating. I unfollowed all of them, but remembered their words, archived some gross breaches of consciousness, for a possible future thing I’m thinking of writing. If I have the time & inclination. The ones who put on some “rebel” hacker-y2k persona, while going along to get along, drinking that Kool-Aid, especially make me laugh. Point is, I found it super gross that alleged security experts were getting off on a suspected breach of Kiwi Farms, all because they don’t like the site. (Most don’t even have a clue about what KF is like, anyway.) To be in a field, then cheering at a peers misfortune, is career suicide, whether ramifications for those actions happen immediately or down the line. I took notice, & am surely not alone.

I don’t think the HTMX people I asked opinions about (the programming, not the people,) are part of the niggercattle who cheered about any KF breaches, to clarify. Interested in others thoughts on any of these things.
 
While programming languages differ, I’ve always kept a special place in my heart for HTML, as that’s what I used to learn the rules of computer language(s.)
Certain "people" (read: Redditors) will say, "Um, ackshually, HTML is a markup language and not a programming language!" While they are technically correct, I think HTML can be a very good stepping stone on the way to learning programming proper because it helps the programmer-to-be get acquainted with the rigid and formal languages that are used to instruct the computer, because it doesn't have that many moving parts. And the best thing about HTML specifically is that HTML learners can just put a <script> tag somewhere in their document and start learning JS when they're comfortable with HTML.
 
What do you think about HTMX? The X/ Twitter account is kind of funny & kind of obnoxious. I loathe most of “tech twitter” because of the hypocrisy of many techies who all virtue signal certain politics, rail against “wrong think,” & generally act like a bunch of followers. When looking at it as a majority group, it makes me want to vomit in my mouth how stupid it all seems. When I followed more accounts in tech circles on twitter, I noticed some things that are not easy to go along with.
I fucking hate additional programming aspects on the frontend. JavaScript devs need to learn their fucking place as people who make animations and bitch about incorrectly filled out forms. The fact that backend devs gave up data display page generation on the backend when rest APIs came out is fucking astounding. Angular and React shouldn't be a thing. Fuck using Ajax for anything other than form submissions that trigger html page reloads/redirects.

The brain trust that decided to allow people running a weakly typed language to track state should be fucking shot. Because js is truly honestly bad for it. You guys had to invent Typescript with classes and a precompiler to make sure your data structures passed between the backend and front barely worked. Oh yeah, and guess what? The backend still makes those classes which you have to keep in sync which nobody does whenever a new version of an API comes out.
 
Certain "people" (read: Redditors) will say, "Um, ackshually, HTML is a markup language and not a programming language!"
I don’t even consider that technically correct so much as it’s in the damn acronym, ie, hyper text (mother fucking) markup language. Anyone who acktuaaaally’s that is a try hard salad tosser.
And the best thing about HTML specifically is that HTML learners can just put a <script> tag somewhere in their document and start learning JS when they're comfortable with HTML.
This is exactly why I recommend HTML to n00bs & experienced programmers too. It mixes well with others. It’s simple to add JS & CSS to it for starters, & it’s a great way to familiarize yourself with syntax.
The fact that backend devs gave up data display page generation on the backend when rest APIs came out is fucking astounding.
Absofuckinglutely. Staying balanced, or at least well informed of all moving parts, so code works as a cohesive whole, not delineated between front & back exclusively, as if it’s completely separate. It’s good to have working knowledge of both, though most everyone ends up specializing.

Very curious about what people are thinking of HTMX, it alleges to have that ease when combining front end & backend development stuff.
 
What are everyones thoughts on lua?
I don't have too much of a problem with it. It's designed to be tiny and extend already developed solutions, solutions designed with safer languages which are easier to maintain. Lua is comfy if you want a popup in gmod or a mod in Palworld. If you are using it to develop a software solution from the ground up, you should consider something else.
 
Absofuckinglutely. Staying balanced, or at least well informed of all moving parts, so code works as a cohesive whole, not delineated between front & back exclusively, as if it’s completely separate. It’s good to have working knowledge of both, though most everyone ends up specializing.
Wrong. Front end devs(How the fuck these people ditched "web designers" is beyond me) design pages with .css and html. Using js to send forms back and animate the page. The backend developers take those pages and render them with data. Puzzling their way through how I do my job wastes everyone's time and money.

Frankly I'm amazed these people have a separate discipline for UI/UX considering that's the one thing they should be doing. They should be exceptionally skilled in marketing and creative design. You know. Things that actually add value, and that programmers are usually exceptionally bad at.

We both have jobs. It's shitty we are expected to do each other's jobs. So much so that not having 3 YOE in the latest frontend/backend framework disqualifies 5+ YOE backend/frontend engineers from most job postings.
 
Last edited:
Back