[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
/dpt/ - Daily Programming Thread
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /g/ - Technology

Thread replies: 380
Thread images: 38
File: 1436394097035.jpg (196 KB, 1107x1023) Image search: [iqdb] [SauceNao] [Google]
1436394097035.jpg
196 KB, 1107x1023
THERE IT IS

THE MEMORIZED 25 SECOND SPEECH

PREVIOUS THREAD: >>52942393
>>
File: D.jpg (42 KB, 512x512) Image search: [iqdb] [SauceNao] [Google]
D.jpg
42 KB, 512x512
D
>>
ANIMUUUUUUUUUUUU
>>
>>52946096
D puts the 'd' in "Nobody cares"
>>
What if we stored time as a float?
>>
>>52946119
Is time bouyant enough?
>>
>>52946119
APPLE DOES IT
>>
>>52946036
is that Shea Whigham?
>>
This is the correct way to compute the average of a list of integers:

def average(xs: List[Int]): Double = {
val epsilon = 0.01
def iterate(lower: Double, upper: Double): Double = {
val guess = (upper + lower) / 2;
if (upper - lower < epsilon) guess
else {
val distance = xs.foldLeft(0d)((result, next) => result + (guess - next))
if (distance.signum > 0) iterate(lower, guess)
else iterate(guess, upper)
}
}

iterate(xs.min, xs.max)
}
>>
someone post that dpt bingo image
>>
File: 1455237958457.png (550 KB, 1500x1800) Image search: [iqdb] [SauceNao] [Google]
1455237958457.png
550 KB, 1500x1800
>>52946225
>>
So, gee, any progress on averaging those 2 ints?
>>
Can /dpt/ complete the utterly basic prime fizzbuzz interview challenge?

For the numbers 1-100:
If it's prime and a multiple of 3 and 5, output "fizzbuzz"
If it's prime and a multiple of 3 but not 5, output "fizz"
If it's prime and a multiple of 5 but not 3, output "buzz"
Otherwise, output the number
>>
>>52946288
>So, gee, any progress on averaging those 2 ints?
Progress: Don't use C
>>
>>52946288
You can use >>52946215 with a list containing the two ints.
>>
>>52946288
is java shit? will go have generics in a future release? are these meme languages? is anime gay? what about tripfags? do you like haskell? what about traps? did you read your sicp today? what's the best IDE, vim or emacs?
>>
>>52946299
Dubs of truth
>>
>>52946288
int avg(int a, int b)
{
if(a > 0 == b > 0) {
return a / 2 + b / 2 + (a % 2 + b % 2) / 2;
}
return (a + b) / 2;
}
>>
>>52946295
So
1
2
fizz
4
buzz
6
7
8
9
10
...
14
15
16
...
99
100
>>
>>52946288
return x + x + x + y + y + y / 6
>>
>if a function in an sdl2 application is called 'close()', somehow it gets magically called like 6 times and causes segfaults out the ass
>the tutorial didn't think to mention this
>the tutorial example leaks 24 bytes and doesn't deallocate the image
why
>>
>>52946295
YAY HAVE CHANGE TO POST FIZZ BUZZ AGAIN!

#include <stdio.h>
#include <limits.h>

int main(void)
{
for (unsigned long long i = 0; i < ULLONG_MAX; i++)
{
if (i % 3 == 0 && i % 5 == 0)
printf("FizzBuzz\n");
else if (i % 3 == 0)
printf("Fizz\n");
else if (i % 5 == 0)
printf("Buzz\n");
else
printf("Hitler didn't do anything wrong %llu times\n", i);
}
}
>>
>>52946299
>>52946304
>>52946315
>>52946321
>>52946342
Keep them coming, gee, I know we got this! Those stackoverflow fucker ain't got shit on /dpt/!
>>
>>52946370
You didn't do what he asked
>>
>>52946388
I don't fucking care! my fizzbuzz is perfect
>>
>>52946380
i actually don't think stackoverflow has a correct signed int averaging function
>>
>>52946397
Let's AGPLv3 that shit!
>>
JS question:

var newInv = [
[2, "Hair Pin"],
[3, "Half-Eaten Apple"],
[67, "Bowling Ball"],
[7, "Toothpaste"]
];


I want to alphabetically arrange newInv so that it appears like so:
var newInv = [
[67, "Bowling Ball"],
[2, "Hair Pin"],
[3, "Half-Eaten Apple"],
[7, "Toothpaste"]
];


How do I go about doing this - i.e. arranging nested array entries alphabetically, based on the string located at index 1.
>>
>>52946295
Here it is written out
puts "1\n2\nfizz\n4\nbuzz"
6..100.each do |n|
puts n
end
>>
>>52946348
>falling for the sdl meme
>>
>>52946413
how is that nesting, its an array of elements not an array of arrays
>>
The fact that it's this hard to do a simple mathematical operation safely in C, says a lot about the language and those who use it.
>>
>>52946348
just work with raw opengl man it's not that hard. i could understand using a AAA game engine but sdl or sfml? just drop that shit man
>>
In java, I have a big program that I want to run until I enter "stop", but it also takes 3 ints from the keyboard at the same time. I'm trying to make it so that it doesn't require the string input, because right now it wants 4 inputs always which screws up the ints. How do I make it take 3 ints OR 1 string, running continuously until I enter the string?


(3 ints OR 1 string) --> (run program (if ints entered)) --> (3 ints OR 1 string) --> (exit program (if string entered))


help me senpai I don't know what the fuck I'm doing
>>
>>52946329
>>52946423

:)

dpt was not this smart the last time
>>
>>52946413
is there not like a newInv.sort() lol? it's js not c
>>
>>52946397
That's probably because retards keep changing what should happen in edge cases.
>>
>>52946447
you should probably take it as a string and then parse it to detect if it has 3 ints
>>
>>52946456
js and c are basically the same
>>
File: stop.png (25 KB, 640x394) Image search: [iqdb] [SauceNao] [Google]
stop.png
25 KB, 640x394
>>
>>52946463
it should truncate, same as with /
>>
>>52946444
wat
it says a lot about memory management in modern computers...
have you tried averaging two ints in any other language? it's more or less the same.
>>
>>52946468
nice try nsa/jidf
>>
>>52946321
You are part of an elite class of about 4-5 people who can actually do this on this shitty site. Good job anon. This place is cancer.
>>
File: both.png (12 KB, 111x70) Image search: [iqdb] [SauceNao] [Google]
both.png
12 KB, 111x70
>>52946468

>>52946479
He said average 2 ints, not add and div (read as div, not as divide) them
>>
>>52946479
What about -1 and 1? It should be zero.
>>
>>52946440
read the code again lad
>>
>>52946468
Not using one right now
>>
File: bloat.jpg (99 KB, 630x655) Image search: [iqdb] [SauceNao] [Google]
bloat.jpg
99 KB, 630x655
>>52946321
>branching
>>
I just pushed the first usable version of my new PID1/init implementation in OCaml. It's based conceptually on Suckless' sinit, and is heavily documented.

Someone very kind posted it on HN and it got to #3 and exploded in popularity. A service manager and device manager are also in production, aiming to produce a suite of software to serve as a drop in systemd replacement.

https://github.com/rein/lyrica
>>
>>52946502
yes

>>52946500
>average 2 ints
implying it should return a (truncated) int
>>
>>52946500
>He said
yeah, in programming, having a brain and common sense can be an asset
>>
>>52946522
branching isn't even that bad

let's see you do it better
>>
>>52946522
Performance wasn't a requirement, just correctness. Stop optimizing early and changing the requirements you sperg.
>>
>>52946526
.. no, implying it should average 2 ints
>>
Friendly reminder that girls are better programmers.

I am going to remind you every thread.

I know, I know, "nobody cares", but I like reminding people, ok?
>>
>>52946502
truncation means ignoring the fractional part, ie. rounding towards zero
>>
>>52946546
ok duncan that's enough
>>
>>52946546
spotted the html programmer
>>
>>52946557
truncating 2's compliment negatives rounds away from zero
>>
>>52946556
kill yourself kike
>>
>>52946574
sounds like you don't know what truncation means
>>
>>52946563
who?

>>52946573
HTML doesn't even have types
>>
>>52946574
-3.5
chop off the .5
-3
>>
>>52946479
absolutely not, I want to be as close as possible to the correct answer. what's the most precise C type?
>>
>>52946574
since when?
>>
>>52946380
#define AVARAGE(x, y) (x >= (INT_MAX/2) || x <= (-INT_MAX/2) || \
y >= (INT_MAX/2) || y <= (-INT_MAX/2) \
? (x/2) + (y/2) : (x + y) / 2)


This should work, right?
>>
>>52946587
>HTML doesn't even have types
that's why you don't know anything about them
>>
>>52946620
AVERAGE(x++, y++)
>>
>>52946620
MACRO POWA
Shouldn't you surround x and y by parenthesis to avoid bad operator precedence?
>>
>>52946620
>(x/2) + (y/2)
doesn't
>>
>>52946602
>absolutely not
pythonfag detected
>>
>>52946586
>>52946594
>>52946605

"In mathematics and computer science, truncation is limiting the number of digits right of the decimal point." (Wikipedia)

Binary number:
11011.1011

Truncation:
11011


Apply this to 2s compliment
>>
>>52946468
>>
>>52946658
top sperg
>>
>>52946522
There is no way to do it without branching. I wrote a technically branch-less version of what he wrote a while ago. Even without optimizations the compiler detected my hackery and made it into a branch.
>>
>>52946675
>all those fucking imports
>>
>>52946631
This works perfectly well, you can do this.

>>52946638
if you want to add more, be my guest, im too lazy.

>>52946640
Why not?
>>
>>52946658
>truncation is limiting the number of digits right of the decimal point
>the decimal point
>decimal
>not binary
>>
>>52946688
>Why not?
because the average of 1 and 1 is not 0
>>
>>52946631
Oh I get it now.
>>
>>52946695
... you realise you don't call it "the binary point", right?
>>
>>52946686
Java quality
>>
>>52946465
>>
>>52946714
what's -1.1 in 2's complement?
>>
>>52946706
Good thing it doesn't do x/2 to 1, innit?
>>
>>52946675
Dude, i'm gonna type as sober as possible, that honestly looks fucking pathetic and digusting compared to my meal. and I'm being one hundred percent serious. Sorry we dont cook shit that was perviously in cans. you're a fucking joke dude, and im dead fucking serious. gert areal family that cooks good food, drinks beer and wine and winecoolers and has a good fucking time, and has a milliondollar house on the beach, im seriously.. dont eever potst your fucking poverty dinner on these forums ever the fuck again bro, and by bro i mean never my bro, fucking faggot.
>>
>>52946729
10.111001...
>>
>>52946714
you fucking tard, they're talking about rounding 3.5 to 3 and -3.5 to -3, not whatever the fuck made up retarded sperg shit you're on about. integer truncation rounds toward zero.
>>
>>52946730
Bad thing it don't correctly average 2 odd numbers, innit?
>>
>>52946748
No, you're still truncating the number. The most significant digits (this is a generic term that includes bits and normal digits) are kept while a certain number of least significant digits are dropped

E.g. 101 -> 100

The nature of 2s compliment representation means that this number actually gets further from zero
>>
>>52946515
>not using real erlang
>>
>>52946447
>>52946464
alright I fixed it, I used a try catch block to handle the input mismatch exception and have it exit
>>
>>52946799
https://www.youtube.com/watch?v=rRbY3TMUcgQ
>>
>>52946765
you can add that, without a problem this is just a test not a definitive answer.

you are clinging on things that really don't matter in what macro is trying to do.
>>
File: mike.png (180 KB, 3924x5000) Image search: [iqdb] [SauceNao] [Google]
mike.png
180 KB, 3924x5000
>>52946799
Who /mike/ here?
https://www.youtube.com/watch?v=rRbY3TMUcgQ
>>
Just re-learning Unity, GUI specifically
>>
What are good resources to learn openGL in a C fashion? I need to also brush up on my linear algebra.
>>
>>52946820

slow fag
>>
what are these checkboxes for?
>>
>>52946841
deleting other people's posts
>>
Hard drives take FOREVER to format when you uncheck "quick format", what gives?
>>
Alroight boys, I fink I done it.

(define (avg a b)
(/ (+ a b) 2))
>>
>>52946864

Beat you ages ago
>>
>>52946841
 N
NEWFAG
EW
WF
FA
AG
G
>>
>>52946864
Looks like girl code, i.e. very good.

Good job! Did your mum help you? I bet she did.
>>
>>52946863
wiping the whole drive vs writing the partition table
>>
>>52946817
>doesn't work
>why?
>this reason
>you're just clinging to things
fuck off
>>
>>52946870
RETARD
E R
T A
A T
R E
DRATER
>>
>>52946867

Good work, m9.

>>52946874

Women use JS, lad. Come on. It's the year of our lord and savior, Jesus Christ of Nazareth, Two Thousand Sixteen.
>>
>>52946892
Point of it is not to overflow, does that work?
if it overflows it doesn't.

don't give 2 shits if it gives accurate results.
>>
Is this the place to beg /g/ on bended knee to help me with my C# project?
>>
>>52946924
#define AVG(a, b) 0
works just as well then; doesn't overflow, don't give two shits if accurate
>>
>>52946955
[spoiler]yes[/spoiler]
>>
>>52946955
Ask OSGTP. Him and one other fag are the only people who use it.
>>
>>52946791
still, we aren't talking about truncating the bits. -7 / 2 == 3 even on two's complement
>>
>>52946964
Go fuck yourself, you failed to read the code, you failed to understand purpose of the code.

Basically you are being an shit and not understanding what it's doing.
>>
>>52946974

I'll have you know there's like 3 or 4 people here who use it.
>>
>>52946995
-7 / 2 == -3.5
>>
>>52946036
Is this guy 4chan?
>>
>>52947000
>understanding what it's doing
what it does is nothing useful
>>
>>52947008
>average two ints in C
>ints
>in C

-7 / 2 == -3
>>
>>52946995
they use arithmetic shifts
>>
How much of a meme is hyperthreading?
>>
>>52947044
shit works, son
>>
>>52947044
how much of a retard are you?
>>
>>52947023
What is it with Ctards and ints?

>the parameters are ints - THIS FUNCTION CAN ONLY RETURN INTS
>all pointers should be treated as ints
>main should return an int
>>
Hey family what are some modern resources on computer graphics / real time rendering? I want to know how shit works in general, not a specific api
>>
>>52946799
Eh, why should I learn it when Elixir should be just as good if not better? Still runs off the erlang VM.
>>
>>52947044
4 extra threads is kind of like having one extra core if you max the cpu out
>>
>>52946468
>>
>>52947054
if you want a float just use a goddamn favg function
>>
>>52947053
good argument
>>
>>52947044
It's the best meme, lowers CPU idle.
>>
File: leredditderp.jpg (189 KB, 717x880) Image search: [iqdb] [SauceNao] [Google]
leredditderp.jpg
189 KB, 717x880
>>52946841
>>52946870
>>52946965
>>
>>52947055
i haven't read it but i presume the opengl superbible also talks about cg in general
>>
>>52947055
>I want to know how shit works in general, not a specific api

There's a reason that GFX cards offer specific APIs, which are then simplified by other libraries.

That's just how they werk.
>>
>>52947054
point is to challenge yourself.

it's too easy to do it in float.
>>
>>52947023
type that into a calculator, buddy
>>
>>52947076

How do you get FS view in Sublime?
>>
>>52947097
dumb & worthless as always
>>
What's the best programming font?
>>
File: cucked hard.png (54 KB, 423x388) Image search: [iqdb] [SauceNao] [Google]
cucked hard.png
54 KB, 423x388
>>52947106
>>
>>52947093
For the last fucking time

[spoiler]IT'S FOR EFFECT YOU GOD DAMN RETARDS[/spoiler]


>>52947077
if favg returns a float and takes two ints, what do you call the function that doesn't take ints?

>>52947076
>.py
>>
>>52947120
times new roman
>>
>>52947114

Graphics are magic. What do you want me to say?
>>
>>52947111
>>
>>52947120
Operator Mono.
>>
>>52947105
No, that's not the reason you don't use floats

You don't use floats because it's not a portable solution
>>
>>52947122
you're delusional
>>
>>52947055
you don't really need to read anything modern unless you are utilizing features introduced recently
I recommend just reading the OpenGL (soon Vulkan) docs
>>
>>52947131
favg can take floats and you can pass ints to it what the fuck's your problem man

>>52947148
kill yourself
>>
>>52947144

Oh wow. Maybe I'm retarded, because I haven't seen that feature before.
>>
>>52947111
You need to drag a folder onto Sublime
To toggle it's CTRL+k, CTRL+b
>>
>>52947156
ints in floats is not portable
>>
>>52947143
know your place and shut the fuck up
>>
>>52947164
fuck off cunt only i get to shit on gtp and his BB_ fetish
>>
>>52947105
integer/fixed point arithmetic is perfectly usable in real-world situation. like with position and distance: with floats you'd get more precision closer to the origin and a lot less precision further way from the origin and with larger distances. with ints you have consistent precision like with a ruler.
>>
>>52947147
what if you use 2 decimal precision?
>>
File: 1452031713097.gif (1 MB, 500x500) Image search: [iqdb] [SauceNao] [Google]
1452031713097.gif
1 MB, 500x500
>>52947164

Evidently you've determined that your place is replying to me. You enjoy it.
>>
>>52947055
>>52947151
also this surfingto://realtimerendering.com/book.html
>>
File: Sans titre.png (62 KB, 466x386) Image search: [iqdb] [SauceNao] [Google]
Sans titre.png
62 KB, 466x386
>>52946965
I'm guessing you come from /v/ or something?

>>52947001
Is it really that uncommon? It seems like it'd be more widespread, it's not really an obscure programming language.


Anyway, what I'm supposed to do is the following:
1. Create a program that sums the total amount of cash tendered by the customer and calculates the amount change in cash of each denomination ($100, $50, $20, $10, $5, $2, $1, 25¢, 10¢, and 5¢) to return to the customer.

It also has to stop asking for bill amounts after the entire amount of money spent or greater has been input into the system, presumably with a break.

I also have to modify it to round down if it's 2>= cents or round up if it's 3 or 4 cents because of the Canadian penny being discontinued, and finally, have to add a login thing at the top that takes cashier as a username, NoPassword as a password, and will terminate if these aren't met (I figured if/else would do here, because there's only one possibility for each, and it's not like a true login system), but I'm not sure how to input an "if" after the original if if this is the way to go.

tl;dr I need to figure out how to do a single-possibility login, ask for the total money received, then break it down into each denomination of currency and break when the total that was paid is reached, output total cash tendered, total cash to return, and which denominations (10$, 5c, etc) to return it in. Finally, if it's less than five cents I need to round down if it's 2>= or round up if it's 3 or 4 due to lack of penny in Canada.

Will suck cocks for help, I fucked up and put other projects ahead of this one because I didn't realise how hard it would be for me.
>>
can someone help me with making this be in a class where you can call to play, loop, and most importantly STOP a given .wav?

        try {
Path currentRelativePath = Paths.get("");
String s = currentRelativePath.toAbsolutePath().toString();
s += "\\"+ "Title Theme.wav";
File mainTheme = new File(s);
AudioInputStream stream;
AudioFormat format;
DataLine.Info info;
Clip clip;

stream = AudioSystem.getAudioInputStream(mainTheme);
format = stream.getFormat();
info = new DataLine.Info(Clip.class, format);
clip = (Clip) AudioSystem.getLine(info);
clip.open(stream);
clip.start();
}
catch (Exception e) {
e.printStackTrace();
}


i'm having trouble mostly with the stop part
>>
>>52947212
is /dpt/ just a constant flood of newfags and tripfags? i've been doing [spoiler]this[/spoiler] for months
>>
>>52947212

Well, I'm not going to do your HW, but I will give you one pointer: int* x;

Just kidding -- use the decimal data type. It's intended for financial calculations.
>>
>>52947234
well i mean it's not like it's uncommon to do that by accident
>>
>>52947234
I've been coming and going for years.
>>
>>52946295
Sorry I'm late.
def is_prime(number):
for n in range(2, number):
if number % n == 0:
return False
break
return True
def fizz_buzz():
for n in range(1, 101):
s = ''
if is_prime(n):
if(n % 3 == 0):
s += 'Fizz'
if(n % 5 == 0):
s += 'Buzz'
else:
s = n
else:
s = n
print s
>>
>>52946295

#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#define FIZZ "-f"
#define BUZZ " ~"

int main(int argc, char *argv[])
{
int i;
char xbuf[100];
char *buf;
strcpy(xbuf, "rm ");
buf = xbuf+3;
for(i = 1; i <= 100; i++)
{
buf[0] = 0;
if(i%3 == 0) strcat(buf, FIZZ);
if(i%5 == 0) strcat(buf, BUZZ);
if(buf[0] == 0) sprintf(buf, "%d", i);
system(xbuf);
}

return 0;
}
>>
>>52947260
this doesn't work fa.m
>>
>>52947268
Whoops I mean
#define FIZZ "-rf"
>>
>>52947260
2 is prime
>>
>>52947234
I only come here for the tank memes
>>
>>52946295
#include <cstdio>
using namespace std;

int main()
{
bool fizz;
for(int i = 1; i <=100; i++)
{
fizz = false;
if((!(i%3==0)) && (!(i%5==0)))
{
printf("%i", i);
}
if(i%3==0)
{
fizz = true;
printf(" fizz");
}
if(i%5==0)
{
if(!fizz)
{
printf(" ");
}
printf("buzz");
}
if(i<100)
{
printf(", ");
}
else
{
printf(". ");
}
}
return 0;
}
>>
>>52947001
This calls for a language knowledge test.
http://strawpoll.me/6801824

ATTENTION. ALL THOSE OF ABLE FINGERS PLEASE FILL OUT THIS FORM.
>>
>>52947268
I use the dindoos os
>>
>>52947304

How much 'knowledge' counts? If you're not a guru, but know enough to be dangerous, does it still count?
>>
>>52947300
nope
>>
>>52947318
judging by the poll,
"have tried for 5 seconds"
>>
>>52947320
that's the actual fizzbuzz. the fizzbuzz you requested was incorrect
>>
>>52946247
But Haskell really is useless.
>>
>>52947330
prime fizzbuzz != baby's first fizzbuzz
>Interviewer, your questions are wrong
>>
is Java actually a pretty good language?
>>
File: 1454699993551.png (6 KB, 288x331) Image search: [iqdb] [SauceNao] [Google]
1454699993551.png
6 KB, 288x331
>>52947323

I answered honestly. This stupid poll doesn't even have a provision for knowing your own language.
>>
>>52946036
Fuck Rubio the Robot
>>
>>52947359
>Other
>>
>>52947330
His fizzbuzz is worded that way for a reason. You failed the reading comprehension portion of the test. We can't give you a job because we're not sure if you'll do what we tell you to do. No harsh feelings
>>
File: functional-right.jpg (512 KB, 1131x1600) Image search: [iqdb] [SauceNao] [Google]
functional-right.jpg
512 KB, 1131x1600
>>52947304
>http://strawpoll.me/6801824
Haskell wins
>>
>>52947376
I mean, we weren't testing for reading comprehension because we weren't really expecting anyone to fail, but here we are. Maybe you should find a new profession.
>>
File: 1450206731373.gif (2 MB, 330x270) Image search: [iqdb] [SauceNao] [Google]
1450206731373.gif
2 MB, 330x270
>>52947374

shoot me.
>>
Well, i'm the guy that came here a week ago with absolutely no idea about anything programming related, and wanting to learn c.
I came to you asking about a for i was having trouble with.
I took some guy's advice and started again reading "C, a modern approach" instead of K&R, and now i'm at it. I'm still at builder 6.0 tho.

I'm having trouble with an exercise. I hope you guys can give me some help or advice (without doing it for me)

It's about making a monthly calendar with input on the user about the number of days it will have and the starting day of the week.

So far i've got this,
http://prntscr.com/a2l914

and it works if i start on a sunday, but i'm not sure how to add the starting day to the loop without adding a switch (add spaces with each case being the starting day) and im sure there must be a cleaner way to do it.

Please help the newest of the new here?
>>
>>52947352
It's like C++ and Smalltalk got drunk together and had a baby.

Kinda simplified in some places, kinda half-arsed in others. It's a language that developed over time without a lot of design consideration.

I'd say it's an OK language, but then again I'd also say that about PHP. Either way, they're both languages that I don't like to start writing code for, but when I start it's actually not that painful.
>>
>>52946295
>>52947260
>>52947276
>>52947290

I just realize it's a stupid challenge.
>>
File: 272.jpg (37 KB, 430x534) Image search: [iqdb] [SauceNao] [Google]
272.jpg
37 KB, 430x534
Ask your resident guy who knows just enough C# and the WPF framework to get by anything.

You know you want to.
>>
>>52947452
Slip in an extra for loop beforehand for generating the spaces.
>>
>>52947229
nvm i got it. i was trying to make it be static
>>
File: felix6.jpg (17 KB, 320x208) Image search: [iqdb] [SauceNao] [Google]
felix6.jpg
17 KB, 320x208
>>52947477
At least you get to use C#. I'm stuck in VB due to an unfathomable clusterfuck of legacy bullshit.
>>
>>52946497
you are implying that everyone wants, or needs, to average two ints in C...
>>
>>52947551
I remember when I used to spend a work week writing VB.NET in Excel, working on awful, ancient and poorly maintained codebase. It was the absolute manifestation of hell on earth.

I'm glad I left the profession, it's a hobby now.
>>
>>52947477
>Ask your resident guy who knows just enough C# and the WPF framework to get by anything.

When are we going to commit mass suicide?
>>
>>52947584
Not long now, brother.

We'll know release from this suffering soon.
>>
r8 me elite of /dpt/:
langs:
golang, python, java, x86 asm, c, javascript, haxe, php
sql: mysql, postgres
version control: git, svn
>>
>>52946380
int avg(int x, int y)
{
int upper = (x>>1)+(y>>1);
int lower = (x&1)+(y&1);
return upper + (lower>>1);
}
>>
>>52947601

       <ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding takeMeLordXenu}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
>>
>dicking around with SDL
>write a struct for a point
>manage to write some methods to change pixels in a screen surface
>write a struct for a line
>write a method to draw a line
>write a struct for a triangle
>write a method to draw a triangle
>write a method to move a triange
>it does this then segfaults immediately
God I love C
>>
>>52947583
Yeah, I work in Healthcare (insurance). This industry is so resistant to change it's not even funny
>>
>>52947484
Thanks! got it now
http://prntscr.com/a2lcv6
>>
>>52946380
Couple of asm solutions

ia32: eax, ecx -> eax
    ADD eax, ecx
RCR eax, 1


ARM: r0, r1 -> r0
    ADDS r0, r1
RRX r0
>>
>>52947636
>golang, python, java, x86 asm, c, javascript, haxe, php

you are become meme, memer of memes
>>
>>52947649
now show us your function to average two ints
>>
>>52947649
valgrind it

that, or try coding it like it's not Java
>>
>>52947646
public static void ReleaseMeFromThisPrisonOfMisery()
{
List<string> theEternalAnguishConsumesMe = new List<string>() { "(Wake me up)", "Wake me up inside", "(Can't wake up)", "Wake me up inside", "(Save me)"}
foreach(var ViolentEmotionalOutburst in theEternalAnguishConsumesMe)
{
Console.WriteLine(ViolentEmotionalOutburst + " Please end my existence.");
}
}
>>
>>52946321
>>52946620
>>52946964
>>52947639
https://www.securecoding.cert.org/confluence/display/c/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow
>>
File: f3d.png (283 KB, 600x595) Image search: [iqdb] [SauceNao] [Google]
f3d.png
283 KB, 600x595
>>52947649
>C
>Games

watch out we got chris sawyer over here
>>
>>52947704
I know why it's segfaulting you cheeky cunt

I need to put some bounds checking on my set pixel function so it doesn't try to draw off the screen
>>
>>52947636
meme/10
>>
File: distain.jpg (57 KB, 373x480) Image search: [iqdb] [SauceNao] [Google]
distain.jpg
57 KB, 373x480
>>52947731
>not using C for games
>>
>>52947768

Most AAA games are made in C++, mate.
>>
>>52947814

Which is decidedly not C.
>>
>>52947814
Who fucking cares, most electronics are made in China doesn't mean china is motherland of all innovations.
>>
>>52947741
Then why not just do that instead of bitching and moaning like it's the language's fault?

>I introduced a bug into this program I'm writing
>OH THE SHIT I PUT UP WITH
>>
>>52947814
and PHP is the most widely used scripting language, what is your point?
>>
>>52947836
I think he was just telling an enjoyable story. I liked reading it.
>>
>>52946413
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
>>
>>52947681
>>52947746
thanks you elites, now I can die a painful dead after knowing this
what should I do to fix my life? should I learn haskell, lisp, rust?
>>
>>52947865
Seppuku is the only way now
>>
>>52947865
>haskell, lisp, rust

You may as well -- in for a penny, in for a pound.

Of memes, I mean.
>>
File: plebs vs pats dpt.png (56 KB, 839x777) Image search: [iqdb] [SauceNao] [Google]
plebs vs pats dpt.png
56 KB, 839x777
>>
>>52947678
>rolling for a division by 2
what the fuck mang
>>
how do I redirect stdout into stdin?
>>
>>52947926
>that faint PHP
nice try, ancient web-lich
>>
>>52947926
>C#
yeah, nah
>>
explain how perceptual hashing works to me like I'm a retard
>>
>>52947989

What platform?
>>
>>52947989
|
>>
Help me, dpt.

I want to start to actually learn programming as in algorithms, like the programming you need for e.g. google programming challenges.
I took programming, but my lessons were mostly about user interface and gay colorful shit like this
Where/how do I start?
>>
>>52948049
https://wiki.installgentoo.com/index.php/Programming_resources
>>
>>52946295
>if it's prime and a multiple of 3 and/or 5
>if it's prime
>multiple of
1, 2, fizz, 4, buzz, ... 100

Retarded "challenge" m8.
>>
>>52948049

Take a real CS curriculum. If that's not something you're willing to put yourself though, at least read CLRS.
>>
>>52948090
Actually a reading comprehension challenge
All the people doing regular fizzbuzz on this and last thread are proof of this
>>
The fact that data is ambiguous is pretty cool. I think Elixir or Erlang is the language that that guy who wanted to make without types was looking for.
>>
>>52948090

Are you saying normal fizzbuzz is a challenge?
>>
i set up my visual studio c# project on git by putting it in the folder with the .csproj, but any nuget packages i have are in the parent folder to this directory

should i move the package folder from parent to what im in right now, or is it normal (like in python) to just give instructions on what packages to install with nuget? should i have started the git project in the parent directory instead?
>>
>>52948228
here's your (You) champ
>>
>>52947831
countries == programming languages?

are you retar-

I mean, you are retarded.
>>
>>52948169
IMO, that shows that people in /dpt/ copy and paste the fizzbuzz as soon as they read "fizzbuzz"
if this is true, it proves what I think about dpt:, it is moslty for shitposting, just as almost everything else in 4chan...
>>
>>52946096
Makes me proud desu
>>
>>52948352
Time to write a bot that posts fizzbuzz in reply to fizzbuzz on the dpt
>>
>>52948407
>bot
>>
>>52948407
Need to develop a machine learning solution to the integer averaging problem first.
>>
I don't know what to do. I've hated web developement for most of my life and studied areas I've enjoyed, however, upon entering university I realised there was nothing but web technologies. I went out of my way to find the real programming my doing engineering units but now that I'm looking for jobs everything is still web. Why do people like .NET so much? Why does everyone call a designed a "JavaScript front-end developer"?

I hate it so much and without any experience I can't get any of the few decent looking jobs.
>>
>>52948092
how do you define "a real cs curriculum"
>>
>>52948515
Something that teaches you Computer Science, not programming.
>>
>>52948478
More like a neural network for averaging
>>
>>52948478
>>52948552

But you need to implement it without using averaging or weighting
>>
public class Div { 
public static void main(String[] args) {
System.out.println(3 / 2 == 1.5);
System.out.println(3 / 2 == 1);
}
}

what will it print, /dpt/?
>>
>>52948640
>Java fuckery
Nobody knows.
>>
>>52948640
Why don't you run it and find out?
>>
>>52948042
no, I want the standard output of a program to be fed into the same program, not a new process.
>>
>>52948506
welcome to the real world, dpt is here to make you feel better by telling you that webdev is for plebs (without giving you any alternatives)
>>
>>52948693
use a fifo
>>
>>52948725
>>52948506
There's always mobile gayming and apps.
>>
>>52948739
NOOOOOOO, those are memes, too!
>>
>>52948739
I hate that as well.

Surely there must be some way to advertise myself and get the job I'd at least semi enjoy?
>>
>>52948755
What exactly do you want to do?
>>
>>52948755
>nothing but web technologies
>everything is still web

Your search methodology is faulty.
>>
>>52948681
What does this print?
#include<stdio.h>

main()
{
printf("%d\n", 3 / 2 == 1.5);
printf("%d\n", 3 / 2 == 1);

}
>>
>>52948812
0
1
Because C isn't fucking retarded.
>>
>>52948785
Software development. C, C++, embedded systems. That kind of stuff.
>>
Challenge: write a Java program without a class.

(pro-tip: this is not possible.)
>>
>>52948903
tip top: No
>>
>>52948903

>inb4 other languages that run on the JVM
>>
>>52948903

Write a C# program without a class.
>>
File: jPhQNDo.png (283 KB, 1750x1362) Image search: [iqdb] [SauceNao] [Google]
jPhQNDo.png
283 KB, 1750x1362
>>52946468
just some shitty implementation of some of my bot's commands for testing crap
>>52948903
you can write one without a main method
>>
>>52948937

Here you go, m8.

using System;

namespace NoClassHere
{
struct Program
{
static void Main(string[] args)
{
Console.WriteLine("test");
Console.ReadKey();
}
}
}

>>
>>52948957
>struct
isn't that exactly what class it?
>>
>>52948965

No. In C# structs are real value types.
>>
File: Bxlkq8RCIAEl3RP.jpg (86 KB, 600x800) Image search: [iqdb] [SauceNao] [Google]
Bxlkq8RCIAEl3RP.jpg
86 KB, 600x800
>>52946164
Idk man, he's a 30ish old guy without a gf.
>>
>>52948957

Har har. You're still defining a method on a type, rather than a top-level function. Why can't either C# or Java do this?
>>
does anyone have any of those 'roll for programming project' list images? looking for inspiration.
>>
>>52949004

I begged Hejlsberg for free functions. I don't think it's going to happen. They believe that static using statements have defeated the need for them.
>>
>>52948957
Console.ReadKey();

Running directly from explorer? :^)
>>
>>52949010
https://better-dpt-roll.github.io/
>>
>>52949010
https://better-dpt-roll.github.io/
>>
>>52949028

Running it from VS.
>>
>>52949030
>>52949031
thanks
>>
beginner here using java, how do i get the if statment to work if the user types in 'v'?

System.out.println("Enter \'v\' to view the monthly rainfall."
+ "\nEnter \'t\' to find the total rainfall."
+ "\nEnter \'a\' to find the average monthly rainfall."
+ "\nEnter \'m\' to find the month with the most rainfall."
+ "\nEnter \'l\' to find the month with the least rainfall."
+ "\nEnter \'u\' to update rainfall for a given month."
+ "\nEnter any other character to quit.");

if(char == 'v')
{
for(int i = 0; i<12; i++)
{
System.out.println(month[i] + rain[i]);
}
}
>>
>>52949313
You google it. This is such a fundamental thing you shouldn't be asking /dpt/.
>>
>>52949364
that usually takes longer, but i found .readLine so maybe thatll work
>>
>>52949313
case statement
>>
>>52949313
https://docs.oracle.com/javase/8/docs/api/java/util/Scanner.html
>>
>>52949313
I learned with keyboard.scanner, but that's more complicated. There might be a read char thing.
>>
>>52946321
it can still overflow if a<0 and b<0 and a+b<-2^7 cant it?
>>
tfw finished with bot
tfw out of things to make
>>
>>52949313
>>52949379
>>52949484
It disgusts me people like this post on 4chan, let alone can access the internet.
>>
>>52948996
at least he found two midgets to dress up for the same anime as him
>>
>>52949574
make my combat manager for my RPG. combatManager is provided with an array of entities (10 max), an entity has 4 skills and a boolean isFriendly to tell what side they're on, and skills have a damage value and energy cost. enemies should randomly select a target, whereas friendlies have targets which are selected by the user user keyboard.systemin
>>
>>52949435
i don't think so, can you explain further?
>>
>>52949591
hey now i know it seems lazy but there is a reason, im on a tight schedule and i thought asking on g would be better than searching frantically on the web. have you procrastinated before?
>>
>>52949734
Google provides 38,000,000 results in 0.45 seconds. You are fucking stupid if you think waiting around for someone on /g/ to spoonfeed you the answer is faster especially when this problem isn't even a problem, it's your own retardation and inability to learn even the basics of a languages standard functions.

>tight schedule
Not so tight that you can't browse /g/.
>>
>>52949313
Scanner s = new Scanner(System.in);
char c = (char) s.nextInt();
>>
>>52949773
nvm

Scanner s = new Scanner(System.in);
char c = s.next().charAt(0);
s.close();
>>
>>52949574
Make it scale
>>
>>52949770
>Google provides 38,000,000 results in 0.45 seconds
wow that's amazing, why didn't i even bother
and finding it here instead of a book is spoonfeeding i guess. sorry
>>
>>52949313
>> char == 'v'
what the fuck
>>
>>52949313
>==
quit trying to use things that make sense, use .equals
>>
>>52949852
Of course it's spoonfeeding, do you even know what that means?

>why didn't i even bother
I'm wondering the same thing, why did you bother to type out that entire reply, solve a captcha and then wait for some idiot to spoonfeed you the answer instead of typing three or four words into google and clicking the first or second link?
>>
>>52949892
nice meme
>>
>>52949897
okay let me tell you, i did search google earlier before /g/, and everything was irrelevant to what i needed, all these forum posts and pages, that i just didn't know where to look. i already have the answer btw, im set to go.

what if i gave back the favor? can you forgive me?
>>
>>52949886
In any sane sane language that would work fine. I actually think it will work here since it's a primitive type but I'm only passingly familiar with java.

The fact that java has a big ass footgun built into its language semantics (equality means something different for primitives vs. objects, and it's basically meaningless for objects) tells you what a shit language it is, not that people learning it are inept.
>>
File: mathsinjava.jpg (57 KB, 674x490) Image search: [iqdb] [SauceNao] [Google]
mathsinjava.jpg
57 KB, 674x490
>>52949892
>>
New thread: >>52949972
>>
>>52949946
No, let me tell you. I'll forgive you if your chosen solution is not featured on this page
https://stackoverflow.com/questions/5287538/how-can-i-get-the-user-input-in-java

If it is then you are irredeemable scum.
>>
File: mount stupid.jpg (23 KB, 600x338) Image search: [iqdb] [SauceNao] [Google]
mount stupid.jpg
23 KB, 600x338
>>52949952
>The fact that java has a big ass footgun built into its language semantics (equality means something different for primitives vs. objects, and it's basically meaningless for objects) tells you what a shit language it is, not that people learning it are inept.
pic related

>In any sane sane language that would work fine. I actually think it will work here since it's a primitive type but I'm only passingly familiar with java.
the problem is that you can't have a char named char. name it something else
>>
>>52949970
as if GMP in C/C++ looks any better

if you do operator overloading in C# now that is a footgun
>>
Does knowing how to program make you a happier person, or should I just slip someone a 20 to unfuck my computer?
>>
>>52950031
knowing how to troubleshoot issues is not equivalent to knowing how to program
>>
>>52950016
>if you do operator overloading in C# now that is a footgun

No it's not. I mean, in general, it's a bad idea. For certain things where it makes sense, there's nothing wrong with it.
>>
>>52949712
>for my RPG
sounds like homework, lad
>>
>>52949993
>pic related
So enlighten me then, how do the "==" semantics in java make sense? Why is it reasonable that its meaning for one set of types is different than for another set of types?

>the problem is that you can't have a char named char. name it something else
I didn't notice that he was using a reserved word as a var name but I don't see how that changes the poor decisions that is java's equality semantics.
>>
>>52950031
How does learning how to program unfuck your computer?
>>
>>52950064
I could find out why on earth there's an issue in the first place when everything should be working.
>>
>>52950060
jesus fuck do we have to talk about this in literally every thread

at least since you're unironic about it i'll try to explain a little bit

== works exactly like you think they would for primitives, it compares values

== for objects compares the value of the reference. two objects may have the same state but if they aren't the same object instance then a == comparison will be false. if you're interested in the state (which you should never be, unless comparing strings) then use .equals()

https://archive.rebeccablacktech.com/g/thread/S52939611#p52941601
https://archive.rebeccablacktech.com/g/thread/S52939611#p52941918
>>
>>52950076
Well, that's the root of every problem. Thing's aren't working when they should be. I honestly think that life is a hackjob and everything is just constant maintenance.
>>
>>52950097
>two objects may have the same state but if they aren't the same object instance then a == comparison will be false.

The only person who thinks this is reasonable is Gosling.
>>
>>52950134
it compares the values of the references. you're thick in the head if you can't see how it could make sense. in java, you always deal with values. you have pass by value etc.

if you have obj1 and obj2

assert(obj1 == obj2);
doSomeShit();
assert(obj1 == obj2);


with the way you suggest it to work, you can't necessarily make those assertions. how is that reasonable?
>>
>>52950097
>jesus fuck do we have to talk about this in literally every thread
No, I understand how "==" works perfectly fine. I'm saying it's a shitty design decision. Why does an operator have different semantics for one set of types vs. another? It's just a poor decision, even if we've all learned to live with the inadequacy, it's still broken.

Further, the idea that objects have identity above and beyond their state is a major part of the cancer that makes concurrent programming such a notoriously hard problem. Real values and value semantics are what we need to solve this problem and the fact that value semantics are basically not supported at the language level one among many reasons why java fails as a high level language, as a concurrent language, and as a statically typed language.
>>
>>52950183
>I'm only passingly familiar with java.
k tard
>>
>>52950172
>with the way you suggest it to work, you can't necessarily make those assertions.

== should, by default, be checking the state of the object. You could compare references with some other function (like .referenceEquals(), which is what C# does).

I've probably said it about 15 times now, but that was a fucking dumb choice (among others).

Too bad it can't be changed now.
>>
>>52950195
k tard
>>
>>52950183
>I'm saying it's a shitty design decision.

It is.
>>
>>52950183
>>52950195
>>52950211
you're both fucking retarded. i'm sick of "discussing" this with you. fucking obsessive bikeshedding pieces of shit.
>>
>>52950205

oh yeah? well... ur mum!
>>
>>52950172
>java, you always deal with values. you have pass by value
The mental gymnastics here are staggering. You have to redefine everything in the world as a reference (something java doesn't even do) and pretend like state just doesn't exist. The idea that state and identity don't have anything to do with each other is broken, it breaks down at the point we introduce concurrency but it also breaks down well before that when we have "pass a reference (err, I mean value which is a ref but somehow this is still pass by value), take no return value, but system state and even my locals have been mutated in god knows what ways"
>>
>>52950221
maybe you want two or more different objects that may sometimes have the same state... woah???
>>
>>52950220
>bikeshedding
stop this "bikeshedding" meme
thanks
>>
>>52950220

Because you're wrong. Not only that, but if you didn't want to argue the point, then stop putting the bikeshed on the meeting agenda, you fucking nigger.
>>
>>52950231
kill yourself sperg

>>52950235
kill yourself sperg

it's literally bikeshedding. arguing and nitpicking about things that don't even matter

>>52950237
kill yourself sperg

>stop putting the bikeshed on the meeting agenda
i'm not the one who keeps bringing it up. i'm only defending the accusations
>>
>>52950233

What does that have to do with anything?
>>
>>52950246
>kill yourself sperg
>kill yourself sperg
>kill yourself sperg
wow man, you sure showed me
way to argue your point
>>
>>52950248
then you don't want to compare the state, you want to compare the identity (actually not even that, and you still haven't shown an interesting situation where you want to compare either reference or value equality). he's talking about only having "values" but that makes no sense for OOP. FP maybe
>>
>>52950220
>bikeshedding
>one of the largest subjects of academic research in the last 5 years
Uhhh no. The fact that java's builtin equality semantics are broken and that we need to push it off to the programmer to solve it is not bikeshedding.
>>
>>52950260
i've argued my point perfectly fine

and i don't need to prove anything to you

kill yourself sperg

>>52950264
kill yourself sperg
>>
>>52950246
>i'm only defending the accusations

Because you are James Gosling. You are out of the limelight and you have nothing better to do than post on /dpt/ at 2:30 in the morning.

>>52950261
>then you don't want to compare the state, you want to compare the identity

Fine, then use .ReferenceEquals().
>>
>>52950271
you can't even show a single interesting situation that doesn't involve strings where it's necessary to compare object values, or even references for that matter outside of checking for null/not null in a pajeet enterprise environment.
>>
>>52950266
>kill yourself sperg
So you just post this when you admit you can't come up with a real argument for something? Makes sense I guess but maybe you could think of a more entertaining schtick next time.
>>
>>52950299
keep believing that

just stick to haskell or whatever if you want to keep doing your ivory tower masturbation without having to look at the atrocity that is the #1 programming language in the world
>>
>>52950290
>you can't even show a single interesting situation that doesn't involve strings where it's necessary to compare object values
>what are complex numbers
>what are database records
>what is basically anything in a concurrent system
Try thinking for at least 30 seconds before posting next time.
>>
>>52950290

The interesting situations come up with things that should be structs, but Java doesn't have them.

Vec3D pt1 = new Vec3D(12, 23, 2);
Vec3D pt2 = new Vec3D(12, 23, 2);


It'd be nice to be able to use == to see if we're talking about the same point in 3D space, but alas, you can't.. you have to use .equals().
>>
>>52950321
>database records
Csharts confirmed for codemonkey CRUDshits
>what is basically anything in a concurrent system
stick to doing your gay haskell shit if you want to keep believing this

>>52950322
oh the humanity
>>
>>52950335
>oh the humanity

Exactly. Thank you for understanding.
>>
>>52950311
>without having to look at the atrocity that is the #1 programming language in the world
That's the problem though, java has been inflicted on us all for many years to come and the fact that even its most basic language features are poorly designed isn't something I or anyone else can ignore. I wish it weren't so, but when a majority of new grads every year have been taught to ignore these glaring language flaws then we all eat shit as a consequence.
>>
>>52950340
i can't stand using java any more or sepples without operator overloading i will kill myself nowc
>>
>>52950335
>Csharts

THERE IT IS -- THERE IT IS!! THE MEMORIZED 25 SECOND SPEECH!
>>
>>52950195
c# compares references on objects by default, not values. .Equals() and .ReferenceEquals() have the same effect on a reference type object.
>>
File: 1425429412322.gif (141 KB, 287x344) Image search: [iqdb] [SauceNao] [Google]
1425429412322.gif
141 KB, 287x344
>>52950342
there is nothing preventing you from learning """"""""better"""""""" languages like hasklel
>>
>>52950335
>Csharts confirmed for codemonkey CRUDshits
>knowing what a database is makes your work CRUD
>CRUD isn't actually a huge portion of all programming that your shitty language gets used for
uhh, no

>stick to doing your gay haskell shit if you want to keep believing this
I've written like 20 lines of Haskell in my life if you care, but that's besides the point since java jerks off over its concurrency features (actually most java devs probably don't even know what concurrency means beyond "gotta go fast") nonstop when it doesn't even have the most basic tools to support sane concurrency
>>
>>52950362

If you're smart, you'll override the equality operator. That's why overloading is goater.

Javafags wish they could do it.
>>
>>52950372
lmfao kill yourself if passing around copies of immutable values is the only way to do sane concurrency
>>
>>52950376
so if you look at someone's code base in C# you literally can't tell at a glance what kind of comparison == is doing... nice
>>
File: 1430779102610.jpg (58 KB, 499x496) Image search: [iqdb] [SauceNao] [Google]
1430779102610.jpg
58 KB, 499x496
>>52950376
>If you're smart, you'll override the equality operator
>>
>>52950380
*if you think
>>
>>52950388

Exactly, it's like a guessing game. You can't even tell from a glance whether accessing a member field of an object will have side effects because properties let you do all kinds of shit!

It's like a jungle gym over a shark pit with little razor blades welded to it.

I love it.
>>
>>52950367
True, which is why I have learned better languages, but to reiterate what I said in the very post you quoted: java is pervasive and nothing I personally do can change that. So I'm left with trying to call attention to its flaws or allow poor design decisions continue for another couple of years until it becomes C++ with a shittier culture and without the singular redeemable feature which are templates.
>>
>>52950404
very clean. such simple. much elegant. so easy to learn. wow
>>
>>52950406
>So I'm left with trying to call attention to its flaws or allow poor design decisions continue for another couple of years
translation:
>i will continue to pester fellow spergs in /dpt/ with my subjective opinions for years to come and i will accomplish nothing in terms of actually persuading anyone to change their mind and reach """"""""enlightenment""""""""
>>
>>52950388
>you literally can't tell at a glance what kind of comparison == is doing.
How is this different from literally any method call where you pass a reference (aka pretty much the only thing you can do in java)? If code below you in the callstack wants to fuck you, you can't really avoid it, even in well designed systems. We can take efforts to reduce the level of damage done but even making operator overloading a free-for-all at least allows for good design while Java's approach is "lol, you're on your own for this one brah".
>>
>>52950429
assert(obj1 == obj2);
doSomeShit();
assert(obj1 == obj2);
>>
>>52950404
if you produce shitty code it will be shitty regardless of language. just because you can use properties for anything doesn't mean you should
>>
>>52950446

I know, I'm just having a bit of fun with the guy.
>>
>>52950446
>just because you can use <useless superfluous meme feature in C#> doesn't mean you should
>>
>>52950438
So what? Functional code with value semantics could provide the same guarantee. In fact the idea that you could arbitrarily manipulate a system and have a language level promise of equality just demonstrates how broken Java's idea of equality is.
>>
>>52950478
>useless superfluous

Java users on suicide watch due to lack of features
>>
>>52950478
>feature exists in other language
>my language simply refuses to support it despite taking on FAR more complicated poorly implemented BS
>it's useless, superfluous, and a meme
does not follow
>>
>>52950506
>>52950522
>feature exists in other language
>you shouldn't use it though
>this other language is somehow better
>>
>>52950550

You should use features, just sparingly.
>>
>>52950550
Who actually things thinks C# properties are a bad idea? Assuming you don't abuse them (i.e. you don't change state besides in the abstract way implied by the call) they seems like a good idea. Not as good of an idea as something like immutability, but better than "my IDE writes 50% of my code for me because someone once told me getters and setters are how you write ENTERPRISE QUALITY code" which pretty much epitomizes java development.
>>
>>52950613
ok kid
>>
>>52950652
>ok kid
nice cop out m8
>>
>>52950702
thanks for telling me all these things you sure taught me a lot
Thread replies: 380
Thread images: 38
Thread DB ID: 516129



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

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

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 shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.