[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 332
Thread images: 34

File: dpt-poster.jpg (517KB, 1521x1076px) Image search: [Google]
dpt-poster.jpg
517KB, 1521x1076px
What are you working on, /g/?

Previous thread: >>61628058
>>
>>61634151
Learning C++
>>
where is akari anon
why is the board down
>>
File: 1464585559708.png (743KB, 1384x1496px) Image search: [Google]
1464585559708.png
743KB, 1384x1496px
>>61634151
D sucks Dick.
>>
File: 1493801381178.jpg (176KB, 1280x720px) Image search: [Google]
1493801381178.jpg
176KB, 1280x720px
>>61634151
Reading K&R
>>
>>61634271
That's not a bad thing
>>
whats wrong with my shitty c bit code it prints 0001110100 when i expect 0001101010

void printbits(int number){
char lol[10] = "0000000000";
for(int i = 0; i < 8; i++){
if((number & (int)pow(i,2)) != 0){
lol[i] = '1';

}

printf("%s\n",lol);
}
}
>>
C++ is a horrible language. It's made more horrible by the fact that substandard programmers use it.
>>
Writing an ultra secure decentralized communications protocol.
>>
>>61634271
Why dont you like it, lad?
>>
>>61634287
pow(2,i)
>>
>>61634315
i dunno how u can even help me i just noticed how eternal shitty that code is but thanks friend
>>
>watch a programming talk by a guy
>its most always technical to some degree an informative

>watch one with a girl
>it always just sounds like a sales pitch and they rarely show any actual programming

Are there any decent womeme talks, /dpt/?
>>
>>61634333
women dont really care about programming, they just think of it as a way to gain male fans (ohhh shes so smurt!!) and money from donations / shitty ruby / JS code.
>>
what is /g/'s opinion on
using namespace X
>>
>>61634355
>C++
Instant trash
>>
>>61634355
Namespaces are awful.
Use a language with modules.
>>
>>61634333
https://www.youtube.com/watch?v=endKC3fDxqs&index=17&list=PL3jwVPmk_PRxo23yyoc0Ip_cP3-rCm7eB
>>
>>61634390
Yeah, this one surprised me desu, andrei's protege was nice to listen to.
>>
>>61634376
Namespaces are good, but modules and namespaces together are better.
>>
>>61634282
Yes it is. The language looks promising in terms of syntax and what it can do but then that gets blown away because it has really poor debugging methods. Turns the language into a simple toy.

>>61634310
Debugging D is awful. There really is no standard "out of the box" way to debug code like in C or Java that just work. D has a random mix of debuggers that either do a poor job of debugging or can't debug at all. This really hold the language back in my opinion.
>>
How do you dereference variables when calling commands in bash?
var="dicks"
output=$( some shit | awk '("$2" == "$var") { print $3 }' )


I did it using eval but I hear it's bad practice to use it.
>>
>>61634409
modules make namespaces redundant.
>>
>>61634390
>DConf
How many funerals does this language need?
>>
>>61634423
>still using a scripting language in current year
>>
>>61634424
What if you need to define a new namespace inside a module?
>>
>>61634432
must be popular in europe
>>
>>61634420
>D has a random mix of debuggers that either do a poor job of debugging or can't debug at all
Thats true i suppose. You might look into the Linux version of Coedit if you care enough. They have a nice front-end.

Ive found that taking a functional approach with D rarely has me needing a use beyond some sparse writeln though.
>>
>>61634420
Real men don't need debugging
>>
>>61634432
>the rustfags are getting nervous
isn't it time for you to take your estrogen?
>>
>>61634446
protip: use tee
>>
>>61634452
I don't use Rust.
>>
>>61634452
Pretty sure it's a pooinlua tard
>>
>>61634332
Np. You can also do
1 << i
, but your compiler will probably optimize that for you.

C++ implementation:

void printbits(int number){
std::vector<bool> bits(8, false); // Vectors of bools are more space efficient in C++
for (unsigned int i = 0; i < bits.size(); ++i){
bits[i] = (number & (1 << i)); // Compiler warning for casting int into bool, but w/e
}
// Print result
for (auto &b : bits){
std::cout << b;
}
std::cout << '\n';
}
>>
File: 1486275222031.png (139KB, 228x260px) Image search: [Google]
1486275222031.png
139KB, 228x260px
>>61634466
>float point indexing
>>
>>61634457
the std.range.tee?
Havent found a use for it yet but i probably will eventually
>>
>>61634477
Absolutely disgusting
>>
>>61634485
If you are chaining functions you can use tee in the middle of anything to see where it's going
>>
>>61634452
>>61634466
>paranoia
SHE'S DEAD, JIM
>>
>>61634477
>indexing starts with 1
>>
>>61634503
You mean 1.0
>>
Stop bullying Lua, it's a nice scripting language
>>
>>61634516
In lua 5.3 they added integers.
>>
>>61634523
>LOO-uh
>Nice
Good meme, I laughed
>>
>>61634496
Id rather just keep a local debug block instead of having to modify actual things. But it seems handy, its just i rarely abuse UFCS enough to lose track.
>>
>>61634526
>It took them 5 versions at minimum to realize this
kek
>>
>>61634538
What do you expect from skid shit?
>>
>>61634516
this is actually horrible
>>
Lua was never meant to be taken seriously
>>
Holy fucking shit dat autism OP pic.
>>
>>61634600
that pictures probably atleast half your age.
>>
File: 1500944815316.jpg (29KB, 559x813px) Image search: [Google]
1500944815316.jpg
29KB, 559x813px
Best place to learn C#?
Will codeacademy ever do C#?
>>
File: 1490524720176.gif (1MB, 450x540px) Image search: [Google]
1490524720176.gif
1MB, 450x540px
>>61634614
First question, why C#?
>>
>>61634446
>Ive found that taking a functional approach with D rarely has me needing a use beyond some sparse writeln though.
It is a bit off putting though. Rolling with print statements is limiting vs procedural line by line examination of the logic. Why does it have to be this way...

>>61634449
But I don't want to create shitty code. I want a way to double check my logic and fix whats broken because I know I'm bound to fuck shit up.
>>
I've finally got the supporting code in place for my Discord bot written in [spoiler] D [/spoiler].

You can define commands that match on patterns in the messages that users send by writing functions and tagging them with custom attributes in a separate module. You then pass that module name to a function that automatically imports your module, loops over all the declarations tagged with @Command or @Pattern and generates the code to look for the patterns you've defined. If your command isn't very complicated you don't even have to specify the pattern to look for; if you leave it out it will use the function name as the pattern. Writing a command is very simple:

@Command
string ping()
{
return "pong";
}

@Command("press f to pay respects")
string payRespects()
{
return "f :pray:";
}

import std.regex;

@Command(`(^say)\s+(.+)`)
string say(Captures!string captures)
{
return captures[2];
}


I have to say that I really like how powerful D is. It seems like there's either a tool for everything you'd need or you can easily create one.
>>
>>61634614
Code academy will give you a basic introduction to logic, which in your case is far more important.
>>
File: 1452870514778.jpg (58KB, 514x524px) Image search: [Google]
1452870514778.jpg
58KB, 514x524px
>>61634614
>>61634636
JAVA
>>
>>61634641
>But I don't want to create shitty code
Don't create them
> want a way to double check my logic
Do it yourself, does one need to hold your hand?
>>
>>61634647
>>61634636
Need to move up from scripting, I already know python. Want to make games for fun.
>>
Whats a good place to find the basics to C? I need to revise it for my class, forgot all about it
>>
>>61634641
>Why does it have to be this way...
Well VS Code + GDB + native D stacktracing work well enough.
If no one gets to it by then, its like the fourth thing down on my project list.
But you should definitely look into soft-functional in your language of choice. It really cuts back on a lot of debugging.
>>
>>61634642
If only any other programming language in wide use could claim the same..
>>
File: 15822597.jpg (5KB, 370x334px) Image search: [Google]
15822597.jpg
5KB, 370x334px
>>61634673
> I already know python
Have you tried Nim?
>>
>>61634650
Java is only useful for cross platform distrubution without re-compilation.
>>
>>61634682
Lisp? It doesn't really seem that widely used.
>>
>>61634675
K&R
>>
>>61634682
>D
>wide use
>>
>>61634675

Basics of C? Can you write imperative code?? I'd have other concerns if I was you.
>>
>>61634709
D has wchars though?
>>
>>61634709
https://dlang.org/orgs-using-d.html
>>
>>61634685
There's more tutorials for unity. Trying to move away from python.
>>
File: muhboi.jpg (184KB, 1381x1640px) Image search: [Google]
muhboi.jpg
184KB, 1381x1640px
>>61634642
Whoops, forgot a picture of it in action.
>>
>>61634686
It's actually a pretty well made language overall though, the community is just corporate crap.
>>
>>61634742
Now make it autonomously shitpost and then make a new bot that tries to moderate that one.
>>
>>61634742
Amazing, almost as good as the ruby on rails app I farted out while I was drunk.
>>
>>61634742
kek
>>
>>61634754
Yeah, it's really well made and a great language... besides the type system being unsound.
>>
>>61634761
It's not the end product, it's the journey. I've never done anything like this before so it was a great learning experience.
>>
>>61634642
how the fuck do you guys come up with this shit? did you just think "oh hmm a discord bot. that would be interesting. also I like the D language. I guess I'll get to work!".
meanwhile I'm sitting here for hours trying to think of anything interesting to write and all I can think of is stupid shit like todo lists and emulators
>>
You're right. Other people have steel, you chose tin.

> D

And deliberately avoided making an alloy out of it. Enjoy your tin.
>>
With the risk of shitting up the thread;
Am I the only one who found programming having become more enjoyable since switching from Java to C#?


> Finding resources is a lot easier because the language doesn't encourage writing factoryFactories and other retarded shit, so the code snippets you find are short and to the point

> .NET was seemingly developed by people with a brain, so shit like file system iteration can be done with one command rather than 35 lines of object iteration, this also fits into the above: a lot less shit code to be found

> Networking is a lot less shit because you don't have to bitshift every single piece of data into a larger signed variety. A uint32 is a uint32, not a int64

> Don't have to write batch or sh scripts to run the program you just made, making it a lot easier to publish

> It's just as cross-platform as Java with .NetCore and Mono, so you don't have to worry about gays and aspergers not being able to run it

> Its primary IDE has amazing debugging and does actually not eat up 16GB of ram and 4 CPU cores from just trying to code completion


I know of the
> Microsoft
meme, which is why I avoided C# to begin with, but now that I've actually started using it, holy shit why didn't I switch sooner.
>>
>>61634825
What does that supposed to mean?
>>
>>61634817
>stupid shit like todo lists and emulators
>emulators
emus teach you alot though
>>
File: installing gtk+.png (23KB, 746x130px) Image search: [Google]
installing gtk+.png
23KB, 746x130px
trying to make gui in ubuntu with c++ and how do i solve this? sry for retarded question i only ever make gui in win api
>>
>>61634817
Well, I had special motivation for getting this to work as I wanted to write a bot that monitors a friend's twitter for new tweets and automatically posts them to a private discord channel so me and some friends can make fun of him (he thinks he's a big e-celeb and posts the gayest shit. He is also in this discord channel). This is just the discord side of things. I recently created a command that can scrape google for images as practice for scraping his twitter feed for tweets.
>>
i love how flustered brainlets get when D gets brought up
>>
>>61634849
>>D is dead
>omg rust shill
>Wtf no it isnt [obsecure company using D]
>holy shit wtf
Yeah, those D brainlets really get flustered when they try to bring that corpse back from the dead
>>
>>61634832
It's not surprising. The C# language is what Java wants to be when it matures.

>>61634843
>writing programs to automatically troll your friends
You're doing good.
>>
>>61634871
D is automatically infinitely better than Rust because it's not associated with trannies and other SJW shit.
>>
>>61634837
yeah but literally nobody gives a fuck. It's not special. you can't sell it, because lets face it no emulator an amateur programmer makes is going to compete with professionally made emulators.
employers only care about things you made that have some value. there are thousands of emulators out there.
>>
I wish D fags and Rust fags got along
>>
>>61634886
I don't care about Rust
>>
>>61634905
What a coincidence, neither do I.
>>
File: smug_pepe_ascii_cloak.gif (213KB, 250x263px) Image search: [Google]
smug_pepe_ascii_cloak.gif
213KB, 250x263px
>>61634891
I enjoy it when they fight it out. I enjoy when they fight it out, thinking that they are the superior language when I just down on them as I know that C is the superior language. Long live C!
>>
/dpt/ how do I use ADT to do trait?

Suppose I am writing game in pure functional language

I am need game object. One of few legitimate use case for object oriented programing

Simple enough just express object state as algebraic expression of types and create alias to said expression

BUT THEN!!!!!!!!!!!!

I am need something like inheritence in order to expressing many rich diversity of game object

Consider situation!:
Have the objects
* Some game object are solid
* Some are stationary
* Some are both but not all that either is both
* Some are control by player
* Some are UI abstraction
* Some are pickup to restore stat, endow ability, etc
* Some are enemy
* Some are walk on land
* Some are fly
* Some are siwm
* Some are affect of gravity and physic
* Some are have more simplerudimentary scheme of move
* ALL have many different overload for interactbehave! Behave are be construct from what?? From what list above!
* AND YET!!!!!!: ALL are game object!

Obvious need for trait. But how do?
>>
>>61634910
>>>I don't care about Rust
>>D is shit
>Wtf rustfag

Let's face it, D is as shit as Rust
>>
>>61634939
>C
>Frogposter
instant brainlet
>>
>>61634940
Diversity should be avoided at all costs.
What constitutes a "game object"?
Consider existentially quantified types
>>
>>61634950
What makes you say that?
>>
>>61634939
Actually the superior language is electrical engineering.
For any program you can write in C it is possible to wire up a circuit that achieves the same result much more quickly and efficiently, without relying on anything even resembling a processor
>>
>>61634950
D is slightly less shit than Rust, and 100 times less shit than C/C++.
>>
>>61634971
C++ is thousand times worse than Java
>>
>>61634940
>help me jump through all these hoops to program something using the latest memes instead of what makes sense
you have terminal retardation
>>
>>61634971
>/C++.
Cringed
>>
>>61634940
Use a non-meme language like Java and just define an interface.
>>
>>61634611
Wow much hardcore
very oldfig
much experience
>>
>>61634964
Lack of ADTs, real polymorphism, type classes, etc.
>>
>>61634977
I don't disagree.
>>
>>61634999
Rust has all three of them, but there has been languages that don't have these and people are still using them
>>
File: 23784532532.jpg (154KB, 508x608px) Image search: [Google]
23784532532.jpg
154KB, 508x608px
>>61634151
>>
>>61634962
>Diversity should be avoided at all costs.
Disagree. You attitude make very boring game. Better apply of other kind software.
>What constitutes a "game object"?
Consider cellular automatan but cell are organize into different subtype that obey different set of rule
Grid is game world
Cell are game object
Same thing sense
>>
>>61634151
this image disturbs me
>>
>>61635022
Pong isn't diverse, but it's very popular.

Try existential types, or even the new type indexed typeable / dynamic
>>
>>61635036
It's also 45 years old
>>
>>61635021
Why do people think it's cool and edgy to regard the weak with contempt and disgust?
Just because you're better than us doesn't justify you in being aggressive about it.
Maybe it's because we're exemplary of undesirable qualities you've strove to purge yourself of, and as rightfully proud as you are to have emerged victorious in this pursuit, you're still a bit viscerally jealous of the relative simplicity we enjoy in not bothering to strive as hard.
But if that's the case, that sure sounds like a whole lot of YOUR problem, not ours.
Go fuck yourself.
>>
>>61635089
Just goes to show how good non-diverse games can be
>>
>>61635099
This is a solid argument but also not very compelling.
Too much logos, not enough ethos.
>>
>>61635021
wow I am triggered
pls delete this rude post
>>
File: qt problem.png (57KB, 1432x224px) Image search: [Google]
qt problem.png
57KB, 1432x224px
what the fuck guys this is like the default project

what is the problem here
>>
>>61635099
>Just because you're better than us doesn't justify you in being aggressive about it.
This is really the core sentiment of the point you're making here.
Now let me explain to you why it's misguided.
You're not good enough.
These people who are better than you, who aren't weak, they're good enough. They rightfully deserve basic consideration for their emotional needs.
You don't.
It's totally okay to vocally or even violently regard you with contempt or disgust for any reason or even for no reason at all. There's nothing morally wrong with that, because you are simply not good enough to deserve the contrary.
>>
>>61635165
>what is the problem here
>/usr/bin/ld: cannot find -lGL
That.
In case you can't read it, it's saying you don't have the OpenGL development library installed.
>>
>>61634999
std.variant for ADT
>>
>>61635214
It's awful.
>>
>>61635232
Why?
>>
>>61635235
Nobody wants your bullshit variant<tuple<variant<this,...>>> and the endless packing and unpacking
>>
>>61635208

thanks anon, googling 'qt cannot find -lGl' returns bullshit so i was stuck
>>
>>61634940
Only lump things together if they truly should be grouped together. Use components instead of inheritance.
>>
>>61635245
they arent just tuples
>>
>>61635274
I know.
>>
>>61635258
>'qt cannot find -lGl'
No problem. For future reference, when you Google expressions that contain words prefixed with hyphens, don't include the hyphens. On Google, a word prefixed with a hyphen is code for "only return pages excluding this word."
>>
>>61635245
Lol.
>C++ and D fags see FP gaining steam, very useful
"h-hey guys we have FP feature's too!! see, here's a badly retrofitted std::optional!! s-see, we can have really bad variants using std::variant!!"
>>
>>61635284

what the hell? can i escape it with \ ?
>>
>>61634355
>>61634376

void func()
{
// do things without namespace

{
using namepace x;
// do things with namespace x
}

// go right back to not having the namespace in scope
}


It can be managed... terribly.
>>
>>61635286
What are you talking about?
C++ has had FP features since before it was C++.
The simplest and most efficient variants are called 'unions.'
The simplest and most efficient tuples are called 'structs.'
The simplest and most efficient type constructors are called 'macros.'
>>
>>61635286
What is FP?
>>
>>61635325
>C++ has had FP features since before it was C++.
What a sad autist
>>
>>61635299
use quotes
>qt cannot find "-"IGL
>>
>>61634658
I'm not perfect and I know you would agree with that. Proper debugging allows an easier time for nipping bad code in the bud. Print statements are shitty for debugging.
>>
>>61635333
It's true though. C has variants, tuples, and type constructors, and they're all incredibly efficient. It even has monads, they're called pointers.
>>
File: 1500280495232.jpg (243KB, 1280x1280px) Image search: [Google]
1500280495232.jpg
243KB, 1280x1280px
>>61634390
she kinda looks like a female version of moot
>>
>>61635325
These are the most primitive forms but that doesn't mean that they are effective and practical forms. We don't program in just the lambda calculus.

>>61635353
Nice meme
>>
>>61635353
pointers are not monads
>>
>>61635353
Pointers and main memory form a comonad.
Not a monad.
>>
>>61635372
They are though. A pointer is a complete implementation of Maybe, minus all the safety.
>>
>>61635391
This is the dumbest thing I've ever heard.
I guess Java has Maybe too, since all its values have null.
>>
>>61635405
>arguing with a mentally ill C tard
>>
>>61635405
>This is the dumbest thing I've ever heard.
Some truths are dumb.
>I guess Java has Maybe too, since all its values have null.
Now you're getting the picture.
>>
>>61635420
You're retarded. Try learning FP before talking about it.
>>
>>61635391
>A pointer is a complete implementation of Maybe, minus all the safety.
The safety is the whole fucking point!
If it's not safe, it's not Maybe.
>>
Why is there a beep noise after every function in my javascript, im assuming it has something to do with the console.log

I never even added it myself and google says you need console.log('\u0007'); in order for it to even beep?
>>
>>61635439
I already know FP. And I know Maybe is literally nothing but a type constructor whose instance may or may not wrap an instance of the parameter type.
>inb4 b--b--but muh pattern based overloading
C doesn't have that. It still has Maybe, just without that particular way of handling it. Granted, that particular way of handling it is the whole point of the construct, but it's also not a part of it, it's a part of the language.
>>
>>61634642
I remember writing an IRC bot in PHP when I was 12. God what a piece of shit it was. Good times good times.
>>
>>61635474
Monads aren't just type constructors, not that there's any point arguing with you
>>
>>61634838
you solve it by installing a glib version which is 2.49.4 or later, you have 2.48.2
>>
>>61635474
Yeah but I bet you can't pretend C has dependent types though, you fucking piece of trash!
A variant could conceivably be defined as a tuple of Maybes, SUCH THAT exactly one of them is a Just.
Your fucking shitlang can't do that! Because there's no fucking "such that" equivalent!
Cunt!
>>
>>61635544
see >>61635417
>>
>>61635523
>Monads aren't just type constructors,
I never suggested anything of the sort.
You may have misread. What I said is that Maybe--that is, Maybe specifically, not monads in general--is just a type constructor whose instance may or may not wrap an instance of the parameter type.
>>
>>61635286
Functional C++ is beautiful and concis--
template <class T, class U> auto delegator(T (*func)(const U& u), const U& u) -> decltype(func(u))
{
return func(u);
}
>>
>>61635544
>Yeah but I bet you can't pretend C has dependent types though, you fucking piece of trash!
struct may_or_may_not_be_a_foo;
int is_a_foo(struct may_or_may_not_be_a_foo);
>>
>>61635584
-e.
int *map(int (*)(int), int *, int);
>>
>>61635631
Is that how map looks like in C++?
>>
>>61634832
>Its primary IDE has amazing debugging and does actually not eat up 16GB of ram and 4 CPU cores from just trying to code completion
Wtf are you talking about? Visual studio is one of the sluggiest IDE's out there. Real men use Makefiles


I do agree though C# > Java, I mean wtf is up with generics in java? And exception handling is also retarded as fuck in Java
>>
>>61635637
no, that's plain C
also it only works on ints but that should be fine because you should only really ever be working with word sized data for maximum efficiency
>>
So yeah, I've pretty much conclusively proven C has all the good shit.
>variants
unions
>tuples
structs
>type constructors
macros
>maybe
pointers
>other monads
opaque data types
>dependent types
boolean functions to be used in assertions and conditionals
>lambdas
pointers to static ("file-private") functions
>closures
lol fuk dat
>>
>>61635671
>I mean wtf is up with generics in java?
don't question it, just use wildcards
>>
>>61635637
lolno

std::map<int,string> whatever{{1,"one"},{2,"two"}}

is the shortest way of declaring map (std can be omitted when "using namespace std")

>>61635584
>pastes library impementation
>argues about language
Of course you may ever chose to write in the most bizzare kind of C++ but you are free not to do so unless your employer requires.
>>
>>61635682
>you should only really ever be working with word sized data for maximum efficiency
oh my fucking god
this is a new level of mental illness even for you mister "c has fp features"
>>
>>61635724
>lolno
>std::map<int,string> whatever{{1,"one"},{2,"two"}}
>is the shortest way of declaring map (std can be omitted when "using namespace std")
not the kind of "map" we're talking about
>>
Just started learning Python, having fun so far. What should I learn alongside it to have a chance in IT industry? I plan on installing a Linux distro and learning SQL as well.
>>
>>61635611
*experiences physical pain*
>>
>>61635739
Learn C
Even a man proficient with power tools can't call himself a competent handyman unless he's also proficient with good old hammers and screwdrivers
>>
>>61635739
looks at job listings, they state which technologies you should know
>>
>>61635729
it's the illness of someone who overheard some ASM keywords but doesn't fully understand what they actually mean.
>>
>>61635567
That Maybe can be /represented/ as a pointer in a system that has null pointers doesn't mean they're the same thing
>>
>>61635724
>anything my tiny brain can't comprehend is a pasted library implementation
>>
>>61635826
Indeed they're not the same thing. Pointers are much more versatile.
But more specifically, a pointer which documentation guarantees is either null or valid and forbids taking the address of for any purpose but to test it for nullness is the same thing as a Maybe.
And the only difference there is documentation.
>>
>>61634940
Just use entity component system instead of OOP
>>
>>61635862
>pointers are more versatile
Yeah and doubles are "more versatile" than bools
>>
>>61634834
I think he's metaphorically calling D tin in comparison to some alternatives which could be steel or another alloy.
>>
Recently I've been doing programming challenges online and I forgot how good it feels to sit down, study a problem and find a solution that just werks. Plus the discussion regarding the problems afterward always has good information about how to solve the problem that you looked over. Do online challenges boys.
>>
>>61635977
Link them fgt. Most of the ones i've ran into are too easy to be of any challenge unless i'm doing it specifically to learn a language.
>>
>>61635977
Id love a PE type that wasnt all tedious math shit.
>>
>>61635994
https://www.hackerrank.com/domains/algorithms
pick the category you want. Go for hard/expert challenges. Have fun! I've just been working through pages 2-3 of implementation.

>>61636036
a friend recommended me hackerrank, some challenges involve math but nothing as complicated as PE gets that I've seen. It's been fun.
>>
File: angry_doggo_noises.png (766KB, 843x1034px) Image search: [Google]
angry_doggo_noises.png
766KB, 843x1034px
>>61635977
>boys
b-but I'm a girl!
>>
I got a job /dpt/

I'm hired. I can finally quit being IT support.
>>
File: 000028-Twitch.png (14KB, 59x81px) Image search: [Google]
000028-Twitch.png
14KB, 59x81px
>>61636100
gj bud
>>
is there any useful Perl6 code yet?
>>
>>61636140
:^)
>>
>>61636100
a job in software development?
how many years experience do you have and what's the pay?
>>
>>61635838
>unironically has brain large nough to contain 1000+ pages with C library specification included
>>61635737
Oh well ic now.
>>
File: window.webm (498KB, 640x436px) Image search: [Google]
window.webm
498KB, 640x436px
ncurses interface for my encrypted chat. windowing and input works.
>>
>>61635724
>lolno
>std::map<int,string> whatever{{1,"one"},{2,"two"}}
Kek. Read SICP nigga.

>>61635682
#define makemap(type) type * map##type##(type (*)(type), type *, type);

This should work no?
>>
>>61636844
Correction.
#define makemap(type) type * map##type(type (*)(type), type *, type);

I don't C macro much.
>>
>>61636844
isn't std::transform C++'s analogy to map functions?
>>
>>61636844
>Kek. Read SICP nigga.

map in C++ : transform

lazy map in C++ :
vector<char> input {'w','a',t'};
auto lazyMap[&](auto key){
return input[key];
}


Really cannot see how >>61635584 is indicative.
>>
>>61636890
I dropped C++ a long time ago. But yes it looks like it is. Then again I can't be sure because I can't read this horseshit:
>template <class InputIterator1, class InputIterator2,
>class OutputIterator, class BinaryOperation>
>OutputIterator transform (InputIterator1 first1, InputIterator1 last1,
>InputIterator2 first2, OutputIterator result,
>BinaryOperation binary_op);
>>
>>61636924
His shitpost is more understandable than the real thing desu.

The fact that C++ needs an auto keyword is proof the type system jumped the shark. There's no reason to even try to understand the type signature in C++. You just have to hope you memorized how to use it.

I'd rather use a dynamically typed language if I can't read the type signature.
>>
>>61636992
Statically typed languages with much simpler type systems than C++ are all moving towards type inference nowadays senpai.
>>
>>61636992
vector<char> input {'w','a',t'};
std::function lazyMap[&](size_t key){
return input[key];
}

Are you retarded?
>His shitpost...
... does not serve any real purpose.
>>
>>61636924
>laziness + mutability
>>
>>61636947
That is just because of the verbose typenames. It is quite easy to read if you have any familiarity with the STL's design.
>>
>>61637193
or lack thereof
>>
>>61637193
That's true but it's also pre-expansion.

Unless things changed, last time I used C++ you get the full expanded hell when you make an error. Throw in some vector<vector<shared_prt<Object>>>'s and good fucking luck.
>>
>>61637218
The split between containers / iterators / algorithms is makes sense, at least.

>>61637242
Yeah, I agree. Having concepts (making InputIterator actually mean something for the compiler) should help, but for now it is shit.
>>
File: 5430905.png (29KB, 400x200px) Image search: [Google]
5430905.png
29KB, 400x200px
Tell me the less cancerous option.
>>
>>61637499
Rust, but it's still like choosing between brain cancer and ass cancer
>>
Learning c++
What do I need to add to vim to be more productive?
>>
IRC still #/dpt/ @ Rizon?
>>
File: 1492637962626.png (672KB, 1034x720px) Image search: [Google]
1492637962626.png
672KB, 1034x720px
someone told me to put on kneesocks and to post here
>>
>>61637632
you're a silly fool
>>
File: 4234871234812.jpg (99KB, 750x1020px) Image search: [Google]
4234871234812.jpg
99KB, 750x1020px
http://www.strawpoll.me/13574279
http://www.strawpoll.me/13574279
http://www.strawpoll.me/13574279
http://www.strawpoll.me/13574279

>>61637632
>not a qt pair of crochet pantyhose
>>
>>61637632
>>
File: trap_programming.jpg (130KB, 652x592px) Image search: [Google]
trap_programming.jpg
130KB, 652x592px
>>61637639
>>61637632

What? I do it and I dramatically improved my productivity.
>>
>>61637538
For reading, just use ctags and cscope.
For writing, use YouCompleteMe.
>>
>>61637499
Depends on what you want to do.
Go is the simpler language and can be nice for concurrent network stuff. Downsides for most people are probably the error handling and missing generics.
Rust on the other hand has the more advanced type system, better C FFI and you can do basically anything you can do in C. The cognitive overhead while writing/learning Rust tends to be higher though.
>>
>>61637499
Go use servers,high concurrency,infrastructure,simple language for teams, Rust only if you really need high performance,low use memory and very low latencies and don't had to use a lot c++ libraries base API, avoid high performance graph data structure.
>>
>>61634420
>no standard out of the box debugger like in C
Wow I had been using non-standard debuggers like GDB all along. I didn't know the standard defined one. Can you point me to one?
>>
How do I auto start a node js file on computer startup

I tried it with making a batch file and adding it to startup directory, it didn't work because it launches with Windows CMD instead of Node.js's CMD

Any help?
>>
>>61637861
I believe you can write shortcuts there. Make a shortcut to node with the script following in the argument list.
>>
>>61637861
what's wrong with windows' CMD
>>
>>61637907
it is homophobic
>>
> #include <future>

do people actually do that?
>>
What programs are the most arbitrarily complex by necessity?
>>
>>61637955
women
>>
>>61637955
Certain games, large distributed systems, cluster computing applications.
>>
>>61637955
Rust programs
>>
>>61638008
>cluster computing applications.
no
>>
>>61637907
for some reason, my javascript gets a syntax error in CMD but not in Node's CMD so I'm assuming its the enviroment problem
>>
Just started learning python. Like literally in the last hour. Been making silly text adventures. I am having a blast.

What should I be learning now? How can I actually improve my python knowledge outside of novel bullshit? [spoiler]also how do I do branching paths? So if my hero picks a sword instead of a bow the whole game (and code i would assume) is split in two, so how would i code that? can you something like if a==1 and b==1 then print c?[/spoiler]
>>
>>61638082
Ah. Yes I meant cluster computing libraries/systems.
>>
>>61638132
Pick up a book on Python.
>>
>>61638132
>also how do I do branching paths? So if my hero picks a sword instead of a bow the whole game (and code i would assume) is split in two, so how would i code that? can you something like if a==1 and b==1 then print c?[
You pretty much just wrote the answer.
>>
>>61638150
Not the person you're replying to but I'm in a similar situation. Trying to learn Python for use in a Finance context. Any book recommendations?
>>
File: 1473594847176.png (393KB, 608x526px) Image search: [Google]
1473594847176.png
393KB, 608x526px
A userscript for downloading images on flickr

(function() {
document.getElementsByClassName("spaceball")[0].style.display = "none";
})();


It just hides a div that prevents you from right clicking the image
>>
>>61638189
The Python subreddit lists some books. Pick one that fits you.
>>
>>61638202
but hacking is ILLEGAL
>>
>>61638222
Seriously though, they made it way too easy to download images from their website. You can also just inspect element and delete that div or get the image URL from the HTML.
>>
>>61638189
Automate Python The Hard Way
>>
>>61638203
Good call, thanks bud.
>>
>>61638243
It's just meant to prevent people in general from downloading.
If you can bypass it they're clearly not targeting you.
>>
>he comments the function with the function name
>>
Ok so I made a .bat file with
"node C:\Users\User\Desktop\TheFolder\index.js" in it
launched it and it gave a syntax error, but when I do "C:\Users\User\Desktop\TheFolder" and node index.js, its fine
>>
>>61635698
The interesting point is not whether you can implement features but whether they exist in a convenient-to-use manner. In that regard, only OCaml may be above C.
>>
>>61635698
All this shows is that C only has crippled and error-prone implementations of "good shit"
>>
>>61638283
Is OCaml compiled with GC?
>>
>>61638316
>OCaml compiled
The (only complete) OCaml implementation produces both native executables and bytecode programs.
>with GC
It is garbage collected like pretty much any FP-oriented language.
>>
>>61638326
Is there any FP-orientated language that is not garbage collected?
>>
>>61638338
Carp
>>
>>61638270
>> * @param int index it's the index
wow thanks
>>
>>61638344
Looks cool desu senpai
https://github.com/carp-lang/Carp
>>
>>61635902
shit, that's autism at peak
>>
>>61638344
>>61638360
>number guessing game is more verbose than its C++ implementation
wtf
>>
>>61638372
Welcome to the magic world of Lisp.
>>
File: 3487123867123712.jpg (42KB, 498x509px) Image search: [Google]
3487123867123712.jpg
42KB, 498x509px
When are they outlawing C?
>>
>>61638399
You don't need to, C is dying anyways
>>
>>61638270
That's what you get when you force people to write comments.
/**
* Controller for the terms
*/
public class TermsController {}

/**
* Repository for the terms
*/
public class TermsRepository {}
>>
>>61638406
>C is dying
People have been claiming that for 20 years.
>>
>>61638428
>/**
> * Controller for the terms
> */
>public class TermsController {}
I would fire him. Documentation page would just show TermsController class: Controller for the terms
Defeats the whole purpose
>>
>>61638444
Everyone pretends to like C on 4chen. But no one really loves it deep down.

Otherwise shit like gtk3 file picker would get patched in the upstream.
>>
File: 21783127371267312.jpg (20KB, 500x349px) Image search: [Google]
21783127371267312.jpg
20KB, 500x349px
>>61638428
>>61638345
I got marked down once in a programming class for not writing enough comments.
>But anon, what if someone that doesn't know C wants to modify your program
Programming for non-CS degrees was a mistake
>>
>>61638446
>I would fire him
Plot twist: the guy firing him would be the guy asking him to do these retarded comments
>>
Ok so I just learned to define something, and am using the command to ask a question again if the user inputs something other than the 3 options I provide. I use the else tag, use my defined line to re ask the same question from before, but if they do it again, it doesnt loop.

Is there a way to loop it back over and over if the user fails to answer correctly?
>>
File: cute_nervous_bunny.jpg (188KB, 1920x1080px) Image search: [Google]
cute_nervous_bunny.jpg
188KB, 1920x1080px
>>61638406
Y-You a-are wrong desu. C-C will n-never die!
>>
>>61638459
You sure are projecting a lot. I really enjoy C, and am currently writing a very non-trivial project with it.
>gtk3 file picker
That has literally nothing to do with C. That has to do with GNOME.
>>
File: 1488556436739.jpg (45KB, 640x621px) Image search: [Google]
1488556436739.jpg
45KB, 640x621px
>>61638459
>Everyone pretends to like C
>>61638476
dumb animeposter
>>
>>61638477
>That has literally nothing to do with C
It's written in C, most people here run *nix OSes. Are you telling me they are deliberately avoiding the chance to practice their favourite programming language?

Thought so. No one really likes C, new developers are not interested in C.
>>
>>61634423
awk '($2 == var) { print $3 }' var="${var}"
>>
>>61638500
This post is too retarded and flawed to even bother writing a proper reply for.
(You).
>>
>>61638446
I asked the guy to write down WHAT the class is supposed to do. He threw an autistic tantrum claiming that this is sufficient. Then I asked him to just write down what the definition of 'Terms' is in this context. He also refused to do that. I told myself: fuck it, and I merged the code. It's always the same old shit with that guy.
>>
>>61638508
Ran out of arguments? I'm not surprised.
>>
>>61638459
>nobody loves it
I don't love it but in a team setting the only other option is C++ and you'd need to heavily restrict features (which C++ doesn't have internal facilities for yet despite the embedded community pushing for it since it became a real consideration in the domain) to get decent productivity.
>>
>>61638500
kys reddit spacer
>>
C++ is superior
there
I said it
issue settled
>>
>>61638513
Why not use ryst goy?
>>
>>61638513
Understandable
>>61638515
Wow, you sure showed me, anon.
>>
>>61638524
>C++ is superior
Q F T
F
T
>>
>>61638509
Shouldn't the definition of 'Terms' go in the model? It's not this guys fault that you are doing MVC.
>>
>>61638524
C++ will forever be superior because it has no vision. It wants to be a different language than C while being compatible with C at the source level
>>
File: wznBM.png (44KB, 575x472px) Image search: [Google]
wznBM.png
44KB, 575x472px
>>61638524
I'd rather objective C frankly.
>only macs do objective C
Its better than C++
>>
>>61638538
So like hapas?
>>
File: anon.jpg (26KB, 349x642px) Image search: [Google]
anon.jpg
26KB, 349x642px
@61638526
@61638512
>>
>>61638536
He didn't document the models either.
>>
>>61638546
C++ is a big guy
>>
>>61638546
Obj-C is a joke, a vendor lock-in proprietary language. I will be surprised if anyone actually uses it for anything these days
>>
>>61638546
@whatever@you@say@anon
>>
>>61638563
Doesn't Apple try to replace it with Swift anyways?
>>
>>61638563
People do. It's proprietary nature is a major problem certainly. I was just talking about the language though, not the environment.
>>
>>61638568
Seems like they aren't Swift enough
>>
>>61638568
Yeah, and they understood their mistakes and made Swift "open source". Not sure if it's going to help

>>61638525
Rust would knock the shit out of C++ just by the virtue of having no GC and some low level features. Too bad it prioritizes ``safety`` over ergonomics. It'll die faster than C
>>
>>61638595
You're just a NSA shill for advocating any other systems language that isn't Rust.

On another note, which language is the simplest to create a compiler for? I'm guessing it is C.
>>
>>61638615
>I'm guessing it is C
you're guessing wrong.
>>
>>61638615
>On another note, which language is the simplest to create a compiler for?
The one you like, compilers are compiled into machine binaries anyways so the language probably wouldn't matter.


Also, Rust really could grab C++ by its balls. Because it's not burdened with
1. 30 year old bad decision of being burden with C compatibility in the source
2. Piece of shit type system
3. Shitty PL design

But no. Muh ``safety``
I mean I'd be okay with lifetime annotations, it's actually helpful. Borrow checker is in the grey area. But some of the other shit Rust does is completely ridiculous
>>
>>61638660
>burden
burdened*
>>
>>61638660
>2. Piece of shit type system
Eeeeeek! WRONG!
>>
>>61638660
Also, their module system is retarded as fuck, it makes modules so complicated I'd rather use header files. They could learn easily from D, or even Go packages

At least they are now thinking about it
https://aturon.github.io/blog/2017/07/26/revisiting-rusts-modules/
>>
>>61638660
>compilers are compiled into machine binaries anyways so the language probably wouldn't matter
>thinks those are valid C++ criticism
>thinks Rust could hypothetically replace C
>can't even properly read
It's like knitting.
>>
File: ana.jpg (293KB, 683x1024px) Image search: [Google]
ana.jpg
293KB, 683x1024px
>>61638660
what ridiculous stuff does rust do then faggot? rust is going to replace every language because it does things the right way.
>best type system ever
>no gc, zero cost abstractions
>no c bullshit
>program guaranteed correct at compile time
>no data races concurrency
literally no reason not to use rust
>>
>>61638660
Rust will die real soon.
The start of a programming language is all fun and joy. After that, you have to make some really tough desicions: should we break code or live with the problems? Rust doesn't have a proper committee, so they just go with the wind.
>>
>>61638747
>compilers are compiled into machine binaries anyways so the language probably wouldn't matter
Yes?
>>61638747
>thinks those are valid C++ criticism
That's not criticism, that's just why C++ became so critiqued
>thinks Rust could hypothetically replace C
C++. No one will reinvent the wheel. Linus would not write Linux with Clang extensions because LLVM wasn't just there when he needed it.
Same goes for C and Rust

Fuck off.
>i32 + i8
>NOT SAFE
>>
What is so special about ML?

>>61638804
Rust will never die. Rust is going to replace every language because it is fast, productive and safe.
>>
>>61638836
Rust is not productive, like C++
>>
>>61638783
>program guaranteed correct at compile time
You're baiting too hard anon
>>
>>61638836
>Rust will never die. Rust is going to replace every language because it is fast, productive and safe.
>fast
it has runtime bounds checking and inefficient strings
>productive
library support is a joke
>safe
it crashes on out of bounds
>>
>>61638871
>inefficient strings
this, lmao
>O(n) string indexing
how can you fuck up this bad?
>>
REEEEEE why is the c standard lib so small
I FUCKING HATE having to FYUIDSG learn everything for windows and linux
>>
>>61638836
If ML is machine learning, begins take data and make money or use computational statistics and solved AI problems.

If ML as ML language, lisp with types in non weird parentesis hell and avoid Autism in Haskell.
>>
>>61638908
muh portability
>>
File: 3423432141234123.jpg (185KB, 2560x1600px) Image search: [Google]
3423432141234123.jpg
185KB, 2560x1600px
Is it moral to take advantage of stupid and/or tech illiterate people for profit?
>>
>>61638941
Apple does it.
>>
>>61638941
Yes. Effective application of the skills you have over the skills others lack is the source of all profit.
>>
Best place to learn Python?
>>
>New team
>a chink
>two rednecks
>two pajeets

Jesus fuck, this is depressing.
>>
>>61638956
/g/
>>
Do you guys think this >>61632925 was bait or are there people on this board who don't recognize the FISR?
>>
>>61638882
>how can you fuck up this bad?
i'm guessing you can blame UTF-8 for that
>>
>>61638992
I'm sure there are plenty of people who don't care because
>muh vidya
or something equally petty
>>
>>61638871
>Rust was voted most loved language in 2016 and 2017 on stackoverflow
Tell me how Rust will die again?
>>
File: consider.jpg (29KB, 600x600px) Image search: [Google]
consider.jpg
29KB, 600x600px
new thread
>>61639037
>>
>>61638992
i don't know what ever gave you the impression that this place isn't populated mostly by retards just like everywhere else
>>
>>61639027
Eventually they will run out of money to rig benchmarks and stackoverflow polls
>>
>>61639027
Who cares. Rust has no major backers other than Mozilla.
>>
>>61639027
>SO
Full of dums though. Nobody who knows their craft uses SO.
>>
>>61639056
>a language I don't like is popular.
>must be because ((they)) use money to rig everything
Keep telling yourself that retard.
>>
>>61638992
Probably was upset about creating a variable that gets used once and has more characters than the value it contains. Why not just
 y = y * ( 1.5F - ( x2 * y * y ) ) 
>>
>>61639398
I much prefer not having magic numbers in the code. (which the code does anyway but besides the point)
If the significance is three halfs and not 1.5 I prefer doing a const float threehalfs. Sure, 1.5 is three halfs but it's also 1+0.5
>>
>>61639463
Don't you usually use const static or macros for magic numbers of that sort?
>>
>>61639463
you're the kinda guy that would
 #define ONE 1.0 
>>
>>61639523
>Don't you usually use const static or macros for magic numbers of that sort?
Doesn't really matter does it?
Why would you want static on that?
>>61639538
1.0 is clear enough from context given it's identity for multiplication.
Also I'd do
#define ONE(type) ((type)1) 

If I were to do that. But I don't.
>>
File: ai smug.jpg (22KB, 720x405px) Image search: [Google]
ai smug.jpg
22KB, 720x405px
>>61634151
Swift playgrounds
>>
>>61639558
The point being that you don't stick your magic number into a variable whose name is literally the value of the magic number. We should avoid magic numbers of course, but threehalfs is certainly worthy of a wtf in code review.
>>
>>61639703
this
>uses a variable for 1.5F
>leaves 0x5f3759df as a magic number
>>
>>61638964
That's racist anon.
Thread posts: 332
Thread images: 34


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.