[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 6 KB, 295x221, matrix.gif [View same] [iqdb] [saucenao] [google]
5283777 No.5283777 [Reply] [Original]

I'm collecting as many resources as possible on computer programming with an aim to private study.
Considering C/C++. From what I understand they are difficult to get to grips with but, as both seem like very versatile programming languages I've decided it's more efficient to just go with them. I don't want to go down the line and find that I've been limited by my choice of programming language after all. I may change my mind if I'm given a compelling argument.

So what books, online resources of courses does /sci/ recommend for creating a good foundation with either of these programming languages?

>> No.5283781

C Primer Plus is an awesome resource for learning C. You can pretty much do anything you want with C, cross platform. The only reason I haven't killed myself is because I want to learn more C.

>> No.5283783

I would like to recommend, before/after learning c/c++, Python, which was built on C and is fucking great

>> No.5283818

>>5283783

I had considered it but it seems to be limited to application development, either way if you could recommend a few books on the subject that would be great.

>> No.5283823

Aside from C/C++, I recommend java. You can run it on any platform and it's forgiving of mistakes. One of its good features is garbage collection. You don't have to worry about bad pointers and memory leaks crashing your program.

>> No.5283839

>>5283823
Hahaha.

>> No.5283869

>>5283777 C/C++
These are good languages. What sets them apart from others is you aren't inside a framework someone has made for you. This means more work but more freedom. C++ is object oriented C. OOP becomes very useful when managing a large program with a team of others; you won't appreciate it much doing simple things on your own.

Your approach to learning programming is all wrong. You don't become a skilled guitarist by reading dozens of books about guitar playing, its a skill you develop by doing a lot of it. Programming is the same way. You shouldn't be saying to yourself "Fuck I don't know how to do this because I've never read a book telling me how". With enough practice you'll be able to spot bugs instinctively and quickly imagine an algorithm to solve any problem.

>> No.5283890

Honestly, it depends what you really want to do. C will give you a better grasp of general programming concepts and insight into how the computer really works, but they are hard and the code is hardly elegant.

If you're looking for some really easy to grasp, beautiful code, go with python or java. If you're looking for the hard, but ultimately more rewarding if you're in it for general computer knowledge, do C.

>> No.5283905

>>5283869

Without the books how does a guitarist learn the chords? Same basic principal here, I'm obviously going to practice but I have no previous experience with either of these languages.

While I'm at it, what exactly is the BASIC programming language for?

>> No.5283910

>>5283905
a guitarist can learn by playing by ear

you can do the same thing for a programming language. download a program run it, see how it works. make changes to the program to see how it messes it up

true basic isn't used for anything anymore, but it's a forerunner of useful languages like c and fortran

>> No.5283930

>>5283777
Learning C is excellent and will not steer you wrong. If you know C, and C is not suiting your needs, I promise you that C++ will not satisfy them. I suggest
a) some scheme dialect
b) some ML dialect
c) for god's sake at least python or java or something, not C++

But I am biased by wanting my high-level languages to actually be high-level.

>> No.5283931

>>5283910

That requires skill I doubt I have

>> No.5283937

>>5283930

Is C++ really that bad a language?

>> No.5283940

>>5283930 here
btw books:
a) The Structure and Interpretation of Computer Programs (free!); How to Design Programs (version 2e+) (free!) (uses "Racket"---diverges from core Scheme in a few important ways)
b) I dunno but I'm sure there are free books out there for haskell. SML has some good resources. O'Caml, too. All wonderful languages if you're in love with strongly typed languages.

Avoid C++ like the plague.

>> No.5283948

>>5283937
Define "a bad language." C++ satisfies some needs in some ways that no other language can. It also has a lot of costs that other languages don't. It is very, very rare that you have a project where you need a lot of speed but C will make some critical abstractions difficult. Video games and massive physical models are such applications.

If you can use C, and you can program in a high-level language, you can learn C++ later in a pinch. But be warned:

C++ Frequently Questioned Answers
http://yosefk.com/c++fqa/

>> No.5283979

>I don't want to go down the line and find that I've been limited by my choice of programming language after all.
Once you get anywhere serious with programming, you're going to be learning all sorts of languages, so it doesn't really matter that much which one you start out with. That said, C and C++ are fine choices - they are indeed extremely versatile languages which can be used for practically anything, and something every programmer should learn at some point. http://www.learncpp.com/ is a great beginner resource for C++.
You might also be interested in http://books.gentoomen.org/ .

>> No.5283980

>>5283937
There are worse languages than C++ (PHP, for example) but C++ is a deeply flawed language. It tries to be too many different things to too many people.

I'd go with C for low-level stuff, Python for clarity, Scheme/LISP/etc to understand higher-order programming, and one of the Hindley-Milder-type-system languages (SML, Haskell, Ocaml) to top it off and because none of the others have a good static type system. The last two might not be languages you use very often, but learning them will make you a better programmer in other languages.

>> No.5283997

>all this C++ hate

Look at all the trolls.
There's a reason why modern games use C++, OP.
Do learn C first, though. C++ is C with classes, so if you skip C you'll shoot yourself in the foot. Can't run before you crawl, you know.
Here you go. http://thenewboston.org/list.php?cat=16

>> No.5284001

>>5283948
>It is very, very rare that you have a project where you need a lot of speed but C will make some critical abstractions difficult.
That depends on your tolerance for needless inefficiency. I, for one, would consider most GUI programs to fall under this category.
Moreover, even without GUIs, problems requiring both abstraction power and speed are not "very, very rare" by any means. They are in fact very common if you tend to work on programs solving real problems.

>>5283980
>It tries to be too many different things to too many people.
Some (me, for example) would consider this a good thing.

>> No.5284015

>>5284001
> That depends on your tolerance for needless inefficiency.
My tolerance for this is very low. That's why I don't program in C++.

>> No.5284021

>>5283777
http://books.gentoomen.org/

Contains lots of programming ebooks. Very helpful.

>> No.5284044
File: 34 KB, 200x209, catplusplus.png [View same] [iqdb] [saucenao] [google]
5284044

>>5283997
Yeah, C++ is just C with classes! It's not like there's severe specification bloat or anything.

>> No.5284131

>>5283905
BASIC was designed as a language for training beginners. It's very wordy, they avoided a lot of symbols that confuse newbs. In the 90s it started being used to develop professional software, but today most people use Python when they want a simple to learn programming language.

>> No.5284147

>>5284131
hipster "programmers" maybe

>> No.5284148

>>5284147

I've used it with some success in the past but it is exactly as it says... Basic

>> No.5284154

>>5283890
Not OP but I tried Java and found it absolutely horrendous, not really beautiful code, I agree with Python from what I've done though. But after trying to learn Java I switched to C++ and have been liking it a lot more.

>> No.5284173

>>5284148
I was poking fun at Python, not basic.

>>5284154
What do you like about C++ that was lacking in Java? I'm interested.

>> No.5284171

>>5283777
>Considering C/C++. From what I understand they are difficult to get to grips with
They aren't. It's just s lie idiots in CS spread to make themselves feel better for not being able to learn programming....
All EE/CompE start learning programming with C++ first.

>>5283930
>java over c++
>java over anything
>java period
gtfo!

>>5283937
Absolutely not. If you think C is a good language so is C++. Nothing in C++ forces you to use the whole set of tools in it. Even the people who help design C++ only use their favorite subsets to code with.

>It tries to be too many different things to too many people.
And your point is what? Unless you're writing a C++ compiler, who cares? Forcing people to code in only one type you like and forbidding anything you don't like is a horrible design philosophy which created the abomination of java.

>> No.5284183

If you want to program effectively, learn Haskell.

If you want to write run-of-the-mill monkey code, use C/C++/Jabba.

>> No.5284180

>>5284171
> Forcing people to code in only one type you like and forbidding anything you don't like is a horrible design philosophy which created the abomination of java.
Java has design decisions. C++ has abandoned any pretense of making a good language. They have abdicated their responsibility to make a good language and instead made a huge pile of shit.

Go to any toolbox and find me a tool like C++. It won't be there. Other languages which are genuinely flexible present you with a stacked toolbox and, for free, you get a whole toolshop to make your own tools if what is supplied isn't sufficient. C++ gives you a promise that you could build a toolshop if you really wanted to. It pinky swears that it is super flexible. And if you believe that even after using it I've got a bridge in Brooklyn to sell you.

>> No.5284181

>>5284173 lacking in Java
Pointer arithmetic and being able to deallocate dynamic memory however I feel like.

>> No.5284192

>>5284181
Yes, Java does not have those "features." I'm curious why you like this, but, it doesn't really matter.

Have you used C? Because C has those "features" and is a considerably simpler language to reason about, is much easier to port, much easier to interface with other languages, and probably some other aspects that I don't give a fuck about at 12 in the morning.

>> No.5284193

>>5284173
>What do you like about C++ that was lacking in Java? I'm interested.

Not that guy but pointers, code that clearly shows that it is taking a reference or copy of its arguments, exceptions being !exceptional! and not the rule, imperative code (why the flying fuck must main be a motherfucking class when it doesn't need), I/O code that is not like having a tooth pulled, acknowledging that advance computer hardware exist.

Hell java SCAN FOR any sort of code that even tries to emulate pointers to block it before 'compiling' into its lala land machine code

>> No.5284198

>>5284193
What are you doing with pointers? And why C++ instead of C, which also has these "features"?

>> No.5284201

>>5284171
The problem with having 15 ways to do every single thing is that everybody ends up knowing a different subset. Nobody knows "C++," they know different parts of C++.

The nice thing about C is there's generally one way to do any given thing. Yes, there are some real problems (cstrings are especially bad), but C++ is the wrong solution.

If you asked me, I'd say D is a much better attempt at what C++ should have been. It's a shame it's not an open standard or I'd probably use it as my primary language.

>> No.5284208

>>5284193
>C++ error handling
>anything other than an ungodly mess
C++ error handling is one of the single worst parts of the language, and I already hate a lot about C++.

>> No.5284219

>>5284208
>want to code in java
>write lines that do it
>compile
>error need to try catch error
>error need to try catch error
>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error>error need to try catch error

>want to code in C++
>write lines that do it
>compiler
>everything works as a poc

>> No.5284225

>>5284219

poc?

>> No.5284223

>>5283869
Programming is nothing like playing a guitar, so I'd say that analogy is retarded.

>> No.5284230

OP here, it just occurred to me. Is there an irc for programmers that isn't bloated as fuck?

>> No.5284231

>/sci/
>recommending anything other than C++/C/x86/Matlab

gtfo

>> No.5284227
File: 188 KB, 800x1100, 2.jpg [View same] [iqdb] [saucenao] [google]
5284227

>> No.5284235

>>5284021
I can second this, I've downloaded a good number of books from here (god knows not all of them, that'd take too long on my connection). It's a great collection

>> No.5284236

>>5284227
Replace C++ with Haskell

Make C++ an old shitty car that breaks all the time

>> No.5284238

>>5284219
>want to code in C++
>write lines that do it
>compiler
>everything works as a poc

I lol'd hard. Then I got a little sad because someone out there is going to think you're not joking.

>> No.5284239 [DELETED] 
File: 296 KB, 749x756, 1279508891437.png [View same] [iqdb] [saucenao] [google]
5284239

>using any programming language from after your birth
FORTRAN is what you should be learning

>> No.5284242
File: 1.04 MB, 4912x3050, 1281307427003.png [View same] [iqdb] [saucenao] [google]
5284242

>using any programming language from after your birth
FORTRAN is what you should be learning

>> No.5284245
File: 991 KB, 1280x1920, langComp2.png [View same] [iqdb] [saucenao] [google]
5284245

>>5284227
Superior

>> No.5284253

>1. actually programming
...
9000. reading about programming
9001. amassing a library of resources about programming

>> No.5284258

>>5284242

bro how fucking old are you? a lot of 'newer' languages are older than you think

http://www.scriptol.com/programming/chronology.php

>> No.5284264

>>5284245
the C++ and assembly entries seem accurate but of the languages I'm familiar with, the rest aren't.

>> No.5284260

>>5284253

I take it OP is the 1 guy actually programming?

>> No.5284273

>>5284242
it doesn't show the relationship between scheme and javascript, which is an interesting little story

>> No.5284280

>>5284198
Don't get confused and think Java doesn't have pointers. Java combined pointers and variables into this hybrid where everything is technically a pointer but decided to act like a var when it wants to.

In C/C++ A pointer is a variable that holds the location of a piece of memory. You deference it to get the value at that location. You can add subtract and multiply the pointer values as you would a regular variable. For example to go to the next byte in memory you just increment the pointer.

In Java everything is a pointer which has a lot of implications when trying to move memory from one place to another. Something like a swap(a,b) function is not straightforward. However you can't do arithmetic on the pointers. If you tell java to increment one of its pointers it just increments the value it points to.

C++ makes it much easier to deal with large projects written by a team of programmers. One guy can write a generic "enemy" class with variables and functions dealing with hitpoints and spawn rates. Other programmers can make child classes like "Warewolf" and "Vampire" with specific functions for blood sucking and response to silver bullets. If you write a function in the "enemy" class for regenerating HP the "Warewolf" and "Vampire" classes will inherit it.

>> No.5284281

>>5284260
I'm a CS graduate but I work in IT because programming all day every day is boring as shit.

>>5284264
Switch Haskell and Perl, in my opinion.

>> No.5284292

>>5284280
You seem like you're implying that inheritance is unique to C++ when it's in almost every OO language.

>> No.5284296 [DELETED] 
File: 60 KB, 1200x1554, JOINT STRIKE FIGHTER AIR VEHICLE C__ CODING STVELOPMENT AND DEMONSTRATION PROGRAM - ethridgr.jpg [View same] [iqdb] [saucenao] [google]
5284296

only guide u ever need

>> No.5284300

>>5284292
I was responding to "why C++ instead of C"

>> No.5284311

>>5284280
You just described inheritance. I hope you know that's hardly an exclusive feature of C++.

>> No.5284316

>>5284300
That sounds more like an argument for OO than C, then.

Given the choice, I would use almost any other OO language over C++, including a number that I kind of hate.

>> No.5284339

Does Python compile to .exe ? I couldn't figure how to do it.

>> No.5284341

>>5284280
I know how Java works, don't worry about any confusion. You brought up pointers.

> In Java everything is a pointer which has a lot of implications when trying to move memory from one place to another.
Managing memory? What for?

> C++ makes it much easier to deal with large projects written by a team of programmers. One guy can write a generic "enemy" class with variables and functions dealing with hitpoints and spawn rates.
You know video games used to be programmed in C, right? You also know that there are a zillion OO languages that actually have useful features C++ lacks, right? Things like encapsulation and reflection, for example.

>> No.5284342

>>5284339
It can be, I believe. There's some module or something for it. Piece of shit language.

>> No.5284346

It's pretty funny how many severely uninformed opinions are flying around here. I hope no one is attempting to gather information from this.

>> No.5284354

>>5284346
Perhaps you'd like to point them out instead of being retarded?

>> No.5284352

>>5284342
Are you kidding? Python is great. Among interpreted languages, it's probably my favorite.

>> No.5284367

>>5284354
Don't hold your breath, the sagers are too hardcore. It would shatter the illusion if they had to contribute.

>> No.5284416

>>5283777
> limited by my choice of programming language after all
Do you even Church-Turing-thesis?

>> No.5284418

>>5283777
OP, you seem to have picked up on an important insight, which is that the programming language you use will almost never be up to you, and so you should learn the one that you are going to have to use. That will be determined by your employer or the available libraries 99% of the time.

So a lot of these arguments about which language is best are irrelevant to you. Depending on the field you prefer to work in, you will either use C, C++ or Java (unless you are doing web development or iphone apps), but you will probably need all 3.

I do most of my coding in C++ and a bit of python.

I would suggest starting with C, but don't be too slow to move to C++ because a lot more code is written in C++ (or related languages) than C. I prefer to learn by writing code and looking up things that I don't get, so I don't know of any useful tutorials.

>> No.5284424

>>5284245
>hurr durr I cannot into into high-level programming concepts
That's all that image tells me.

>> No.5284434

>>5284424
Computer scientists should understand generative programming (macros); lexical (and dynamic) scope; closures; continuations; higher-order functions; dynamic dispatch; subtyping; modules and functors; and monads as semantic concepts distinct from any specific syntax.

>> No.5284437

CS major here, this guy >>5283930 knows his shit.

>> No.5284439

>>5284434
Yeah they should, so?

>> No.5284447

>>5284434
>Swordmen should understand swordmanship as as general skill distinct from any sword.
Nonetheless, if you're free to choose, don't chose a plastic knife!

>> No.5284490
File: 384 KB, 1920x1200, sci-fi-planets.jpg [View same] [iqdb] [saucenao] [google]
5284490

Once you learn how to program, the language you use doesn't really matter; after all, languages are simply tools that you use to solve problems.

Some languages are better for solving some problems; other languages are better at solving others. In order for you to create your personal criteria to define which language to use given a situation, I'd recommend you start working on an extremely flexible language, while attempting to solve one same problem using different paradigms in that same language.

As such, I'd recommend you give Python a shot. Python can handle many types of programming paradigms, including object-oriented programming (which is the most used paradigm), functional programming(functions can create and return functions), lineal programming (like C), among many many others.

Once you've tried solving a few problems using different paradigms, you can start to determine which language is most suited to solve a particular problem.

And then, my friend, you'll be able to solve any problem you find, and you'll know what language to use!

>> No.5284506

>>5284418

Well it wouldn't really matter anyway, OP clearly isn't studying at uni. How many programmers do you know that don't have a degree?

>> No.5284536

>>5284506
Good point, I guess I don't really get the idea of programming as a hobby, but each to their own.

>> No.5284537

>>5283777
google gentoomen library

torrent with hundreds of books

>> No.5284549

>>5284238
i dunno man, you probably suck then.

>> No.5284551

>>5284281
implying haskell is a programming language

>> No.5284556

>>5284236
c++ doesn't break unless you tell it to.

>> No.5284583

>>5284556
What's the problem?

test.cpp: In function 'void print(const StringToStringMap&)':
test.cpp:8: error: conversion from
'std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >' to non-scalar type
'std::_Rb_tree_iterator<std::pair<const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >' requested

>> No.5284588

>>5284551
haskell is a fucking drug of abuse

>> No.5284594

>>5284583
a) you're not carrying over the reference variable
b) how am I supposed to know if you don't show the code.

>> No.5284605

>>5284583
you can't convert from a const_iterator to an iterator. If you could, for example, a class could return a const_iterator to some private data, and then the caller could convert that to an iterator and change that data. Seems pretty reasonable to me.

>> No.5284608

>>5284171
>implying you're even proficient in Java
No, you get the fuck out for starting language wars. And that's kind of funny, how you make this conjecture that if C is good, so must C++ be.

>> No.5284622

>>5284583
That your compiler sucks at displaying error codes is not the fault of the language.

>> No.5284623

>>5284608
The logic is that if C is a good language for a project, C++ will often be as good or better because it adds new features without removing any. There are of course some portability issues but afaik these are not serious when running on standard x86 hardware/os. How many being projects are being started in C instead of C++? llvm uses C++ and gcc is moving to C++.

>> No.5284626

>>5284594
typedef std::map<std::string,std::string> StringToStringMap;
void print(const StringToStringMap& dict) {
for(StringToStringMap::iterator p=dict.begin(); p!=dict.end(); ++p) {
std::cout << p->first << " -> " << p->second << std::endl;
}
}

>> No.5284625

>>5284623
should be "big projects"

>> No.5284630

>>5284622
> he thinks this is the fault of the compiler!
I lol'd pretty hard.

>> No.5284635

>>5284626
You're using an antiquated language. Switch to C++11 already.

for (auto p : dict) {
std::cout << p.first << " --> " << p.second << std::endl;
}

>> No.5284639

>>5284626
change iterator to const_iterator.

>> No.5284640

>>5284639
or what he >>5284635 said (I forgot what the auto syntax was).

>> No.5284642

>>5284635
what features does it have that weren't available in 1975?

Actually, what features is it STILL MISSING that WERE available in 1975?

If you can answer those honestly (though not necessarily completely because that's an unfair request) I might consider your opinion that C++11 is somehow not a complete piece of shit. Might.

>> No.5284643

>>5284639
Why, does std::cout mutate arguments?

>> No.5284644

>>5284642
I really care little whether you're convinced or not. Maybe you should go back to masturbating to Yosefk's FQA.

>> No.5284645

>>5284626
also this discussion is about C++'s dangerous/difficult to understand features, not your code not compiling. Dangerous features are, for example, implicit conversion.

>> No.5284650

>>5284643
No of course not, the error is the assignment
p = dict.begin() because dict is const so dict.begin() returns a const_iterator, which as I already pointed out, cannot be converted to an iterator.

>> No.5284651

>>5284644
Hahaha, oh man, I'm switching to C++11 just because of that!

spoiler: I'm not, you turd

>> No.5284660

>>5284651
No, I'm serious, man. No one will beg you to become a believer. Nobody cares. Really. So stop the attention whoring.

>> No.5284659

>>5284650
That's not enterprise. We don't fix bugs. We make templates to turn bugs into features! C++11 to the rescue, where I can write a template to take care of this non-problem for me!

template <typename Container, typename ConstIterator>
typename Container::iterator remove_constness(Container& c, ConstIterator it)
{
return c.erase(it, it);
}

Ahh, C++, will you ever cease to amaze?

>> No.5284662

>>5284660
I'm sorry, did I say C++ was an antiquated language? Or was that you? I thought it was you. That I should switch to C++11. Please refresh my memory here.

>> No.5284663

>>5284659
>non-problem
But you're right. It is not. You're the only one in this thread that thinks there exists a problem. Take that hint.

>> No.5284667

>>5284663
> search the internet to cast away const
> first result
Lemme know when you're done working on that list.

>> No.5284666

>>5284659
what the hell are you talking about? You fix the problem by respecting the constness of the input argument:

typedef std::map<std::string,std::string> StringToStringMap;
void print(const StringToStringMap& dict) {
for(StringToStringMap::const_iterator p=dict.begin(); p!=dict.end(); ++p) {
std::cout << p->first << " -> " << p->second << std::endl;
}
}

What exactly do you want out of C++? A language where const has no meaning?

>> No.5284670

>>5284666
const is actually a piece of shit type qualifier but it was a joke. I'm actually surprised that someone found a need to have to want to do this, apparently enough people that it was the top result from google.

>> No.5284675

>>5284670
>cast away const
Yes, if you look for something in Google, the answer is usually in the first results. That you think there is some deep meaning to that is only a display of your cluelessness.
You specified a structure as a const. It returns a const iterator. You wanted a mutable iterator. The interface does not allow a direct change. You can do it by hand. If you want a mutable iterator, don't set the structure to const. Why in the whole world do you think there exists a problem?

>> No.5284682

>>5284630
I thought you were complaining about the ridiculously verbose output. But it seems, like everybody here keeps saying, that you don't really understand what const means.

>> No.5284685

>>5284670
not sure what your problem with const is. The only time I've had to use const_cast (well actually this was C, but anyway) is when api's didn't declare inputs as const when I was pretty sure they were.

>> No.5284689

>>5284682
const merely says that the object can't be modified by this particular "handle" (pointer, reference, whatever template quackery you've pieced together). It definitely doesn't say that the object won't change, which is hilarious, because that'd actually be an interesting property for things to have.

what now

>> No.5284692

OP if you are okay with pirating here is an interesting link to find almost any book.
bib.tiera.ru/static

>> No.5284694

>>5284682
> I thought you were complaining about the ridiculously verbose output.
You may not be aware, but some programming languages have metaprogramming facilities which don't cause compilers to shit all over your screen like that. They even let you specify what the error was, including if you used the syntax wrong. Yes, that means that some languages allow you to even redefine the fucking syntax AND even still they don't shit all over the screen like that. 100% true.

>> No.5284697

>>5284694
Good for them, I guess? I'm not exactly proud of C++'s obfuscated templatery madness, either.

>> No.5284696

>>5284689
just like the restriction that I'm not allowed to drive a bus is meaningless, if it doesn't guarantee that the bus will remain immobile forever

>> No.5284698

>>5284696
who said const was meaningless

>> No.5284700

>>5284698
> It definitely doesn't say that the object won't change, which is hilarious, because that'd actually be an interesting property for things to have.

>> No.5284702

>>5284700
Son, sit down please. It's time we had a talk about what "meaningless" means.

>> No.5284720

>>5284698
>>5284702

why would you take a reference and make it constant, it's like an oxymoron or something.

>> No.5284725

>>5284720
I'm sorry, are you asking me why you would want objects that can't be changed in general, or are you asking me some technical question about C++ practice, or what?

>> No.5284734

>>5284725
you make a reference so you can change the original data
you make something const so the compiler catches you when you accidentally want to change it

so do you want to change it now or not. it's technically a contradicting instruction.

just sayin.

>> No.5284736

>>5284734
> you make a reference so you can change the original data
what

>> No.5284820
File: 679 KB, 500x281, 1353366375547.gif [View same] [iqdb] [saucenao] [google]
5284820

Everybody calm the fuck down, OP was not looking for a debate.

Have some pacification titties,

>> No.5284827

>>5284820
god I wish I had boobs to play with like that

>> No.5284824

>I don't want to go down the line and find that I've been limited by my choice of programming language after all.
That's not how it works. You learn a paradigm using a language, any language, and then switching to a different language that uses the same paradigm is like changing socks. The syntax change a bit but that's all you have to worry about unless you're using some deep specific language issues (protip: nobody uses those).

I learned structured programming with Python. Then OOP on Smalltalk. I learned assembly on a SPARC simulator developed by Miles Murdocca (or a colleague of his) after learning a lot about CPU circuits.

Today I code in Python, Smalltalk, C, C#, Java, AS3, x86 Assembly.
Because it's all the same fucking shit, after learning OOP going to Java from Smalltalk took like 1 day. Then going to C# some hours. Then going to AS3 1 hour. You basically read the syntax for 5 things then pull up the official docs for the basic classes and you're done. I don't even remember the syntax of the languages much, I just code with the docs open and do some ctrl+f if the ide/compiler says my syntax is wrong.

>> No.5284830

>>5283823
>Pointers
>Hard
I disagree, good sir.

But managed languages are much easier to learn on because the error messages are more helpful.

OP, if you're dead set on C or C++, I'll recommend C, and the second edition of "The C Programming Language".

>> No.5284856
File: 42 KB, 491x398, rainbow1.jpg [View same] [iqdb] [saucenao] [google]
5284856

>>5284820

Hypnotised....

>> No.5284862

>>5284820
I'm gay but... why... why can't I stop watching...

>> No.5284869

>>5284856
>>5284827

ikr?

>> No.5284870

>>5284862

Wait... Seriously?

>> No.5284871

>>5284870
What? They're pretty and bouncy and stuff.

>> No.5284874

>>5284871

hypnoboobs, even gay guys like em

>> No.5284878

this >>5284830

then "21st Century C", to set you up and running in a modern environment

"Introduction to Algorithms" by Cormen for algorithms, "Numerical Recipes in C" for computations, and congratulations, you're a programmer.

C is a wonderful choice because it's pretty much 1-to-1 mapping between the machine and the language, the library is neat and tidy, it's simple, fast and dare i say elegant. the most important thing is that you have a full grasp of the language after reading a single book, i can't say that about any other language i know.

there's a fuckton of vidya games out there written in c, and it's pretty much a standard, when implementing little sciency number crunchers (Python, R, Matlab are the others, but they're like 40 times slower)

sage, because not /sci/.

>> No.5284882

>>5284878

haven't you noticed the boobs yet?

>> No.5284888

>>5284692

There are a lot of books it doesn't have. Logic by W.Hodges for example.

>> No.5284892

>>5284341
>C++ lacks
>encapsulation
What?

The reflection part, I agree. Reflection can be a bad thing in many cases, though. When you have to put in extra work to make sure someone isn't able to figure out what method you used to simulate two streams efficiently, for example.