Programming thread

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
If you want my advice, learn them all.
I've found that once I learned C I can read almost any language, and even cargo-cult out fixes when I need to. Maybe not Javascript, but that's not intelligible to anyone. And OO stuff needs at least some background in another OO language to understand it.

Yes, even Perl.
 
So here is a question I want to pose to my fellow kiwi programmers, Aside from templeOS, What is the most punk Rock coding language. What is the middle finger of programming?
APL. But really Haskell or Ocaml. C is too mainstream to be "punk rock" IMO.
Learn Python for backend and JavaScript for frontend if you want freedom from strong typing, and a number of approaches to coding.
Go die in a hole with everyone else who wants "freedom" from strong typing. Strong typing gives you freedom from errors. Just like brackets, strong typing is a good idea.
If I was gonna learn C again today, I'd go with Modern C by Jens Gustedt (direct link) because of the depth at which it covers everything you need to be a good C programmer, but it is lengthy and there is a lot of information that might just slide off without some prior knowledge of C. You don't need to read the whole thing, but at the very least, scroll through the takeaways section and read any entry that interests you or that you find yourself disagreeing with.
I love C23. This is a great book, and the third edition has some C23 in it. Buy the new version of the book if you can.
 
Last edited:
APL. But really Haskell or Ocaml. C is too mainstream to be "punk rock" IMO.
Haskell isn't punk, Haskell is prog rock. It's one of those weird concept albums about eating snakes or turning into a flower or whatever.

Go die in a hole with everyone else who wants "freedom" from strong typing. Strong typing gives you freedom from errors. Just like brackets, strong typing is a good idea.
Weak typing is such a horrendous idea I'm surprised to see anybody defending it.
 
Go die in a hole with everyone else who wants "freedom" from strong typing. Strong typing gives you freedom from errors. Just like brackets, strong typing is a good idea.

Semantics never makes for good code, culture and processes do. Strong typing doesn't prevent errors. There are plenty of ways to fuck up a perfected typed method.
Typing is one tool, among many that helps you achieve a good codebase. I've worked in many loosely typed codebases that had very high standards and good code quality, and I've seen strongly typed codebases become a pile of shit due to code debt, pressure to rush things, all of which lead to apathy from engineering leadership and engineers that don't give a shit.
 
Dynamic typing would be less of an issue if it wasn't a pain to verify what you're actually working with.
In Python, adding assert isinstance(x, Y), x everywhere is a lot of effort, let alone a full if not isinstance(x, Y): raise Exception('blahblab')

However, with pattern matching you can check more easily you're working with the right data (barring someone intentionally trying to fuck up, which no language protects against).
For example, Erlang, which is still on my to-learn list:
Code:
Stuff = {list_of_stuff, [a,b,c]}.
% Ok
{list_of_stuff, List} = Stuff.
% Kaboom
{something_else, Idk} = Stuff.
Here only identifiers starting with an uppercase letter are variables. Lowercase identifiers are atoms, which in patterns only match against identical atoms.

If you haven't, take a stab at a functional programming language, pattern matching is great.
 
Dynamic typing would be less of an issue if it wasn't a pain to verify what you're actually working with.
In Python, adding assert isinstance(x, Y), x everywhere is a lot of effort, let alone a full if not isinstance(x, Y): raise Exception('blahblab')

However, with pattern matching you can check more easily you're working with the right data (barring someone intentionally trying to fuck up, which no language protects against).
For example, Erlang, which is still on my to-learn list:
Code:
Stuff = {list_of_stuff, [a,b,c]}.
% Ok
{list_of_stuff, List} = Stuff.
% Kaboom
{something_else, Idk} = Stuff.
Here only identifiers starting with an uppercase letter are variables. Lowercase identifiers are atoms, which in patterns only match against identical atoms.

If you haven't, take a stab at a functional programming language, pattern matching is great.
fucking hated having to learn erlang in school but its still less of a pain in the ass than haskell
 
  • Like
Reactions: UERISIMILITUDO
Go die in a hole with everyone else who wants "freedom" from strong typing. Strong typing gives you freedom from errors. Just like brackets, strong typing is a good idea.
Strong typing also gives you the freedom to define a struct with one of every type and a flag to indicate which type it holds so that you can have dynamic typing again.

I've had the pleasure of working with a database where someone decided that this was a good design strategy.
 
Dynamic typing would be less of an issue if it wasn't a pain to verify what you're actually working with.
In Python, adding assert isinstance(x, Y), x everywhere is a lot of effort, let alone a full if not isinstance(x, Y): raise Exception('blahblab')
For me it's always been about how to verify what you wrote at a baseline without running it, especially painful within branches that are rarely executed. Dynamic languages may have linters and other tools, typescript compiles or transcompiles, but usually the tools are not a part of the build process (because there isn't one) so they are a poor replacement for actual compilation. They're great for little scripts or personal projects but anything that has to function reliably and be statically analyzed is better in a real language.
Strong typing also gives you the freedom to define a struct with one of every type and a flag to indicate which type it holds so that you can have dynamic typing again.

I've had the pleasure of working with a database where someone decided that this was a good design strategy.
I've done something similar with a tagged union when I wrote a virtual machine for a toy language, it would store the union as the value of a variable, you could have pointers by pointing to another union. Maybe there's a better way but nothing beats the simplicity.
 
Last edited:
I intend to learn C one of these days, but I was wondering if there is a language that is lower level like C, C++, C#, Rust, etc. but has a similar syntax to javascript.

I'm working on learning how to make templates for shopify but its so fucking boring, so when I get into a rut I like to make a game or something because its great practice and it revitalizes my interest in coding. Making money off of developing webstores is great and all but its fucking boring.

I can just use Electron to run javascript/html stuff as a native application, the idea I have is a simulation that involves mostly using menus and managing resources no need for physics engines or any of that stuff. But I think something that is specifically for making native applications would be more suitable. I suppose I should just learn C right now, but seeing as I have a decently solid grasp of javascript, I think my best bet is using a language that has a similar syntax would be a good way to dip my toes into writing lower level programs without having to spend alot of time learning the basics to yet another language.
 
I can just use Electron to run javascript/html stuff as a native application, the idea I have is a simulation that involves mostly using menus and managing resources no need for physics engines or any of that stuff. But I think something that is specifically for making native applications would be more suitable. I suppose I should just learn C right now, but seeing as I have a decently solid grasp of javascript, I think my best bet is using a language that has a similar syntax would be a good way to dip my toes into writing lower level programs without having to spend alot of time learning the basics to yet another language.
Use c++ it's not that complicated, just stay away from templates and all the modern pointer features and you get C with some useful syntactic sugar and access to c++'s std library that has advanced data structures, you can use cmake as a build system. I'm doing a project now using a mongoose c++ http server and using tauri for a "native" looking application using vite+react. If you want a native UI you can use something cross-platform like GTK (native? on Linux but not on Mac or windows) or use whatever windows/mac provides but it would be non-portable to the other systems. For mobile React Native is the go-to (it is actually native, unlike flutter).

If you want a different language that's low level there's plenty to choose from just look at this list and sort by birth date https://en.m.wikipedia.org/wiki/System_programming_language nim and mojo have a similar syntax to python from what I remember but I have no experience using them, otherwise JavaScript is a C-like language as far as syntax is concerned. There are other paths like compiling to JavaScript from another language, but that's heresy and should be avoided.
 
I was wondering if there is a language that is lower level like C, C++, C#, Rust, etc. but has a similar syntax to javascript.
You're in luck. JavaScript's syntax is really just a clone of Java's syntax, which itself looks a lot like C. So when you're getting into C, you will notice that it looks a lot like the JS you're used to, except messier due to certain things you have to manually do in C that JS does for you automatically. You'll probably want to look into C++ too, because C's simplicity is awfully double-edged and it makes certain seemingly-simple things incredibly hard, which isn't particularly fun if you're trying to quickly make something useful.

My main advice: I would just recommend that you should explore. Read about various things, look at examples, try some shit out... If you're learning new things, you aren't fucking up. You can look at the post above me for good places to start, but I implore you to go farther and attain basic familiarity with as many things as you can. Knowledge is power, especially when it comes to programming. Good luck.
 
You're in luck. JavaScript's syntax is really just a clone of Java's syntax, which itself looks a lot like C. So when you're getting into C, you will notice that it looks a lot like the JS you're used to, except messier due to certain things you have to manually do in C that JS does for you automatically. You'll probably want to look into C++ too, because C's simplicity is awfully double-edged and it makes certain seemingly-simple things incredibly hard, which isn't particularly fun if you're trying to quickly make something useful.

My main advice: I would just recommend that you should explore. Read about various things, look at examples, try some shit out... If you're learning new things, you aren't fucking up. You can look at the post above me for good places to start, but I implore you to go farther and attain basic familiarity with as many things as you can. Knowledge is power, especially when it comes to programming. Good luck.
Well I suppose I have no excuse then. I will be learning C soon because my idea is really cool and I wanna do it.
 
  • Like
Reactions: Concentrate Juice
Well I suppose I have no excuse then. I will be learning C soon because my idea is really cool and I wanna do it.
A delusional criminal JS stalker meets the end of his life today.

You are mentally ill, stalker. You have been instructed, many thousands of times, to stop using gay scripting languages and use something without a 450MB runtime. Enjoy struct {child_t* children; unsigned long long number_of_childs_enjoying;} prison, stalker.
 
I intend to learn C one of these days, but I was wondering if there is a language that is lower level like C, C++, C#, Rust, etc. but has a similar syntax to javascript.
If you want a true challenge beyond C, x86 or ARM Assembly. I find the lower level languages to be way more interesting than the higher level ones personally speaking. Initially when I was looking into programming for video game hobbyist shit, I was looking at C++ and potentially Rust because of the Bevy Engine. I would eventually take a side quest and started looking into operating systems their order of operations, and eventually x86 Assembly.
 
A delusional criminal JS stalker meets the end of his life today.

You are mentally ill, stalker. You have been instructed, many thousands of times, to stop using gay scripting languages and use something without a 450MB runtime. Enjoy struct {child_t* children; unsigned long long number_of_childs_enjoying;} prison, stalker.
JavaScript:
if( this.user === "stalker child") {
 let stalkerChild = this.user
 return enjoyPrison( stalkerChild);
}

If you want a true challenge beyond C, x86 or ARM Assembly. I find the lower level languages to be way more interesting than the higher level ones personally speaking. Initially when I was looking into programming for video game hobbyist shit, I was looking at C++ and potentially Rust because of the Bevy Engine. I would eventually take a side quest and started looking into operating systems their order of operations, and eventually x86 Assembly.
Sorry for the double post but How punk rock is x86 assembly? :story:

 
Sorry for the double post but How punk rock is x86 assembly? :story:

x86 is the closest you can get to a CPU before bytecode. Most people don't code in it for good reason;however, it offers a unique opportunity. With knowledge of x86, you can write a compiler and your own programming language.

In most computer science programs, the last project for a student is to build a compiler. Compilers are the perfect synthesis of application and academic theory. If you can build a compiler and have an understanding of data structures, you are as good as any comp-sci grad. Better than most even.
 
Back