[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: learn_c.jpg (328 KB, 1178x1696)
328 KB
328 KB JPG
Does it help and make it easier to learn C++ if you learn C first?
>>
>>106516366
Yes, it's easier. And an overall better language. Is there a reason why you want to learn C++? Want to try Unreal or some shit?
>>
>>106516386
I want to make cross platform gui apps for Windows and Linux. I hear it's pretty tedious to do with just C and that QT and C++ is my best bet.
>>
They're very close to being the same (if you take most of the STL and objects away). C++ has vectors, better string handling, and destructors. These make it much more beginner-friendly. There could be reasons you might want to use C though, but if you don't know, I'd say start with C++.
C++ is basically a superset of C anyway.
>>
>>106516366
It's better to learn C first if you want a solid understanding of the logic behind a lot of C++'s design choices and why the stl is a heaping mass of diarrhea.
>>
>>106516366
It's better to learn C# and Java before learning C and C++
>>
Learn to make Linux programs in C first and kill two birds with one stone.
>>
Are there any modern C books? Not ones written in the 1990s? Something recent within the past 8-10 years?
>>
File: dennis.jpg (117 KB, 864x1200)
117 KB
117 KB JPG
>>106516366
Python is a better way to learn basic programming, but C is the king of languages and can never be dethroned. 1000 years from now, Dennis Ritchie will be regarded as a prophet/saint/gigagenius.
>>
>>106516501
Something with a focus on Windows for starters perhaps?
>>
I never understood the concept of learning any specific programming language. You just use the language that works for what you want to do, and just learn actual programming rather than a language. Especially in the age of LLMs you can get bootstrapped really quick in pretty much any language, and once you can look past the syntax differences, you'll see there's not that much substantial difference between programming languages. Just build software that solves the problem you need to solve and that's it.
>>
>>106516531
If you don't know anything about programming, it's easy to see why someone would ask this. But yes, it really doesn't matter, all the languages are more or less the same unless the languages you compare are from a completely different paradigm.
>>
>>106516531
You are generally correct. All programming languages are just crude expressions of computation in the general sense. My philosophy here is:

- python is the best possible choice for learning because it is so frictionless and simple to get going. It teaches you in a C-like way how to think about core stuff. Loops, variables, etc. Without really any baggage at all.

- C/C++ is the language where you understand how the thing you're writing actually translate to physical hardware in a way that remains abstract enough to still be very powerful. It is the canonical sweet spot in the way nothing we experience ever is.

- assembly is a great bonus once you know C/C++. If you spend a little time with assembly, your brain dissolves C code into cpu instructions on the fly. It's some Matrix shit. You see how it all actually happens. You don't need it to be a good programmer, but it's extremely helpful.
>>
>>106516443
Erlang supports wxWidgets
Java supports Swing, JavaFX
Rust has egui and ftlk
C++ has Qt and Dear ImGui
Flutter and native webview are also valid options

C/C++ are shitty languages. using a language without GC without a very good reason to is probably a shitty idea
>>
>>106516632
> I cannot separate the concept of languages and programming in the abstract from the set of libraries that specifically interests me.
>>
>>106516725
OP asked about languages. I brought up languages that I've had experience with. a lannguage's ecosystem is an important asset to discuss, unless you think some newcoder should be writing a Swiss Table implementation in C in order to "learn"
>>
>>106516501
The language has barely changed. Beej's C Guide is pretty approachable and free.
>>
File: FatherSonHolySpirit.jpg (899 KB, 2160x3840)
899 KB
899 KB JPG
>>106516507
>>
File: 1757284865541.jpg (15 KB, 208x243)
15 KB
15 KB JPG
>>106516531
They make different trade offs to restrict what you can write or read.

For example long anonymous functions are discouraged in Matlab or python, as they're restricted to a single statement and if you want to change it to multiple statements well you have to name the function which sometimes even has to be it's own file. So I'm forced to pick a name for the 2 lines and type it out two or three times. These extra steps interrupt my mental flow state and pollute my mental namespace, but they give other people the same satisfaction I get watching a Rube Goldberg machine, which helps them to keep the momentum going.

Learning a language might be remembering all those idiosyncrasies, but it might also be the more difficult process of adjusting your expectations so you can get joy from a shitlang.
>>
>>106516756
I don't think ecosystem is relevant at all to a beginner. Core programming constructs, then data structures and algorithmic thinking are the important parts. Anything higher level than that is a distraction and an impediment to becoming a fundamentally skilled programmer.
>>
>>106516507
>>Python is a better way to learn basic programming,
you meant lisp
>>
>>106516863
OP explicitly wants to create native GUIs.
>>
>>106516366
Learn C.
Make projects with C.
Move on to C++ when you feel C is holding you back. (never)
>>
>>106516447
^This anon learned C with classes, not actual C++. C is much easier, learn it first.
>>
>>106516507
He looks like he's taking a python in the angus
>>
>>106516941
I like python lists and python dicts
what's the best way to use these in C?
>>
>>106516988
C is simpler, but the core of C++ is easier to program in. Refs vs pointers, I choose refs every time.
If you use templates and/or inheritance or other features, the language becomes harder to learn. But you don't have to use those features to get started.
>>
>>106517090
> like python lists
Build a minimal lisp/scheme compiler in C, implement a full scheme/lisp compiler in scheme/lisp and throw away the C version and de-install the c compiler.
>>
>>106516366
>popular languages were written in C
>don't learn popular languages, learn C!
>>
File: 1664638644571.png (207 KB, 396x462)
207 KB
207 KB PNG
everyone should really learn C first and start from grade school, but I can't imagine how hard it is to get a decent teacher anywhere now
I still remember my grade school teacher forcing everyone to "step through" the pain of Assembly before C
>>
>>106516366
A little bit but I don't really see a point in knowing C++ unless you have a specific goal in mind. C++ is too complicated. If you want to do desktop applications your best bet is something like Java or any of it's equivalents. You don't need to manage memory manually, there's no point to doing that.
>>
>>106516366
Pick whatever language you'll actually do a project in.
>>
>>106517278
There's zero point in doing that. You're only going to frustrate developers with memory handling problems and archaic tools. It's a lot better to start with a high level programming language like python, java, go, etc. Your suggestion reminds me of the retards in Java IRC telling it was a brilliant idea to start programming in the terminal with nano or vim, instead of an IDE. Great idea if you want people to give up immediately.
>>
You can learn pretty much all of C in a day, so why not? C++ is not a superset of C but it is a superset of C with some trivial changes you don't really need to worry about
>>
>>106517278
>grade school
Are you a Chinese national?
>>
>>106516443
I'm going to be real, that is going to be extremely difficult not just because of the complexity of making a GUI but also bindings in other programming languages. I don't know why you want to do that but there are several existing options already. Honestly I don't see the point unless you have a much better idea than everyone else.
>>
>>106516443
Nvm I misread your comment. Don't do it in C++ and Qt. You're only going to suffer for no reason. Use Java, Kotlin or Scala and JavaFX. That is the most robust and less painful option you have right now.
>>
File: YaUpRcrJKTg.jpg (100 KB, 720x540)
100 KB
100 KB JPG
>>106517330
>Great idea if you want people to give up immediately.
admittedly, I think only a handful of people (like 4-5) in that class even finished the "final exam" of reversing a linked struct list
but it was the early exposure to code and syntax that was invaluable

>>106517405
teach probably was
he looked like this
>>
>>106517453
>Use Java
If I remember correctly, Java was invented specifically to solve these kind of problems.
>not a programmer but played around with code
I really don't understand why java is getting so much hate and why python is so appreciated, look at me, I'm genius, I add spaces instead of semicolons
>>
>>106516443
Use Python or some WebView shit.
>>
>>106517535
>these kind of problems
and actually, to take half back the things I said, nowadays everything is web based. you open a browser and bang! you have everything there... you don't even need to install anything.
I think it's called SaaS, Software as a Service
>>
>>106517330
so the average person is smart enough to grasp the fundamentals of programming with python, but not smart enough to grasp the additional low-level concepts that C requires? what an arbitrary boundary. this cancerous mindset is exactly why we have so many javascript kiddies who have no idea how computers actually work.
>archaic tools
something tells me you're one of them.
>>
>>106517573
C is shit because there aren't even namespaces. Java is shit because no null safety. Python is shit because necessary whitespace fucks REPL use. Common Lisp is shit because no cryptographically signed packages and few built-in data structures. Erlang is shit because :gb_trees` and `:gb_sets` require structure balancing prior to tests for equality. Haskell is shit because persistent data structures bloat in size when serialized without structural sharing information. Go is shit because no sets are built in. Rust is shit because unchecked arithmetic overflow (in prod), borrow checker limitations, and the orphan rule. Clojure is shit because of inability to use sorted-set and hash-set with same content as a map key, bug in multiple-arity protocol implementation shorthand syntax, and non "stickiness" of numeric types across arithmetical expressions. C# is shit because Microsoft is shit. Lua is shit because 1-based indexing.
they're all fucking shit.
>>
>>106516443
Real talk: Make a WebApp lmao.
Learn JS. I'm not even kidding. That is the least painful way of making a cross platform GUI """""app"""""
>>
>>106516509
C isn't well supported on windows. Use c++
>>
>>106516443
You should use Javascript instead if possible. Unironically.
>>
File: 1732797739615902.jpg (166 KB, 505x323)
166 KB
166 KB JPG
They are two different languages with two different programming styles. Learning C to learn C++ is like learning Latin to learn Italian. When you start with C and move to C++, you'll have to unlearn a lot of C-isms that are considered bad form in C++, so it's not even helpful to learn the former to better learn the latter. Going the other way around however is a matter of not using C++'s features.
>>
>>106516632
>C/C++ are shitty languages
C++ is up to debate because nowadays it's just a blob of different languages tied together around C with classes.

C is objectively the best language because it's quite literally how computers work but in a easy human readable format. It's border line Assembly.
>>
>>106516366
Everything is written to assembly... yet people still doubt the necessity of learning assembly!
>>
>>106518149
you have zero idea what things you are missing out on by forcing yourself to use C because you think it's cool or some shit
this is because you are inexperienced
>>
>>106518268
i wish i had typesafe hash tables that don’t rely on hacky macros shitting up my error messages. beyond that i don’t really care. most modern language features are just conveniences and niceties that don’t actually matter all that much
>>
>>106518149
>>106518268
> inexperienced
And wrong. I work in kernel dev, its actually wild how often you have to inline assembly because C doesn't even support things that Rust does. If GCC didn't have a ton of builtin features, C would be unworkable in low level programming.
>>
>>106518353
what about the backslashes? might as well use fucking Jinja as a preprocessor or some retarded shit like that
why not Rust? I just don't fucking get it
why write your own hash table? I have a hash table that outperforms Swiss Table when using certain types of keys, but I don't even use it.
writing in a compiled language is an annoying activity in 95% of projects anyway. give me a REPL so that I can experiment with shit live and trivially debug stuff.
>>
>>106518398
>what about the backslashes?
who cares?

>why not Rust? I just don't fucking get it
why write your own hash table? I have a hash table that outperforms Swiss Table when using certain types of keys, but I don't even use it.
because once ive written it its mine forever and i want to write things that will still compile on as many platforms as humanly possible long after im dead
>>
>>106516572
>python is the best possible choice for learning because it is so frictionless

let's see

- expressions versus statements

- some things are immutable, others are mutable

- some essential things are done through built in functions (like len()) while other essential things are member methods of an object

No sir, python is full of inconsistency and friction.
>>
>>106516572
>C/C++ is the language

They're two separate languages you kid. Moreover C++ can be considered as at least 3 programming languages today.


>>106516632
>C/C++ are shitty languages. using a language without GC without a very good reason to is probably a shitty idea

Based.
>>
>>106516507
>Python is a better way to learn basic programming

No, it sucks for that. Squeak or any Smalltalk would be far better. Or, a simple lisp like Scheme.
>>
>>106516366
>Does it help and make it easier to learn C++ if you learn C first?

Who was the retard who posted that image?

Rust is written in Rust
most Lisp implementations are written in Lisp
Fortran impls are written in Fortran
Pascal impls are written in Pascal
OCaml impls are written in OCaml
Haskell impls are written in Haskell

Every time you have a decent. not shitty, not toy, language, the implementations end up being written in that language, not C.
>>
If C is so good, how come there is no D?



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.