Post things Java fags will never understand

Post things Java fags will never understand

Attached: Untitled.png (640x242, 4K)

Other urls found in this thread:

msdn.microsoft.com/en-us/library/kk6xf663.aspx
twitter.com/SFWRedditImages

>"Congrats, you're hired!"

Attached: 1720-business-man-offering-hand-shake-pv-793x581.jpg (793x581, 66K)

I never understood how some faggot language designers couldn't keep types and functions apart cleanly in syntax.

Or why the idiots had to specify a language to syntactically have special operators rather than making these standard functions with one or two parameters. [I don't mind enabling prefix, infix or postfix notation, but make them normal functions].

care to give an example where a function would do better than an operator?

reference to char pointer lmao

Literally the most employed language.

What's a pointer?

it stores the memory address of a variable.

so say you want to have some function modify some variable x you pass into the function.

if you pass by value (create a copy of x), you won't be able to modify x; only the copy of x created.

if you pass by pointer (pass the memory address of where x's value is stored), you can then dereference the pointer (access the stored value) and modify x directly.

references work very similarly to pointers, just you can't change what memory address they store, and you don't have to dereference them; any operation done on them affects the value in the memory address pointed to.

So isn't char*& basically char** const? I don't get it.

int* foo
or
int *foo

Why the fuck is this not standardized anyway?

Everywhere. It is one pointless concept less.

There is no need to make the addition function on integer types or any other function special "operators".

Make it int + int or +(int,int) or int.+(int) and alias it to int add int, add(int, int) or int.add(int), but keep it a normal function.

you know everyone has to learn this, right?

I hardly believe divide(add(2, 2), 4) would be better than (2 + 2) / 4
unless that's not what you mean.
are you talking about C++ even?
just not following, sorry

Because types and functions were too complex as concepts.

Is it an int pointer type? Do you run a pointer function on int or foo (left or right associative single parameter? infix two parameter?). C coders don't care about syntax. You just write that magic star anywhere.

dont forget
int * foo

though I prefer
int *foo

nope

char*& doesn't need to be manually dereferenced
char** does

so say I want to access the char* being pointed to

say I have
char** const foo;
char*& bar;

to obtain the underlying values, I'd have to do something like this for each one respectively:
std::cout

It can still be (2 + 2) / 4. Or (2 add 2) divide 4. That is just the infix notation for two parameter methods.

Both should work 100% the same. / and + are supposed to be proper regular methods like all others. Not special "operators".

I work as a C++ dev and can't really tell what the fuck is this. A reference to a pointer? Why? Shit code, use std::string, changes requested, note sent to your manager, write more retarded shit like this and you'll be fired.

>use shitty proprietary libraries
Might as well use javascript.

What an unbelievably stupid post.

I would, if I could. C++ is meh.

Your skills with it are meh if you don't know char*&

int ii, *i = ⅈ

I'd like to forget all of that dumb shit still present in C++ that literally nobody uses, it is only there to support legacy/retards. Heard that fools day joke about C++ removing pointers in C++23? I was delighted for a moment, since I can't remember when I did use a raw pointer in the last 3 years, because I'm not a retard.

You're fired.

>lmao let's add random asterisks to types and turn the whole expression into something else
>ahahah and let's also use & if you want to access the value
>wait wait wait! what if we made it so you have to use BOTH for a particular purpose
>DEVILISH

zygoHistoPrepro :: (Corecursive t, Recursive t) => (Base t b -> b) -> (forall c. Base t c -> Base t c) -> (Base t (EnvT b (Cofree (Base t)) a) -> a) -> t -> a

you were never employed in the first place.

You should know how virtual functions work and stuff like this, not how to do something that nobody ever does since 1998.

Totally agree. There are people who will defend the shit out of char* too, which I hardly get.

Use char* when you have to, not because you prefer to. If you prefer to, your preference is shit.

>knowing sepples
lol what a faggot

>Use char* when you have to
...but that literally never happens, so we can safely assume that you don't have to use it ever at all and it's a shit code, and you can forget that it is possible to do.

Is there any difference to these examples apart from visually?

No, but you have a lesser chance to do
int* ohMyGod, whyTheFuck, areWeUsingPointers, atAll;
Which makes only ohMyGod a pointer, even though you've probably wanted to make them all pointers. But you don't have to remember it, since:
- declaring multiple variables on the same line is a shit code
- nobody uses raw pointers today (except in Qt, but memory management there is handled by parenting system, so you never have to write 'delete')
- the worst thing that happens is a compilation error which you'll notice and fix in 6.28 seconds

People like you are why PUBG looks like a 2006 game and runs at 20fps.

People like me are why PUBG exists, was made by a team of 35 people in 2 years and is not still in development that would last at least 20 more years.

Interesting, thanks

Crysis was made by Europeans and for a simple tech demo, it has dynamic environments and realistic physics, unlike PUBG, which takes 10GB of RAM for a dozen trees and an outhouse.

PUBG being slow has nothing to do with C++, there are games on the same engine (UE4) running much better. They probably have shitty unoptimized assets or use way too much effects or didn't bother to tweak engine for their "vast outdoors" scenario.

>t. non gamer
Crysis - CryEngine 2
PUBG - UE4
Both utilise c++, it's even a must for the latter. PUBG is technically bare boned compared to Crysis and other UE4 games.

pls respond

No. The first one is a reference, compiler won't pass any data around. The second one is a pointer to a pointer, you'll pass it by value, but compiler will optimize it and still won't pass any data around. The result is the same, but references are not retarded and it's easier to understand what happens.

gaymer*

Pretty much. The only time I can think of needing to use char* is to interface with C APIs or to save data into files as raw binary using reinterpret_cast.

nope

char*& doesn't need to be manually dereferenced
char** does

so say I want to access the char* being pointed to

say I have
char** const foo;
char*& bar;

to obtain the underlying values, I'd have to do something like this for each one respectively:
std::cout

The sane form is
int *a, *b;

because with the form
int* a, b;

a is a pointer and b is an integer which is kinda unexpected (consistent with the operator priority but still unexpected).
Try to keep the star attached to the variable and not the type.

It is a quirk in the language that it's read as part of the variable. The theory is that since *a is an int, and variables should be declared the way they're used, you declare it as int *a.

This is C's biggest mistake, but we can't fix it now because of 50 years of backwards compatability. The * should be part of the type.

Nah, it's just that trying to declare multiple variables on the same line should be a compiler error.

Why do you want to do that?

This. As long as people follow sane coding style conventions when writing C++ it's not THAT bad. Of course if you get some guy trying to be really clever doing insane shit only he understands then you're in for a world of pain.

Throw in a code base with 0 tests and you'll want to kill yourself.

>As long as people follow sane coding style conventions when writing C++ it's not THAT bad

So basically just write C and sparingly use C++ features?

Are you aware that being a decent java backend dev requires having a complete and full understanding of the JVM memory model and how it translates to your target architecture

>things C fags will never understand

Attached: being effective.jpg (316x475, 19K)

Well yeah UE4 is a slow piece of shit, every single UE iteration is slow and shit

(define exec-n-times
(lambda (func param n)
(cond
((equal? n 0))
((equal? n 1) (func param))
(else (+ (func param) (exec-n-times func param (- n 1)))))))

(define add5
(lambda (x)
(+ 5 x)))

(exec-n-times add5 25 10)

>requires having a complete and full understanding of the JVM memory model and how it translates to your target architecture

if you need to touch the memory model, then you did something wrong

Good luck writing a scalable backend without understanding GC in detail or why making only your setters synchronized isn't enough to prevent stale data

>(- n 1)))))))

autists really enjoy compiling code in their head first

>proprietary libraries
>stl
what the fuck am I reading

Use lisp then, this is more consistent for operators.

>understanding GC in detail

and then a new version of java comes out with security fixes and you are fucked

>I hate lifelong learning

wrong profession

>Well yeah UE4 is a slow piece of shit
I'm not sure if the problem really is the UE4 or that the people using are shit, but I'm yet to see a decently implemented game on UE4.

>every single UE iteration is slow and shit
Well now you are just speaking out of your ass, the previous iterations were at least decent and some great.
UE1 only 'flaw' is that it was optimized for Glide, because it came at the same time 3dfx was king while nvidia and the others were second class. Using Glide it was very solid, using the other APIs it was still ok.
UE2 was ok, but in my opinion surpassed by the CryEngine and Source (specially Source, it has much better physics implementations in its games).
UE3 was great, very good looking games that were nicely optimized, I don't know why anyone would complain about UE3.

>Congratulations on your technical achievement award, user

Attached: 153065651.jpg (612x411, 31K)

>complain about UE3
Texture pop-in.

i more or less understand pointers. but i don't really undertsand why certain functions require them. like for example strcpy i think it requires a const char* to be copied to a char. and then IIRC you can't copy a const char into a char* and so on so forth. i use MS VS though so it lets me know when the pointers are wrong lol.

they work the same yes, but for a programmer the operator ads convenience. especially working with large amounts of operators, seeing (())((()))() everywhere makes it hard to fix simple logic errors, where a 1 minute fix becomes a 5 minute game of connect 4.

> like for example strcpy i think it requires a const char* to be copied to a char

strcpy(char dest, const char * source) // ????

> msdn.microsoft.com/en-us/library/kk6xf663.aspx
> strcpy(char *dest, const char *src)

Attached: thinking.jpg (1000x1000, 24K)

good thread

I am a dark nerd. You want to know what a dark nerd is?

Well, first of all, I frequent Jow Forums . then I hate Java, I hate Winshit, I hate "employment", I hate Applel iToddlers with a passion

It's true that I never created any "usable" software application, but my fizzbuzz is so optimized, because I wrote it in pure C on a Gentoo compiled with the best optimization flags

Stop it. Get some help. And join the industry.

>specially Source, it has much better physics implementations in its games
it was neat at the time to see small and medium objects bounce around, but colliding with a barrel or any dynamic object is beyond retarded with a very buoyant pushback. movement precision was a huge downfall compared to GoldSrc. and while it runs fairly on shit hardware, it's also quite limited and performance can go to shit fast

>What's a pointer?

Attached: ipad-pro-whats-a-computer-commercial-frame.jpg (450x450, 46K)

they should have just made it int*
It makes more sense to have int* a separate type from int, because they don't hold the same values.

t-thanks

>reference to character pointer
>not even wchar_t*&
Then again, C and C++ shit the bed hard when it came to Unicode support. Using strings in these languages just sucks. C has security and buffer issues out the ass. C++'s std::string requires strict etiquette to maintain performance.

Converting an application from ASCII to Unicode is a world of suffering in and off itself. C++ programs always mix STL and C calls. Then you have to clean up all the stupid string manipulation tricks that assume 1 char == 1 int. Unicode versions of string functions often don't have the same signature as their ASCII counterparts. Unicode STL equivalents are inconsistently named making the cin getline() mess look like a minor mistake. SFINAE will constantly bite the programmer in the ass when random template fails to instantiate to coercion failure.

Modern autopointers and move semantics smooth away any real need to use raw pointers outside of external libraries

Attached: rage1.jpg (300x300, 40K)

>wus a bointer ?

Attached: 1522622794481.gif (233x226, 1010K)

how do i embed part i want to be seen as code and the rest as normal text ?

i assume its incomplete statement of a pointer referencing another integer

>Post things Java fags will never understand
English

It's just a bit of safety in the function, so that it can't dereference the pointer and change the underlying value. If you pass in a pointer to a function that treats it as const, it's a bit of a guarantee that the value/s pointed to won't be affected.

***x(char)

Attached: wc.jpg (470x313, 19K)

well you can dereference the char to get a char*.

what's happening in the background is that it just keeps looping through your memory until it finds a '\0'. if it doesn't find one, you will find that your output is literal trash.

>I'd like to forget all of that dumb shit still present in C++ that literally nobody uses,

Then forget it, why the do you care if you aren't planning on using it, it's not like you are going through physical fucking pages of standard documentation for a function.

so what is dereferencing for a pointer?

Top kek

Stop making this remarks about Java and us Indians we are more than you'll ever be

you literally just access the value inside the memory address that the pointer points to. that's what dereferencing is.

There are no pointers in Java, at least no pointers that the programmer has control over.

just watched a video on it, why do people have so much trouble with these concepts i dun get it

More what?

private int age;
public int Age
{
set
{
age = value;
}

get
{
return age;
}
}

neither do I.
probably because most people's explanations of what pointers and references are are shit

I failed my pointer class.

int* (*wat)(int*, char*, size_t, void*);

private int age;
public int Age {
set { age = value; }
get { return age; }
}

public int Age {get; set;}

if there are no pointers in Java, why is there a NullPointerException?

you're right user, haskell has the right idea