[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]

/dpt/ - Daily Programming Thread

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: 311
Thread images: 26

File: Lauren Mayberry3.jpg (117KB, 934x1410px) Image search: [Google]
Lauren Mayberry3.jpg
117KB, 934x1410px
Old thread:
>>56736691

100 Project suggestions:
https://better-dpt-roll.github.io/

Lets manage a thread without the daily "Java is shit" baitposting.
>>
File: 1427571057920.gif (1MB, 290x189px) Image search: [Google]
1427571057920.gif
1MB, 290x189px
Java is shit
>>
>>56742259
https://www.edx.org/course/software-construction-java-mitx-6-005-1x?utm_campaign=mitx&utm_medium=partner-marketing&utm_source=email&utm_content=mailchimp-60051x-sept2016&utm_source=MITx+on+edX+News&utm_campaign=cec2aeaf2e-Software_construction_9_14_2016&utm_medium=email&utm_term=0_e07062bda1-cec2aeaf2e-104983165&ct=t%28Computation_Systems_09_02_2016%29
>>
How does one authenticate a user by HWID in a way that's not crackable in 5 minutes?
The way I'm doing it right now is making a libcurl http request to a php script on my server with the useragent equal to the encrypted HWID. The script then checks if that HWID is valid and if it is, gives a response of a pseudorandom base64 number that returns true when passed through a function in the program.
Is this even safe?

Help.
>>
>>56742259
Not funny, because java really is shit.
>>
>>56743119
What are you trying to do? What do you authenticate users for? Why?
>>
>>56743208
Licensing.
>>
>>56743212
For what?
>>
>>56742009
>she
>>
SO, hard question for all the 17yo Java-bashing edgelords here: if not Java, which programming language should be the lingua franca for 90% of generic Windows apps instead?

Note that it should be ALL-purpose, so into the trash go all your hipster Rubys and Haskells.
>>
>>56745268
>Windows apps
C#
>>
>>56745268
How about some .NET language which is de facto main platform for windows?
>>
is there some way to make a very basic GUI in C++, without installing extensive libraries like Qt?
>>
>>56745439
win32 api?
On linux gtk should be installed by default so that
>>
The best language for general development is C++
>>
What's a good beginner C++ book?
>>
>>56745268
If you care about performance, C++

If you don't care about performance, CL or Scheme
>>
>>56745475
kekekek
>>
>>56745476
https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628
>>
>>56745268
see >>56745324
ignore this >>56745494
>>
>>56745451
if I learn Qt, I can also use it on Java, amirite?
does the same hold true for Win32 API?
>>
>>56745508
anon, we all know c is too hard for c++babbies
>>
>>56745509
C# is garbage collected which causes unacceptable stuttering
>>
>>56745268
C#.
How is this even a question?
>>
>>56745517
Anon, C is much, much simpler than C++. It's always better to learn C before C++.

Also one should always use
-Wall -Werror --pedantic
>>
>>56745514
There are bindings for multiple languages but i dont think you'd want to use qt bindings for java instead javafx or even swing.
>>
>>56745514
If you must use the JVM use scala and its swing wrappers for GUIs
>>
File: shitposter.webm (3MB, 1280x720px) Image search: [Google]
shitposter.webm
3MB, 1280x720px
/dpt/-chan, daisuki~~

Ask your much beloved programming literate anything (IAMA).

>>56745494
>If you care about performance, C++
>If you don't care about performance, CL or Scheme
C++ clang++:                    5.518077517 seconds time elapsed
C++ G++: 4.659448453 seconds time elapsed

Scheme Bigloo: 3.604533288 seconds time elapsed
Scheme Chicken: 7.966139806 seconds time elapsed
Scheme Gambit: 1.932229635 seconds time elapsed
Racket: 3.618877176 seconds time elapsed
Common Lisp SBCL: 3.015000773 seconds time elapsed


>>56745475
it's lisp.

>>56745439
Yes: imgui
https://github.com/ocornut/imgui

>>56745268
F# ?

>>56742009
Please, use an anime image next time.
>>
>>56745519
>C# is garbage collected which causes unacceptable stuttering
First of all, you are wrong.
Second, java is garbage collected as well. The original question was, what should be used instead of java. C# is java but better in 99% of cases. (You could make some argument for java having better crossplatform support as of right now, but that's bound to change soon.)
>>
>>56745519
if u are completely retarded yes, that would happen
>>
>>56745552
>muh cherrypicked single benchmark
>>
>>56745546
even calling standard swing from scala is trivial if you dont want to use wrapper...
>>
>>56745577
Yes but plain swing is much more unpleasant to use than scala-swing.
>>
>>56745514
>does the same hold true for Win32 API?
Yes the win32 api is largely the same regardless of which language you are using. However why wouldn't you use some higher level abstraction, like windows forms / WPF?
>>
>>56745552
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=sbcl&lang2=gpp
>>
>>56745572
more importantly, with no code or even description of what was being benchmarked, but you really shouldn't be falling for bait this old anyway.
>>
>>56745613
Silly me, expecting people to post on /dpt/ in good faith
>>
debuggers are for monkeys

http://linuxmafia.com/faq/Kernel/linus-im-a-bastard-speech.html
>>
>https://better-dpt-roll.github.io/
>028: factorial

No bully, I'm only a few weeks in:
#include <stdio.h>
#include <stdlib.h>

int main(void) {
int i, num, num2;
long fact = 1;

printf("Input a number: ");
scanf("%d", &num);
num2 = num;
num = abs(num);

for (i=1; i <= num; ++i)
fact *= i;

if (num2 < 0 && num % 2 != 0) {
printf("The factorial of %d is -%lu\n", num, fact);
}
else
printf("The factorial of %d is %lu\n", num, fact);

return 0;
}


Works with 0 and negative numbers.
What's to be improved here?
>>
Who else /as400/ here?
>>
>>56745666
int factorial(int n) {
return n == 0 ? 1 : n*factorial(n-1);
}
>>
literally >95% of you FUCKING SUCK at programming, and a lot of you delusionally think you don't suck
>>
File: frk.png (4KB, 164x196px) Image search: [Google]
frk.png
4KB, 164x196px
>>56745726
>>
>>56745666
uint fact = 1;
for (; num > 0; num--) fact *= num;
>>
>>56745666

What are you using to learn C? You're already doing loads better than most C programmers I see with only a couple of weeks. Like most people who learn don't even bother to know to use void to designate a function with no arguments.

Only criticism is inconsistency with if else and braces, where the if uses braces but else doesn't. Please use braces for everything even if it's annoying. It saves you from crappy bugs with scope.
>>
File: 2016-09-22-125602_583x130_scrot.png (16KB, 583x130px) Image search: [Google]
2016-09-22-125602_583x130_scrot.png
16KB, 583x130px
alright, I answered this shit already, but lets see how well /g/ knows their compiler/programming theory
>>
>>56745753
>use void to designate a function with no arguments.
>pointlessly typing unnecessary characters that in no way aid understanding of the code
>>
File: 1474643240306.jpg (191KB, 1242x818px) Image search: [Google]
1474643240306.jpg
191KB, 1242x818px
enjoy your college meme
>>
>>56745773
Fuck off with your homework.
>>
>>56745777
so you suggest they learn that empty parentheses () means no arguments, which is incorrect?
>>
>>56745785
>>>/pol/
>>
>>56745825
thank you for correcting the record
>>
>>56745773
that's your homework
>>
>>56745777

> 6.7.6.3 Function declarators (including prototypes)
> 10 The special case of an unnamed parameter of type void as the only item in the list specifies that the function has no parameters.
> 14 An identifier list declares only the identifiers of the parameters of the function. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters. The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied.)
>>
>fucking monkeys ITT unironically use debuggers
>>
>>56745848
yes, I already finished it. I just want to see what /dpt/ can answer
>>
>>56745717
i will have to learn a bit more to do that, I haven't started with functions yet
>>56745752
cool!
>>56745753
messed around for a few days making silly programs and stuff
now I'm reading C programming: a modern approach
>Please use braces for everything
will do!
>>
http://programmers.stackexchange.com/questions/131377/whats-the-benefit-of-avoiding-the-use-of-a-debugger/131391

What looks like guessing from the outside often turns out to be what I call "debugging in your mind". In a way, this is similar to grandmasters' ability to play chess without looking at a chess board.

It is by far the most efficient debugging technique I know, because it does not require a debugger at all. Your brain explores multiple code paths at the same time, yielding better turnaround than you could possibly get with a debugger.

I was not conscious about this technique before briefly entering the world of competitive programming, where using a debugger meant losing precious seconds. After about a year of competing, I started using this technique almost exclusively as my initial line of defense, followed by debug logging, with using an actual debugger sitting at the distant third place. One useful side effect of this practice was that I started adding new bugs at a slower pace, because "debugging in my mind" did not stop as I wrote new code.

Of course this method has its limitations, due mostly to the limitations of one's mind at visualizing multiple paths through the code. I learned to respect these limitations of my mind, turning to a debugger for fixing bugs in more advanced algorithms.
>>
>>56745890
pajeet tier shart in marts will still defend using a debugger
>>
If i'm publishing an app to the play store do i need to add license of the third party libraries?

They use Apache 2.0 and MIT
>>
Kids who've never worked on a system larger than a college assignment GTFO
>>
>>56745916
yes but no
>>
>>56745890
Yes lets have 100 developers work on enterprise project without debugger we will make money for sure!
>>
>>56745890
>all this rationalizing because you can't figure out how to use gdb
>>
>>56745943
>100 pajeet tier shart in marts
FTFY
>>
>>56745930
woaah thanks my friendo :^)

Let's say i'm using RxAndroid do i have to add it somewhere in my app? This is an actual questino i don't want to get memed by the regulations of the play store, i can't find anything specific about this
>>
>>56745890
>competitive programming
lol, get a load of this fucking loser
>>
>>56745962
>foxgrapes.jpg
>>
>>56745659
>a disassembler on steroids that you can program.
That's what a debugger is you monkey.
>>
Alright guys I'm in a computer class in college, just starting to learn basic Java, but my teachers given us a tough dilemma to get around for a project.
My problem boils down to the fact that getting making my double equal the results of an int divided by an int displays the wrong number. I'm having it print to 2 decimal points with %.2f%n , but even if I remove that it always wont do the math right. For example it keeps doing 25/6 as equaling 4.00. I know having just one of those numbers be a double makes it do the decimal math right but part of her assignment is the numbers were dividing with x/y HAVE to be integers, and with no extra variables we need to get a accurate 2 decimal point output in double. SO the requirement is basically:
int x;
int y;
double result;

and it has to be you input x and y as ints, and then in 1 equation calculate it:
input x
input y
results = x/y

but holy hell it won't work. How do I make it do the right math without making one a double or adding any more variables?
>>
>>56745981
>I was not conscious about this technique before briefly entering the world of competitive programming
>briefly
keep rationalizing why you have to use a clunky tool just to step through some code
>>
>>56746028
>I prefer to do by myself what I could get the computer to do for me
Your mentality is foolish.
>>
>>56746024
cast to double first
result = (double) x / y
>>
>>56746052
I think you have to do
(double x) / y
>>
>>56746024
Take your homework somewhere else.

>>56746052
Don't encourage him
>>
>>56746046
we don't have general artificial intelligence, the machine is not as smart as a reasonably competent human being, but of course a pajeet like yourself might need every assistance they can get
>>
>>56746067
* ((double) x) / y
>>
>>56745777
>>pointlessly typing unnecessary characters that in no way aid understanding of the code

The use of the "(void)" formal parameter causes the C compiler to explicitly check to make sure that no arguments are provided at the point of call. If you use the "( )" formal parameter in C, then that check is not performed (for compatibility with the old pre-prototype style).

Proof:
echo > x.c "void f() { }  int main() { f(123); return 0; }"
gcc -Wall x.c
# no warning !!!


I always use "(void)" in C so that the compiler will catch it if I accidentally pass any arguments.

The rule is different for C++. C++ treats "( )" identically to "(void)", because C++ doesn't need to worry about compatibility with old pre-prototype C code.
>>
>>56746076
Why not just write it in assembly, so you can prove you are better than stupid pajeet tier gcc compiler! There is no way machine can do anything better than mighty you? You will surely write more optimal code
>>
>>56746106
>Why not just write it in assembly
now that's a strawman argument
>>
>>56746124
nope you made general claim, its not logical fallacy to attack it
>we don't have general artificial intelligence, the machine is not as smart as a reasonably competent human being
>>
>>56746076
>the computer can't do everything yet
>therefore there's no point in making it do what it can to help speed up development and bugfixing
That's the mentality that says we should still program in assembler and nothing with a more advanced compiler.
That's the mentality that says we should write code in Notepad and nothing more capable.
That's utterly retarded.
>>
>>56742484
Is this even any good?
>>
the only excuse for something to go wrong at all is if you literally just wrote some new code, and then it should be immediately obvious want went wrong, so you should be able to fix it trivially without using a debugger.

>>56746149
it was in the context of debugging you fucking retarded sperg

>>56746155
kill yourself
>>
>>56746149
He's just doing damage control because he doesn't know how to use a debugger.

I think I'll toss in a question about debuggers when I interview people just so my company never accidentally hires him.
>>
>>56746167
You got BTFO, just leave.
>>
>>56746174
and not a single valid argument in favor of non-pajeets/shartinmarts using a debugger was presented that day
>>
>>56746174
You should always do that. Debugger usage is fundamental imo.
>>
I'm about to ditch SFML (lack of stable C++ ABI forcing me to compile my own versions constantly, huge size, etc.), but what do I replace it with?

SDL or GLFW?

Both have all the functionality I need. I just can't decide. SDL is more widely used and I've used it a few times in the past, but GLFW seems to be even smaller than SDL. Meaning, even less chance of something that can break.
>>
>>56746189
i'll leave when i want to leave, and i didn't get BTFO you ridiculous idiot
>>
http://linuxmafia.com/faq/Kernel/linus-im-a-bastard-speech.html
>>
>>56746198
Until today I assumed that it was one of those things that are so obvious that you don't need to ask about them. Clearly I was wrong.
>>
>>56746233
can you even list your arguments against debuggers without referring to authority?
>>
>>56746251
have fun with your ENTERPRISE C# shart in mart crud garbage app lmfao
>>
>>56746265
fuck off with the "appeal to X" red herrings, how about YOU present some arguments in favor of using for NON-CODEMONKEYS to use a debugger
>>
>>56746265
>linus
>authority
>>
>>56746195
I hope to god you're not employed, you are a danger to any company's code.

The reason debuggers are useful are because in most cases, they are faster and more precise than you sitting and thinking "hmm.... I wonder why my code isn't working... well what value do I think this variable would have on the sixteenth iteration? Let me work it out... um... I *think* that's right...".

>>56746213
You turned to insults when it was pointed out that your reasoning was idiotic. It's time for you to leave.
>>
>>56746283
you made positive claim burden of proof is on you

>>56746286
well i guess i went little overboard
>>
>>56746269
Oh yes, I'll be sure to have lots of fun earning an income. You should drop your l33t h4x0r talk and try it sometime.
>>
>>56746330
>being a wagecuck
BAHAHAHAHAHA
>>
>>56746330
dont be so harsh, look he is even delusional because of malnutrition and exposure to elements since he is unemployed. We must be kind to poor and mentally ill.
>>
>>56746337
>unemployed
>thinks he knows shit about writing code
Not really surprising, given the arguments presented thus far.
>>
>>56746349
>>56746356
i make retarded amounts of $$$ on stocks and i'm running my own startup lmfao stay sour grapes
>>
>>56746349
>We must be kind to poor and mentally ill.
Why, when they don't show others even the most basic courtesy and respect?
>>
>>56746365
anyone can run their own startup lol
Here ill make startup based on banana gifs

>>56746377
They dont know any better, you cant blame paranoid schizophrenic for being paranoid thats problem with delusions, you dont know you are delusional.
>>
>>56746365
That's not true though, is it? You've overplayed your hand.
>>
>>56746402
>>56746404
i'll let you believe what you want to believe
>>
I want to create a simple CRUD web back end. What's the best language/tool to use? I'm currently looking at Python and Flask, but I'm open to suggestions. In return, have some quality code I found in one of the code bases I maintain.
    private String millisToTrackableDuration(long millis) {
long seconds = TimeUnit.MILLISECONDS.toSeconds(millis);
long minutes = TimeUnit.SECONDS.toMinutes(seconds);
if (seconds <= 5) {
return "5sec";
} else if (seconds <= 15) {
return "15sec";
} else if (seconds <= 30) {
return "30sec";
} else if (minutes <= 1) {
return "1min";
} else if (minutes <= 3) {
return "3min";
} else if (minutes <= 5) {
return "5min";
} else if (minutes <= 10) {
return "10min";
} else if (minutes <= 15) {
return "15min";
} else if (minutes <= 20) {
return "20min";
} else if (minutes <= 25) {
return "25min";
} else if (minutes <= 40) {
return "40min";
} else if (minutes <= 55) {
return "55min";
} else if (minutes <= 70) {
return "70min";
} else if (minutes <= 85) {
return "85min";
} else if (minutes <= 100) {
return "100min";
} else if (minutes <= 115) {
return "115min";
} else {
return "130min";
}
}
>>
>>56742009
I just started learning JavaScript. Why does everyone seem to hate this language while ate the same time it has managed to become the de-facto standard web scripting language.
It seems like a pretty nice language to me.
>>
>>56746421
And we'll let you cry yourself to sleep tonight.
>>
>>56746428
>some quality code I found in one of the code bases I maintain
have fun debugging that with your DEBUGGER lol
>>
>>56742009
speaking of lauren, what's the best language for automating twitter harassment
>>
>>56746440
Because something being widely used doesn't necessarily mean that it is good.

It's a pretty terrible language, desu. No way of importing code, no multithreading, bizarre scoping, no type system, byzantine coercion rules, and that's just for starters.
>>
>>56746464
Here's a framework you can use
http://slut.sourceforge.net/
>>
>>56745268
>the year of our lord two thousand and sixteen
>there are still people who use Java when C# exists
>>
>>56746428
C#
>>
>>56746483
Surprise, some companies have mountains of Java code that they don't want to spend time rewriting in C#

You'd know that if you had any professional experience
>>
>>56745613

It's all probably from this:
https://bitbucket.org/Tetsumi/closurebench/src

>>56746337

There are advantages in choosing to work, rather than to start a business. Namely, you do not have to take a risk. Should the company go under, you lose nothing, and may even be able to use your experience at the previous company when looking for a new job... so long as that experience wasn't the cause for why the company failed, of course.
>>
>>56746539
>I am a lazy person, which is why I like open source, for other people to do work for me.
https://www.google.com/search?q=linus+torvalds+net+worth
>>
File: Adam_Smith_The_Muir_portrait.jpg (50KB, 540x694px) Image search: [Google]
Adam_Smith_The_Muir_portrait.jpg
50KB, 540x694px
>>56746470
Then why did people keep using it to the point of making it widely used?
>>
>>56746584
people - especially web devs - are retarded
>>
>>56746440
on the browser side it seems to me that the big problem is that while there are nice parts of js we've been stuck with the bad parts for 20 years. there's never going to be some big break. just to use incremental improvements one has to add in all these compatibility libraries and transpilers
>>
>>56746584
>>56746470 has a point.
Java is good because 1 bilion devices use it is logical fallacy, same argument could be made for tobacco or alcohol.

As to answer why, when java first came out you had horrible old c++ and c, also oop was new popular thing. So all went with a fad and here we are.
>>
>>56746602
>i am smart and everyone who thinks different than me is dumb
What a cheap uninteresting cop-out answer.
>>
>>56746635
ok
>>
>>56746516
i mean there are people today who choose Java over C# when picking a language to learn and use
either way, that sounds like an argument for C# if anything
and i do have professional experience, but it was at microsoft, so as you can imagine that wasn't really a problem
>>
>>56746631
So it was good, at some point.
>>
>>56746649
you're fucking pathetic
>>
>>56746649
Because Java has a lot of momentum behind it, still. You'll be employable if you're good at Java.

Universities still teach it, probably a combination of their teaching staff having more experience with Java, and a vague nod to Java at least traditionally being more open than C#.

I know you might not like to hear this, but Java and C# are pretty much the same language if you squint a bit. You can train someone who knows one to use the other in a couple of weeks.
>>
>>56746668
It was different and easier and idea write once run everywhere sounded great to enterprise. Dont know whether thats good or bad.
>>
>>56746648
We were talking about JavaScript.

Java sucks donkeys balls.
>>
>>56746703
JavaScript is almost as shitty as Java
>>
>>56746692
java is arguably better than C#

>INB4 EPIC MEMES HURR HURR GUARANTEED (YOU)S
>>
>>56746703
Yeah, I thought I was replying to a different post.
>>
>>56746713
>java is arguably better than C#
I didn't say that. I said they're basically the same language. It's not surprising really, given that C# was designed to be Microsoft's Java.

The differences between them are largely inconsequential.
>>
>>56746745
>The differences between them are largely inconsequential.
if you say so, idiot
>>
>>56746751
I suppose you don't really know any other languages, so it's cruel to mock you.

There's a whole other world out there, you know. If you're willing to step outside your bubble.
>>
>>56746784
But the Java bubble pays so damn well...
>>
>>56746784
kill yourself
>>
Assume that people had discarded oop 20 years ago. What would javascript look like now?
>>
>>56746669
k lol

>>56746692
>You'll be employable if you're good at Java
yeah, but the landscape is quickly becoming such that you'd be more employable with C# if that's not the case already, and C# is a better language in general, so there's no real reason to go with Java instead nowadays

>Universities still teach it, probably a combination of their teaching staff having more experience with Java, and a vague nod to Java at least traditionally being more open than C#.
i'm sure those are exactly the reasons why. that's not really a reason to learn Java over C# if given a choice, though

>I know you might not like to hear this, but Java and C# are pretty much the same language if you squint a bit
if you really believe this, then you definitely don't know C#. they share many, many similarities, of course, but C# has quite a few significant features that Java has no sense of whatsoever, becoming proficient with which would take more than a couple weeks
>>
>>56746817
Strongly typed
>>
>>56746842
AHAHAHAHAHAHAHAH stay delusional retard
>>
>>56746817
Pretty much the same. A bastardized Scheme, polluted by committee, lacking many basic features.
>>
>>56746853
>bastardized Scheme
How can anything be worse than Scheme
>>
C# fucking SUCKS BALLS, shart in mart pajeet and todd and chandler
>>
>>56746692
>Universities still teach it,
What kind of shit university exclusively teaches Java?
My uni teaches everything from racket in the first year, to C for system programming, Java and processing and shit for other courses.
>>
>>56746890
I didn't say they exclusively teach Java. Mine taught Haskell, C/C++, Java, and Prolog. The choice of language was largely incidental; the intention was that we would be able to pick up any language relatively quickly.
>>
>>56742009
shes beautiful
>>
>>56746842
I agree with you on everything except the jobs.

Java is easily still the biggest market for jobs, although C# is the only close contender. C++, C, and Python are at the next tier.

If you really want to guarantee a job, you'll learn both Java and C# to a moderate level of proficiency. This is no easy task, though, because I do agree that they are VERY different languages.
>>
>>56746958
>I do agree that they are VERY different languages.
Where do people get this notion from?

They only seem very different if they're the only languages you know.
>>
File: antifb.jpg (4KB, 95x95px) Image search: [Google]
antifb.jpg
4KB, 95x95px
hi guys, i made a userscript to block the 'sponsored' posts in facebook. But it still shows 'suggested pages/posts' in the news feed because i don't have sample code of this. Anybody has this that can post some inspect element of this?
Also what 'sponsored' is in your locale
>>
>>56746958
Very different are java and haskell, c# and nasm.
C# and Java? Hardly...
>>
>>56747008
sponset
>>
>>56746581

Linus Torvalds is lucky. He produced a product he expected to go nowhere, and people ended up both contributing to it and using it. He makes money because large corporations ended up finding that product more useful, say, any of the BSDs, and they donate to the Linux Foundation because they want to keep that product being developed.

Most people will not end up like Linus Torvalds. They may come up with a good idea, but it ends up not being used. They may come up with a bad idea, and only end up wasting their time. Most have no idea about what the market wants, and quite honestly, that's fine. Not everyone has to be an entrepreneur, and if you can make 100K implementing someone else's ideas, whether they turn out great or turn out terrible, you still earned yourself some decent money.
>>
>>56747014
KILL YOURSELF
>>
>>56747038
God how could i've been so blind. By your light i can see now, i was clearly wrong! You have convinced me, C# and Java are as different as day and night!
>>
File: wdsa.webm (483KB, 960x540px) Image search: [Google]
wdsa.webm
483KB, 960x540px
>>56746539
Doxing is not an acceptable behavior. Please, don't. It's also against global rule 4.
>>
>>56747002
>>56747014
Maybe I should be more clear, but this is of course taking into account the inclusion of .NET and the Java standard libraries.

What criteria would you define to measure languages as significantly different?

If you tell me what your thoughts are, maybe I can build an argument to suit your needs.
>>
>>56747064
C# is almost as disgusting as python with a java clone syntax, it's similar in syntax and in being object-oriented and that's about it
>>
>>56747087
God damn, that's a cute anime.
>>
File: 8923415.png (154KB, 400x347px) Image search: [Google]
8923415.png
154KB, 400x347px
>>56747087
gotchu senpai

>>56746539
>>>/rules/global/4
>>
>>56746851
nice argument

>>56746745
>I said they're basically the same language
>The differences between them are largely inconsequential
this is very far from true. some examples: user-definable value types, user-definable conversions, operator overloading, significantly different/more powerful generics (boxing/unboxing, covariance/contravariance, constraints), delegates, better native interop (p/invoke, cli), unsafe blocks/methods, nullable types, linq, initializer expressions, implicitly types locals, extension methods, ref/out parameters, params (varargs), unsigned types, and attributes. that's not everything but it gives an idea

>>56746958
it may not necessarily be winning out yet, but C# is much more prevalent in the industry than people think. it's not immediately obvious because a very popular industry use case is internal tools, pipelines, testing, and automation. it's frequently used internally by companies that use completely different languages/technologies for their actual application/service backends/frontends

>>56747002
>>56747014
other languages being more different doesn't make C# and Java more similar
>>
>>56747064
You don't understand.

C# and Java are different in that C# sucks and Java rules, much like O'Doyle.
>>
>>56747115
whoops

>>56746539
>>>/global/rules/4
>>
>>56747087
>>56747115
>posting a bitcucket is doxing
???
>>
>>56742259
fpbp
>>
>>56742484
this fucking url though
>>
>>56747087
>>56747115

That's not Doxing; that's the source for where that benchmark came from. I pulled that link from an archive of a previous DPT, so I did not put into circulation any information that was not already public knowledge.
>>
>>56747122
>it's not immediately obvious because a very popular industry use case is internal tools, pipelines, testing, and automation. it's frequently used internally by companies that use completely different languages/technologies for their actual application/service backends/frontends

This.

It also holds true for the Windows Server market share. Those things are like 80% of all private internal servers that aren't included on stats that only measure public-facing servers.
>>
>>56747087
>People read rules?
What anime is that?

>>56747122
Ofc it does semantically speaking. If you use "very" for java and C# what do you use for java and prolog? Extremly? Whats only different? Are C and Java more or less very different?
Java and C# are more closely related than bunch of other languages, you cant usevery. From point of semantics ofc.
>>
>>56747156
>>56747133
I was just linking the rule for anon
>>
File: anal beads.png (72KB, 665x1027px) Image search: [Google]
anal beads.png
72KB, 665x1027px
Some of these are no longer true, due to some recent attempts by Java to catch up to C#, but at least this can aid the conversation.

I'm not picking a side, I just come bearing information.
>>
>>56747169
just because it's not as extreme as haskell vs php doesn't mean they aren't every different, and if you can't see how java and C# differ in very significant ways you don't know them well enough to make that judgment

things aren't black and white fucking autist
>>
this connects back to the previous sperging about learning a language vs learning a syntax, just because, java and C# have a similar syntax to each other doesn't mean they're similar languages, fucking pathetic retards
>>
File: fee.jpg (85KB, 1280x722px) Image search: [Google]
fee.jpg
85KB, 1280x722px
>>56747169
The girl is Yuuri Wakasa from School-Live!

https://en.wikipedia.org/wiki/School-Live!
>>
>>56747202
I know they are different but in language you define adjectives "short" in relation to "long", otherwise it makes no sense to speak of short things if you dont have concept of long. Same is true with close. In English we only have comparative and superlative we cant use comparative for such closely coupled languages or we cant define others well. It becomes meaningless
>>
File: akari.jpg (8KB, 219x230px) Image search: [Google]
akari.jpg
8KB, 219x230px
>>56747236
Thank you kind anon.
>>
>>56747236
Wait is that the apocalyptic thing where the girl in the background is delusional as fuck?
>>
>>56747169
Arguing semantics is just silly.

If you'd like, we can say that Java and C# are "significantly" different, but this obviously depends on what you see as significant.

I would say that the average programmer who is reasonably knowledgeable in Java and C# would agree that they are very different languages, on their own merits.

Once you include their standard libraries, their toolsets, and their other non-primary integrations (Swing, FX, Xamarin, .NET Core, etc.), the gap widens.
>>
>>56747258
they ARE very different to each other, how else do you think people end up with the belief that one is vastly superior to the other, that one is a top tier language and the other one is bottom trash
>>
File: ?.png (7KB, 120x120px) Image search: [Google]
?.png
7KB, 120x120px
>Explain how image compression works , in 3 sentences or less.

>e.g. how could you compress a image of 1MB to 200 Kb while maintaining the same quality? what is actually happening?
>>
>>56747285
Their beliefs are delusional using absurds like absolute statements...

>>56747280
If we observe only them in relation to one and other yes, generally speaking about all languages, they are not.
>>
>>56747308
not the same quality
>>
>>56747308
convert it to webm
>>
>>56747310
you're one of the most annoying anons in this thread, are you literally 14 years old, you keep spouting this pseudo-intellectual nonsense about logical fallacies and this arguing about semantics

it is a fact that there are people who think that java and C# are very different. you may not agree with that, but only because you suck.
>>
>>56747337
How can you argue anything without being semantically correct?
>>
>>56747346
go see a doctor about autism
>>
>>56747308
Homework

Ignore homework posts
>>
>>56747314
>what is lossless compression

>>56747308
The sequence xxxxx (five characters) can be written as 5x (two characters)
>>
File: umarusee.jpg (113KB, 1280x720px) Image search: [Google]
umarusee.jpg
113KB, 1280x720px
>>56747314
You could keep the same quality by simply using a palette, anon.
>>
>>56747308
Compressing works by removing redundant information. Take a file made that repeats the same information over and over, by just leaving "insructions" how to recreate the original you can save a lot of space.

e.g.
original:   AA AA AA AA AA 00 00 00 FF
//by just saving the data as a byte followed by the times it repeats you get
compressed: AA 04 00 02 FF 00

same information less space.
>>
>>56747382
>>56747405
good luck compressing an arbitrary 1MB image to 200KB losslessly
>>
>>56747285
Because those people are not very informed.
>>
>>56747368
If you don't care about words having a meaning I can't help you.
>>
>>56747417
java and C# have many differences. they were designed by different people with entirely different design philosophies. they are used for different purposes. your opinion is bad and you should feel bad.
>>
>>56747443
I feel bad.

For you.
>>
>>56747455
kill yourself
>>
>>56747308

https://en.wikipedia.org/wiki/Portable_Network_Graphics#Compression
>>
>>56747411
If the entire image is one single color uncompressed, then you can easily shrink its size (relatively speaking) down to almost nothing.

You'd only need information storing the dimensions and the color.

That's all the question is asking. Rather than saying quack 1,000,000 times, you just say quack and convey that you mean it to extend to 1,000,000 quacks.
>>
>>56747457
Why are you intent on silencing me?

Is it because this distinction between Java and C# that you've constructed in your head is the basis for your entire self-worth, and you don't want me to shatter the illusion and force you to accept that in reality, there is no such distinction, and you're every bit as good and bad as the Java programmers that you're so desperate to think of yourself as better than?
>>
>>56747529
bla bla bla (You)
>>
>>56747529
I don't know about her, but the fact that you're responding to only the shitposter and not the valid discussion is quite telling.
>>
File: Canepa-Green-McLaren-P1-GTR-0.jpg (58KB, 957x614px) Image search: [Google]
Canepa-Green-McLaren-P1-GTR-0.jpg
58KB, 957x614px
oh snap it was the carposter all along!
>>
File: BP7RbKcCIAAwyj6.jpg (26KB, 599x337px) Image search: [Google]
BP7RbKcCIAAwyj6.jpg
26KB, 599x337px
I havent seen any update from akari bbs today.
>>
>>56747569
/o/ut
>>
File: GTR-3.jpg (70KB, 1200x801px) Image search: [Google]
GTR-3.jpg
70KB, 1200x801px
>>56747607
after you lick my tailpipes
>>
>>56747569
>green McLaren
>is actually orange
Sucks to be a color blind fag
>>
File: bugveyron-vs-mclaren_fullyc_013.jpg (57KB, 940x499px) Image search: [Google]
bugveyron-vs-mclaren_fullyc_013.jpg
57KB, 940x499px
>>56747633
it's dark green with orange accents idiot
>>
>>56747541
Syntactically the languages are very similar, it's C++ syntax all over again.

The type systems are roughly the same. No higher-kinded types. Nulls. They both have closures (delegates in C++; anonymous inner classes in Java because fuck you). Neither has macros. I'll give you that they implement generics a bit differently. Both use OOP with interfaces and superclasses. I'll give you that C# has extension methods but they're toys. Neither has typeclasses. Neither has purity enforced by the type system. Neither has tail call optimization. C# has properties, surprise, it's nothing. Both of them have the blight that is reflection.
>>
>>56747600
I'm right here.
>>
>>56747651
now compare C# to python using the same reasoning
>>
>>56747670
How's going?
>>
>>56747644
Cars are like computer cases. Only edgy kids care about them.
>>
File: Ferrari-F12tdf-2.jpg (312KB, 1600x1066px) Image search: [Google]
Ferrari-F12tdf-2.jpg
312KB, 1600x1066px
>>56747697
i don't even care about cars i just post them because some fag gets super butthurt about it
>>
>>56747690
Python's type system is entirely different. Its syntax is very different. Its scoping is different (I neglected to mention that Java and C# both use the same sensible scoping; Python's is insane). Its lambdas are a joke.
>>
>>56747697
Cars are like computer cases which are like smart watcher which are like macs which are like thinkpads which are like ipads which are like samsung galaxies which are like laptop which are like computers which are like tvs which are like books which are like trees which are like life. Only edgy kids care about them.

Slippery slope never ends
>>
>>56747728
>makes weak ass arguments for why java and C# are similar, only highlighting similarities and dismissing the few differences he does bring up
>only points out differences between python and C#, brings up syntax as one of his main arguments
you're a lost case
>>
>>56747731
What matters is how much you paid and whether what you got can do what you need.
>>
>>56745666
>conflating algorithm with user interface
congrats satan, you've failed the test

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

long fact(int i);

int main(void) {
int num, num2;
long fact;

printf("Input a number: ");
scanf("%d", &num);
num2 = num;
num = abs(num);
fact = fact(num);

if (num2 < 0 && num % 2 != 0) {
printf("The factorial of %d is -%lu\n", num, fact);
}
else
printf("The factorial of %d is %lu\n", num, fact);

return 0;
}

long fact(int i) {
long fact = 1;
for (i=1; i <= num; ++i)
fact *= i;
return fact;
}
>>
>>56747780
how much you paid relative to your income*
s/need/want
>>
>>56747780
dont mind me im only blowing things out of proportion
Personally ill use whatever i have to and in spare time do whatever i want to.
>>
>>56747799
woops
long fact(int num) {
long fact = 1;
int i;
for (i=1; i <= num; ++i)
fact *= i;
return fact;
}
>>
>>56747803
I think it's foolish to overpay for something whether you're a pauper or a prince.
>>
>>56747651
>>56747728
You're absolutely cherry-picking, and if you think those are the extent of the differences, you're not very familiar with either of them.

See >>56747199
and >>56747280
>>
>>56747824
ever since good old year of our lord 1999 you can do
for(int i = 0; i < num; i++)
>>
>>56747836
The language is not the libraries available for it, nor the tooling.
>>
>>56747855
Introducing an extra variable is incredibly wasteful.
>>
>>56747825
but are you overpaying for a ferrari if that's what you enjoy? did you still overpay when you sell it on to someone else for twice the price after you've had your fun with it? sounds like sour grapes
>>
>>56747874
Great, you've successfully addressed 1/40th of the content of those posts, while also failing to realize that things like .NET and the JVM are not to be dismissed, as they are integral parts of the usage of those languages.

McFucking kill yourself.
>>
>>56742009
So I'm learning Haskell and it took me a whole day to do this. Please give me tips about it:
input is a txt and ouput is a .cue file
import System.Environment
import Data.List.Split
import qualified Data.Text as T

--From stackoverflow.
show2d :: Int -> String
show2d n | length (show n) == 1 = "0" ++ (show n)
| otherwise = show n

mystrip :: String -> String
mystrip x = T.unpack $ T.strip $ T.pack x

main = do
args <- getArgs
f <- readFile (args !! 0)
let linesOfFile = lines f
let nlines = map (splitOn " - ") linesOfFile -- [["01 blahblah", "00:00"],["02..]
putStr "FILE \"\"\n"
mapM_ putStr [" TRACK " ++ (show2d a) ++ " AUDIO\n REM NAME \"" ++ (mystrip $ b !! 0) ++ "\"\n INDEX 01 " ++ (mystrip $ b !! 1) ++ ":00\n" | (a,b) <- zip [1..] nlines]
>>
>>56747874
THE LANGUAGE IS NOT THE SYNTAX YOU GODDAMN FUCKING RETARD
>>
>>56747694
Writing some tests.
I want to trigger the error from yesterday.
>>
>>56747874
>the sum of a language is only its syntax

what
>>
>>56747337
>it is a fact that there are people who think that java and C# are very different
And they're either pedantic or retarded.
>>
>>56747912
The syntax limits what you can express in the language. (It's not the only thing that does.)
>>
>>56747929
you're pedantic and retarded
>>
>>56747926
Did you miss the bit about type systems?
>>
>>56742009
Who is this semen demon?
>>
>>56747891
I rather think that depends on how much you pay for the Ferrari.
>>
>>56747855
>>56747890
there are no extra variables introduced tho.
>>
>>56747955
>filename.jpg
>>
>>56747912
>>56747901
>We dont need universities, cs is a meme.
Kids here is why you should go to school and learn some formal theory.
>>
>>56747955
Coraline Ada Ehmke
>>
>>56747964
>heh, I'll say they're uneducated without providing any sort of actual argument to refute their claims, that'll show 'em!
>>
>>56747961
you'd presumably pay more or less the current market value, adjusted for various factors such as the local availability and whatnot
>>
>>56747962
i
>>
>>56742009
>"The Cunt of Glasgow" Edition
>>
>>56747911
>args <- getArgs
>f <- readFile (args !! 0)

You can do this, if you're assuming there's at least one arg:

>arg0 : args <- getArgs
>f <- readFile arg0


You want to break up that last line for sure.
>>
>>56747986
Where did anyone say anything about current market value previously?
>>
>>56747964
>babby's first semester in college
>thinks he knows all of programming even though he can hardly be considered well-versed in any one specific programming language
sure is dunning kruger
>>
What IDE are you guys using?
>>
>>56748002
what does your post have to do with anything?

and who are you to judge other people on how they spend their money? the fuck does it matter?
>>
>>56748018
None.
>>
File: 1470973297480.png (77KB, 250x250px) Image search: [Google]
1470973297480.png
77KB, 250x250px
>>56748010
>dunning kruger
Looks like someone's got dunning kruger
>>
>>56747984
>>56748010

programming language doesnt need library, doesnt need compiler. It requires syntax semantics and grammar. It can be defined on paper and still be a language.

So yes strictly speaking you can dismiss jvm and .NET. C# is still language even on paper without .NET and winshaft same with Java
>>
>>56748018
The one that works the best with the languages I use.
>>
>>56748032
If you don't like the idea of people judging you, then I humbly submit that you need to get over yourself.
>>
>>56748035
>>56748034
the LANGUAGE FEATURES and CONCEPTS are very different. it's not just how similar the syntax is. fuck off
>>
>>56747936
Reminder that infix operators with complicated precedence rules, separation of expressions and statements, grouping of statements by blocks of code, while loops, for loops, if blocks, else block, else if blocks, lexical scope, variables that are mutable by default, procedures/methods/functions as the primary abstraction for sections of code, and assignment with special support for "lvalues" is not required of any language and there are dozens of language without these traits.
>>
>>56748050
you're clearly the one who needs to get over yourself
>humbly
you're delusional

insufferable sperg
>>
>>56748057
We were never just talking about syntax.
>>
>>56747988
Are you retarded?

>>56747824
int i;
for (i=1; i <= num; ++i)


>>56747855
for(int i = 0; i < num; i++)
>>
>>56748057
What are you talking about?
My entire reply was shaming you for saying "dunning kruger" because it shows how much of a self obsessed idiot you are
I don't care what you're actually arguing over

>>56748071
I'm not the person you're replying to, but
>insufferable sperg
>delusional
>you're clearly the one who _
hello javafag, you've been laying low for a while
>>
>>56748065
kill yourself. there are many differences between that java and C#.

>>56748072
the fuck is this then: >>56748065
>>
>>56748071
I humbly submit that you ought to take a break from posting and take a chill pill before you become further upset.
>>
>>56748089
(You)
>>
File: 721468.png (5KB, 348x90px) Image search: [Google]
721468.png
5KB, 348x90px
>>56748089
>take a chill pill
Anon this is javafag you're talking to
>>
>>56748076
They're both wasteful. You can do it without introducing the additional variable.
>>
File: 589175125.png (6KB, 381x93px) Image search: [Google]
589175125.png
6KB, 381x93px
>>56748100
I thought he'd left or been banned too
>>
>>56748057
yes clearly java doesnt have # or C in its name... But TOOOLING! LIBRIARIES!

C and C++ extremely different languages! Like day and night.

>C is subset of C++
fuck of you retard, C doesnt have unique_ptr! Futures lambdas, different generics. muh they are obviously completely different languages not similiar at all.
>>
>>56747998
you can also do just
readFile . head =<< getArgs
but you should really check if your arguments are correctly formatted, that the file exists, etc.
>>
>>56748088
We were also talking about type systems.
>>
>>56748118
i leave sometimes (or quite often lately) because you're fucking pathetic time wasters
>>
>>56748101
>>56748076
long res;
for (res = 1; num; --num, res *= num);
>>
>>56748088
>kill yourself. there are many differences between that java and C#.
None worth mentioning. That's why they're basically the same. Anyone who knows Java could pick up C# in a day and become proficient over a month of two. The same is not true for a Java programmer going to Scheme.

>>56748088
>the fuck is this then
That post refers to semantics. Go drown in shit.
>>
>>56748136
c++ is very different from C because its more strongly typed!
>>
>>56748141
Much better.
>>
>>56748146
poo in loo
>>
>>56748149
Templates
RAII
>>
File: 1474003402543.gif (742KB, 500x281px) Image search: [Google]
1474003402543.gif
742KB, 500x281px
>>56748158
Here's your (You)
>>
>>56748165
and that, one might even say they are very different like C# and Java
>>
File: 832759372.png (6KB, 346x103px) Image search: [Google]
832759372.png
6KB, 346x103px
>>56748140
>>
>>56748146
>Anyone who knows Java could pick up C# in a day and become proficient over a month of two.
Maybe this is it. They're afraid of Java programmers taking their jobs. That's why they're so adamant that Java and C# are very different and that it's impossible to pick one up when you know the other without having to start from scratch.
>>
>>56747911
use Text.Printf.printf
>>
>>56748182
(You)
>>
>>56748141
>>56748101

>>56747890 is still an idiot for replying to >>56747855 instead of >>56747824
>>
>>56748176
No, one mightn't.
>>
>>56748188
Noo C# and Java are so different that once you learn C# extremely well you have to spend years learning whole new paradigms learning drastically different tooling and jvm its so different it makes big difference when programming. It would take years to switch coz you know they are "very different"

>>56748202
im being sarcastic
>>
File: 891327581562.png (6KB, 350x94px) Image search: [Google]
891327581562.png
6KB, 350x94px
>>56748194
>>
>>56748218
>im being sarcastic
Difficult to tell, given some of the posters here.
>>
What do you guys think of Libgdx?
>>
>>56748188
>Maybe this is it. They're afraid of $LANG1 programmers taking their jobs. That's why they're so adamant that $LANG1 and $LANG2 are very different and that it's impossible to pick one up when you know the other without having to start from scratch.
Yup.
>>
>>56748230
I know i was trying to find most closely related languages i could think of... Its hard. Should have taken american and British english
>>
>>56748238
Don't use it, it is harmful software. Use a free alternative from the FSF.
>>
>>56748238
it's trash it's what mexicans use for their babbys first 2d android games
>>
>>56748245
>>56748272
What should I use then?
>>
>>56748283
depends on what you want to do
>>
>>56748283
if this is your first game you might as well use libgdx so at least you can focus on game design and actually making stuff. For second one you can try and pick up better tool.
>>
>>56748289
2d games.
>>
>>56748346
Then just write your own blitter.
>>
New thread: >>56748383
>>
>>56748391
Come on man..
>>
>>56748392
Made before bump limit.
DO NOT POST IN THIS THREAD
wait till 310 posts for a new thread.
>>
>>56748146
>Anyone who knows Java could pick up C# in a day and become proficient over a month of two
of course it would be easy to *pick up* one coming from the other, but you must have an extremely lax definition of "proficient". and you clearly underestimate the number of differences between the languages in general, let alone the number and significance of features C# has that Java doesn't

>That's why they're so adamant that Java and C# are very different and that it's impossible to pick one up when you know the other without having to start from scratch
>without having to start from scratch
literally nobody said this
>>
>>56748392
we're not even at 310 you fucking retard
>>
>>56748404
just use libgdx.. Rendering stuff to screen is smallest part of game...
>>
>>56748346
it's all trash, like don't use gamemaker, there are people who use unity engine for 2d games but that's retarded and only relevant if you want to learn the unity engine, you could do it with plain opengl but that's only relevant if you want to learn opengl
>>
76 (You)s, including the plaintext (You)s in posts
>>
>>56747600
>>56747273
>>56748169
samefag
>>
>>56748201
The original code is in >>56745666, >>56747799/>>56747824 just copy pasted it and moved it into a separate function.
Thread posts: 311
Thread images: 26


[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.