[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

First year university student. Recommend me good c++ beginner

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 61
Thread images: 4

File: unnamed.png (23KB, 300x300px) Image search: [Google]
unnamed.png
23KB, 300x300px
First year university student. Recommend me good c++ beginner tutorials. As beginner as possible.
>>
>>59668620

Just go straight to graph theory
>>
programming and principles using c++
>>
>>59668653
Is this actually useful?
>>
>>59668672
Looks decent thanks
>>
Extremely useful, you'll learn about it in algorithms class.
>>
>>59668620
Effective C++
>>
>>59668731
Okay, good to know
>>
File: g-side.png (260KB, 498x1480px) Image search: [Google]
g-side.png
260KB, 498x1480px
>>
>>59668620
http:/www.learncpp.com
>>
>>59669249
>typo
fug D: D: D:
well fix the link yourself.
>>
>>59668693
so young, so naive
>>
>>59668620
Truth be told, you won't learn anything from "tutorials". What you really need is a desire to learn, or a potential application. From there, you'll seek out the information you need on your own. Find something you want to learn C++ for. It'll be more powerful than any half baked Indian tutorial.
>>
>>59669293
Can you give some kind of hint of what the graph theory actually teaches you?
>>
>>59669397
Graphs are an extremely general structure that can be used to model just about any discrete structure in one way or another. Once you get a grasp of graphs and graph algorithms you will see graphs in everything, and the algorithms will provide a general approach to solve these problems. One beautiful thing is that many discrete problems can be transformed to graph problems, solved then the solution can be transformed back to its original domain.
>>
>>59669521
Hope you never find Category theory.
>>
>>59669606
I'm well acquainted with category theory. You probably understand neither.
>>
>>59668708
I second it. Great book. Don't get the epub version, it sucks. You can get a high quality PDF from libgen, tho. Use ISBN from https://www.amazon.com/dp/0321992784/
>>
I'm trying to learn Python, but I'm having trouble finding projects I can help out in. Is there a way to find simple projects, or anything beginner-level on github? Help me out on this, /g/
>>
>>59668620
>C++ Primer
>C++ Programming Language.
>Scott Meyers Effective C++
Follow the sequence.
This is hard way and the best way. Do problems. You should be reading for 1 hours and coding for 45 mins in a span of 2 hours.
15 minutes rest.
Start over.
I did this way and my C++ skills are better than any fagget posting in this board.
>>
>>59669934
I used to read that book went torugh first 2 chapters was really good, but then I lost the documents and I can't find the proper version again - it was a clean document the 2nd edition the latest I think 2014 - do you happen to have it and can share?
>>
>>59669935

What do you want to program?
>>
First year uni student like OP. We learn Java and a touch of Python and I'm happy with both of those.
How should I broaden my horizons? I'm thinking C++ or C#.
>>
>>59670915
>my C++ skills are better than any fagget posting in this board
People with real C++ skills don't use C++.
>>
>>59671746
that's the thing, I have no idea. Maybe some scrapers or anything web-related?
>>
>>59668620

I liked "Accelerated C++" by Koenig & Moo. Not sure if it was updated for C++14. Although you're only going to scratch the surface of a language as big as C++ in undergrad.

For the record, I don't think C++ is a great language, but it's probably the best we have.
>>
http://www.learncpp.com/ is decent but not perfect, OP.
>>
>>59672329
Lisp.
>>
>>59668620
https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
>>
Take a C++ course and just do the assignments. Your objective starting out is going to be to learn the proper process and then start implementing mathematical operations into programs. Once you have the fundamentals down, set aside a day to learn pointers and address.
>>
>>59668620
fuck tutorials, read a good book
>>
>>59674457
I have the C++ Primer and it's pretty good, but I suggest to first know C to better understand everything. C should be the first programming language for everyone serious enough to learn how to program well.
>>
>>59671797
In my first year of uni we did C the first semester and Java the second semester. In my opinion, once you learn how to use these two well enough you can pretty much learn almost any programming language.
>>
My friend has been trying to help me learn. Is his advice good?
In this example we're just writing a simple Animal class.

https://pastebin.com/qX89s2fV
>>
>>59675605
>defining you methods inside your class declaration
you triggered my autism
>>
>>59675605
I should specify he wrote the code. He wrote that after looking at what I had written.

#define ONE 1

#include <cstdio>
#include <string>

class Animal {
char * _name;
public:
Animal(char * name = "A string") : _name(name){}
char * getName() const { return _name; };
char * setName( char * name) { _name = name};
};


I don't know how char * works
>>59675699
help me help you
>>
>>59675798
>>59675605

Your friend should stick to C. Do not follow his advice.
>>
>>59675798
In C++ you want to declare your function prototype in the header file and define it in the implementation file. Look up runtime vs compile time
>>
>>59675977
What makes you say that? He's building what I can only describe as his own multi-purpose engine. He's written quite a bit but due to my unfamiliarity with c++ I can't really critique what he's done.
>>
File: 1411230430643.png (158KB, 304x536px) Image search: [Google]
1411230430643.png
158KB, 304x536px
>>59675605
this is plain satire op is trolling.

>i could've done this->Name[index] however this creates less proficient assembly

>by doing *(this->Name+index) instead we end up creating more readily cache friendly code.
>>
>>59669731
Opinion: Category theory is just for mental masturbation/math autism, useless for programming and CS.
>b-but muh nads are based on it.
>>
>>59675798
Your class would be perfectly fine if you would have used std::string instead of char*.

Your friend on the other hand is the archetypical newbie C/C++ programmer who tries to outsmart the compiler by writing """"cache friendly"""" code which generates """"""fast assembly"""""". Stay away from his kind and learn from books and video lectures from respected authors.
>>
I started a job that advertise a C++ developer. Ended up going onto a team that did both Java and C++ for SL and BL work. Now I do mainly Java (which I originally hated), and hardly any C++ (which i originally loved). I'm not awesome with Java, Spring Hibernate etc, and completely dog shit with C++. It's so easy to go from C++ to Java, but to go from Java to C++ after being away from it for months. It really does fuck you off as you completely forget how shit is done.
>>
>>59677086
now awesome with Java *
>>
>>59676951
I was going to use std::string but he recommended using char * because
>if you're going to use c++, c-strings are a waiste of time because of the amount of effort involved in using them
>also 99% of the time, you will make a mistake, you will use the underlying char * inadequately, and you will write cache-unfriendly code.
c++ allows you to use close to hardware managed objects.
you would be better off implementing your own string class if you want to learn

He also added
>the std::string class is approximately 24 bytes (most implementations are very similiar), a char * is 8 bytes. Which means you're paying a penalty of 16 bytes to have another class manage the underlying char * and it provides all of the functionality you need for your applications (or most of them) and generally working at acceptable speeds.

I've been learning through lynda.com with Bill Weinman (provided free thru uni)
>>
trying to learn C++ after C here. C++ seems very large compared to C and there seems to be 10 ways of doing one thing. how long does it take to get comfy in C++?
>>
>>59677332
I've been doing C++ on and off for 2 years.... i still don't know the basic shit.. But i work on a solution with more than 6 million lines of code so, it's not exactly gonna be easy for someone to learn C++ on that

However within the first year I found myself very capable... I wil stress though, alot of guys will learn C++ and read Stack overflow articles on what methods are best for doing certain things... but I cannot stress enough, learn design patterns and trust me, you will set yourself above the rest....
>>
>>59677395
thanks
what design patterns book is the best?
i have Head First Design Patterns and Elements Of Reusable Object-Oriented Software but didn't read those yet
>>
>>59677486
Honestly, a good resource is sourcemaking

https://sourcemaking.com/design_patterns

They also sections on anti-patterns and refactoring...
>>
>>59675605
stay away from your friend
>>
File: SumatraPDF_2017-04-01_00-38-48.png (400KB, 1444x1257px) Image search: [Google]
SumatraPDF_2017-04-01_00-38-48.png
400KB, 1444x1257px
takes a true master to code with style
>>
>>59668693
arguably more than combinatorics.
>>
class M {
std::size_t C;
std::vector<int> data;
public:
M(std::size_t R, std::size_t C) : C(C), data(R*C) {} // constructor definition
int operator()(size_t r, size_t c) const { // member function definition
return data[r*C+c];
}
int& operator()(size_t r, size_t c) { // another member function definition
return data[r*C+c];
}
};

does it look this ugly in real world too?
>>
>>59676557
This does seem ridiculous. Can anyone confirm?
>>
>>59668620
>http://codeforces.com/problemset?order=BY_SOLVED_DESC

Start from top, click on the problem in the column "Name" to view it, try to solve it, if you get stuck check the corresponding "Solved" column to see submitted working code.

If you want to upload and have the site test and rate your solution you need to make an account, stuff is submitted on the same page the problem description is on.
>>
I started with cplusplus.com
http://www.cplusplus.com/doc/tutorial/
>>
>>59678749
I'm not kidding.
>>59677229
>>
>>59668620
>coming to /g/ for programming advice
my advice is to get out of here or kill yourself
>>
>>59670915
>my C++ skills are better than any fagget posting in this board.

I doubt it.
>>
>>59668620
Practical Common Lisp
>>
>>59669521
As elegant as it sounds most graph solutions are NP though. I'm currently trying to deal with something related to graph coloring and is considering set theory instead
Thread posts: 61
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.