Programming thread

I've always thought it would be better to start people new to programming with elemental languages like assembly. It's hard to do very useful things with it but very easy to wrap your head around what it's doing. I also think it falls in line with most other teaching that follows the course of history.

Though introduction with high level languages like python would not have taken off without reason.

So, why teach python first instead of something simple like Atmel/AVR assembly?
well we learned pascal and c in highschool but i learned python on my own and its what i know the most of
 
  • Like
Reactions: Evil Whitey
So, why teach python first instead of something simple like Atmel/AVR assembly?
Most people actually don't care about understanding the low-level details. It is also unneeded for webshitting and sisyphusian internal CRUDware development, so its easier to simply never teach properly.

Regardless, in an ideal world I think education should start with C then move on to Asm and -say- Python in parallel. Raising purists is similarly in poor taste as raising phonies.
 
I think learning a high-level language is a better way of getting into programming because it is far easier to create something useful. I certainly wouldn't be a programmer today if I didn't dabble with PHP as a teenager. If someone would try to force me to learn assembly when I was like 13 years old I'd probably quit forever because I wouldn't be able to see the value in fucking around with the registers but I could clearly see value in making my own website.
 
So, why teach python first instead of something simple like Atmel/AVR assembly?
Probably the added complexity of dealing with hardware. Most kids don't want to learn to program anyway, why would they make it more difficult and expensive?

I think learning a high-level language is a better way of getting into programming because it is far easier to create something useful. I certainly wouldn't be a programmer today if I didn't dabble with PHP as a teenager. If someone would try to force me to learn assembly when I was like 13 years old I'd probably quit forever because I wouldn't be able to see the value in fucking around with the registers but I could clearly see value in making my own website.
webdev as an intro to programming is an interesting idea, it's a shame that social media (and corporate homogeneity) pretty much destroyed the idea of personal websites.
 
The only language people should be starting with is scheme. If you're not getting ahead of the curve on achieving satori, then you're not gonna make it.
A lot of CS programs in major universities start first year students off with Racket, basing a lot of the curricula around the HtDP book. It's taught in a way that emphasizes the relationship between pure functional programming and core mathematical concepts like functions, logic, and their related algebras. I think starting off with pure FP is a really good idea, since it has you learn to program in a less state-dependent, more algebraic way.
 
A lot of CS programs in major universities start first year students off with Racket, basing a lot of the curricula around the HtDP book. It's taught in a way that emphasizes the relationship between pure functional programming and core mathematical concepts like functions, logic, and their related algebras. I think starting off with pure FP is a really good idea, since it has you learn to program in a less state-dependent, more algebraic way.
How many programs still teach this? Last I heard it was on the way out everywhere that was still using it in favor of Python or Java.
 
I think learning a high-level language is a better way of getting into programming because it is far easier to create something useful. I certainly wouldn't be a programmer today if I didn't dabble with PHP as a teenager. If someone would try to force me to learn assembly when I was like 13 years old I'd probably quit forever because I wouldn't be able to see the value in fucking around with the registers but I could clearly see value in making my own website.
I started with C++ and credit that with exposing me to all the underlying ideas really young, but beyond a few basic CLI tools and some text adventure shit really didn't pick it up again (with a much more high-level non-typed GC language) until I was in my teens because of the reasons you've mentioned.

Later when I was occasionally helping teach friends, or at least point them to resources (pre-LLMs) I learned that webdev was best for starting them out purely for motivation purposes.
 
  • Thunk-Provoking
Reactions: agent_donkey
Case in point: recently the C compiler pissed me off by whining about a function without a return. Fucking retarded compiler doesn't get that the function exists TO TERMINATE THE PROGRAM and DOESN'T HAVE TO RETURN EVEN!
:lit:
The Rust approach turns this on its head: "I, the compiler, am the adjudicator of the author's meaning, and he's not allowed to do unsafe things."
This isn't a problem in rust btw. You can just do it, and it is safe.

i feel like rust could do more inference bullshit for its memory lifetime analysis but anything like that is going to be a bit tedious regardless if it can automatically infer that you meant to make that function argument mutable or whatever
the least retarded option for most applications is probably just biting the bullet and adding a garbage collector and using that lifetime analysis to make a lot of the garbage not need collection
Lifetime inference is always being worked on. Rust has GC
Box<T> -> unique_ptr<T>
Rc<T> -> shared_ptr<T>
Arc<T> -> atomic<shared_ptr<T>>
Wonder if someone here can help since google is useless and chatGPT loops on bad answers. I have a large c++ application that uses grpc. I want to find data leaks due to frequent hard crashes and from what I gather Address Sanitizer is the best tool. However it shits the bed when used in conjunction with grpc. One of the solution I read is to recompile grpc with address sanitizer, but I'm worried I'd need to compile multiple libraries that grpc uses in turn. You'd think there would be a method to tell the sanitizer to ignore grpc but I can't find one with the suppression list not having any effect.
When you say it "shits the bed," do you mean you are getting linker errors? or is it crashing at runtime? If it is crashing at runtime, and you are fully sure it is a memory leak, Try -fsanitize=leak instead of -fsanitize=address, address sanitizer will kill your program when violating the C(++) memory model, leak sanitizer won't, also the output is nicer to read when you enable debugging symbols, you'll get source files and line:column numbers rather than module address offsets.
The only language people should be starting with is scheme. If you're not getting ahead of the curve on achieving satori, then you're not gonna make it.
I have been reading about lambda calculus recently, and I'm starting to see the appeal of lisps and schemes. I take back all the ignorant shit I ever said about them, they are based as fuck.
 
I think starting off with pure FP is a really good idea, since it has you learn to program in a less state-dependent, more algebraic way.
Any in particular you'd recommend? Less as a "I'm new to programming" but more functional languages in general. I've used Erlang and Elixir a bit and despite some oddities they're pretty nice, although the popularity of Phoenix has me fear Elixir will end up the same way Ruby did with Rails. Gleam also seems alright, and I like that it's got a type system, but the maintainer is a faggot.

The lisp derivatives seem interesting but they really do love their parentheses, I can't really say it's worse than every "C but better" language using every symbol on the keyboard though.
 
Last edited:
  • Like
Reactions: y a t s
I have learned about pointers in a fun, but albeit annoying, way. I was attempting to move my player token, and discovered that two addresses/variables/whatever, can point to the same memory space. Fascinating. So I was incrementing the player's coordinates by 2 instead of 1, even if accidentally.
heap style memory management was a mistake, return to stack.
 
Any in particular you'd recommend? Less as a "I'm new to programming" but more functional languages in general. I've used Erlang and Elixir a bit and despite some oddities they're pretty nice, although the popularity of Phoenix has me fear Elixir will end up the same way Ruby did with Rails. Gleam also seems alright, and I like that it's got a type system, but the maintainer is a faggot.

The lisp derivatives seem interesting but they really do love their parentheses, I can't really say it's worse than every "C but better" language using ever symbol on the keyboard though.
Just learn basic Scheme. Anyone who complains about lisp's parentheses doesn't understand functional programming and the beauty of s-expressions. Lisp was designed to be a very close analog to lambda calculus.
 
rainbow parenthesis or it's equivalent is a must
100% agree. Also having an editor that handles alignment automatically (and properly) is a godsend.

As an example for others here, this is what it looks like in my emacs setup:
parens.webp
Be sure to use an editor theme that has good contrast between colors. You should be able to distinguish them at a glance.

I also really like the % key vim has that lets you quickly jump to the matching closing parentheses when selecting and moving around chunks of code. The encapsulation the parens provide means you can do a simple d% from an opening paren to quickly cut that entire expression, even over multiple lines. Then you can paste it elsewhere and do something like =} to realign the pasted chunk.
 
I have been reading about lambda calculus recently, and I'm starting to see the appeal of lisps and schemes. I take back all the ignorant shit I ever said about them, they are based as fuck.
be careful, if you want to join the lisp shill master race you must renounce your rust faggot ways
if you truly love lisp you have to shit on rust at every opportunity because the only good language to :smug: about is lisp, and rust takes 1 step forward and 6 steps back
The lisp derivatives seem interesting but they really do love their parentheses, I can't really say it's worse than every "C but better" language using every symbol on the keyboard though.
as you come to understand the ways of the s-expression you will eventually attain enlightenment, the parentheses will become invisible, and it will read about as clearly as python niggers say python does
the trick to reading lisp is that everybody follows strict indentation rules so you can read by the indentation
also get an editor that can balance parentheses or you will die
 
Anyone here heard of Delphi? It's a rapid deployment language that I've never heard of and looks like a nightmare
 
Back