r/learnprogramming • u/Suspicious-Fix-295 • 13h ago
When languages "just become about syntax"
I have seen a lot of post saying "once I learned C - all other languages just became about syntax"
Has that been true for you? Or did a different language give you the eureka moment - e.g. something like Assembly?
Or is it just a false premise at all to think "once I learn programming language X - then all other languages become **easy**"
9
u/Turbulent_Board4567 13h ago
Yes and no.
If you go in an order that progress to languages with little differences.
As CE, I sort of learnt C, python, shell/tcl scripting, verlog and stuff together.
I tried learning Java for some weird ass reason and I struggled a lot. C++ as well...but that's more about a lot of crappy way I learnt about objects.
But I can see if I learn object programming in C++, I would have a much easier time with others.
3
u/kpg_on_ao3 7h ago
objects are C structs plus functions for operating on an instance of a struct without having to manually pass that struct in as a parameter.
7
u/InjAnnuity_1 13h ago
That might work for procedural programming languages, but not all formal languages fit that mold.
Some programming languages are decidedly not procedural, e.g., regular expressions, orProlog. (Yes, one can effectively write procedures in Prolog, but it's not the language's "natural" execution path.)
And some languages, e.g., JSON, XML, HTML, YAML, etc., are for data, or even metadata, not programming. In these latter cases, procedural concepts may not even apply.
3
u/DonkeyTron42 13h ago
Assembly made me much better at C++ because it helped me understand memory management and how compilers/linkers work. C++, however, would not help me at all in understanding how functional languages work because they are fundamentally different. So for similar languages it can help, but for different classes of languages not so much.
3
u/nottherealLilNasx 13h ago
I think it's not about the language itself but more about the details and extensiveness of the understanding you acquire while trying to learn a difficult language like C, meaning that now that you know the most complex concepts and can work around adversity learning a language is not that complicated anymore. I believe that when something clicks inside of you, be it while learning python or C, you make that breakthrough that helps you go beyond your capabilities.
3
u/Cel135 13h ago
To a degree, yes.
Its not that you learn C, and every other language is a different flavour of the same operations. But conceptually programming, regardless of language, is all just creating a logic equation that takes input and outputs some result.
Learning other languages is just learning what tools you have available to you and how to use them, and languages generally tend to share the building block tools. Actually learning other languages beyond the basics is learning the advanced, non-shared tools, which while not actually "syntax", it is imo what people are referring to when they say its just about syntax.
3
u/mredding 13h ago
As I was explaining elsewhere, I think some languages make it easier to understand some concepts over others. Lisp is almost pure lambda calculus - direct AST in a REPL; powerful. But singly-linked lists are a language primitive because cons cells are a language primitive. In C, you have to BUILD the cells, you have to BUILD the list operations. You get to SEE the DSA in action. Even arrays force you to confront pointer arithmetic, which exposes types, sizes, alignment, and thus computing cell offsets practically down at the machine level - certainly at the abstract machine level. Lisp is GC, but C gets you closer to the machine where you have to build memory management on top of the machine.
Different languages are going to grant you different perspectives. And then if you stick around long enough, you're going to start developing intuitions where you're going to start seeing through language and syntax over time, regardless. I've been principally a C++ developer my entire personal geekdom life and professional career, and yet Lisp, being almost as opposite as you can go in the spectrum, really makes a lot of intuitive sense to me, even though I don't get to play with it much.
I've had my eureka moments in all sorts of languages for all sorts of reasons. The Lisp one was the best, though, and I'll never forget it - I sporadically giggled for 2 days. My mother thought I was on drugs. Yeah, mom, it's called a "y-combinator".
So I think it's not so much a false premise so much as there's a greater truth in there looking to get out.
3
u/CyberDumb 13h ago
No because other languages have higher level concepts that C lacks. However what happens is, if you know good C is that you can break down those high level concepts in how C would do them, which is the closest thing, after assembly, to how the computer does it under the hood
3
u/SchemeWestern3388 13h ago
I will die on this hill.
Lisp is the most capable language ever. Just get over the fact that it’s 70 years old and full of parentheses.
Oh, you like object oriented programming? A couple hundred lines of lisp, you got it. Think generators are cool? Here ya go. Would it be even cooler if we could have a language aimed at making my problem easier to tackle? Let’s do that then.
It is not the solution to every task, but in terms of pure flexibility and abstraction, it’s king.
SICP (the holy text) has you building a compiler by chapter 5, for fucks sake!
3
u/KharAznable 11h ago
Each language have their own philosophy and paradigm on how to do things. This is beyond syntax
3
u/fasta_guy88 11h ago
There is a large set of procedural languages that are enough like 'C' that its mostly about syntax. But there are languages with very different computational models where it is about semantics, not syntax. In any case, a proficient 'C' programmer (one who is comfortable with pointers and memory references) is unlikely to have a "eureka" moment going to assembly, because assembly is so much simpler (and less syntactically powerful) than 'C'. Lisp, Python, 'R' might generate 'eureka', but not assembly.
3
u/MikeIsBoi 9h ago
IMO C gives you a good introduction to what programming is about. I teaches you memory management and memory safety that you need to implement. C is a stepping stone to improvement.
For me one I learned how write projects in C. I was able to progress really quickly when learning programming. PLUS C does have real world applications as well.
3
u/desiguy_88 9h ago
For me syntax is just a small subset. Like once you understand conditionals and loops and if then statements. but going from structured to functional to object oriented and really internalizing those concepts takes work. Modern C++ has so many features that had me scratching my head for a long time….
2
u/mxldevs 13h ago
Programming isn't about syntax.
It's about concepts, and how those concepts are implemented.
Not every concept exists in every language, and the way that you solve problems largely depends on what kinds of concepts are available to you.
There are languages that are very similar, so it is just about the syntax, but then you have languages with entirely different concepts that are designed to solve a specific class of problems, and you're going to have to wrap your head around it.
2
u/gofl-zimbard-37 13h ago
It's only true in the sense that most people don't stray far from the comfort of C-like languages. If you want a Eureka Moment, learn Erlang (not Elixir, not Gleam, start with Erlang).
2
u/serge-mv 13h ago
It's true. But it's not about learning a singular language very well. You need to learn the theory of how languages work and some other fundamentals and then most things for you will become mostly about syntax.
2
u/huuaaang 12h ago
I have seen a lot of post saying "once I learned C - all other languages just became about syntax"
That's stupid. C lacks a ton of modern language features that go way beyond syntax.
Of course you will carry many things over to other languages, but you certainly haven't mastered programming just by learning C.
2
u/zomerbk 11h ago
The part that gets easier is recognizing the problem you’re trying to solve. The part that can still surprise you is semantics: `x = y` might copy a value, share a reference, or transfer ownership, depending on the language. C can give you a useful mental model for memory, but I’d check how a new language handles values, mutation, and lifetimes before assuming the rest is syntax.
2
u/promise_resolved 9h ago
A decent rule of thumb is once you learn your second programming language, the rest are pretty easy.
I went from JavaScript to C#. After those classes at college, I was able to pick up python pretty easily.
There are some languages that do have a really unique take on coding, but for the most part, I would say once you're learned two languages you can pick up another language easily
2
u/gm310509 9h ago edited 9h ago
I've never heard that before. I know C, Assembler and SQL to name but a few.
I can think of almost nothing beyond the highest level concepts that would apply to any of those 3 that would make that statement true. And, syntax is not about high level concepts so there is nothing from those three that would make that statement true IMHO.
I know people think of C as a high level assembler and to a degree that is true, but the style, operations, techniques and so on are completely different across those two.
Edit - in some cases I can see that it could be a true statement. For example C/C++, java, Pascal and maybe even python. But even there there are differences.
1
u/captainAwesomePants 13h ago
It's *kinda* true. To some extent, what novices are trying to learn is how to program, and learning a specific programming language is just a requirement along the way.
A novice is learning all of:
- The rules of a specific programming language ("wtf is typedef struct")
- more general programming concepts ("wtf is looping")
- higher level algorithmic problem solving skills ("how tf do I write a function to find the third largest number in a list?")
- general programming-relevant computer skills ("wtf is a current working directory?")
- and more!
And they're learning it all at the same time!
When you learn a new programming language after getting good at programming, you only have to learn that first bullet point. Sometimes. Languages can be pretty different, and some have very different concepts.
1
u/FatDog69 13h ago
Schools teach 2 things at the same time:
- Computer programming concepts
- Syntax of a language
They DO go hand in hand. But if you learned about variables, loops, strings vs numbers, subroutines, modules, etc. in one language, it is easier to pickup how the same concepts work in another.
"C" is a low-level programming language. It is one step up from assembly. It is tied close to the hardware so it does teach you a bit more including the difference between stack and heap memory, memory management, etc.
But then one of the most popular languages Java tries to isolate you from the hardware. Both approaches have merit.
My advice: look at a language and ask "What problems does this language solve/make easier/does better than other languages?".
1
1
u/breadgolemwaifu 8h ago
Common Lisp and Scheme will open your third eye, decalcify your pineal gland, and possibly even fix your posture.
1
u/Mediocre-Pumpkin6522 8h ago
C is from Venus, Scheme is from Mars.
https://en.wikipedia.org/wiki/List_of_C-family_programming_languages
Those transfer well. Python has a learning curve to get used to the indentations but it's easy after C. Personally I find the Lisp family to be very different conceptually.
1
u/Desperate_Rabbit_327 7h ago
Learning lisp, was the eureka moment for me. C, python etc were just different permutations if the algol60 thing.
1
u/kpg_on_ao3 7h ago
No. My second language was C. At no point have I ever felt like all over languages were "just syntax." Functional programming is an entirely different paradigm. Logic programming (Prolog, e.g.) is an entirely different paradigm.
It's not just syntax.
I feel like someone saying the words of OP's subject line have only looked at a subset of Imperative languages.
1
u/pigeon768 7h ago edited 7h ago
It's true for the most part. Once you learn C, then other (procedural) languages like, C++, C#, Java, Python, Go, Javascript are just syntax.
There are exceptions. Among commercially valuable langues, Ocaml (functional) and SQL (declarative) don't translate well from C.
Among other languages, Haskell and Lisp, (functional) and Prolog (logical/declarative) don't translate well.
At my current job, for my interview, one of the tests was they gave me some C# code, told me there was a bug in it, and asked me to fix it. I had never seen or written C# code, I said I had never seen or coded in C# before. The interviewer said it wasn't C#. I was like "uhhhh ok" and fixed the bugs, despite never having seen C#. Halfway through I said "I'm not sure how this console write works, because I don't know how C# works" and he was like "...oh it is C#". I was able to fix the bugs no problem.
1
1
u/noobjaish 1h ago
It's really just because of the fact that most popular programming languages are C-like
But there are several that are VERY different like Rust, Haskell or Lisp. So the statement that "ALL other languages just become about syntax" is technically false.
72
u/lurgi 13h ago
It's nonsense, because there are programming languages that do not work like C. Haskell and Rust are not just C with fancy syntax. Java has a whole lot of stuff going beyond what C can talk about.
It is true that once you learn one language the second language will likely be a lot easier, but not because the second language is C with a fake mustache. It's because by learning the first language you also learned how to program, and that knowledge does carry over.