/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread: Anime threads >>>>>>> any other /dpt/ threads

Other urls found in this thread:

ddili.org/ders/d.en/
upce.cz/index.html
codecademy.com/learn/learn-python
reddit.com/r/C_Programming/comments/6vvg1c/preprocessor_question/
doc.rust-lang.org/book/second-edition/
rustbyexample.com/meta/doc.html
doc.rust-lang.org/nomicon/
rust-lang.org/en-US/conduct.html
youtube.com/watch?v=3x8mSr8ZPGQ
twitter.com/SFWRedditGifs

Are programming socks a meme or do they actually work?

Where should I start learning to program? Should I start with Python?

#include

I'm working on a music visualiser.

>Should I start with Python?
You should start with something. Why do you think python is a good idea?

Python damages brain. Learn D instead.
ddili.org/ders/d.en/

>job opportunities

...

I find the syntax comfy and easy to understand even as a brainlet

Is this a meme language or actually good? Never heard of it.

>Programming
>Job
>Money
lmao

D is a highly underrated language, and yes, it's pretty Good

Is it better to learn python or ruby if I want to do web dev later? Is rails or django better?

D is pretty good. Actually one of the best languages that have GC

D is a gateway to C++

How brainlet friendly are we talking here?

It depends on the book you are reading. The D book is pretty beginner friendly, Read the first few chapters to find out.

Imho, you should start with Goviaji, this language was developed in 2K16 at Univerzita Pardubice (upce.cz/index.html )
Books: Myšlení v Goviaji, 2016 (Petrešenko Batčko);
Goviaji in Nutshell, 2016 (Tomáš Makášérčko).

This, ironically. Learning D is worth it because it's a very easy transition to C++

Ah yes, I'm very familiar with this language.

>I find the syntax comfy and easy to understand even as a brainlet
Then it's pretty good for you to start with probably. It's not that important what you start with really. Some say python makes it difficult to move to other languages. I don't think that's true. I've used a broad range of languages and python is among them. I didn't start with it and I don't particularly enjoy it for reasons that'd be hard to explain to a newbie.
>Is this a meme language or actually good?
It's a very niche language but that niche takes it seriously. It comes from people in leading positions within the C++ community.

Personally I think I'd learn best with it. But I think we're not like one another.

It's more important that you're motivated to keep learning in any case. I think python is good at that. With many other languages you can get very cryptic problems or environment issues that hinder you from actually programming. They're understandable from the perspective of developing actual software but not for learning.

If I were to tell myself what to start with I'd say Go. But I think python is a fine candidate. Just don't procrastinate on a language choice. Spending a single hour contemplating this is a massive waste of time.

You also were exchange student in Pardubice?

they're a meme

you need programming nylons

This is really good advice user

> Spending a single hour contemplating this is a massive waste of time.

uh oh, t. guy whos been contemplating this for 3 days

>uh oh, t. guy whos been contemplating this for 3 days
codecademy.com/learn/learn-python
Try this maybe.
I haven't tried it but I've been told it's a very 'gamey' way of learning. So it doesn't feel like work as much.

>codecademy.com/learn/learn-python
Thanks man, I'm going to go get started on it now.

>I find the syntax comfy

Let's be real here, you don't have much experience do you? Especially as a "learning language," I would recommend ruby over python every time. Inexplicably, python has more general adoption but ruby is simply a better language, though their problem domains are nearly identical.

I'd agree. But Python is more popular. So he's more likely to find people that can help teach

I have no experience at all outside of doing some html years ago, I've looked at samples from a few different languages and python just looked the least confusing to me, I like ruby too.

rails is absolute garbage, and I say this as a ruby enthusiast. I do not like python, have never looked at django, so I couldn't comment. But why would you want to do web dev? If you want to do web dev, you're better off going deep into javascript imo

i want to get into webdevelopment and am pretty good with php including its popular frameworks.

stackoverflow survey showed that there are inexplicably more jobs for fullstack java webdev than anything php related.

would it be a good idea to switch and learn the java stuff?

which popular parts are even included in java webdevelopment?

Header brainlet here.

Let's say I have xyz.c with struct abc { ... }; and xyz.h with typedef struct abc abc; in it.

Then I have ass.c with:
#include "xyz.h"
abc mystruct;.

It tells me that the storage size of mystruct is unknown. I can easily make a pointer to struct type abc, so it recognizes the typedef, but it doesn't actually let me implement a struct of that type. Does the xyz.h file need additional info?

>inexplicably
Why do you think Java web dev is inexplicable?

>which popular parts are even included in java webdevelopment?
Old: Spring, Hibernate
New: Play, Jetty

Isn't rails in super high demand?

Well I wouldn't fault you for picking python but, I just really think ruby is a much better option for early experiences in programming. python is a bit more, "idiosyncratic" in some regards, and so if you move to learn other languages it could be a little harder to unlearn the python way.

In any case, they are very similar languages, and you'll find as you look at languages deeper, if you become experienced in python, you will be able to quickly and easily write some ruby code, or vice versa. The actual "programming" parts, reasoning and problem-solving, is the important thing, though the syntax and particulars of a language can assist in how you approach a problem.

What am I even rambling about, anyhow python, ruby, doesn't really matter, good luck, have fun!

ass.c doesn't know the size of abc. You need to define the struct in the header or you can only access it trough pointers. Now it's opaque type that you can't create.

Most enterprise development is either Java or C#

reddit.com/r/C_Programming/comments/6vvg1c/preprocessor_question/

and since its an opaque type, might as well take advantage of it and have your make/free functions in the header so 'clients' don't need to worry about that. (and other related functions..)

gcc vs clang: the debate

Yes but in part that's because rails quickly becomes a spaghetti mess, and taking over a rails project is an incredibly un-fun horrible thing. Rails had/(has?) a huge spike with all these companies seeing how they could write a one-liner and have a blog or some shit, but then they find out the picture's a bit more complicated than that.

Many, many, many people using rails could be much better served by even a simpler ruby web framework, but somehow that doesn't cross their minds. Rather the opposite, there are an alarming number of people who decide to "learn rails" without understanding any ruby. Not even fucking kidding. So yes there's """demand""" but I don't think I'd go near it personally, much better areas of webdev.

oh ok. I was under the impression that only prototypes and typedefs went in headers. I didn't know you could declare whole structs in them.

you mean external linkage structs, or just define struct types?
also, you can also include functions with the inline keyword

REMINDME: make C preprocessor in Python

you losers learn Rust yet?

doc.rust-lang.org/book/second-edition/
rustbyexample.com/meta/doc.html
doc.rust-lang.org/nomicon/

go suck a dick you worthless shitlord faggot piece of crap

>rustonomicon

>that autistic tantrum
the power of C

no, it seems like kind of a bad language. I also don't like C though, before you try to bully me about it.

rust-lang.org/en-US/conduct.html

Yes I am learning it.

jew.. i'm mean... yuden

>abc mystructe;

yuden feet

disgusting

hi

hey

welcome, now get out

Segmentation fault (core dumped)

footfags get the gas

In Python, how do you write in a csv file an array of results like this ?

> FX FY FZ
>H1 1 2 3
>H2 4 5 6[

with open('file.csv') as f:
print '>\tFX\tFY\tFZ'
for i in range(2):
print '>H%d\t%d\t%d\t%d' % (i+1,i+1,i+2,i+3)

unless you need some external api to write to csv files :^)

thanks a lot dude

dunno python 2, but i think you forgot write permission and you should use f.write

c++ replace when

when non-C++ non-dead language ISO standard comes out, that's when

every day I hate python more and more

AFAIK C# has ISO standard, but maybe it's outdated, i dunno

Stop being childish then.

Software 3D renderers are ez. Trying to optimize them ain't.

Why the hell would you waste processing power on software renderers

Using windows. Can someone write me a script to make a folder and put 25 photos into that newly made folder then repeat? I don't know how to write scripts at all.
Have 1000s of photos that I need to change the exif data on manually, they are all in the same folder. exiftoolgui has a bug where if you try to edit more than ~25 photos then the exif data won't save. Instead of manually making folders and and putting in 25 photos with mouse I think it'd be easier with a script. But I don't know anything about scripting.

use opengl fag

can I do it for you? I'll pay you!

give me a the destination folder address and image filename pattern

What are some pseudo-programming exercises I can practice? Gonna go to an interview in a couple of days and I was told I'll get around 10-20 such problems.

It's my first interview too, so any tips are appreciated.

no, i will do it for you, i'll pay you and pay him too

you mean you've never made your own project over 10kloc?

Look them right in the dick. It establishes your no-nonsense attitude while demonstrating that you don't intend to upset the dominant hierarchy.

I've made some shitty programs before, and even tried *trigger warning* to make some games , but I've always just identified what I wanted to implement(say, Pathfinding) , searched around the internet for solutions and learn about them (say, A* and Dijkstra) and stuck them with duct tape in my project.

I just have no idea what sort of things are asked of you in a professional environment. They obviously won't let me use stack exchange if I don't remember how to implement quick sorting or stuff.

Did we ever figure out averaging two ints in C?

nothing wrong with games, that's where all start, but only the best manage to stay

new folder 1, new folder 2, .... etc (each folder needs 25 photos in it)
IMG_XXXX.JPF is the file name pattern.

average = (int + int) / 2

yes, in 50% of the use cases

Nope

>never programmed before
>starting comp sci on monday
alri

I'm retarded desu, more like 66%

Why start with Go?

>thinking comp sci is programming
well it probably is nowadays

us or yurop?

poorop

speaking of the venerable dr church, can anyone point a brainlet at somewhere that has like, actual examples and worked problems/solutions involving (simple, typed, ...) lambda calculus? I'd like to play around with it but all intros I've seen are either much too complicated for me to skim or just stop at some basic definitions. I could put in the legwork and work from the definitions but, well, I don't want to.

lol pussy, it's as easy as anything else, university is almost as brain dead as high school

im a brainlet

youtube.com/watch?v=3x8mSr8ZPGQ
Here's some background info you'll want before you start in CS

In bitwise operations, how would I convert a 32bit in into 4 8bit ints?

>poorop
what?

shift by four for different times

sorry, it's the autism spilling

poor europe

then brush up on your mats skills desu

what does /dpt/ think of enterprise integration patterns??

I don't understand.

16bit to 8bit is:
x & 255;
x >> 8;

What do you mean by 4?