[ / / / / / / / / / / / / / ] [ dir / animu / ausneets / general / had / ita / leftpol / o / pinoy ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Name
Email
Subject
Comment *
File
Select/drop/paste files here
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 33481015d04b397⋯.png (507.22 KB, 1070x601, 1070:601, pink ree.png) (h) (u)

[–]

 No.854951>>854964 >>854990 >>855325 >>855328 >>855331 >>855407 >>855430 >>855528 >>855640 >>855669 >>856145 >>857119 >>857126 [Watch Thread][Show All Posts]

https://www.youtube.com/watch?v=TJHgp1ugKGM

WHY MOST C++ TUTORIALS ON THE WEB DONT TEACH MODERN C++

REEEEEEEEE

I'VE BEEN STRUGGLING TRYING TO FIND SDL2 TUTORIALS ON MODERN C++

LAZY FOOS IS TRASH OLDER LEGACY C++

 No.854955>>854964

Did he just spend like 40 minutes explaining that sequential data access is faster than random data access.

EVERYONE HAS KNOWN THIS FOR YEARS


 No.854956

>sepples

u deserve it tbh fam


 No.854964>>855407 >>855424

File (hide): 96431450000a53b⋯.png (27.08 KB, 407x446, 407:446, zmRKd9m.png) (h) (u)

>>854951 (OP)

>I'VE BEEN STRUGGLING TRYING TO FIND SDL2 TUTORIALS ON MODERN C++

Have you tried looking for a more general (not tied to a single library) tutorial on modern C++? If you know modern C++ by itself, I suppose you should be able to translate much of the old trash to it.

>>854955

>EVERYONE HAS KNOWN THIS FOR YEARS

I don't know man. I'm willing to bet there's more than a few CS grads out there who know nothing about cache locality and everything about how "elegant" linked data structures are.

<linked lists have O(1) insertion so they're always better than arrays when you need to insert something :^)))))))))))


 No.854975

>pic

smh fam. you're supposed to aim at the roof of your mouth (brainstem specifically), not your temples.

sage for offtopic


 No.854985>>855420

Effective Modern C++ isn't too bad. It focuses on C++ 11 and 14. It drones on a bit, but far less than some other books. The most annoying thing is it intentionally shows you how not to do things and after hours of reading, it's easy to forget they're showing the wrong way to do it.

The C++ Standard Library 2nd Edition by Nicolai Josuttis has a good section on C++ 11.

Programming with C++ 17 is another book by Josuttis, but it's not finished yet. He has a pretty good writing style.


 No.854986>>854989 >>854990

>the only language fatter than your mum

GNO

>From: Richard Stallman

>To: emacs-devel

>Subject: Re: Efforts to attract more users?

>Date: Mon, 12 Jul 2010 08:36:48 -0400

>

>C++ is a badly designed and ugly language. It would be a shame

>to use it in Emacs.


 No.854989>>855036

>>854986

Emacs Lisp is even uglier then C++ though


 No.854990

>>854951 (OP)

Go read Bjarne Stroustrup's work.

>>854986

>Richard Stallman

>"C++ is a badly designed and ugly language"

Stallman can go fuck himself.


 No.855036

>>854989

It's ugly (like all lisps) but C++ always takes the crown.


 No.855325

>>854951 (OP)

>WHY MOST C++ TUTORIALS ON THE WEB DONT TEACH MODERN C++

You open with what is clearly worded as a statement or hypothesis but your link doesn't contain any supporting evidence. Are you perhaps illiterate, or mentally retarded?


 No.855328>>855361 >>858483

File (hide): 05e3f18b1b748bb⋯.png (709.37 KB, 900x602, 450:301, dfeb84caa712f953a4ae72fffc….png) (h) (u)

>>854951 (OP)

SDL is a C library anyway, you goddamn brainlet wojakposting cuckchanner.


 No.855331

>>854951 (OP)

Check out Alex Allain's Cprogramming.com; Alternatively, check out his book, Jumping into C(++). As a previous anon mentioned, Bjarne Strostrup has an excellent collection, and it's the de-facto standard for college level courses.


 No.855361>>855367 >>855378 >>855528

>>855328

>This image

Why the fuck did they placed a light bulb into the psu?


 No.855367

>>855361

It must be one of those new age fads.


 No.855378

>>855361

gaymur lighting?


 No.855385>>855399 >>855402 >>855530 >>855536

Engineering newfag here, doing c++ this term. I can't understand what the point of the ‘using’/‘using namespace’ is. Surely if I've included something it means I want to use it no?


 No.855399

>>855385

Including and doing that are different things. Let's take a look a cout from the standard library. If it's just included you need to use it like so:

std::cout << "Example" << std::endl;

If you use the "using namespace std" you only have to do:

cout << "Example" << endl;

Problems can arise in doing that because you could have a different library with a cout function for example and it wouldn't know which one you were referring to.


 No.855402>>855564

>>855385

You can declare things in a namespace. "using namespace foo;" means that you can use things in namespace foo without specifying every time that the thing is in namespace foo. For instance:

namespace loo
{

int poo = 1;

}

//without using namespace:
int designated1 = loo::poo;
//with using namespace:
using namespace loo;
int designated2 = poo;
You're probably familiar with "using namespace std;". This is used because standard library things (like std::cout) are all in namespace std.

>Surely if I've included something it means I want to use it no?

#include "india.h" just means that you're literally copy-pasting the content of india.h into your file, so things are still inside their namespace.


 No.855407

>>854951 (OP)

>WHY MOST C++ TUTORIALS ON THE WEB DONT TEACH MODERN C++

Are you making a statement or do you not know how to formulate questions in English? Pro tip: you swap the verb and the noun (this is called an inversion) and you place a question mark at the end of the sentence.

If it was a question: I guess most people just don't know modern C++. They learned C with classes, or some slightly more modern C++, usually from someone who also only knew C with classes, and so it gets perpetuated. It doesn't help that modern C++ is fucking ugly as shit and is literally bolted onto the language.

>I'VE BEEN STRUGGLING TRYING TO FIND SDL2 TUTORIALS ON MODERN C++

SDL is a C library, and Lazyfoo is an ass for writing the tutorial in C++. Learn SDL, then learn modern C++, and then you will be able to put the two together without problems. If you want to follow the Lazyfoo tutorials just suck the crappy C++ down, you're not in for the C++ code, you are in for the SDL code.

>>854964

I didn't know that until I watched a video by Stroustrup and was also raised on "le O(1) insert". And now I am paranoid of linked lists and try avoiding them beyond what is reasonable.


 No.855420>>855427

File (hide): c6e5b0eeb028160⋯.jpg (22.95 KB, 215x176, 215:176, scott meyers.jpg) (h) (u)

>>854985

Yes. Read my book!


 No.855424

>>854964

Just use a vector fam


 No.855427


 No.855430

>>854951 (OP)

>sdl

all the cool kids use sfml


 No.855528

>>855361

It's all good as long as it's a newer CFL

>>854951 (OP)

C++ is OK if you don't veer off the reservation and try to do things that it can't understand*. You will find most tutorials tell you what you should do, but not examples of what you shouldn't do & why you shouldn't do it - which can sometimes be even more important for beginners when learning to code. The why is often more important to understand than the how, since you can deduce the how from understanding the why. (Essentially there not as much focus experience transferal)

-Why can't I do this?

No, you don't do that. Do this.

-Yes, but that seems a convoluted solution. Why can't I simply do this?

Do you want it to work or not?

-Yes, but why can't I do this and it work too?

I don't know. It just doesn't. Do you want it to work or not?

*before you sperg out "C++ does it all" telepathically tell your computer what you want to type. Did it do it? No? That's because it can't understand telepathy. C++ can be used to "do it all" solution wise, but (I was talking about coding syntax (concept interpretation) here) there are things it can't do.

unsigned int I_dont_want_a_pointer_I_will_fill_array_later [] [] [];


 No.855530

>>855385

You can sort of think of it like an abbreviation, or path setting.

When you #include it you say "I'd like to have available..x..because I'm going to use it later", but when you actually use it you need to say it's full name.


std::cout << "This would be the full name of cout if you #include the relevant header" << endl;

using namespace std;
cout << "Able to use a shorter name (abbreviation), because you've said you're using std namespace" << endl;


 No.855536

>>855385

>Surely if I've included something it means I want to use it no?

Yes, but when you use it, you must use it's full name.

I send an invite (#include) to Mr. Keith Peterson because I want him at the dinner.

When he attends I must always refer to him using his full name "Mr. Keith Peterson" to not get confused with other guests called Keith. If I have stated I'm within his circle of friends (namespace) I can call him "Keith", but there is the possible danger of getting confused with another guest.

#include - includes the code, by copying it and pasting it

namespace - includes the named scope, so you don't have to write it in full each time.


 No.855564

>>855402

Thanks anon, it's would have been great if my professor with his very dubious accent explained that properly instead of just saying "please pasta this into your code".

I already understand how headers work because I played around with C before attending uni, I just wish my prof and his niggershit textbook would actually teach something besides pajeet programming techniques.


 No.855640>>857131

>>854951 (OP)

modern c++ is not designed for performance speed, it's designed for safety, "implementation speed", an trying to be coop and hip with the in crowd (which no c++ programmer will never get)

If you're going for sdl2, you probably are going for something graphic, this does not need implementation speed but rather performance speed, you want to churn triangles at the highest speeds to your graphics card, not worry about having total reflection and runtime bounds checking and some class being uncle sister mentor bing bong to another class.

Thus, any tutorial talking about games that is actually talking about modern c++ is simply not worth it, you shouldn't be writing games on modern, but rather adopting something like orthodox c++

also watch this https://www.youtube.com/watch?v=rX0ItVEVjHc


 No.855669

File (hide): f781b13b30d5850⋯.png (75.75 KB, 231x231, 1:1, skeletal disbelief.png) (h) (u)

>>854951 (OP)

>the blogposting brazilian cuckchanner is still coming up with excuses on why he can't learn things

>now he needs tutorials for a specific version of C++ to use a C library

You're so fucking retarded. It's hilarious.


 No.856145

>>854951 (OP)

Modern C++ sucks ass, like all modern programming paradigms.


 No.857119

>>854951 (OP)

cuz everyone's busy doing javashit


 No.857126>>858480

>>854951 (OP)

stroustrup has three different books on modern c++ depending on your needs and skill level

i hear he knows a little bit about the language


 No.857131>>858448

>>855640

>Due to lag of adoption of C++ standard by compilers, OS distributions, etc. it's usually not possible to start using new useful language features immediately. General guideline is: if current year is C++year+5 then it's safe to start selectively using C++year's features. For example, if standard is C++11, and current year >= 2016 then it's probably safe. If standard required to compile your code is C++17 and year is 2016 then obviously you're practicing "Resume Driven Development" methodology. If you're doing this for open source project, then you're not creating something others can use.

the fuck is this horseshit


 No.858448

>>857131

Ah... I see, you're one of those guys that are so fucking annoying and go preaching around how everyone should code using the newest standard that comes up every week, and how new people should not be allowed to know how the underlaying metal works (so they don't know how to be faster, so, you don't have an excuse to go faster either).

I'm sorry dude. It's not fast people the ones making you slow. You're the one making yourself (and other people) slow, with poor design desitions.

You're going for untested features in all senses, you don't know how well new features are implemented, and you don't even know if those new features are all that useful in making implementation speed faster. Basically you're just using a new tool just because it's new, and not because it's the tool you need.

Zealous attachment to wathever the c++ dark council chooses to fancy on currentYear is a sign you have never programmed for speed, stay out of this conversation and stop pretending you have enough idea to be calling things horseshit, when your code is probably as sluggish as stale puke.


 No.858480

>>857126

But does he know anything about programming?


 No.858483

Why would you want to use Modern C++ with SDL OP? Assuming you're not just troleing, then use SFML and read a good book. I suggest Stroustrup or Meyers.

>>855328

>pic

every time


 No.858499>>858501

Try Rust.


 No.858501>>858561

>>858499

The choice of cock-monglers everywhere.


 No.858561>>858584

File (hide): 35f14dfe2faa89e⋯.png (283.56 KB, 640x522, 320:261, install_c.png) (h) (u)

>>858501

At least it's :

> safe

> fast

> modern

Everything that C++ isn't


 No.858584

>>858561

Modern C++ is modern though.




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
40 replies | 7 images | Page ???
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / animu / ausneets / general / had / ita / leftpol / o / pinoy ][ watchlist ]