/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

en.wikipedia.org/wiki/Homelessness_in_San_Francisco
youtube.com/watch?v=JqczAyFIyos
github.com/NotHawthorne/kaskade
twitter.com/SFWRedditVideos

IF YOU USE JAVASCRIPT YOU NEED TO KILL YOURSELF AND FUCK OFF TO >>>Sup ForumsWDG RIGHT ABOUT NOW

>tfw fell for the D meme
>can't be comfortable with any other language in existence
>peak baby duck syndrome

D is shit in some regards, so just write lots of code which uses that kind of thing and you'll get over it

Is swift the sepples and java killer?
It looks really promising. The only real contender is D.

DO NOT REPLY TO BAIT

THEY ARE PAID GOOGLE TROLLS WHO ARE DESPERATE FOR (YOU)S BECAUSE THEY ARE DESPERATE FOR PEOPLE TO FILL IN THE CAPTCHA BECAUSE THEY'RE STRUGGLING WITH THEIR SELF-DRIVING CARS

DO NOT LET PAID GOOGLE TROLLS SHIT UP THE THREAD

Who is satori?

nothing with automatic memory management will ever kill sepples

>D
Nim is better but I got too much used to D

2hu.
But satori in the picture is not refering to character/person.

sure but they are better languages when you just want native application and don't care that much about performance.

>can't be comfortable with any other language in existence
>is sad to believe he has found the comfiest possible language
>this language is an imperative shitlang
Learn Haskell and/or Idris.
You're welcome.

>try to teach self lua to program using only my android to make virtual boy esque video games to be played in vr
>give up because just to consider doing this made me too retarded to realise I was retarded

I made pong though at least.

>inspiration

Hey /dpt/ total noob here. Taking classes at a community college, and learning Java. I imagine that's gonna make me the object of ridicule here. Regardless, Im starting to feel like the classes are going too slow for me, and I would like to start to take up another language, or start to learn more advanced things in Java. So I have a few questions.

Should I continue learning java? It seems pretty hated here, but I also here its where a lot of jobs are, and im learning it in school anyway.

At what pace can I reasonably expect myself to continue when teaching myself?

How do you guys stay motivated to learn? What keeps you from fucking off and playing a game?

Thanks in advance for any kind anons who want to help me get a scope on the whole thing.

Java is the easiest way to get a code monkey job. It's good to know, and it's not hard to know. You shouldn't be finding it hard.

Best languages are languages that does not force a specific paradigm. The only thing that stings me is that D's GC is not thread-local --which means it has a global memory heap/allocation which will stop the world

en.wikipedia.org/wiki/Homelessness_in_San_Francisco
>Reasons cited for homelessness in the 2015 survey commissioned by the City include job loss (25%),
JAVASCRIPT CODE ARTISANS BTFO

The worst languages are the ones which try to be everything at once, especially when they get that way by snowballing tacked-on shit rather than by design.

fuck off animeposter

> try to be everything at once
D isn't one of them :)

>hur a dur moan ads are the best
>Maybe Integer
In C this is just
int *

How do I make functions which transform trees tail-recursive?
For instance this one.
(defun m-macroexpand (form)
(if (atom form)
form
(destructuring-bind (a . b) form
(let ((mac (gethash a *menv*)))
(if mac
(m-macroexpand (funcall mac b))
(cons (m-macroexpand a) (m-macroexpand b)))))))

nah fuck applel

C doesn't have a construct analogous to maybe.
C++ does have std::optional, but it's clumsy.

I don't think he understands Maybe

Searches Demonoid now. Also the display of seeders/leechers was super fucking broken so I fixed that. Any recommendations for stuff I should be adding to this?

Oh yeah, its actually been really fun to learn so far. Im sure when im working on real projects, and not school assignments, I will understand why you affluent gentlemen have such distaste for it.

I just want to grow, and not wash out like I feel 80% of my class is going to.

Forgot to post pic.

Except the destination int* has 4 states. Null, integer, something which is used to be something other than integer and most importantly: invalid memory. Maybe only has 2 states and you have to implement code for both of them.

youtube.com/watch?v=JqczAyFIyos

Java is a very dumbed down language. Once you have experience with other languages, you'll sense that it was built for the lowest common denominator (i.e. pajeet) to be able to write semi-competent OOP.
That said, it's still a robust language and you should definitely know it.

>C doesn't have a construct analogous to maybe.
Yes it does.
int *
>I don't think he understands Maybe
I sure do.
A Maybe a is either a Just a, which wraps an a, or a Nothing, which is nothing.
Additionally it provides a return function which constructs a Just a, and a bind operator which only calls a function accepting an a on a Maybe a if that Maybe a is a Just a.
int * can do all these things. An int * (when used properly) is either a valid pointer (Just int) which wraps an int, or the integer value 0 on its own, with nothing wrapped at all (Nothing).
Return is just malloc.
Bind operator is just if.

>What are you working on, Sup Forums?

Exploring the deepest, darkest corners of Racket.

link to kaskade.py

>lets replace C and C++
>memory is hard lets add garbage collect lol
>what is java c# golang?

>what is java c# golang?
Garbage

You don't use the latter two. Using the third state you describe is type-unsafe, so you shouldn't so it. Using the fourth is a rookie mistake. So an int * is basically a Maybe int as long as you use it right.

github.com/NotHawthorne/kaskade
Working on stripping results that have the same magnet from a different site, and a prefix before each torrent name that tells you what site it's from.

All significantly better designed than D, at least they had clear design goals.
D wanted to be "C++ but better" but then forgot to keep the only thing that makes C++ relevant.

>All significantly better designed than D
Each one of them are objectively worse than D. Although all of them are better than C++ but that's not a big feat.

>int * can do all these things. An int * (when used properly) is either a valid pointer (Just int) which wraps an int, or the integer value 0 on its own, with nothing wrapped at all (Nothing).
>Return is just malloc.
>Bind operator is just if.
Dude
You are retarded

It's not about what you can do but what you cannot do wrong. In this respect Haskell is superior.
You cannot dereference the invalid memory pointer by mistake in Haskell.

Excellent. If you dont mind me asking, what all have YOU learned, and over what period of time? What keeps you motivated to keep learning? Do you work in the field yet?

Is it possible to catch up? Im 22 now. Is there really an Asian kid/ paj ready to take my job at any moment?

Data.Maybe.fromJust

>only thing that makes C++ relevant.
1. Microsoft kept C++ alive
2. C++ is very old and mature, so more libraries are written in it
3. Being compatible with C at the source level, C++ piggybagged on C's legacy.

I'm glad that language monopoly is slowly being abolished and C++ meme is finally dying

you need to go back

D can link with C and C++ effortlessly. Why hasn't D replaced C++?
Because it's useless without the GC, and there are millions of better garbage collected POOlangs.

>and there are millions of better garbage collected POOlangs
Not really. Also being able to call sepples easily is kind of HUGE thing just because there exists so much shit written in sepples.

haskell

>Not really.
Then why is D dead?

No language can "link" with C++ effortlessly. Although it can call some of the, in fact most of the C++ natively.
>Why hasn't D replaced C++?
1. No multibillion dollar company shilling it
2. Shitty GC that hasn't got any attention whatsoever
3. Language too big
4. About 20 years younger than C++

>Because it's useless without the GC
Any language that supports GC properly is bound to have GC dependent libraries, no one is interested in manual memory management anymore. But for that I guess you'd have to have tons of Macros in the standard to make up for the GC independence.

GC isn't inherently bad, what you are thinking of is the conventional global mark-sweep GC (I think your hasklel/idris has it as well) that stops the world.

It saddens me that although D community is aware and trying to make a better GC, they probably aren't going to make a thread-local GC.

>1200 pages book
>Costs money
Please

Here's the Mona Lisa with 199990 lines. At this point, you can hardly tell a difference between the generated image and the real thing.

>"he's anti-anime on an anime website with an anime owner and he's also probably an newfag hehehehe" am i rite

fuck off

Most used languages are not used because they are good...

Forgot to add:
Walter is not doing anything about the GC. This is why probably I'll end up jumping ship to Nim.

>It's not about what you can do but what you cannot do wrong. In this respect Haskell is superior.
But user, that respect doesn't matter.

>I like writing buggy code.

Programming breeds anxiety in my head for no fucking reason

Should I unsarcastically exercise

No see the trick is to learn how to write code that has no bugs DESPITE not relying on any kind of safety.

Now that I'm comfortable with function pointers in C, I find that I use them a lot to give different behaviors to the same typed struct. For example, if I have an entity type in a game, I'll have the update and render functions be members of that structure. That way, I can implement all of the different kinds of entities under the same type by just creating unique update and render functions.

My first language a few years ago was Java. Has anybody else that started with Java catch his or herself programming in a Java style, even when it may not be the most appropriate thing to do?

>Why hasn't D replaced C++?
>"Let's rewrite the whole in wolrd in another language"
>"say no mo faam"

Java didn't have any issues replacing C++ for general purpose application development, and had significantly more trouble interoperating with C++.

Can I master python in a day?

>What are you working on, Sup Forums?
started to learn python
currently working on a math game... i'm doing some tutorial course

Incredible. Triangles BTFO.

That's what they're built for.

C++ could never match Java actually, Java was more popular from the beginning. And it kept taking off when Android adopted it.

I mean, I do, but thats mostly because im a fat 300 pound fuck.

Master? unless you know some other languages, especially C and java, im gonna say no. Learn some? sure.

Reminder to show off your language/skills

probably not, but you can master Racket in ten minutes!

Is it worth it to start learning C++ or should I just sharpen my skills with other languages I am slightly above novice level with? (C, Java, and Python)

>you can master Racket in ten minutes!
You have been "exploring the dankest parts of racket" for months

What? Haskell doesn't cost money.

1) skip the LC bit
2) there's a pdf of haskell from first principles up somewhere
check lainchan book links

C++ is a complicated and confusing language. You should be good at C and Java first.

>C++ meme is finally dying
not really, and if it is it's not because of D(ead)

C++ is dead, boy

>C dying faster than C++
lmao

>master
no
>make useful program
sure
You don't need to know python to make useful stuff with it.

good doggo saving the day, what happened tho?

it's overtaking C in a year or two dumb shit

where is D even in that graph?

C will forever remain in a plateu since almost all languages can FFI with it.

C++ however, ... dead soon

Why do C-like languages all push this meme that everything should be everything else?
C:
>pointers to different types
>just kidding you can implicitly cast a pointer to any non const type to a pointer to any other type
C++:
>different classes
>just kidding implicit constructors and cast operators
Java:
>different classes
>just kidding they're all Object

This isn't necessarily a bad thing

a slight downward slope doesn't mean it's dying just that newfags and their snowflake faglangs are diluting the market

There was talk in cppcon 2014 or 2015 where the guy was talking about sepples in embedded.
The graphs he shoved actually shoved that sepples peaked somewhere 2000 but then it was steady fall and increased use of C. So it won't be overtaking C at least on embedded field and C is not even used that much on Application field.

How difficult would it be to make a very simple and basic browser in python?

Thanks friend. I'll try and tune up those skills before I jump into it.

Enjoy being taken over by C# LMAO

You can see suckless surf which is like 3k lines of C. So writing working browser in python using webkit should be easy, making it useful might be bit harder.

they're not even in the same space. C# competes with java not C++. enjoy being taken over by python LMAO

use a strongly typed language

no good strongly typed language exists, though.

Java is strongly typed though

Looks like C# IS taking over C++ in terms of "popularity". IDK why should anyone care but there you go, the current state of C++

It could never even surpass Java in popularity, it could not replace C and now, it's being overtaken by C#. What a sad story.

>

sure is summer

Haskell
Idris

If that makes you feel any better, sure

>idris
>implicit conversion

Which is more popular the microcuck c# or applefag OBJECTIVE-c?

>good