/dpt/ - Daily Programming Thread

Language poll edition
strawpoll.me/12732251

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

teachyourselfcs.com/
functionalcs.github.io/curriculum/
github.com/open-source-society/computer-science
htdp.org/
techempower.com/benchmarks/
techempower.com/benchmarks/previews/round14/#section=data-r14&hw=ph&test=plaintext
benchmarksgame.alioth.debian.org/u64q/csharp.html
benchmarksgame.alioth.debian.org/u64q/compare.php?lang=ocaml&lang2=java
twitter.com/NSFWRedditVideo

God I love memes

Which of you fucking faggots ticked C++?
I understand the fucking retarded children who ticked Python, but C++?

is there any place where you guys recomend to learn? also what language? java seems easy

I just want to be a codemonkey my math is shit but if needed i'm up to go to engineering school (its free in my country and i can learn at least eng math there)

>tfw voted for Rust twice from work and from home

Java for general purpose applications
Python for scripts
JavaScript for web
C for hardware
Haskell for memes

me

Find a problem you think is interesting.
Find research on the problem.
Implement easiest solution, implement more advanced solutions if its interesting.

>45 votes for Java
Is this all they're teaching in colleges these days?

Read Introduction to Functional Programming by Bird and Wadler(first edition)

>no PHP
WTF were you thinking, OP?

Java or C#
Read any book or online tutorial until you get some basic OOP knowledge
Then start making some actual projects and learn on the go

If you want to work as a coder try to find coding job as fast as possible, don't wait until you feel competent cause it will never happen

Congratulations, you're code monkey

gcc has this __builtin_expect() function to move infrequently used code out of the way:
if (__builtin_expect(unlikely_event, false)) do_unlikely_things();

but does that also work when called from an inlined function?
inline bool unlikely_event_happened() { return __builtin_expect(unlikely_event, false); }
int main()
{
if (unlikely_event_happened()) do_unlikely_things();
}

>still no option for Fortran

how could anyone like this monstrosity?

that's neither a programming language nor favourable.

go back to your cryogenic chamber

I'm going to quit my job and become a JavaScript-monkey.
t. Is Elm something popular these days? Should I learn it?

>Other (specify in thread)

MATLAB

Interesting question, I don't think so.
Then again, in my tests __builtin_expect had no influence on the overall performance, I guess branch prediction is doing its job pretty well nowadays.

>hurr Fortran is for old people meme

why would you use fortran today when there are better alternatives?

Why are you pretending you know Fortran to make such a claim?

>C for hardware
>not using assembly for hardware

kys

which one will get me going in the right direction?
teachyourselfcs.com/
functionalcs.github.io/curriculum/
github.com/open-source-society/computer-science

Most people who use Fortran aren't professional programmists, they don't know any other languages and see no reason to learn something new since Fortran works good enough for them. They alose use 40yo libraries for the same reason.

t. CS freshmen

I'm genuinely curious.
In which practical field is Fortran superior than every other existing language?

htdp.org/

>In which practical field is Fortran superior to every other existing language?
Fix'd

C++ for general purpose applications
bash for scripts
don't do web
C++ for hardware
Haskell for memes

C# for general purpose applications
Python for scripts
TypeScript for web
C for hardware
Lisp for memes

Software development is being flooded with idiot bootcamp coders at an alarming rate and it's absolutely destroying any credibility I might have once had as a self-taught.

How do we fix computer science education?

Throw out diversity mandates and make it about the real science again, not pajeet training.

Qt for desktop/mobile applications
Rust for server-side
Python for scripts
Python for web
Rust for hardware
Idris for memes

unfortunetly you can't do python in browser tho

>Rust for server-side
techempower.com/benchmarks/

they're all gravitating towards web development. solution? stay out of web development. I'd much rather deal with pajeet than nu-males and women quota hires

java, while verbose, is way faster than C#

People often fall in love with their first programming language no matter how much that language sucks. It's like a virgin falling for the prostitute they got their dick wet with first.

java and faster in the same sentence
it's like C and safety in the same sentence

I want to develop a personal android fitness app that has a few functions:

>Calculates the warm up reps when entering max weight
>Keep track of you progress

And maybe a few more. Where do I get started with this?

Yeah, but that's "front-end', not "web". For front-end I'd have some js-monkey to write some shit.
>using pre-tokio benchmarks
techempower.com/benchmarks/previews/round14/#section=data-r14&hw=ph&test=plaintext

benchmarksgame.alioth.debian.org/u64q/csharp.html

Not to such a degree to disqualify it from use, and it's a very new language undergoing a lot of optimizations still so it's performance is likely to steadily increase over time faster than java's will.
Plus it has LINQ and Entity Framework, which, holy shit if you've never used those for database queries and management you are missing OUT.

Java is faster than C# per line

you don't know what your'e talking about. java is one of the fastest object oriented languages out there.
benchmarks prove it
metrics on coding challenge sites prove it
independent research proves it

>fastest object oriented languages
What is OCaml. Wanting speed and java is stupid. That's how I spot idiots who shouldn't code.

No SAP/ABAP developers over here?

yeah, LINQ seems pretty interesting. I was blown away the first time I ever saw a join-select-projection statement directly in C# code.

>projection
What are you calling a projection?

did I say it was the fastest object oriented language? I said it was one of the fastest. learn to read dipshit.

also: benchmarksgame.alioth.debian.org/u64q/compare.php?lang=ocaml&lang2=java
interesting that OCaml BARELY out-performs Java in 3 tests, and Java firmly beats it in all other ones.

>making java slow
You can not code.

My first game with SDL. Really struggling just getting the base code for a bloody window to show. I always need a bit of a jumpstart when it comes to new projects..

Are there any free distributions of MFC? a solution I've downloaded from github has dependencies from this library and I cannot build it with VC++ 2010 Express because it doesn't include MFC.

Alternatively, if you know any free (as in freedom) versions of MFC that I can use with VC++ 2010 Express.

So you just want to remember a little bit of information and have some basic UI for displaying/modifying it, right? It seems like the place where you should start with this is picking the app development technology you want to use, reading whatever tutorial is available for it, and getting started.

The OCaml code is poorly written.

Yes that's basically what I need to do. You MUST use Android SDK though right?

Java still beats Rust.

for the past 3 years in dpt, you all have bashed Java to no end. now this week you are all sucking Java's dick...

what changed?

Why don't you try the recent 2017 Community Edition? It's free and it has more in it than the Express Editions, I believe it includes MFC too.

we've been invaded by pajeets on h1bs

>10GB download
I'm on capped internet, that's worth a whole month of shitposting for me. If they distribute MFC for free now why cannot it be installed separately?

java is verbose as fuck, and there are a lot of issues with the language, and the way it handles OOP
but it's not slow

>Java is in the lead
the fuck...

>Other (specify in thread)
F#

No shit, tokio is less than a year old and java has been optimized for this for the last 20 years. Still, it's a good result for a new platform.

My Clojuire shilling :^)

t. special snowflake

>H-1B... hmm?
now i can import some filipino trannies for "specialty occupations" in a "niche" night club

people with careers and actual social lives don't have time to post in /dpt/, but time to vote in a thread. explains why /dpt/ hates java, but java is in the lead

>10GB download
You don't have to download all the components, start the installer and uncheck all the stuff you don't need like C#, SQL Server and Web, maybe you'll get it down to 1Gb.
> If they distribute MFC for free now why cannot it be installed separately?
Because no one needs it anymore, it's a legacy technology.

>I'm using a bot to artificially inflate Java

Why didn't you say so earlier?

VS2017 allows you to select which features to install, with much more fine-grained control than the previous version. so you only get what you need and it's rarely more than a few 100 MB.

you have 10 seconds to name language comfier than C#

protip: you cant

even more so after C# 7.0

Who gives a shit about C++
You should be more concerned about Java leading the poll

Thank you for not using an anime image

python Blackjack, I give aces a value of 0, then check if they should be 1 or 11 when I call check score

todo: game logic, split function

its bugging me though, any other ideas, or is this alright?

import random

suits = ["Spades","Clubs","Hearts","Diamonds"]
faces = ['Ace','2','3','4','5','6','7','8','9','10','Jack','Queen','King']

values = {'Ace':0,'2':2,'3':3,
'4':4,'5':5,'6':6,'7':7,
'8':8,'9':9,'10':10,
'Jack':10,'Queen':10,'King':10}

player_hand = []

def new_deck():
deck = []
for s in suits:
for f in faces:
deck.append( ( str(f),s ) )
random.shuffle(deck)
return deck

def hit():
return deck.pop()

def show_hand(hand):
for x in hand:
f = x[0]
s = x[1]
print("{} of {}".format(f,s))

def check_value(hand):
val = 0
for x in hand:
card_val = values.get(x[0])
if val >= 11 and card_val == 0:
val +=1
elif val < 11 and card_val ==0:
val +=11
else:
val += card_val
return val

deck = new_deck()


player_hand.append(hit())
player_hand.append(hit())

show_hand(player_hand)

print(check_value(player_hand))

What an awful analogy. This board really is filled with 16 year olds.

spent 3 years with learning Java
with advent of xamarin+visual Studio
switched to C#
staying with C# unless someone hires me at high pay to do Java

Are there any memes involving coffee??

I'm looking for a cool picture to include in a web developement-related project

according to the poll? c, python, and java

...

java

What do you mean user?

>it's rarely more than a few 100 MB.
The installer alone was 150MB.

>worriedlaughter.jpg

more popular doesn't mean comfier

perl for scripts
c++ for web
haskell for hardware
c for memes

Rust doesn't even have a standard so fuck off with it in systems or embedded programming.

Go.

Haskell

perl, lisp (scheme to be specific)

haha no

I'm stuck with null error and I can't find out why. From main I'm calling method addItem which is in the Officer class.

Officer off = s.listOfficersByName("OfficerName"+1).get(0);
for(int i=0; i

How do I use sqlite in a c# program?

On one website I'm seeing people say to use NuGet to install the package, others I'm seeing to just download System.Data.SQLite.dll and an XML file and just add the reference. On another site I'm seeing to use a different dll altogether, and use SQLite.NET.dll and add that reference.

What's the ideal way to go about this? Any recommended guides?

Why is this a problem? The reason C/C++ need a standard is because they had and still have dozens of closed proprietary compilers. If you have only one implementation you don't have to worry about standardization, and since the implementation in question is an open-source project with BSD license, you don't need more than one.
Also, assemblers don't have standards either, yet they're still used in system and embedded programming.

I can't, sorry.

C# is my langfu.

Just use NuGet. You're going to use NuGet a lot more than you are going to manually add .dll files by hand. I think the Sqlite library for C# can be acquired via NuGet, yeah? I used it for a small program, it's pretty syntactically similar to System.Data.SqlClient.

MS can't into 7zip? I really hope VC++ 2010 Express includes this shit properly, I'm about to burn 10 eurobucks worth of shitposting.

Post full source.

>I'm about to burn 10 eurobucks worth of shitposting.
???

every way is OK

using nuget is the fastest and you can fuck up fewest things