Programming thread -

Kiwi Lime Pie

Thankful to be tasteful. 🥝🥧🐈
kiwifarms.net
How much math do you have to know to be a programmer? I've heard you've gotta know shit like trig to work in C.

If you're actually designing or analyzing algorithms, the branch of mathematics called discrete mathematics will be essential.
This book has a good selection of relevant topics: https://www.amazon.com/dp/1337694193
There's also one by the same name "Discrete Mathematics and it's Applications" but the author is K. Rosen.
A version of that text was used in the Discrete Structures class I took.

Anyways, to piggyback on @Kosher Dill 's reply, one area of (discrete) math that might be most useful or practical is boolean algebra and how true/false works with various combinations of AND, OR, and NOT operators. That's useful for evaluating or simplifying complex expressions that have a True/False result.

The only other time math ever seemed necessary for CS/programming was for the computer graphics course I took. Because some of the transformation operations were expressed as matrices, the college's introductory course for matrix/linear algebra was a perquisite. Logical organization/thought is probably more important than the mathematical aspects most of the time.
 

wokelizard

kiwifarms.net
So the general consensus I'm getting is that math isn't a prerequisite to programming, but it does make shit generally easier to know it and you'll never get passed a certain point of quality without it, so hypothetically knowing as much as possible makes it as easy as possible.

A thing I've always had a problem with in math is that there's no linear path of mathematics grouped from necessity or difficulty, & there doesn't seem to be a encyclopedic compendium of it either, only a specific field or subject matter thereof. Does anyone have a source one could use to get, say, the "complete" material for mathematics?
Try this!
For programming stuff you might want to start off with linear algebra - 3D programming is all about matrices, vectors, dot/cross products, complex numbers+quaternions for rotations, eigenvalues/vectors, basis transforms etc. For doing anything scientific add calculus and learn a bit about differential equations. A great maths youtube channel is 3brown1blue, that guy is very good at teaching.
 

D.Va

(ㅇㅅㅇ❀)
True & Honest Fan
kiwifarms.net
First off, there's just the whole lack of OOP. What do you do if you're coding in an OOP language and the library you're using does maybe 98% of what you need it to do? Oh, you just subclass the class which has the part you want to change, override a property or method or two, and use that instead (presuming the library authors weren't jackasses who abused final). But in JavaScript libraries, there's no OOP so there's no subclassing, and there's a pretty good chance the authors have done something obnoxious like wrap the whole damn thing in JS's weird giant closures anyway, so you can't even do the foo._bar = foo.bar; foo.bar = function() { foo._bar(); //other stuff }; hack. Now another solution could be to just fork the code and hack it and then just use my private fork, but see below.

I'm not sure what libraries you're using where you absolutely have to extend out an entire class. If you were, that would indicate the library in particular is poorly written. In any language, extending a third-party library class not designed for it is, by all means, a bad idea, and it's going to be the first thing to break if the maintainer updates an internal part of their library that wasn't meant to be touched by the API consumer.

"Extend this class" is not the be-all-end-all for OOP; it is far more nuanced than that. Libraries with good OOP design, especially JS ones, will make use of dependency inversion to separate the library into domains that communicate over interfaces. Good libraries will make it very easy to swap the built-in functionality out as modules, rather than overriding the entire thing.

I'd love to see what libraries you're having trouble with and why, because I don't remember the last time I've had to wrestle one to do what I want. What you are using is either programmed by an idiot, or it hasn't been touched for a dozen years.

Second, Node.js has so taken over the JS ecosystem that I think JS library authors have forgotten that there are people out there who are still only interested in using their code client-side. Instructions will generally start with an npm command, and code samples will start with a few require() calls. Instructions relevant to client-side use are often included as a seeming afterthought if they're included at all, so sometimes I have to try to "port" the Node instructions and code to something I can actually use. It's frustrating. And as it turns out, the "dist" files for client-side use have been transpiled from the Node code, so I can't even tweak the code without installing Node.js and then learning how to code in it, which I'd rather not do. Now this wouldn't be so much of a problem if I were just able to subclass the parts I wanted to change and be able to tweak them with my own standard client-side coding style, but see above.

What this tells me is that you're stuck in the 2000s Javascript development environment. You're missing out on several things by sticking with it:
  • compile-to-JS languages, especially TypeScript, which make writing large projects far more bearable
  • something actually resembling dependency management
  • actually being able to write several files and organise them over a directory structure, without even needing to think about the includes of your html doc
  • unit/e2e testing to make sure your stuff still works after changes
  • a pipeline to bundle up your several JS scripts into a single .js file, automatically minifying the contents, including your third-party libs, and applying polyfills for various browser quirks in the process
  • only actually building what you need, since only the imported parts of a library will make it into a bundled .js
  • local build services that reload your changes live
  • probably some other things
You don't really need much to learn how to "code" in Node, you already know the language and it isn't too taxing to get an old-school web frontend building through webpack. It's flexible enough that you can make gradual changes here and there until it looks like a typical node project.

Honestly, take some time to figure out how to port something you've written to webpack. It's far nicer than micromanaging a list of <script src=
 

MarvinTheParanoidAndroid

This will all end in tears, I just know it.
True & Honest Fan
kiwifarms.net
Well, before we get too deep into it: @MarvinTheParanoidAndroid - what are you actually interested in doing?
Everything I suppose, modding software, making my own, making vidya, modding vidya, and whatever's beyond that.

So since I brought up math related prerequisites, do you need linguistic prerequisites to get far in programming, as in knowing the difference between a predicate and finite verb? I bring it up because @Yotsubaaa referred to an expression of C code as a clause in the thread about the Covid-19 projections.
 
  • Feels
Reactions: Yotsubaaa

Stock Image Photographer

All my homies hate human rights
kiwifarms.net
Everything I suppose, modding software, making my own, making vidya, modding vidya, and whatever's beyond that.

So since I brought up math related prerequisites, do you need linguistic prerequisites to get far in programming, as in knowing the difference between a predicate and finite verb? I bring it up because @Yotsubaaa referred to an expression of C code as a clause in the thread about the Covid-19 projections.
No, I don't think that will come up outside of useless eso-langs that you should never bother learning. Hell, if the language is well designed you won't even need to have an excellent grasp on spelling because all of the keywords will be short and simple.
 

SIGSEGV

Segmentation fault (core dumped)
True & Honest Fan
kiwifarms.net
Everything I suppose, modding software, making my own, making vidya, modding vidya, and whatever's beyond that.

So since I brought up math related prerequisites, do you need linguistic prerequisites to get far in programming, as in knowing the difference between a predicate and finite verb? I bring it up because @Yotsubaaa referred to an expression of C code as a clause in the thread about the Covid-19 projections.
They were referring to a logical clause, not a grammatical one. Unless you're planning to create your own programming language and/or write a compiler, there isn't any linguistic shit to worry about.
 

Least Concern

Pretend I have a Biden avatar like everyone else
kiwifarms.net
In any language, extending a third-party library class not designed for it is, by all means, a bad idea, and it's going to be the first thing to break if the maintainer updates an internal part of their library that wasn't meant to be touched by the API consumer.
Sure. If it's not meant to be extended, it can be marked as final (though hopefully that's done with restraint and logic and not just because the dev couldn't imagine any cases where someone might want to extend that class with two seconds or less of thought). But some libraries explicitly expect you to subclass stuff to get anything done, and for those that don't, I hardly see the ability to do so as an anti-feature. And if it's a project which reasonably follows semver, I'm not too worried about breakage due to internal changes.
Libraries with good OOP design, especially JS ones,
:thinking:

will make use of dependency inversion to separate the library into domains that communicate over interfaces.

Sure, but that's a different goal than the one I aim for when subclassing.

Good libraries will make it very easy to swap the built-in functionality out as modules, rather than overriding the entire thing.

In most cases I don't want to override the entire thing. Just like a little bit here or there.

I'd love to see what libraries you're having trouble with and why, because I don't remember the last time I've had to wrestle one to do what I want. What you are using is either programmed by an idiot, or it hasn't been touched for a dozen years.

I'm afraid I can't because it could tie this identity to my real name through StackOverflow activity and such.
What this tells me is that you're stuck in the 2000s Javascript development environment. You're missing out on several things by sticking with it:
[a list of Node.js's improvements to JS]
I don't want to write a large JavaScript project, though. That's what my post is about. I just want to tweak tiny parts of existing projects. And if I can do that without having to install (and learn how to use) an entire new galaxy of tools, that'd be great.
 
  • Like
Reactions: Marvin and SIGSEGV

Kosher Dill

Potato Chips
True & Honest Fan
kiwifarms.net
Everything I suppose, modding software, making my own, making vidya, modding vidya, and whatever's beyond that.
If The Vidya is one of your primary interests, then why not just find out what language is used for the engine/platform you prefer, and start with some tutorials on that? The domain-specific learning can come later.
 

Yotsubaaa

And I will love you 💗
True & Honest Fan
kiwifarms.net
They were referring to a logical clause, not a grammatical one. Unless you're planning to create your own programming language and/or write a compiler, there isn't any linguistic shit to worry about.
I was also using it wrong, too. 😅 I meant it to refer to both the conditional and also the executed code, sort of like:
Code:
if clause
else if clause
else if clause
else if clause
else if...
Because my point in that example was that out of the entire if-else structure, literally 2 characters were changing in every if-else (conditional and executed code).

Perhaps I should have used 'item' or something instead of 'clause'. Oh well. See @MarvinTheParanoidAndroid, you don't need to know too much grammar/language to be able to program! Me no write good myself and me do okay!
 

Coolio55

<(0_0<) <(0_0)> (>0_0)> KIRBY DANCE
kiwifarms.net
This is probably one of those "duh idiot" moments but I just found out that you can install the .net core sdk (for free on all platforms) without Visual Studio and just use the command line tools to make projects/build executables etc. You can also use mono.
Thanks open source!

Moral: Command line rules once again bich ahahahahaha
 
Last edited:

Megatorg

kiwifarms.net
I remember there being a website with an interactive compiler that processed code step-by-step. Does anyone have the link to it?
 
Tags
None