Message from @picnicnapkin

Discord ID: 463082336162938898


2018-06-30 20:29:49 UTC  

Lithuania has high suicide rates

2018-06-30 20:30:00 UTC  

I've thought about it, decided it'd be too much hassle ;D

2018-06-30 20:30:24 UTC  

Play basketball instead

2018-06-30 20:31:20 UTC  

Stereotypes are fun.

2018-07-01 19:49:08 UTC  

```cpp

#include <iostream>


int main()
{
std::ios::sync_with_stdio(false);
std::cout<<"a\n";
std::printf("b\n");
std::cout << "c\n";

return 0;
}
```
@meratrix what do you expect the output to be?

2018-07-01 19:50:09 UTC  

```cpp
std::ios::sync_with_stdio(false);
```

2018-07-01 19:50:16 UTC  

wut dis do?

2018-07-01 19:50:35 UTC  

compile and find out 😉

2018-07-01 19:50:48 UTC  

Nah nigga

2018-07-01 19:51:26 UTC  

it's some cool shit

2018-07-01 19:54:01 UTC  

b

a

c

2018-07-01 19:54:19 UTC  

Okay, I'm assuming that first line does some fuckery.

2018-07-01 20:18:43 UTC  

Wait, why are you doing ios related programming

2018-07-01 20:18:45 UTC  

Blech

2018-07-01 20:19:48 UTC  

Also i hate when people dont use “Using namespace std;” and just type std: a bagillion times

2018-07-01 20:20:52 UTC  

You shouldn't use namepsace std; in actual software.

2018-07-01 20:21:08 UTC  

@DanielKO I you wanna explain it.

2018-07-01 20:36:14 UTC  

do you suggest `using std::cout;` or something?

2018-07-01 20:39:43 UTC  

`Using namespace std;` is bad for actual software, generaly fine for small side projects, because if you're using libraries and they happen to have them named the same, say they both have their own `String`, then it's going to cause issues when you `Using namespace String`.

2018-07-01 20:43:08 UTC  

polluting namespace is bad mmkay

2018-07-01 20:43:52 UTC  

clang-tidy/format are great

2018-07-01 23:55:25 UTC  

That method, `std::ios_base::sync_with_stdio()`, controls whether the standard stream objects `cin`, `cout`, `cerr`, `clog`, `wcin`, `wcout`, `wcerr`, `wclog` are synchronized with `stdin`, `stdout`, `stderr`.

2018-07-01 23:56:25 UTC  

If you turn synchronization off, you might get better performance in `cin`, `cout`, etc.

2018-07-02 00:00:44 UTC  

If you're just using the standard library, don't worry about `using namespace std;`.

2018-07-02 00:02:51 UTC  

But, if you're teaching someone C++, you don't want them to learn bad habits.

2018-07-02 00:03:56 UTC  

So yes, `using std::cout;` is a more controlled way to do it.

2018-07-02 00:57:59 UTC  

I agree, when I was taught c++, we were told to have ```Using namespace std;``` and it took me a while to get out of the habit of it later

2018-07-02 01:05:36 UTC  

I say, never overlook possible excuses for a programmer to copy-paste shit. If it gets too verbose, you can be a good fraction of programmers just copy-pastes shit to avoid typing.

2018-07-02 01:10:42 UTC  

```cpp
void dump_debug_stats(const Data& d)
{
using namespace std;

...

clog << "Data Type: " << setw(4) << hex << uppercase << setfill('0') << d.type << "\n";
clog << "\tpayload: " << setw(12) << setfill(' ') << right << d.payload
<< "\ttimestamp:" << setw(20) << dec << d.timestamp << "\n";
}```

2018-07-02 01:11:38 UTC  

This is an example of a justified use of `using namespace std;`.

2018-07-02 01:13:42 UTC  

Because if you say "always use `using std::somename;`", you know what's going to happen. Some idiot will create one single header, `usingstd.h`, and fill it with
```cpp
using std::cout;
using std::cin;
using std::endl;
using std::sqrt;
using std::string;
using std::vector;
...
```

2018-07-02 02:51:07 UTC  

Yeah, but what you're taught is usually shortcuts that aren't always used in production.

2018-07-02 02:51:34 UTC  

There are many style guides out there that would castrate you for not following if you're working with a team for software design.

2018-07-02 02:52:34 UTC  

There is a reason you refactor codebases more than you actually implement more functionality.

2018-07-02 06:55:27 UTC  

those eyes...

2018-07-02 21:29:06 UTC  

mfw using split on visual studio

2018-07-02 23:14:14 UTC  

Or the standard layout. I don't need like 3 output windows, repo, and project directories on startup. pls.

2018-07-02 23:15:22 UTC  

I'll only use VS for large projects I actually need intellesense.

2018-07-02 23:15:28 UTC  

Otherwise atom.

2018-07-02 23:17:03 UTC  

Most stuff I do doesn't need a massive IDE though.