/dpt/ - Daily Programming Thread

Previous thread: W-What are you working on senpai?

Attached: teach_me_cpp_senpai.jpg (1440x810, 155K)

Other urls found in this thread:

boards.Jow
youtube.com/watch?v=7eeEf_rAJds
youtube.com/watch?v=o9pEzgHorH0
youtube.com/watch?v=8YJWqTm0XqY
twitter.com/NSFWRedditVideo

Attached: common lisp.png (223x117, 5K)

way to go girl!

I fell in love with perl. What's the best resource for learning it correctly?

thank you OP

Attached: 1526300666121.gif (346x360, 871K)

Designing an unnecessarily low level protocol to connect an Arduino MKR WiFi to my home-made home automation / data collection microservice.

>split function and data namespaces
>car and cdr works for nil
common lisp is pretty warty desu

I'm learning design patterns like a true 'jeet. The worst part is that I actually like them.

Attached: 1506018692290.png (1000x1000, 253K)

I have no idea what any of this mean, can you help?

Attached: lisp-kludge.jpg (1200x1200, 251K)

same but data structures

Should I take a shower or finish my BeanFactoryBuilder?

How does parent-child relationship takes place?
If a child called fork(), then does the parent will be the first generation child or the main parent?
If the first child became the parent of the new child, then what happened when the main parent exiting from main()? Does the second generation child also got adopted by init?
Also what happened if the first generation child exiting its main() and became an unreaped zombie process? Does the init immediately adopt the second generation child?

It makes OOP not dull.

>tfw have to use C++ because some libraries I need are too big to convert to C
worst feel

congrats you discovered a Lisp-2

Are there ways to somehow earn money with programming other than
- wageslaving at the office
- wageslaving at Upwork

I just can't stand the humiliation of being attached to an office cubicle (or Upwork spyware) for the rest of your life

Attached: 2891fg.jpg (601x508, 76K)

Why is python so slow?

Is it possible to filter threads (better if filter is related only to post of OP(subject and comment)) by using a link?
e.g:
https: //boards. Jow Forums.org/g/ catalog#s=bash
searches for a g-thread with bash-content

is it posible to apply something like
boards.Jow Forums.org/g/catalog#filter=boringstuff or
boards.Jow Forums.org/g/catalog#f=boringstuff
to filter boring stuff?

I don't like to use 4chanX because I want to use a bash script e.g. with lynx.
And I would prefer to use a "filter-link" than apply regex with grep etc.

Thank you!

Attached: b1512682093887.jpg (2044x1202, 826K)

Its semantics force it to be.

You're doing it wrong.
youtube.com/watch?v=7eeEf_rAJds

Attached: prostate exam.gif (600x600, 3.05M)

Try and start a small independent business

In terms of anything specific? Or a list of things? Generally, it's because it's so dynamic, and there's a lot of metaprogramming functionality, that you can even operate on raw operators and type annotations, that it has to cater to the possibility of devs being too flexible

How to check whether an extern variable is defined?
If it's not possible then how argp does it with their argp_program_version and argp_program_bug_address?

while or for?

for

What for?

While what?

as in the loop
for (;;)

God I wish that was me

learning C#

Attached: Screenshot (5613).jpg (1920x1080, 75K)

>while (on4chins) shitpost
>for (shitposts;on4chins;moreshitposts)
One is logic, the other is inane.

I'm also feeling suicidal, but there's no need to go that far

Attached: regexbenchmark.png (504x688, 80K)

i was told it's a good first language

They meant C, not C#.

You were told wrong. It onboards on you too much to be a good first language. Maybe they meant C

For a first language you should learn a dynamic language like python.

C fucking SUCKS compared to C++ and if you use it today you should FUCKING KILL YOURSELF.

but i got called a retard for asking about python apparently it's a terrible language to start with

As a first language? I doubt it.

kys

I'm falling in love with Ruby.

People are stupid. Begin with python, end with C.

>simplicity sucks compared to spaghetti
Ok zoomer

C or Python, they're both good to start, but not an OOP-centric language like C#, Java or C++. You are likely to stay on shit practices early on. There's a talk about how a python dev implemented a 20-line code out of someones OOP-centric 660-line of code shit

It is, but it doesn't matter. your not going to be doing anything that will be significantly different between java/c#/C/c++/ whatever other static OOP language you pick.

Install Perl.

Here, ignore his spaghetti: youtube.com/watch?v=o9pEzgHorH0
Dev 1 is someone who didn't have a good foundation - 20 classes, 660 lines of code
Dev 2 is slightly better - 1 class, like 30 lines of code
Dev 3 is best - 1 function (because the class was basically a function anyway) - 20 lines of code

>C
>OOP
before someone calls me a retard, I called it OOP because all beginers will create bootleg classes in it anyway.

>There's a talk about how a python dev implemented a 20-line code out of someones OOP-centric 660-line of code shit

>some guy who knew what he was doing was able to rewrite what code monkeys produced in hundred times less code
color me shocked

That's the point retard

I'm coming from Perl.

If its the one I think it is that was a retarded talk and is more about shit code vs good code, you could have rewriten the same thing in C# in the same number of lines.

>When you're working on a project with someone in C and you see their half assed implementation of classes

Why can't you niggers just learn about functional programming?

Attached: aids.jpg (334x274, 42K)

I bet procedural monkeys don't exist

i have a few projects of medium size, in python but i find myself using pypy instead
and then when pypy is insufficient speedwise i just have to write some C
is there a way to avoid this, meaning what language should i use instead
preferably a language also useful in real life

i was thinking some lisp or scheme with a compiler, but unfortunately it seems people prefer java and c++

so should i learn C then?
i'm starting a maths/computing degree next year so i'm gonna be learning a couple of languages anyway, i just want to know what the best one for beginners is. there's so much conflicting info online

That's my point though. You start on an OOP-centric language where tutorials and resources focus on OOP, then your implementations start on it too. You can write good and bad code in various languages, but why would you start with something that onboards too much and leaves you susceptible to not understanding 'right tool for the job'?

why don't you try finding out by yourself, it will only take a few lines of code

Just pick one, or one of each type, like Python + C# + Haskell.

I hear Rust is good but I could be very wrong

C+Python alongside it imo. C is simple enough that you can learn it with another lang. Personally that combo has let me do anything interesting I've wanted to do in 10 years

>you shouldn't use OO just write functions
>this OOPsie language is the best thing for you to learn

Attached: 1516425036072.gif (200x202, 194K)

C FUCKING SUCKS AND YOU SHOULD KILL YOURSELF

>it's OOPsie because you can use it
I said OOP-centric
inb4 C++ is procedural-centric

>i'm starting a maths/computing degree next year
mind if i ask where?

Scheme, then racket.
That's all you'll ever need in your life.

How do I kick python's ass to make it print faster? Replacing print with sys.stdout.write made it a lot faster, but it's still too slow for my needs.

Example python3 -c $'import sys\nt=1\nwhile 1:\n\tsys.stdout.write(str(t))\n\tt+=1'

I need the maximum speed possible!

>I need the maximum speed possible!
Use C++.
Performance shouldn't be your concern at all if you're using Python.

Starting with C is a good way to end up hating programming. Its 'better', but takes longer to do the same thing, is easier to write shit code it, debugging is harder. Unless you are planning to write large, low level applications from the start pick something thats easier to get into like C# or java.

Objectively wrong everywhere

Actually, starting with C is a really good way to end up appreciating and liking C++ when you move to it.

>\n\t
This is why I don't like this shit. What's the point of programming when you can't write cool oneliners with it?

>Performance shouldn't be your concern at all if you're using Python.
finally someone who gets it

Attached: 1509001599870.jpg (320x315, 40K)

So thats where all the seplets come from. Another reason not to start with C.

nah, he's obviously retarded

C's great

How long does it take to get comfortable with a programming language starting as a beginner?
I decided to learn c++, and even got the design patterns book to help with good coding habits, but I still have trouble with programming things that aren't in the courses I take, and I don't feel like I understand the contents of the book enough to learn anything.
Is this normal or am I just too much of a brainlet to have a chance?

I have an application that takes user input. Currently the form code is responsible for checking if the selected object in a treeview is allowed to be renamed, then generating a dialog menu to take text input and push it to the backing object. Currently there's a bunch of boilerplate behind this, as there are about fifteen different object types that can be renamed, at different areas of the form.

I'd like to change this so that the form just checks if the selected object has the ICanRename interface or whatever, then the object updates everything as necessary when the rename event fires. The thing I'm not sure about is if it's good practice to have an object generate UI stuff; should I instead have the main form generate the user prompt and pass the resulting text off to the object?

>I started with OOP and picked up a book to *patch* the bad practices of OOP
top jej
>am I just too much of a brainlet
Not if you don't pick up C

>all these non-developers saying C# is shit
C# is great because it just works. The syntax is clean, everything supports it and it's backed by one of the biggest companies in the world

>design patterns book to help with good coding habits
kek. you got bamboozled, half of those patterns should never be used. Get 'clean code' for good coding habits.

>it just works
see

that's not the point.
We're talking about a first language.

This. Just getting C to compile correctly will already traumatize a newbie, while VS can just be installed and everything works for C#.

This is some serious cancer

>having trouble compiling a C program
>VS
>C#
the absolute state of /dpt/

VB6, that was a real language.

Attached: 1534643356982.jpg (470x470, 36K)

that's not the point.
We're talking about a first language.

maybe I should have posted this here

>C#
>good first language
Meme of the century

Can we stop considering retards for a second.
Programming language design should never consider retards.

>C
>good first language
Meme of the century

>C#
>good first language
Memetics of the ages

Are languages like haskell, rust, go worth learning?

C IS FUCKING SHIT AND KF YOU USE IT YOU SHOUKD FUCKING DIE

yes

It's a bullshit chart, C# runs faster than Python and Java in almost all cases. It can't match C because it doesn't give you access to the bare metal hardware but in exchange you will never run into pointer or memory location issues.

Okay so what you need to do, since you want to get a job as soon as possible, is to go look for job listings right now and check what types of jobs interest you, and what languages those jobs need you to know. C++ is a piece of shit garbage language but it is widespread and if that's what you need to know to get a job, go study that.

Haskell, definitely
Rust, possibly
Go, hell no

IF you arnt considering retards or practicality then only first language that matters is Idres

>It's a bullshit chart
It's just a chart focused on a thing, no need to be buttmad
>it doesn't give you access to the bare metal hardware
What a meme language

>It can't match C because it doesn't give you access to the bare metal hardware but in exchange you will never run into pointer or memory location issues.
You can still use unsafe code in C# if you want all the pointers and shit.

>Not QBasic
youtube.com/watch?v=8YJWqTm0XqY

>or practicality
practicality obviously matters.
But a language should NEVER gimp itself on the basis that someone might misuse it.
Take Rust for example. They couldn't trust programmers to use pointers at all so they just fucking took them away completely and left you with braindead references with idiotic arbitrary restrictions like "HUR DUR YOU CAN'T HAVE MULTIPLE MUTABLE REFERENCES THAT MAKES MY BRAINLESS HEAD HURT HUUUUUURRRRRRRRRR"
The borrow checker has got nothing to do with correctness. There are plenty of perfectly correct programs that the BC rejects.
The BC exists solely to enforce the language designer's arbitrary and idiotic opinions on a language level.
And it makes it harder for people who know what they're doing to do things.

>He didn't start on DarkBasic

Nice try pajeet.

Attached: Marina tentacle.gif (341x379, 2.93M)