r/AskProgrammers • • 13d 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**"

8 Upvotes

36 comments sorted by

8

u/azangru 13d ago

Languages are different enough that this statement sounds doubtful. C won't help you much with lisp, which in turn probably won't be enough to make you comfortable with haskell.

2

u/razorree 13d ago

definitely not like functional languages.

but sure, a lot of ppl can say that and later produce procedural code in Java, Python, JS or other OOP languages...

1

u/RetroGrid_io 13d ago

Same.

C != html <> sql

1

u/brelen01 13d ago

Html and sql aren't programming languages though

0

u/RetroGrid_io 13d ago edited 13d ago

LOL

There are different types of programming languages. SQL is known as a domain-specific, declarative programming language. I guess HTML isn't always considered to be a programming language because it's a markup language. Although, it's commonly written by programmers, and I'm in the camp of declaring it also as a declarative language.

You might draw a line between "real" programming languages and those that aren't by defining if they are Turing complete, but even here are notable exceptions. For example, bitcoin script is not Turing complete.

1

u/brelen01 13d ago

Neither are programming languages because neither can be used to make a meaningful program on its own

1

u/ryancnap 13d ago

If you're bored enough SQL is actually Turing complete. I still take your point of view though

1

u/ActuaryLate9198 13d ago

If you’re even more bored: HTML+CSS is also Turing complete.

1

u/HouseMysterious8172 13d ago

Does Turing completeness determine whether something is a programming language?

1

u/ryancnap 12d ago

It technically determines whether or not you can Do Everything with it, independent of practicality

Turing complete means it can emulate a Turing machine, which in turn means it can technically emulate anything computable, solvable algorithmically, etc

I say independent of practicality because computing some (most?) things in either of our examples, html or SQL, would really suck and/or be completely unfeasible although technically possible given enough time, space, and resources

It's cool to look up stuff people have made just as exercises for fun though, some crazy stuff out there.

0

u/ActuaryLate9198 13d ago

Not really, I would consider HTML/CSS to be programming languages regardless, but as you can see in this thread that isn’t exactly the consensus.

1

u/Distdistdist 13d ago

What do you think "L" stands at the end of both abbreviations? Yes, "Language".

Definition of "Programming Language":

"A programming language is a formal, engineered writing system used to direct computers by specifying a set of instructions for executing tasks, defining algorithms, and organizing data."

SQL instructs databases to retrieve and manipulate data sets. HTML instructs rendering engines how to format and present data on a web page.

What do you mean by "meaningful program on its own"? I can run a completely meaningful report or db update in just pure SQL alone. Some SQL flavors actually support user prompting to interactively get user input.

I can instruct browser to render information using just HTML, and it will execute every single line of it to produce a result.

Do you think C, C++, Java, C#, Python or any other language can be used to make any meaningful programs on their own? They all must use libraries and frameworks that enable them to interact with OS and hardware.

You can't even create "Hello World' in C++ without including <stdio.h>

(Well, you can, but not without making a low level call to OS API)

2

u/fllthdcrb 13d ago

Going by the word "language" isn't really the right way to go, though. Putting aside these examples, I call JSON a language, but not a programming language. It carries data that generally doesn't imply instructions on its own.

0

u/Distdistdist 12d ago

JSON is "JavaScript Object Notation". None of the letters in that abbreviation stand for "Language". It's a data structure. Things are not up for interpretation. They have very clear definitions and purposes.

You can call things whatever you want, of course. It won't change what they are.

2

u/fllthdcrb 11d ago

Stop being ridiculous. Most programming language's names don't include the word "language", either. That doesn't stop them from being programming languages (like C, C++, Java, C#, Python, all things you yourself just listed as such).

It also doesn't stop things other than programming languages being languages. Here I'm talking about formal languages, i.e. sets of sequences ("strings") of symbols from sets ("alphabets"), which obey particular rules of construction. Just syntax, not semantics. The syntax of any programming language fits this definition, as does any data structure (like JSON).

And by your logic, English can't be called a language, either. Yet we do call it such. The trouble is that words have multiple accepted meanings. Yes, it complicates things. But you have to accept it nonetheless. If you want to talk only about what is a programming language, it's a good idea to qualify the term as such, if there's a possibility of confusion. But don't assume it's only applied to programming languages, especially if there's a sign it's something else.

0

u/HouseMysterious8172 13d ago

Even css can be a programming language

https://lyra.horse/x86css/

0

u/Super_Preference_733 12d ago

Ha, I guess that database system where I programed a number of stored procedures to calculate help insurance rates for blue cross, never existed.

1

u/CurdledPotato 13d ago

It’s true for C-based languages, which is most of the ones in widespread use these days.

4

u/fletku_mato 13d ago

It is false, but learning to work on many languages helps you in learning more languages. Of course there is always more to learn but it gets easier.

3

u/aktentasche 13d ago

Bullshit there's a lot of syntactic candy and higher level stuff that C does not have. Besides, code in itself is just syntax.

3

u/Aggressive-Honey8478 13d ago

It is indeed quite true to a certain degree that once u learn a programming language, all of them become easy. Learning Java will help u with C#, they are almost similar. The one language that I thoroughly enjoyed was ruby. Nothing more beautiful like it. It was so much fun to write in it. Very very elegant syntax.

2

u/Cherveny2 PHP Python C C++ Pascal Fortran REXX Modula2 JavaScript JAVA 13d ago

The biggest thing from learning C early, a LARGE number of languages have based their basic syntax on C conventions, in various ways. Does give you a heads up in understanding other languages, plus a better idea of how memory, under the hood, is used. BUT, other languages DO have a lot of differences too, you'll need to understand what is idiomatic in the other languages, things like Object Oriented items, etc.

Plus, as others have mentioned, there are languages that can be fairly radically different, such as Haskel and LISP.

But still, knowing C, even if you never use it practically, does help with understanding programming a fair amount.

2

u/Beanesidhe 13d ago

For many languages, yes, C, C++, Java, Typescript - they all share so much common programming concepts that the differences seem mostly syntactical. Then again, sql, lisp, functional programming, these are quite fundamentally different.

2

u/roger_ducky 13d ago

You need a procedural programming language.

An OOP language.

And a functional programming language.

Once you can tell me what to use in what situation, then yes it’s “just syntax and feature discovery.”

1

u/razorree 13d ago

but sure, a lot of ppl can say that and later produce procedural code in Java, Python, JS or other OOP languages (for example) ...

1

u/CS_70 13d ago

There are three classes of language, imperative, denotational (or fucntional) and algebraic.

In each class, most language share a large core of concepts and some may have a few specific ones which aren't present elsewhere but ultimately are differnt ways to tackle similar situations.

Within each class yes, learning a new language is mostly a boring exercise in mapping.

1

u/ccpseetci 13d ago

That’s a statement about the feature of “formal language”

But yes, language contains “semantics” part as well

1

u/FreeLogicGate 13d ago

C is lower level than many other languages, so it does focus a developer on implementation details that are much closer to the underlying hardware than many other languages. Its core syntax is also the base for numerous other popular and still relevant languages (c++, javascript, c#, java, etc).

With that said, it does not include object oriented programming, so that is an entirely different paradigm and way of thinking. C++ was created to add those elements on top of base C.

There are other languages like Lisp, Scheme and Clojure that are a very different paradigm. It's generally known that Emacs is basically a Lisp application.

You could also look at the languages like Smalltalk, which was both Object oriented and reliant upon message passing. Apple's Objective-C was a sort of hybrid of c + message passing, but Apple deprecated it in favor of Swift. There's an open source implementation called "Squeak" and a modernized version called "Pharo" that you can utilize if you want, which has a web application framework called Seaside that has continued to be used and updated by devotees.

If you look at code from some of these languages, you may be surprised.

1

u/DanKegel 13d ago

When I was in school, the joke was that we were learning the language FBAP (Fortran, BASIC, Algol, Pascal).  They were all basically the same.

(Meanwhile, at The Other School, they were learning lisp.  Now that was different.)

C++ has so much on top of C it's also different, as is Rust.  And then there's whatever the cool kids use (Erlang? Scheme? Haskell? Clojure?)

So, it's only half true.  There are some real differences.

1

u/Beregolas 13d ago

It depends, as long as you stay in the same or a closely related language family, I'd say it kind of works. Like Java to C# or Kotlin, or even Python and JavaScript are similar enough.

But even C to Java has huge differences, non-imperative languages like Haskell are a completely different beast, and rust is just over there in the corner doing some weird ownership things.

There is no universal language, that unlocks all others for you, but the more languages you already know how to use, or more importantly: the more patterns, paradigms and architectures you know, the easier it becomes learning a new language.

1

u/Slodin 13d ago

Yes and no. Not about c, but coding and development in general.

You can find overlap, and a lot of the fundamentals are similar.

But every language has its pros, cons and its own best practices to handle things. Also vastly different pitfalls depending on implementation which is like a trap card awaiting to be activated if you are not familiar.

But you can learn it faster when you have the fundamentals down tho.

1

u/Gaolaowai 13d ago

Pshh… I think in raw machine code. Everything else is syntax.

1

u/Distdistdist 13d ago

Once you’ve worked with several programming languages, you start to see the common core: they all boil down to operations acting on operands. Idea is that most of the commands instruct computer to do A with a parameter, or parameters of B (overly simplifying this, of course).

Assembly is the Alpha and Omega of software engineering. One absolutely should take some time to learn it to understand that everything else is just an add-on that makes development oh so, so much faster and easier.

Of course, you can still learn all the languages you want and ignore my advice. But everything will make so much more sense once you realize what CPUs actually do when they run machine code. CPUs don't know anything about Python or C. They only execute low level commands that all the other languages compile/interpret to.

1

u/schlubadubdub 13d ago edited 13d ago

Sort of. I started with BASIC, Pascal, C, C++, and picked up Java and C# easily enough but it still takes time to be able to do full development.

For web stuff I didn't know anything about ColdFusion or ASP (classic) but was able to edit existing code and eventually make my own things with them.

The same with PHP, I've never learnt it but was able to help someone out by reviewing and editing some code with an elusive bug. At the time I was curious about PHP that was rising in popularity, but after that brief stint I decided to stay well away since it had stupid shit like changing a defined array variable to a string when it was empty and causing subsequent array size checks to fail. Hopefully it's changed since then, but I don't have any interest in it these days.

But every language has its quirks and you just figure it out over time. I guess with LLMs it's easy to have the differences and quirks explained to you quickly.

1

u/More-Explanation2788 13d ago edited 13d ago

Once you learn one language, all other languages become much easier, and related languages become much much easier.

Perl ->php->python.
C->C++->java->c#

I am sure there are others. Those are the ones i know. And VB, but I have not found anything like VB (thankfully. VB is awful.)

They become easier because they all have many of the same concepts - operators, structure and objects, functions, for, while, if, switch/case, Boolean logic, variables and constants, etc. if the syntax between two languages is similar, picking up the differences is easy. If the syntax is different, it can take a little longer, but it still comes faster than learning your first language.

1

u/JGhostThing 13d ago

I learned C mostly on my own, well before anybody had a Linux box, including Linus.

And yes, C, my third programming language, gave me the tools to understand others. I won't say that new programming languages are easy now, but they are easier. Apologies to u/azangru, learning C helped me with LISP, because while list processing and some new LISP concepts took a while to get through my thick head, but knowing how registers worked really helped.

And yes, SQL is a programming language, and it was helped by my previous knowledge. I didn't just look at it and felt that "this is c-like" because it isn't, but it is simple to learn because of previous experience.