learning c/c++
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: learning c/c++
Are you sure that was written by a human and not a computer program?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
- Kazinsal
- Member
- Posts: 559
- Joined: Wed Jul 13, 2011 7:38 pm
- Libera.chat IRC: Kazinsal
- Location: Vancouver
- Contact:
Re: learning c/c++
Not at all, but it's still a Malbolge program!
Re: learning c/c++
Nope, you're right.Blacklight wrote:On the grounds that he has clearly never worked with Befunge or Malbolge.Love4Boobies wrote:On what grounds do you make this claim?BMW wrote:No programming language is really useless, it just depends what you use it for.
However I still don't think they are useless - they have some amusement value.
Currently developing Lithium OS (LiOS).
Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
Re: learning c/c++
By that token, zits/pimples al over someone's face in middle school are useful because they give bullies a reason to make fun of the person. Are they actually useful? I think not.BMW wrote:However I still don't think they are useless - they have some amusement value.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
If you're new, check this out.
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: learning c/c++
Since this has already gone really far off track, I might as well have some fun.
Languages like Brainf*ck, Malbolge and other esoteric languages are designed to be difficult, strange or just plain funny. Either for entertainment value or as an experiment on how close to white noise you can get (or in some cases, how code can be a nice picture - See Piet). They all serve a purpose, even if that purpose is quite trivial.
Languages like Brainf*ck, Malbolge and other esoteric languages are designed to be difficult, strange or just plain funny. Either for entertainment value or as an experiment on how close to white noise you can get (or in some cases, how code can be a nice picture - See Piet). They all serve a purpose, even if that purpose is quite trivial.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: learning c/c++
You really don't need to unlearn anything - I had multiple language switching events, from Visual Basic to C# to Java later to C and Objective-C (I still hate C++) there is not much issue. Actually the object-oriented background of mine helped me to build OS GDT and IDT in an object-oriented way - I treated GDT and IDT as vectors of objects of type gdt_s and idt_s and I even manipulate them with "instance methods" like gdt_addItem(gdt_s). Check out the books on object-oriented programming in C and you will find migrating what you have learned in C#/Java to C easy.Griwes wrote:If you know C# and Java and want to write something in proper C++, unlearn everything you've learned. Same holds for C.
C and C++, when used without standard libraries, are pretty similar. The main differences are:
1) You have real constructors and destructors, so RAII is possible.
2) You have templates (never underestimate a compile time Turing-complete language!).
3) You have easy to use polymorphism.
4) You have namespaces.
5) You have overloads.
So, basically, to write a *kernel* in C++ (as opposed to writing it in C), you'd have to learn at least those things *and* C. Of course, knowing more things in detail can be really helpful, so I would advise also writing some userspace applications in modern C++; also, there should be some serious style differences between code written in C and in C++.
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: learning c/c++
You totally missed my point; to write modern C++, you cannot write Java or C# in it, which you will do without unlearning them.
But you weren't talking about C++, since you hate C++, and you even explicitly said "migrating to C" later on, so your post brings nothing into the discussion - or at least is totally unrelated to my post you quoted.
But you weren't talking about C++, since you hate C++, and you even explicitly said "migrating to C" later on, so your post brings nothing into the discussion - or at least is totally unrelated to my post you quoted.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations