Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
What's a good service to learn Python?
If you just want to see how incredibly gay it can be then check out Codeacademy.
It will show you the basics but at the same it is a kind of a trap because you'd be doing all the exercises in an ecosystem that is ultimately different from actual programming ecosystem and that might cause you some frustration once you decide to take off the training wheels. Still, it's not entirely a bad choice for a complete beginner who just want to see what all the fuss is about.
Once you're done with that pick up a book about the language and just go through it. If you decide the book sucks then pick up an another one and keep doing that until you find one that appeals to you. Read the entire thing, even if it's like 1k pages. You should also (probably) disregard any book about Python 2.x. I'm not an experienced Python programmer, but from what I can see 3.x is the future and has been for quite a while now. Someone else can probably give you more insight on that.
 
if you want to be a programmer you should start by typing out random letters and making random changes until it compiles, then you will learn by brute force.
Start small.
 
You should also (probably) disregard any book about Python 2.x. I'm not an experienced Python programmer, but from what I can see 3.x is the future and has been for quite a while now.
python 2 is extremely ancient and unsupported, to the point of not being in many package managers
it doesn't really have that many huge differences from python 3 iirc, so maybe you could learn from a python 2 book if you understood the differences
if you want to be a programmer you should start by typing out random letters and making random changes until it compiles, then you will learn by brute force.
Start small.
also don't learn specific languages
you should probably learn stuff like c and scheme even if you never use it because just having knowledge of it will help you
in fact maybe learn a bit of scheme and a bit of c first and then go to python later, unless you really do need python specifically right now
 
C is a really good language to learn if you can because the need isn't going anywhere but new guys are generally keeping away from it due to it's reputation that it's hard to work with.

I think the reputation is undeserved and probably comes from trannies promoting Rust.

Rust has a place as the systems language you have pajeets learn. If you are smart enough to follow some pretty easy to understand rules you gain nothing by Rust's memory safety.

Also if memory safety is so important consider doing the needful and never using heap allocation.
 
C is a really good language to learn if you can because the need isn't going anywhere but new guys are generally keeping away from it due to it's reputation that it's hard to work with.
And the book, shown recently, is very short.
It's one of very few print computer books I've kept. Along with a Strostrup C++ book, the W. Richard Stevens networking books and maybe a data structure book.
 
The worst part about C is that it has like 90% perfect syntax and then 10% complete garbage like pointer syntax and type degeneration.

I've been using Odin in a side-project for a little while and I would recommend it over the other two nu-langs (Rust/Zig).

You get C-level power without the retarded little bits of C.
 
The worst part about C is that it has like 90% perfect syntax and then 10% complete garbage like pointer syntax and type degeneration.

I've been using Odin in a side-project for a little while and I would recommend it over the other two nu-langs (Rust/Zig).

You get C-level power without the retarded little bits of C.
What's your side project?
 
I'm seriously considering retraining as an electrician.

Career wise: Currently pretty much dead end working as a windows driver developer and job interviews aren't going to go that well:
>" What's a challenging problem you solved?"
>"I had to disassemble Microsoft's own driver to understand what undocumented DDI marks memory to not be invalidated during hibernation."

I'd obviously rephrase to be less autistic but my point is that my examples already alienate your typescript and .net developers which dominate my area.

It's not that I don't have my own portfolio of personal web apps but to be honest in the age of AI, they are basically meaningless.
Replying to this and your other posts. Mate, if you can do kernel-mode development of basically any sort with a reasonable degree of competence (looking at the pajeet who nuked crowdstrike's fleet lmao), you're a good hire in any serious shop. Seriously. And I'm not saying you should stay in driver work for M$ specifically, or even driver work in general. The skillset you need to do that instantly opens the doors for you to pivot into any other systems-level-ish adjacent role.

Say there's a company out there doing work on, idk, high-performance computing. Researcher support, application development, whatever it doesn't matter. You interview for a position. Have you ever worked in the field? No? No problem. I can assure you the guy who's interviewing you isn't put off by this at all; he knows 4 out of 5 applicants have never worked in his particular field directly either, and that's alright. He's not looking for someone who knows the answers to yesterday's questions, he's looking for talent, he's looking for someone with the smarts to look at a problem that you just can't solve by googling it and looking at the first couple SlopOverflow Q&As. He doesn't care if the guy in front of him worked at NASA programming flight computers that have fuck-all to do with algorithms to denature proteins, or viceversa. The specifics don't matter and they'll change day to day anyway, but if you can learn to "disassemble Microsoft's own driver to understand what undocumented DDI marks memory to not be invalidated during hibernation", fuck, you can probably learn what he's interested in and be productive in a couple of months.

Forget about typescript, node, whatever webfaggotry you mentioned you were trying. It's pointless; yes, there are more jobs, but 99.999999+/-1% of them are going to be soul-sucking CRUD slop "apps", and navigating the "modern web" programming ecosystem is poison for one's soul, intellect and happiness. You can do better than that.
 
I'm seriously considering retraining as an electrician.

Career wise: Currently pretty much dead end working as a windows driver developer and job interviews aren't going to go that well:
>" What's a challenging problem you solved?"
>"I had to disassemble Microsoft's own driver to understand what undocumented DDI marks memory to not be invalidated during hibernation."

I'd obviously rephrase to be less autistic but my point is that my examples already alienate your typescript and .net developers which dominate my area.

It's not that I don't have my own portfolio of personal web apps but to be honest in the age of AI, they are basically meaningless.
It’s worth doing the interviews anyway. If you can do low-level stuff you can handle webdev just fine. You have to be thorough with low-level stuff. Much higher barrier to jacking off to abstractions.

Read The Fine Manual. https://www.sqlite.org/docs.html

SQL is one of those "programming languages" (barely) that will tie your head in knots for a couple years until you learn how to sort things out. It's not something you learn on a lark very well. Sqlite makes it approachable because you can simply copy a file and screw around on your fresh copy and no one gets hurt. And you can do it all from the command line easily.
I’d like to add onto this: SQL is the highest leverage skill you can have for business programs. If you are comfortable with it, you can handle complex stuff with relatively little effort.
 
new guys are generally keeping away from it due to it's reputation that it's hard to work with.
The reputation is real, but I think it's wildly misinformed.

I have a lot of experience with C, and what I've come to realize is that the most friction that at least I feel when writing C comes about when I try to write C like another language. This mainly manifests in me trying to write overly abstracted code, and with poorly conceived heap use patterns. It's really tempting if you've been working with a garbage collected language or framework to treat object creation as 'free'.

Many of the malloc/free footgun scenarios, (and associated performance issues that arise from even successful use), are the result of me not thinking about my memory usage thoroughly. A lot of C programs don't really need the heap, to be honest, or at least not to the degree they end up using it. The majority of code that does need the heap can be written to use something like a memory pool or bump allocator with pages gotten from raw mmap calls. At least in glibc, malloc under the hood for a good chunk of cases just works by using brk or sbrk, it's not until you request relatively large memory regions (on the order of hundreds of KB), that malloc actually starts relying on mmap.

On top of what I mentioned, you can also clean up a lot of code relying on the heap by having your code put the responsibility for memory management solely onto the caller as much as possible by avoiding returning heap allocated pointers. This alone makes a lot of the difficulties much more tractable, as your allocation and deallocations are more likely to occur in a localized part of your codebase.


TL;DR, if you use C as C, it's perfectly fine. Many people self-impose difficulty by trying to use C in ways it's just not intended for, and I'm speaking from experience.


Edit: I also just want to point out that using mmap and madvise with common access patterns is a huge performance boon, locality and cache alignment are vital to efficient code. The MMU and caches inside a CPU are able to work the hardest when you are mindful of page and cache behavior.
 
I've been keeping an eye on both Odin and Zig for a while now, leaning more towards Zig. What do you like more about Odin?
daily reminder that zig is fucking gay. the compiler does shit like rejecting your program if it has unused variables
I don't have much more to add. It's just like C, but easier to read, write and compile. And I like C, but C's syntax is kind of niggerlicious the moment you have more than one level of indirection.

C is a well-worn pocket knife that's showing its age, from the 1970s. Odin is a modern pocket knife made by a boutique knife company with good materials and a modern touch for usability. Zig is a swiss army knife with a bad spring that cuts you every now and again. Rust is a spork.

All I want or need is a pocket knife.
 
has anybody here ever heard of prescheme
it's an obscure systems language that is essentially a subset of scheme with c-like runtime characteristics, used in the scheme48 runtime and basically nowhere else
 
C is a really good language to learn if you can because the need isn't going anywhere but new guys are generally keeping away from it due to it's reputation that it's hard to work with.
I wouldn't say it has a reputation of being hard to work with, so much as a reputation of being annoying to work with. C got traction early on by being an exercise in how much shit you could take out of a language's implementation requirements while still having a language that's good enough to write real shit with. People act like module/package systems and rich type systems and multiple calling conventions are 'modern' but they were all popular when C was conceived. C caught on because it jettisoned all of that and made itself easy to port to new architectures, and that was a killer feature in an age where new architectures appeared every other week. C might be a pain in the ass but if you wrote your software in C, you could very easily port it forward in five years when your company decided that it didn't want to buy DEC machines anymore and instead wanted something from Sun. Nowadays this problem basically doesn't exist - there are less than ten major ISAs that cover 90% of all computing on this planet (fewer if you consider that some of them are just extensions of the others), and operating systems have settled on a handful of well-defined calling conventions.

I can't really recommend using C for anything other than OS programming and that's just because so many OSes are built on C and make assumptions about linkage based on how C works. It's important to learn C because odds are good you'll probably have to interact with a library written in C at some point but I don't think new software that isn't a device driver or a low-level system utility should be written in it.

A more abstract, macro problem with C's dominance is that it bakes certain assumptions about how computers worked in 1970 into itself that haven't really been true to how computers work since the Pentium made everything superscalar. All programming languages are lies at the end of the day so this isn't a C-specific problem, but there is a very persistent idea among some people that C represents a kind of platonic truth about how computers work that's simply not true and leads people astray.

Anyway, all that aside - every programmer who's serious should have a working knowledge of C and be able to write software in it. I don't think it's a good use of one's time to immediately hop to C for every problem but sometimes you do need it.
 
c is at its very best when you want to make a small low-overhead program but you don't want to write 8 versions in various assembly languages
and i don't think it's a bad thing that c is as simple as it is, because i feel like conceptual simplicity is very underrepresented in modern programming
in fact i think c could stand to be way simpler, especially its often-incomprehensible syntax
 
c is at its very best when you want to make a small low-overhead program but you don't want to write 8 versions in various assembly languages
C is also at its best when it's the target language for various compilers (e.g., f2c compiled Fortran 77 into C, p2c compiled Pascal into C, Squeak's VM is written in a subset of Smalltalk and automatically compiled into C, Eiffel compiled into C and maybe still does, and I don't think any of the Modula-3 compilers ever generated anything but C). Bernstein has remarked that he wrote qmail in C because it was available on every system, but that he should have implemented a simple compiler for an Algol-like language that compiled into distributable C and then written in that instead of doing all the bounds checking by hand. I think we should go back to this sort of thing, because I really don't like the modern practice of putting every egg on the planet into LLVM's basket.
 
Back
Top Bottom