/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

youtube.com/watch?v=8dMFJpEGNLQ
perldoc.perl.org/Getopt/Long.html
google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
eclipse.org/downloads/packages/eclipse-ide-cc-developers/oxygenr
twitter.com/SFWRedditGifs

A Rust interpreter for Scheme

Old thread:

#include

Learning to make gui's with python

thanks for anime image

Why would such a thing be included?
Especially that deep?

Why didn't Richie try to solve the namespace problem? Fucking noob.

wat

Dennis Richie when he designed C.

C doesn't care about scope, or types or anything else that might make programming easier.

Hey Sup Forums not a regular browser but I'd love insight from regulars here.

If I have a teenager that seems to like the idea of coding what resources are there to get him on the right track? Are there some languages that are "better" than others? In terms of ROI on learning them and so forth.

Thanks for any insight.

just get him to learn python or something, it's brainlet friendly and easy to hack together something that works

python is like basic in terms of dijkstra's criticism of the latter

>or types
So it's B?

>people want better C
Literally just C with better standard library, like define the fucking API for threading and add compiler flag for platforms that supports it. Now do
the same for utf8, directories and file paths, basic data structures.
Maybe smarter compiler like, recursive macros and maybe some kind of modules instead of headers.
Saner types without the _t ending so every faggot doesn't have to rename uint32_t to u32.
>Solutions proposed
GC
Uglier syntax than ATS
Name mangling
nonstandard ABI
Anything but what people want from C

C has a type system, it's just shitty and weak

Employed Haskell programmer here

I could use some help guys.
I have some perl code that decides whether to show you the usage screen (--help) or to continue running but it throws an annoying warning:
>Use of uninitialized value $ARGV[0] in string eq
Looking at the code, is there a better way to be doing this?

sub task {
my $self = shift;

if($ARGV[0] eq 'fetch') {
$self->fetch;
}
else {
$self->usage;
}

return;
}

There has to be a smarter way to check if the user has typed
feed.pl fetch --resort blahblah

I'll have 2 number nine...

Vice video
youtube.com/watch?v=8dMFJpEGNLQ

Thought?

Alos, how does one get in to AI field?

i made an irc like thingydoo

give it a go: ircs://2hu-ch.org/overchan

Assuming that you're using Linux, check out perldoc.perl.org/Getopt/Long.html

Employed Java programmer here

Take Andrew Ng's Machine Learning course on Coursera. If you want a good understanding of neural networks (which have become the center of modern machine learning), you should know how to differentiate functions of multiple variables and matrix-vector multiplication. It's not necessary to know these things before taking the course, but it helps.

>tfw employed C programmer
Living the dream tbqhwy

enjoy it while it lasts. programming will become easier and easier until you don't have a job, because a biologist, or a physicist, or whatever else, can program the same as you

Yes and yes, I have been using getopt for the options (--help and --resort) up until the point but the problem is fetch isn't an option it's a command and it takes no input, throwing it in with these optional flags seems like a step in the wrong direction:
GetOptions(
'resort=s' => \$resort_value,
'help' => \$self->{'help'}
);

Or am I just very very confused? I'll go through the getopt man pages again though, thanks.

>biologist
>physicist
>spending their time writing code and debugging instead of directly working on their field
right

You think so?
I reckon there will be a place for software engineers for a while longer, plus being able to do shit yourself saves on labour costs if you want to start a business.

Mending cars is also easy, but nobody wants to do it themselves.

Python or Ruby is a good, JavaScript works too but you'd have to learn HTML and CSS

its been 2 years now and im still burnt out

i can no longer get my self to program, it was the only skill i had, programmed for over 10 years, but im so depressed due to it.

Sometimes i feel like doing a project, but then my body seems to shut down and i cant get myself to work on anything.

I always see the hurdles ahead , and the massive weight of having to go through thousands of lines of code, which makes me hesitant to work on anything. All I feel is pain and suffering when I think of code.

I feel regret and anguish when I think that i spent 10 years of my life on a skill that amounted to nothing. I've also can't stand the direction where IT is going. It used to be innovative and exciting, but now its all about survellience and politics. Im full of regret, i feel so much anger when i think that i might end up homeless even though i tried so hard. There isnt a place and there are no jobs for a depressed programmer like me.

so i try to not think about it, i convinced myself to get rid of this skill, i can't help but hate programming and i picked up buddhism instead. its really the only thing that brings me calmness to my mind, and I love to read buddhist texts and research its history. Im convinced programming and a lot of other activites we do is pointless in the long run. I hope this can be a lesson to someone, you sohulnd't try so hard to be something, All you have to do is keep doing whats close to you and what you are familiar with not being swayed by others. This life is really not as important as you think and should be lived pleasantly. I think I went too far trying to become a programmer,I wasn't meant to be one and I should stop trying so hard.

>>spending their time writing code and debugging instead of directly working on their field
>enter requirements into a box
>click some buttons
>code is automatically generated
>no code monkeys required

it's not though. it's time consuming and requires technical knowledge and resources. you can't honestly think that writing java apps will make you indispensable for decades to come. there may still be some programmers, but just as there's still some farmers

look man, sometimes its best not to think about the future too hard, bad for the soul.

What namespace problem?

true, we'll probably have a living stipend by then anyways

don't start this shit again

People are and have been doing multi million line codebases in C just fine.
So I ask again. What namespace problem?

How into multithread optimizing? I haven't touched it yet.

Don't compilers already automatically spread the load evenly?

Do you mean creating more execution contexts or optimizing an already existing multithreaded codebase?

Do you really think ditching programming entirely is the way to go? Instead of thinking black and white, you could try programming only during the weekends. Never overdo things.
About Buddhism, how do I start with it? I've seriously thought about picking it up. The main reason is to relieve some mental stress.

The one where if one faggot make library and prefixes his shit with stuff_ and other faggot makes library and uses same prefix as the first one and there's name collision and you need to use both libraries you are fucked.

>Don't compilers already automatically spread the load evenly?
No, the compiler has nothing to do with it. The operating system might do that at runtime.

Threads aren't necessarily system threads

This problem exists with any namespace solution that I can think of though, not just using prefixes but C++ or any other language's actual namespaces.

Literally never happens.
And how would namespaces even solve that problem?

I see, but wouldn't true optimizing mean you need to manually define which thread runs what part of the code?

>from foo import bar as baz
Python fixes this elegantly.

If something like that exists they themselves will become obsolete

So from which foo are you importing?
The problem was with two libraries named under a foo prefix/namespace.

Yes, you can set processor affinity via some system calls, like SetThreadAffinityMask() or pthread_setaffinity_np(). Many programs do this.

$ARGV[0] is the name of the program, not the first argument on the cmd line

Pls respond to my post

Are you sure? print $ARGV[0]; outputs fetch when the user uses the fetch option.

I want to edit some rather large csv files (1000+ rows). What is the best way to do this on Linux? Don't really want to install a whole office suite for this.

i think you need to pass the @ARGV array onto the subroutine?

Write your own program. It's CSV so it cannot be that hard.

man perlvar

>Perl identifiers that begin with digits, control characters, or punctuation characters are exempt from the effects of the "package" declaration and are always
>forced to be in package "main"; they are also exempt from "strict 'vars'" errors. A few other names are also exempt in these ways:

> ENV STDIN
> INC STDOUT
> ARGV STDERR
> ARGVOUT
> SIG

i love this pasta

It depends, what kind of edit do you need to do?

How can anyone be autistic enough to actually enjoy coding? Fuck this shit is mindnumbingly boring.

google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
>dir2/foo2.h.
>C system files.
>C++ system files.
>Other libraries' .h files.
>Your project's .h files.

what the actual fuck lads? why not:
>dir2/foo2.h.
>Your project's .h files.
>Other libraries' .h files.
>C++ system files.
>C system files.

it's not so much the coding itself as the results you get out of it

How do I know if free() was successful?

Use the Chromium guide

it always succeeds as long as you use it correctly

Should I keep learning rust or should I learn another programming language that isn’t rust?

have a coding challenge tomorrow in ruby on domain modeling. Probably only working with a has many through, 3 classes problem. Any tips to help me prepare? I don't want to get fucked

learn C++

I’m too brainlet sorry senpai ;;(((

This did the trick, still feels a bit off. If anyone has a better solution let me know, at least the warning is gone.

sub task {
my $self = shift;

if(length $ARGV[0]) {
if($ARGV[0] eq 'fetch') {
$self->fetch;
}
else {
$self->usage;
}
}
else {
$self->usage;
}

return;
}

You think so? Try being a turner(used translate).

I'm certified to be one. When I did my internship I wanted to kill myself on the spot, I almost broke a fucking machine one time. Almost started it with key inside because I did same moving pattern over 200 times and my brain just melted. Programming is way more fun and challenging than some of the professions out there

underrated post

Keep learning Rust

Did you turn pages as a profession?

Ok I’ll have tons of fun meeting rainbow hair sjws :D

>I’m too brainlet
In that case you should most definitely mote to C++ from Rust

>meeting people
Get

move*

But rust looks easier than c++, desu

Wait till you get to borrow checking and the traits part

do you say this without trying them both?

and I don’t have to use a bloated as fuck ide (visual studio) in order to code rust

If you have problem with C++, you can not survive Rust 1 month

eclipse.org/downloads/packages/eclipse-ide-cc-developers/oxygenr

n-no, what kind of a profession is that?

Why did you think that was necessary to mention?

Anyone here know a lot about SSL?

What is the main different between SSL and simply exchanging public keys, encrypting messages, sending them over TCP and decrypting with the private keys?

Enjoy formatting for 30 seconds each time

haven't had any problems with the newer versions of eclipse being slow

what's wrong with traits?

>bunch of errors
user...this doesn't help.
we can't help you sort errors if all you give us is 'it doesnt work', and what code are you trying to compile?

Got a job as a Python programmer.

Now what?

Or do you mean turner as in athlete?

Rust doesn't allow Higher Kinded Polymorphism as of now, you'd have to be pulling your hair any time you try to do anything remotely complex. On top of that there's BC and life time checker

include paths

>Internet explorer

>he doesn't have a Windows Phone as a dedicated shitposting device