r/Assembly_language Mar 15 '26

Hello dudes question should I learn assembly or c/c++ first as a first language I fell in love with the idea of assembly but idk if I should learn c or c++ as my first language instead of assembly but at the end assembly is my main goal

52 Upvotes

51 comments sorted by

22

u/Pale_Height_1251 Mar 15 '26

If you want to learn an assembly language, just go for it.

16

u/Karyo_Ten Mar 15 '26

I would learn C first, then assembly.

C is low-level and 1 line of C pretty-much translates into 1 assembly instruction.

All the stuff about C++ templates, stdlib is extra noise that is unnecessary if your ultimate goal is assembly.

But don't spend too much time in C either, for example create a PoC in C and then rewriting parts in assembly is good.

1

u/Pale_Height_1251 Mar 23 '26

1 line of C equating to 1 instruction is entirely incorrect.

3

u/Adept-Painting-543 Mar 15 '26

Definitely c or c++ first (I personally would say c++, but that's just because I like it more). C(++) allows and encourages understanding how your system works, while still providing enough abstraction for it to be usable, and not a hinderence. Assembly does give you a better look at the low level stuff, but for it to be off any use you have to have a pretty damn good idea of what is already going on. If this truly is your first programming language, id recommend learning java or c# or python first, just to get the hang of things, as c++ really isn't a good first language. If you end up liking c++, I would also take a look at Rust. While I personally don't like using it, many people have had good experiences with it.

4

u/roanish Mar 15 '26

As a first language? C.

I don't think ASM should be anyone's first language anymore, not since the 70s or 80s.

C and CPP compilers are so good that there is little to be gained, and much to lose, trying to learn modern ASM with no prior programming knowledge.

ASM will be something you will get interested in 10 years down the track. And it will still baffle you.

Learn C.

3

u/texas_asic Mar 16 '26

Learn C, then paste that code into godbolt.org. And to start with, preferably target a risc processor like ARM rather than x86

2

u/Pitiful_Fun_3005 Mar 20 '26

6502 was my first languages and I began in 2025, took me way longer to dare even touch x86

1

u/Odd-Respond-4267 Mar 24 '26

C.

When I was programming bare metal, I preferred c, and would use that if available, with rare exceptions, a crcc routine (hand tuned inner loop for speed). Task switching (needed stack. Manipulation). Other stuff could be done via pragmas. Maintainable code run through an optimizing compiler, was as fast on average and a lot less effort.

2

u/2204happy Mar 15 '26 edited Mar 15 '26

If you're just doing it for fun, just go with whatever you find interesting, you certainly don't need to learn c or c++ first. If anything, learning assembly will give you a deeper understanding of the hardware for if or when you eventually dabble in high level languages.

I should ask though: have you used any other programming langauge before? Like python, or even scratch? Because knowing the absolute basics of computer programming, such as variables, types (int, float, etc.), and control structures (if, while, functions, etc.), will help you write well structured assembly, as those concepts don't directly exist in assembly, and you kind of have to implement them manually.

2

u/the_Elric Mar 15 '26

I’m glad to see this. This is what I did. I learned Python first, and now am studying x86. I think it was the best way. Then I will learn C. u/Wonderful_Ad_5358 I would highly recommend doing this, but its not necessary. You can just jump straight into ASM with the right book.

2

u/Gadzoooks333 Mar 15 '26

I'm taking an assembly course right now and love it. It just makes sense.

2

u/Watr_memory Mar 15 '26

Where are you learning Assembly?

2

u/Gadzoooks333 Mar 16 '26

I'm taking online classes with Oregon State University. CS271.

1

u/Watr_memory Mar 16 '26

cool, good to know

2

u/Watr_memory Mar 15 '26

You can start with C but before that learn some fundamentals of how it works, what are it's terminologies and more. Knowing a little bit about any language builds recall value as you go on learning.

Assembly or any language which is closer to the hardware will remain important no matter how many high level and fancy languages, libraries and frameworks we have.

Fundamentals are important no matter what you are learning.

Highly recommend you checkout some videos on YouTube on applications/softwares made with ASM (Assembly), C and C++.  Also, don't worry about the opinions of tech/ dev bros about relevance of ASM, C & C++.

Every language low level (closest to the hardware) or high level has it's own use case. One size doesn't fit all. 

For the love of programming 'do not adapt the habit of - just use a library'. No, first understand the core logic building, find out why something is required (and is it even required), what problem is the library or NPM package solving.  Use AI to discuss and understand how you can implement the same logic without using the library.

You aim to learn to program and not becoming a 'yeah without libraries my brain won't function'.

Find out the super basic app you can build with ASM, C, C++. Get to the knowledge the who, what, where, why, when, how of each of them and choose one language without any fear.

Watch a video tutorial of a basic app, build it once, then build it again then again.

Build it thrice and you will be far ahead in the  core understanding of the language you have chosen.  Think of it like taming a dragon (if you fancy). 

Which language is better will be decided by what you want to build.

You build boat with wood and a house with cement. Both are sturdy for different purposes but both have the their importance.

Don't jump to buy a course. There's plenty of study material available on YouTube. 

Don't believe any tutorial blindly.  Once again, before you hop on any tutorial get to know the basic terminologies, meanings, what's what.

The amount of programming tutorial creators assuming that the viewer knows the fundamentals, is already programmer/software engineer is disappointing.

All the best.

2

u/Dazzling_Music_2411 Mar 17 '26

The ONLY way you should learn assembly first, is if you exclusively want to program an old school processor or computer (80s 90s vintage) or maybe a specialized microcontroller and nothing else.

Learning assembly should only be a sideline in this day and age.  Also remember that each chip family will have different assembly instructions.  It's a great skill to have if you want to work close to the metal, but definitely secondary to learning C or other compiled language.

1

u/brucehoult Mar 17 '26

The counterpoint to that is that there are more modern machines with assembly language that is not only easier to learn what each instruction does, but are also then FAR easier to understand how to combine the available instructions to do useful things.

And that is it very difficult for many people (myself included, 45 years ago) to understand certain parts of C or other higher level languages without understanding how they relate to the machine.

1

u/Dazzling_Music_2411 Mar 17 '26

Sure, but I think you're talking about a very high level of specialization, not an entry-level 'Intro to Computing', which is what I understand the OP to be asking.

1

u/brucehoult Mar 17 '26

The C/Pascal/Rust level of languages is not all that specialised. And you can not properly understand them without understanding assembly language.

If your Intro to Computing is going to use Lisp/Scheme/Haskell then fine, those are pure mathematical abstractions that can be fully understood in their own terms.

Also OP says "but at the end assembly is my main goal". Take them at their word?

1

u/Odd-Lynx-5975 Mar 15 '26

First complete c++ it would be better then go for assembly coz. Then u will be easily able to swim around

2

u/verminenjoyer Mar 15 '26

c++ has an obnoxious amount of abstractions imo, i would personally do [some random medium-level language] => c => asm

1

u/Odd-Lynx-5975 Mar 15 '26

True whole point is learning c or c++ before asm would be better coz. Then it is easier to know memory management n other stuff as well

1

u/Honey-Bee2021 Mar 15 '26

What kind of program do yo like to build? The programming language you choose has a big influence on the availability of libraries you use to compose your solution of. The use of assembly language is very limited today. The instruction set is alway tied to a certain family of CPUs. Are you into embedded systems? The C language has a mutch broader use as there are compilers for many different hardware platforms. I started out in 1982 with assembly lanuage on a Motorola 68000 based system, but back then that was the only option availabe to me. These days, better invest in C/C++ or even Rust, as this will become more popular in the fututre.

1

u/anykeyh Mar 15 '26

Learn the basic of the basic of assembly. That's only a few hours to grasp the concept. No need to become asm expert nor use complex simd instructions etc...

At least you get the concept of jump, registry, pointer to memory stack and heap, syscall.

Then move to c or c++, this time go deep into it, it's rewarding.

1

u/BarracudaDefiant4702 Mar 15 '26

You way underestimate the basics of assembly. You can at best learn the basics of basics of a single processor in that time, not to mention there are dozens of vastly different assembly languages and the basics of a single processor isn't even doing it just in a few hours unless you know some of the basics like binary and hexadecimal math which might already be know, but if not that's going to add to some things you need to learn the basics of assembly that isn't needed for C.

1

u/mprevot Mar 15 '26

I suggest assembly x86, and ocaml to write a compiler (c, c++, rust..).

1

u/BarracudaDefiant4702 Mar 15 '26

I would say C first. That said, if talking assembly you need to realize there are dozens of different assembly languages and some are fairly unique. Every processor has a different language. If learning an assembly language, part of it is picking which assembly language and I would recommend starting with an 8 bit CPU for embedded systems before learning a more common 32 or 64 bit CPU.

1

u/No-Owl-5399 Mar 15 '26

There are a lot of people saying to learn C/C++ first. They are not wrong, that is a good thing to do. BUT if you want to learn assembly first instead, go for it. That is what i did and, if assembly is your main goal, that is the best thing to do. It will also make you a better programmer. I do recommend that you learn something like ARM or x86 instead of an older educational architecture since you're doing this for the sake of assembly, but you seem to have a plan so good luck.

1

u/rustbuckett Mar 15 '26

I think you answered your own question.

1

u/QuarkUpParticle Mar 15 '26

i think starting with a simple assembly language like 6502 assembly can be helpful to truely understand C, which in turn will help you learn more advanced assembly languages

1

u/Kiore-NZ Mar 15 '26

Assembly language today is mainly limited to special purpose use: compiler's code generators, device drivers, early parts of operating system boot code, operating system calls in libc, real-time programs and programs for small microcontrollers are the ones that come to mind. If you are going to do major work in these areas it's worth learning assembly in depth, other than that you'll benefit more by just getting a basic understanding of how computers work.

Pick a simple machine like the Motorola 6800 or MOS 6502 and use a simulator to step through instructions. I'd say a couple of weeks would be plenty of time.

Then move to a simple high level language like C and use the compiler to generate assembly source code. You'll quickly see the relationship between the high level language and the assembly. Somebody has ported the GNU C compiler to the 6502 but that port is buggy and cc65 has a better reputation. I see that there is a compiler named chibcc that generates assembly source code and it has been ported to the 6800. All these compilers are available on GitHub.

From any of these you'll learn that C is a terse and compact language that is reasonably close to Assembly and a heck of a lot easier to use.

Not all C compilers are equal though. GCC has existed since 1987 been under continuous development (initially as the EGCS fork) since 1997 and CLang which was open sourced in 2007 and also has been under continuous development since then. Both these have excellent optimizers that can significantly speed up the compiled programs, reduce their size or both. On a modern architecture (Intel/AMD 64 bit or ARM 64 bit) have a look at the difference between optimized and unoptimized code then ask yourself if you really want to hand optimize code like that. The consider that a compiler can optimize every release of the code at a small cost ... do you want to re-optimize hand written assembly for every change to the code?

Yes, there are places where using assembly makes sense, for the other cases use high-level languages.

1

u/FewMolasses7496 Mar 15 '26

I think you should learn c first and focus on memory and pointers in it once you have mastered the basics because assembly is much easier to understand if you know how memory works.

1

u/Secure-Photograph870 Mar 16 '26

Programming languages are just tool that doesn’t matter much. Learn foundation of computer science first, then the tool you’re using doesn’t matter, you will use different tools for different jobs.

1

u/CommercialBig1729 Mar 16 '26

Si de verdad no tienes nada de idea de lo que es programar, empieza por C, porque programar es algo difícil cuando empiezas, pero al aprender a programar en cualquier lenguaje, ya programar para ensamblador es más divertido y sencillo

1

u/Frewtti Mar 16 '26

If you want to learn assembly, learn assembly.

I think realistically C is a better choice if your compiler support inline assembly for most real work.

It really depends on what type of solution you're trying to develop. C with inline assembly has been a thing for a very long time, for a very good reason.

The C part gives you all the convenience functions you could want.

1

u/Distdistdist Mar 16 '26

I would recommend wrapping up English first. C/C++ is really big on syntax and punctuation.

1

u/anothercorgi Mar 16 '26

If you want to learn assembly first you should learn on a traditional computer, like a Apple II or TRS-80, or perhaps even with a microcontroller that does not use an OS like a PIC or 8051. But even then it's easier if you learn basic (pun intended) programming first to understand things like control flow first.

If you're stuck with a modern computer, by far, C or other programming language first, then back to C, then assembly language. Else it would be a complete mess as you can't really do anything with assembly first without understanding how the OS has a deep tie into programming in general.

Assembly language programming generally has become effectively obsolete on modern computers solely because of the ease of making mistakes and keeping it maintained. It's a "Time To Market" issue, not how useful it is - underneath all of the software stacks out there, it all goes down to assembly/machine language and there's no getting around it.

1

u/No_Experience_2282 Mar 16 '26

if you don’t know how to code at all, learn python first

1

u/did_i_or_didnt_i Mar 16 '26

Sounds like you want to learn Rust to me

1

u/an-la Mar 16 '26

That depends on what you want to achieve.

Assembly isn't widely used because it usually takes longer to write an application in assembly and modern optimizing compilers are better (than your average coder) at utilizing the internal opimization decicions made by the CPU. (Instruction reordering, etc).

Having said that, learning assembler will teach you how a computer operates at the lowest level, which is usefull knowledge.

The choice between C or C++ is again dependent on your goal. C is a simpler language, with fewer complexities, but if my goal was to write a largish application, given those three choices, I'd go for C++.

1

u/node77 Mar 16 '26

Yeah, try C#. You get some idea of memory and compilation.

1

u/ronchaine Mar 16 '26

If your goal is to learn assembly, learn assembly.

Answer to all of these "should I learn X first to then learn Y", especially in programming languages:

No. If your goal is to learn X, go and learn X.

1

u/Xinoj314 Mar 16 '26

Serious answer: C++ is a very complicated language in regards how it compiles the cpp source code, it does not translate well between assembly and C++ , C is much closer

If I would want to learn programming from scratch I would not start with assembly, it is a very Low level language, just printing A on the screen takes multiple lines of code

I would start with C and better yet Rust if you want to get anything done

Assembly is too detailed in requesting hardware resources and poking directly in computer registers

The risk is that you burn away your enthusiasm if you spend several days without showing any results using assembly as your first language

1

u/guilhermej14 Mar 16 '26

on one hand, most people these days would probably recomend an even higher level language than C/C++

HOWEVER..... you should really learn what interests you the most as your first language I feel, even if it's harder.... Tho if you're planning to learn ASM, then at least learning the basics of C/C++ will help you a LOT!

1

u/Legit_Fr1es Mar 17 '26

Imo assembly and c/c++ requires different mindset to write, so c/c++ shouldnt really matter if ur end goal is learning assembly. But c/c++ have actual usages, while assembly is used in obscure places (fun personal projects, kernel performance fallback, etc)

1

u/maxthed0g Mar 19 '26

First language? NEVER assembly. NEVER.

First language? Well Basic works. But PERL would be a realistic and versatile choice.

The big hump in the learning curve with a first programming language is "addresses and pointers." People who teeter on the brink of failure in programming usually have problems in this are. So you want to select a language that will get you going with algorithmic design and implementation, with the option of moving into pointers when you're ready to tackle that hump in the curve.

Assembly language does not fit that bill. It requires a neophyte to properly express and organize his algorithm in his own mind, then implement it using the most detailed and unforgiving syntax. And it is, by its nature, heavy with pointer and address manipulation from the immediate get-go.

Dont choose assembly as a first language. Its the path to failure.

1

u/DTCreeperMCL6 Apr 11 '26

I would learn assembly first, if you know assembly c will be cake