[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: 330
Thread images: 70

File: 1483058239541.jpg (937KB, 2436x3248px) Image search: [Google]
1483058239541.jpg
937KB, 2436x3248px
prev: >>59566658

What are you working on?
>>
File: anime-is-now-real.png (593KB, 1000x750px) Image search: [Google]
anime-is-now-real.png
593KB, 1000x750px
>>59573335
First for coffeescript is pretty good.
>>
C++17 is complete.
>>
>>59573335
>trying to decide which functional language to learn
>can't decide between JS and Rust
Help
>>
>>59573389
And... It's still shit.
>>
>>59571020
help
>>
File: come-be-happy.jpg (256KB, 1000x1502px) Image search: [Google]
come-be-happy.jpg
256KB, 1000x1502px
>>59573389
>>
>>59573416
you need a .h lad
>>
>>59573403
Learn JS just to know it
>>
>>59573409
Good for book writers like (((Bajrne))). Every 3 years they get to publish a new book.
>>
>>59573403
There's an O'Reilly Book called "functional Javascript", so maybe torrent that and skim it a bit first
>>
File: wassup.jpg (41KB, 500x500px) Image search: [Google]
wassup.jpg
41KB, 500x500px
>>59573403
Learn JS just to know you should have not.
>>
>>59573416
>#include foo.c

what
>>
>>59573389
I am so fucking hyped for std::pmr::polymorphic_allocator
>GCC 7 WHEN
>>
well that was fun.
still should have automatized suits but oh well.

module runnable;

void main()
{
enum suit: int { sp = 0, he, di, cl }
suit sel;
int[52] cards;
cards[0..12] = suit.sp;
cards[13..26] = suit.he;
cards[26..39] = suit.di;
cards[39..52] = suit.cl;

void shuffle_and_draw()
{
import std.random : randomShuffle;
import std.stdio : writeln, writefln;
auto range = cards[0..$];
randomShuffle(range);
writeln("After :",range);
int trump = range[0];
writefln("Trump is: %s",sel);
}

import std.stdio : writeln;
writeln("Before: ",cards );
shuffle_and_draw();
}
>>
File: 1024px-SegmentDescriptor.svg[1].png (27KB, 1024x155px) Image search: [Google]
1024px-SegmentDescriptor.svg[1].png
27KB, 1024x155px
who the hell came up with this fucking bullshit?
>>
>>59573335
OOPS
>>
>>59573540
The joys of backwards compatibility anon
At least I'm pretty sure that's the reason
>>
>>59573540
what is it?
>>
>>59573592
x86 GDT entry I think
>>
>>59573540
You're not suppose to use it anyway, unless you're writing an OS. And if you are writing an OS then you deserve the suffering.
>>
>>59573403
Rust if you want to die broke
>>
>>59573335
I'm literally laughing out loud at that picture, all I have to do is read a section then scroll to his face, instant keks. and his fucking school shooter outfit. that can't have been serious right?
>>
File: crc output.png (117KB, 1329x705px) Image search: [Google]
crc output.png
117KB, 1329x705px
I'm having a hard time figuring out how to do this CRC problem.

http://pastebin.com/KfRWDSnh This is what I have so far. It works when just inputting the first 64 characters as well as inputting the whole string. However, I don't know how to get the intermediate checksums.

Additionally, most of the solutions online don't seem to give the right output, even when I try brute forcing different polynomials.

The polynomial is in the pastebin, btw.
>>
File: languages3.png (17KB, 522x384px) Image search: [Google]
languages3.png
17KB, 522x384px
This image will trigger users of bad languages
>>
>>59573717
>people still deny the accuracy of this image
>>
>>59573403
>JS
>Rust
Neither of those languages is a functional languages.

They're both dysfunctional.
>>
File: 132051522990.jpg (617KB, 1600x1067px) Image search: [Google]
132051522990.jpg
617KB, 1600x1067px
C was a mistake
ML was robbed
Haskell/Idris opens our eyes to the hell we've chosen for ourselves
We underestimated the hardware growth
We were faithless, we chose being "close to the metal" in an era of kb and mb
We should have sided with humanity, but we sided with the machinery
Our programs are ugly, our future is grim, our stack is unwieldy and grotesque
>>
>>59573335
writing the nim game in scheme
>>
>>59573367
In what way?
>>
This thread is now /dppt/, the daily pragmatic programming thread.

Shared mutable state and dynamic typing are not pragmatic, so any language that permits either is not welcome here.
>>
>>59573794
You forgot to add POO to the list.
>>
#59573794
Are you the guy that tried to start /"""""relevant""""" languages general/?
>>
>>59573809
>stating the obvious
>>
>>59573416
>>59573427
>>59573458
finally made it
you don't need a header
>>
C was a mistake
ML was robbed
I'm a humongous shitposter
>>
>>59573837
You should still use headers with c though.
Or move on to a language from the 21st century.
>>
Ugh, HtDP keeps getting more tiresome. The exercises are too easy and the pacing is too slow. It's a good book for someone with 0 programming skills, but I need something with more difficulty to keep me motivated.
>>
>>59573863
Try SICP instead.
>>
Dynamic typing should have ended with Lisp/Scheme
>>
>>59573890
and then Lisp/Scheme should've ended
>>
File: 3646273_a51f37252a_z.jpg (57KB, 499x500px) Image search: [Google]
3646273_a51f37252a_z.jpg
57KB, 499x500px
>dynamic typing
>OOPs
>>
>>59573831
If you are implying that me stating the obvious is somehow bad, then why did you do it yourself?
And who are you quoting?
>>
Dynamic typing is for people who don't want to write correct code. If you're so sure your code is correct, then prove it to the satisfaction of the compiler.
>>
>>59573872
I actually started with SICP, but it overwhelmed me. Now that I'm more experienced, I might pick it up again. Is The Little Schemer any good?
>>
>>59573953
>Is The Little Schemer any good?
It deals with dynamic typing and is therefore absolute trash which should be avoided at all costs.
>>
>>59573953
I haven't used it so I can't comment on it, sorry.
>>
>>59573860
I'm not doing it like this because I want to and the program needs to be really fast, need c.
>>
>>59573964
>dynamic typing is absolute trash
Motivate.
>>
>>59573974
If you need performance, you can use C++, surely?
>>
>>59573940
>being a faggot
>>
>>59573993
Who are you quoting?
>>59574000
Same question here.
>>
>>59573974
>program needs to be really fast, need c.
wew lad
>>
>>59574031
Meant to quote >>59573964
>>
>>59573953
Kanna is absolute trash and you should delete that image while you still can
>>
>>59574046
"dynamic typing is absolute trash" is nowhere to be found in that post.
>>
>>59574063
>It deals with dynamic typing and is therefore absolute trash
>>
>>59574083
Are you blind by any chance? The person who is currently helping you with reading is doing a shit job.
>>
>>59574117
I'm blind and my personal screen reader is retarded. What did you mean with your comment?
>>
File: 28376286597135.jpg (21KB, 335x363px) Image search: [Google]
28376286597135.jpg
21KB, 335x363px
C was a mistake
ML was robbed
Roses are blue
And so are you
>>
>>59574149
I'm glad you agree.
>What did you mean with your comment?
I was merely pointing out your inability to read and comprehend basic sentences.
No wonder someone like you would prefer dynamic typing. It all makes sense now.
>>
File: 1364768235336.jpg (26KB, 731x565px) Image search: [Google]
1364768235336.jpg
26KB, 731x565px
C was robbed
ML was a mistake
>>
>>59573728
>Idris
>fast development
Factually wrong.
>>
>>59574213
Indeed. Being "fast to develop in" isn't and cannot possibly be a property of any given language.
>>
>>59574213
Yes, it is fast to develop in, assuming you avoid proofs
>>
>>59574181
Are you by any chance the OCaml shill? If so, is that language still relevant now F# is here?
Excuses for my reading comprehension. Java ate away a large part of my brain.
>>
>>59574239
That doesn't seem to be possible, assuming Idris is a programming language, which I believe it is.
>>
>>59574265
>>59574213
So why isnt it?
>>
https://www.youtube.com/watch?v=60sGTd8T-KY
Livestream of reverse engineering the HTC Vive, love this guys work.

His repo is at https://github.com/cnlohr/libsurvive
>>
>>59574250
Kanna is shit and F# doesn't even have HKTs
>>
>>59574250
>Are you by any chance the OCaml shill?
Why would I be shilling literal garbage? Do just you assume everyone you talk to to be a complete retard?
>If so, is that language still relevant now F# is here?
How can a language be "relevant"? If you're asking whether or not you should even acknowledge the existence of either of them, the answer is definitely no.

>Java ate away a large part of my brain.
Yes, that's noticeable and I'm glad you are trying to fix it, but the path you've chosen is simply wrong from the onset. Dynamic typing will lead your brain to become even more of a joke than it currently is.
>>
>>59574301
Who are you quoting, reddit poster?
>>
>>59574301
dumb frogposter

kanna is still terrible tho
>>
>>59574301
simmer down /u/steve
>>
>>59574301
you call this loli?

Get the fuck off my chan senpai
>>
>>59574285
It's a programming language.
>>
C is a robber
ML got mistaked
>>
>>59574319
I would be

writing like that

if I came from

plebbit
>>
>>59573540
Ahh I miss osdeving I should play around with writing an os again. But skip all this bullshit with the bootloader going straight to long mode.
>>
>>59574250
>the OCaml shill?
What do you mean by a OCaml shill?
>>
>>59573717
D. checkmate
>>
>>59574346
What sort of retarded attempt at logic is that? You not displaying one plebbitor trait somehow makes you a non-plebbitor?
Some other plebbit traits would be using plebbit filenames coupled with general plebbit rhetoric and frogposting. All of which you are guilty of.
>>
File: 540.png (118KB, 657x527px) Image search: [Google]
540.png
118KB, 657x527px
>>59574373
stfu pedo scum
>>
@59574301
>using this meme incorrectly
>>>/r/ibbit
>>
>>59574388
Everyone else with a brain begs to differ.
>>
>>59574407
>Exactly what I said.
Maybe you're talking about me.
>>
File: maxresdefault.jpg (297KB, 3000x1688px) Image search: [Google]
maxresdefault.jpg
297KB, 3000x1688px
>tfw to intelligent to use javascript
>>
>>59574432
btw that's a great massage technique to combat hair loss
>>
>>59574407
Haskell is a fine start, but it's still not powerful enough.
>>
>>59574388
please stop posting frogs
>>
File: 1489623889370.jpg (34KB, 626x717px) Image search: [Google]
1489623889370.jpg
34KB, 626x717px
If JavaScript is so shit, what can i learn for web development?
>>
>>59574477
So, what do you consider a powerful language?
>>
>>59574513
All web dev is shit
>>
>>59574513
fuck off to >>>/g/wdg and your frontend is supposed to work with js disabled anyway
>>
File: 1490127977090.png (440KB, 657x527px) Image search: [Google]
1490127977090.png
440KB, 657x527px
>>59574508
No, frogposting is to much fun
>>
@59574560
lad, if you want (you)s, please do it somewhere else.
>>
>>59574543
Idris among the Turing complete ones, otherwise Coq.
>>
File: bathroomtiles.png (6KB, 733x161px) Image search: [Google]
bathroomtiles.png
6KB, 733x161px
>still no burnout
>>
File: function_names.jpg (537KB, 818x659px) Image search: [Google]
function_names.jpg
537KB, 818x659px
>>
File: 827.png (250KB, 680x638px) Image search: [Google]
827.png
250KB, 680x638px
>>59574578
I don't need your filthy (you) for I've evolved beyond fundamental needs
>>
>>59574631
UR GOING DOWN BOI
>>
File: 1490353440525.jpg (118KB, 900x641px) Image search: [Google]
1490353440525.jpg
118KB, 900x641px
>>59574560
>>59574631
stop pls or i will have to use force
>>
WebAssembly
>>
>>59574756
>>>/g/wdg
>>
100 messages in and the thread cobtains so little programmong so far
>>
File: can't_wake_up.png (22KB, 721x254px) Image search: [Google]
can't_wake_up.png
22KB, 721x254px
WAKE ME UP INSIDE
>>
>>59574770
what does this mean? You invoke the function once, and it generates an error because somehow the function claims that variable twice?
>>
File: fish.png (16KB, 974x533px) Image search: [Google]
fish.png
16KB, 974x533px
>>59574607
>twf never been this productive in my entire life
>>
>>59574787
It's clearly inside a loop.

>>59574770
Try adding curlies around your function call.
>>
>>59574756
>assembly
oh that must be high-performance right?
>it's fucking javascript
>>
File: average_cs_student.jpg (206KB, 418x512px) Image search: [Google]
average_cs_student.jpg
206KB, 418x512px
>>
File: can't borrow.png (42KB, 830x267px) Image search: [Google]
can't borrow.png
42KB, 830x267px
>>59574770
It's because of the argument.
>>59574837
Teach me, senpai.
>>
>>59574701
Don't make me dump that Cirno doushinji
>>
>>59573519
>GCC
>not Clang
>>
File: 1488174359754.gif (1MB, 195x229px) Image search: [Google]
1488174359754.gif
1MB, 195x229px
>>59574552
>>59574558
But internet is a thing and we still need to develop shit for it.
What's the least shit language for this purpose?
>>
>>59574915
i bet you wont faggot
>>
>>59574977
we need a global NSFW-chan.
>>
>>59574941
C++ for P2P stuff
C for low level stuff
>>
File: maki 32.jpg (36KB, 611x682px) Image search: [Google]
maki 32.jpg
36KB, 611x682px
>>59574770
Writing Rust is like writing C with a chastity cage.
You literally need to ask the compiler's permission to borrow memory, you're not even in control of your own project.

Rust is literally the cuckold's language.
>>
>>59575045
A chastity cage with nothing in it I would add.
>>
>>59573540
ik dat feel senpai
been working on an os lately, implemented my entire gdt in nasm macros

feels godo :)
>>
C was a success
ML was dumb
>>
ml
>no macros
>synax that would be more readable with {}
>no libraries
>shitty foreing function interface
>most implemenations have GIL or just don't support native threads
>>
>came up with a project idea
>unironically js seems like the best option to get it running quick and good

fuck dee pee tee do I succumb
>>
>>59574896
I'm still fairly new to rust myself so if my advice doesn't help, try asking in the #rust-beginners IRC channel.

You could try replacing
on_comparison(a,b);

with:
on_comparison(id(a),b);

to try to force a move.

(https://bluss.github.io/rust/fun/2015/10/11/stuff-the-identity-function-does/)
>>
>>59575254
learning new skills is always good

i'm not sure what you're asking
you literally NEED some JS knowledge if you want to be employed these days
>>
>>59574896
Well, I can see one problem. You're consuming objects_b more than once. That's not what the error message points to but it is something you need to fix.
>>
>>59575261
Or alternatively, you could make it so that the for loop with the mutable references is the innermost one.
>>
>>59575272
I do know JS to a more or less extent (I rewrote my C++ IRC bot in Node just for fun the other day), it just feels kinda dirty using it but on the other hand with just a couple of libs I could get the project done in less than a week rather than spending a fuck ton of time reinveinting the wheel, I'm just not sure man.
>>
File: programming-languages.jpg (129KB, 640x369px) Image search: [Google]
programming-languages.jpg
129KB, 640x369px
>>
>>59575332
where is asm?
>>
>>59575341
Literally irrelevant.
>>
File: 1468521738861.png (1MB, 1273x922px) Image search: [Google]
1468521738861.png
1MB, 1273x922px
>>59575332
>someone needs to write a language good enough to remove reddit posts from 4chan in one line
>>
>>59575332
>best tier
C++, C
>high tier
java, C#
>POO tier
go
>low tier
python, ruby, javascript
>shit tier
hasklel, lisp, scala, F#
>>
>>59575294
Wow, this actually worked, thanks m8. I'm going to play around a bit to understand why the original version didn't work.
>>
ghci environments are pretty cool.
I really need to do this on a linuxbox
>>
>>59575393
Who are you quoting?
>>
>>59574770
It's telling you what went wrong
>>
>>59575451
>C
C is SHITE, C is a disservice to intelligent programmers. It has almost 0 features that a modern and intelligent programmer uses to be productive. Since C is such a timesink, it's popularity is falling more than any other languages in the market.
C is dying and it should die ASAP. C programmers are actually retards in general. C is a small language to grasp, exactly the kind of shit that makes things retard friendly.
C has no advanced features like C++ does.

But as a newfag you are kinda in the right direction. C is for newbies. Think of it this way:
During ancient times, counting to 10 was a big deal and a person who could count to 10 was considered to be "wise".

Fast forward a few century counting to 10 is so trivial we teach this to toddlers. Now toddlers appreciate the vast "knowledge" of counting to 10 while matured brains are busy with modern technologies.

C is from stone age and the people who still preach it is like overgrown toddlers that can't learn advanced things.
C doesn't have delegates
C doesn't have resizable arrays
C doesn't have strings
C doesn't have string concatenation
C doesn't have namespaces
C doesn't have exception handling
C doesn't have closures in the standard
C doesn't have unit tests
C doesn't have Function overloading
C doesn't have memory safety of any kind
C doesn't prevent memory exploits and has no bounds and runtime checks
C doesn't have dynamic method loading/creatin
C doesn't even have generics and templates
C doesn't have meta programming
C doesn't have mixins
C doesn't have higher order functions
C doesn't have contract programming
C doesn't have inner classes
C doesn't have function literals
C doesn't have array slicing
C has a very limited support for implicit parallelism
C doesn't even have string switches

C is a cancer that plagues the modern software industry. If you want guaranteed memory exploits and security vulnerabilities in your program with timesink development period then use Assembly, not C.
>>
>>59575505
t. salty about C because he never managed to understand pointers
>>
>>59575531
>le pointer xDDDDDD
Even a 4 year old understands pointers, that's what C toddlers boast about
>>
>>59575531
Why do C tards think they are the only ones that understand pointers?
>>
>>59575544
>>59575554
I must be at the beach for there to be so much C salt here.
>>
File: 1486299819303.gif (1021KB, 235x156px) Image search: [Google]
1486299819303.gif
1021KB, 235x156px
>>59573335
>What are you working on?
Reading "Object-Oriented Programming with ANSI C"
http://www.cs.rit.edu/~ats/books/ooc.pdf
>>
>>59575531
What's a """pointer"""?
//..
//re creating the array without duplicate values
void cleanup(ref string[] elements)
{
for (int i = 0; i < elements.length; i++)
{
for (int j = 1; j < elements.length - 1; j++)
{
if (elements[i] == elements[j])
{
elements = elements[0 .. j] ~ elements[j + 1 .. $];
}
}
}
}

void sort_by_descending_length(ref string[] elements)
{
for (int i = 0; i + 1 < elements.length; i++)
{
if (elements[i].length < elements[i + 1].length)
{
string temp = elements[i];
elements[i] = elements[i + 1];
elements[i + 1] = temp;
}
}
}
//..
>>
>>59575505
code monkey
>>
>>59575606
C toddler
>>
File: 1362829182961.jpg (209KB, 682x600px) Image search: [Google]
1362829182961.jpg
209KB, 682x600px
>>59575505
>C Doesn't have MUH bloat!
>How do you expect me to program if I don't have MUH "features"?? :(((
Wow, is that the power of POO/functionnal babies?
Mfw you consider yourself a programmer.
>>
We should not have chosen C
Things could have been different
>>
>>59575505
You memes are stale and your logic is weak, Pajeet Poopaloo.
>>
File: 1489530656576.jpg (49KB, 600x381px) Image search: [Google]
1489530656576.jpg
49KB, 600x381px
>>59575620
>Features
>Bloat
Oh so epic, only a middle schooler would control the damage so hard.
In fact C is so primitive it does a good job keeping the toddlers into the language. Picture related, a toddler toy rhyme book on the left and a book for adults on the right
>>
>>59575505
This is literally spam now. Spamming is against the rules, poojeet.
>>
>>59575634
Your defense is so weak it makes me laugh, C tard
>>
>>59575531
Fucking this
>>
>>59575674
Give me a use of (((pointers)))
>>
>>59575663
Truth hurts, doesn't it?
>>
>>59575600
I got cancer from so many unneeded { }
>>
File: 1370693556477.jpg (40KB, 261x307px) Image search: [Google]
1370693556477.jpg
40KB, 261x307px
>>59575657
You call yourself a programmer but you can't even understand why C has been so successful for all those years.
Pretty pathetic attitude imo
>>
>>59575715
>t you can't even understand why C has been so successful
yea, people needed a better B
>>
File: 1481237428364.jpg (91KB, 335x329px) Image search: [Google]
1481237428364.jpg
91KB, 335x329px
>>59575663
If it's spam, why do you reply to spam and not just silently report it?
>>
C apologists are NSA shills plain and simple. Rust makes it harder to produce vulnerable programs as it actually implements safety precautions like Bounds checking, dangling pointer prevention, data race prevention, lifetimes etc. This is against the interest of the NSA and so they are shilling C so that people continue to produce exploit prone, unsafe and vulnerable programs.

Ignore the NSA/C shills. Programming in C should be banned and outlawed.
Say no to security exploits, say no to the NSA. Your data and your privacy is worth preserving.
>>
Only stinky Indians and C dinosaurs can't understand dependent types.
>>
>>59575505
Delete this post now. Delete it.
>>
File: 1488248151444.jpg (233KB, 503x662px) Image search: [Google]
1488248151444.jpg
233KB, 503x662px
>>59575505
>>
>>59575740
Here comes the Rust shill.
Enjoy your chastity cage, cuck.
>>
File: can_borrow.png (34KB, 764x238px) Image search: [Google]
can_borrow.png
34KB, 764x238px
>>59575474
>>59575273
>>59575261
Apparently all I had to do is to remove lifetime bounds on the arguments of my functional argument. This is the expected behavior, because obviously the compiler is smart enough to understand I can't double borrow since the borrow is over after the call.

Can someone explain me why the lifetimes on the arguments broke the code in the first time?
>>
>>59574607
>>59574812
amphetamines?
>>
>>59575765
Fuck off NSA shill
>>
>>59575767
Is that visualRust?
>>
File: 1761374713.jpg (38KB, 251x241px) Image search: [Google]
1761374713.jpg
38KB, 251x241px
>>59575780
Stay jelly, fagtron 9k1
>>
>>59575740
Nice try NSA
>>
File: 1490092293174.jpg (9KB, 344x209px) Image search: [Google]
1490092293174.jpg
9KB, 344x209px
>>59575681
>void main()
>>
>>59575740
>Rust makes it harder to produce
You got that right.
>>
>>59575695
>>
>>59575793
..security bugs
Yeah
>>
>>59575796
>char\0 array\0
Not]0 this\0 meme\0 again\0
>>
>>59575793
rust makes it hard to write anything because of all the boilerplate to make sure the compiler and the borrowing system don't throw a shitfit

it's literally a chastity cage extension for C.
>>
>>59575767
Oh, right, you have Copy in your bound so it's safe to into_iter objects_b multiple times.

Beats me honestly, if there's a way to see the inferred lifetimes then it should be obvious.
>>
>>59575787
No, this is spacemacs' Rust layer + racer.
>>
>>59575796
That's a C limitation. Big boy languages don't need pointers
>>
>>59575773
ssri.
I got way less shit done back when I was on amph
>>
>>59575792
>his language needs to return an arbitrary number
>>
File: 1365535874060.jpg (68KB, 562x434px) Image search: [Google]
1365535874060.jpg
68KB, 562x434px
>>59575505
Here comes that butthurt Rust shill who keep spamming his shit tier opinion as if it would magically make it true.
You have my pity.
>>
>>59575822
>rust makes it hard to write anything
For a C toddler that is
>>
>>59575852
>Damage status
>CONTROLLED
>>
>>59575851
>non-zero = fail
that's not entirely arbitrary.
>>
File: 1490417162757.png (196KB, 1282x1055px) Image search: [Google]
1490417162757.png
196KB, 1282x1055px
>>59575505
>C has no strings
Ironically this is true. Picture related C toddlers going right back to their basements
>>
File: buttholes.png (105KB, 656x1025px) Image search: [Google]
buttholes.png
105KB, 656x1025px
>>
>>59575870
>XDD LE DAMAGE STATUS XDDD
We all know you're 12, no need to be this obvious kiddo
>>
>>59575872
Languages that are not from 80 years ago and obsolete have exception handling
>>
>>59575897
why?
>>
>>59575899
>>59575852
Oh the edge. How does it feel not being able to refute, C toddler?
>>
>C
>functions return int, if you want something else out you have to pass a pointer into the function
>zero indicates success, any other value indicates failure
>have to handle the return value every single time
>have to convert error codes into useful messages every single time
>have to do resource cleanup every single time
Exceptions and RAII literally solve every single one of these problems.
>>
>>59575713
Huh?
 if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
>>
>>59575917
Keep meming, that's all you have left retard.
C has been successful for all those years for a reason.
>>
>>59575897
This is what goto is for.

>but muh tutorial said never to use goto
Then it was wrong.

It's funny how people who write posts denouncing C often do not know how to use it effectively.
>>
>>59575921
>C
EWW, C doesn't even have anonymous functions
>>
>>59575939
>using shitty editor
>being literally pajeet tier programmer
>>
>>59575906
c++ main has a return code too. how are you going to throw an exception to your shell?
>>
>>59575947
>for a reason.
Yeah, hardware was shit
>>
>>59575964
Keep writing ebin programs in your basement, anon, being a NEET is a bless
>>
>moving from C to C++, Rust, etc. when you could move to an actually safe language like Haskell or Idris
>>
>>59575968
Whatever makes you feel good, Pajeet.
>>
>>59575976
Literally anything but C cancer
>>
>>59575952
What even is this post?
>>
>>59575985
8 cores
16 threads
Poorfags BTFO
>>
>>59575967
Java's main manages without a return code:

public static void main(String[] args)
>>
>>59575976
Neither are systems languages.
>>
>>59575952
>Then it was wrong.
That's because back in the time Fortran and BASIC were "GOTO: the language".
>>
>>59575976
>"safe" now means "can't do anything"
>>
>>59576001
>Not using GPU acceleration to BTFO poorfags even further
http://blog.jwilm.io/announcing-alacritty/
>>
>>59576013
Professional /dpt/ inhabitants detest usefulness.
>>
>>59576004
ATS, then.

>>59576013
Idris has had space invaders and pacman written in it. It's a fully capable language.
>>
C does not have ANY security concepts. Programming in C should be banned and outlawed
>>
>>59576029
>dataviewt@ype
>>
>>59575997
Look at >>59575897. That is not idiomatic C code. Idiomatic C code would use goto for error handling, so there would be no need for nested if-statements.
>>
>>59576019
>terminal emulator
Wow, it's fucking nothing.
And C has an OpenGL library too, stupid Rust fag.
>>
>>59576031
t. failed his C class because he couldn't understand pointers
>>
>>59575964
No editor would fix this, idiot
>>
>>59576059
Pointers are useless.
>>59576058
>reading comprehension
>>
>>59576031
We get it, you're a bad programmer
No need to ridicule yourself further
>>
Is all the pro-Rust anti-C shilling going on because Rust has a code of conduct, and C doesn't?
>>
>>59576059
Why do C toddlers think they are the only people that understand epick pointer trix?
>>
>>59576058
Imagine trying to write that parser stuff in C.
>>
>>59576075
I guess no good C programmers exist then
>>
>>59576078
Its literally just shitposting trying it incite more shitposting trying[..]
>>
>>59576072
>Pointers are useless.
Spoken like a true Pajeet
>>
>>59576078
No it's just Mozilla's marketing team. Don't worry it will run out of money soon.
>>
>>59576045
Why are you talking about C?
>>
>>59576095
No actually give me a simple example without spewing memes like a 12 year old C toddler
>>
>>59576082
Because users of other languages repeatedly demonstrate that they don't understand pointers (or C at all, really).
>>
The reason I don't use C is because I understand it.
>>
File: 1489461328707.png (740KB, 1834x1200px) Image search: [Google]
1489461328707.png
740KB, 1834x1200px
>>59576112
Uh? Even a 15 year old can learn all the concepts of C within a week. It's not magic. It's primitive.
>>
>>59576078
>>59576092
Last time this guy got out of hand, the mods did a ban and >60 posts were deleted from a /dpt/.
>>
>>59576120
No one does. Even Linus produces 40 security bugs in a year in average
>>
>>59576109
Strings, arrays, any complex data structure wouldn't exist without pointers you fucking retard.
>>
File: 1486428981152.jpg (111KB, 420x550px) Image search: [Google]
1486428981152.jpg
111KB, 420x550px
Using C is like squaring 6 digits integers manually and feeling smug about it.

You cannot prove me wrong
>>
>>59576148
Still looking for an example
>>
>>59576153
>squaring 6 digits manually
>manually
What did he mean by this?
>>
>>59574432
too*
>>
>practice 'fizzbuzz' all day
>get to interview, some junior fucking executive in his 20s smug asshole
>wants me to do 'fazzbib'
>stare him dead in the eyes and walk out of the interview
No job is fucking worth this, so sick of it
>>
File: pajeetmyson.jpg (406KB, 1834x1200px) Image search: [Google]
pajeetmyson.jpg
406KB, 1834x1200px
>>59576122
>Le C is simple so it's bad argument
I guess C was too simple for you to code anything worthwhile in it.
>>
>>59576153
you know you're allowed to build abstractions in C?
>>
>>59576175
With what, macros?
>>
>>59576167
Simplicity is meant for primitive brains and toddlers. That's why toddler rhyme book is of 40~60 pages.
>>
>>59575505
you can't resize arrays in C?

wew lad bad language
>>
>>59576183
C tards use linked lists because they can't have vectors
>>
>>59576159
What example you fucking retard.
Your favorite language make use of pointers even if you don't see it.
>>
>>59576167
>code anything worthwhile in it.
>C
kek
>>
>mfw PaCeets use void pointers for generics and then autistically screech about how every other language is inefficient and bloated
>>
>>59576183
>I'll respond to myself to get more (you)!
>>
>>59576191
Give me an
example
motherfucker. My language produces machine codes without me understanding how to write them too.
>>
Rust will never even have HKTs.

They seem to have given up on it, now they're considering something less powerful instead: https://github.com/rust-lang/rfcs/pull/1598

Why the fuck would anybody even bother with this disaster of a language? It is a poorly-designed shitshow.
>>
>>59576211
At least it has strings
>>
File: CvsRust.jpg (23KB, 312x294px) Image search: [Google]
CvsRust.jpg
23KB, 312x294px
Rustfags BTFO
>>
>cabal doesn't work
>stack does
Shit language
>>
File: rust lang.jpg (9KB, 225x225px) Image search: [Google]
rust lang.jpg
9KB, 225x225px
Rust, the choice for diversity hires everywhere!
>>
>>59576222
Uhm. so you mean it's reaching 1M within two years?
Not that bad. While C's popularity has dropped another 11% in the last three years
>>
File: 1487921166812.png (339KB, 387x550px) Image search: [Google]
1487921166812.png
339KB, 387x550px
>>59576241
>Angry C manlet got BTFO in arguments so now he has to post ebin /pol/ meemz to stay relevant
>>
>>59576164
it's a meme you dip
>>
File: Capture.png (6KB, 286x158px) Image search: [Google]
Capture.png
6KB, 286x158px
>>59576222
>tfw more relevant than rust and about to take over c
>tfw over half are probably just typos or jokes to c
>>
>>59576211
What could possibly be blocking HKTs?
>>
File: 1489681269874.png (790KB, 3720x3720px) Image search: [Google]
1489681269874.png
790KB, 3720x3720px
>>59576266
>half
90% of them
>>
File: A.png (6KB, 297x157px) Image search: [Google]
A.png
6KB, 297x157px
>>59576222
>>59576266
blown the fuck out
>>
>>59576269
I have no idea. If I were Rust's designer they'd have been included from the start.

Last I heard they were quibbling over syntax.

It's sad, I want to like Rust, but they keep making elementary mistakes with the language. I don't even care about the SJW aspect of it.
>>
>>59576208
I'm not him faggot
>>59576188
idk what that means, is that like concatenation onto a string or whatever (though it was said C had no strings either) I'm pretty basic noob coder

so you go

stuff -> stuff -> stuff
>>
>>59576310
resizable arrays
>>
File: Capture.png (7KB, 405x141px) Image search: [Google]
Capture.png
7KB, 405x141px
>>59576302
FUCK
>tfw already ded and deprecated
>>
File: haskell.png (8KB, 415x154px) Image search: [Google]
haskell.png
8KB, 415x154px
>>59576329
>>59576302
>>59576222
>>59576266
>>
File: 1364770688872.jpg (41KB, 449x269px) Image search: [Google]
1364770688872.jpg
41KB, 449x269px
>>59576246
>mfw Rust will NEVER achieve C level of popularity
This is what happens when you poo a shit tier programming language!
Stay salty Rusty rust fagget.
Rust isn't named after a shitty parasitic organism for nothing.

>>59576293
>Posting yet irrelevant chart that proves C raises more results than other programming language
>>
File: Capture.png (7KB, 327x150px) Image search: [Google]
Capture.png
7KB, 327x150px
>>59576353
nice ps lad
>being less relevant than rust
>>
>>59576210
You give me an
example

write a function that takes a string as an argument without using pointers.
>>
File: anal beads.png (4KB, 421x152px) Image search: [Google]
anal beads.png
4KB, 421x152px
GG NO RE
>>
>>59576003
That's not java's main (as in what actually starts up and returns to the os)
>>
File: Capture.png (6KB, 293x156px) Image search: [Google]
Capture.png
6KB, 293x156px
>>59576409
pretty shocking 2bh
>>
It's worth noting that "C programming language" has plenty of false positives and results that are completely about other languages.

Also funny that a good chunk of the top results are "Is C Dead?" "Why aren't professors teaching C as the first language anymore?"
>>
File: monad-tutorial.png (6KB, 286x143px) Image search: [Google]
monad-tutorial.png
6KB, 286x143px
>>
>>59576424
kek
>>
File: urmom.png (7KB, 576x148px) Image search: [Google]
urmom.png
7KB, 576x148px
>>
>>59576453
>Why aren't professors teaching C as the first language anymore?
Because the first language was Pascal :^)
>>
File: wip.jpg (315KB, 3840x1997px) Image search: [Google]
wip.jpg
315KB, 3840x1997px
I'm working on a basic crud thingie, but I'm at a loss as to how to make it as simple as possible while still making it look (and flow) good.

The options I've thought are:
- Make a separate page to edit/insert new entries, but this is kinda lame imo. Last project I worked on had 2000+ pages/views and I'd like to avoid as many extra pages I can.

- Ajax save/insert entries, but this creates a crapton of js bloat afaik and there'd be a big mess to update the table WITHOUT reloading the page.
Maybe sending it via ajax and upon success reload the page, that's the option I'm probably going with, but it's also kinda lame, why make it via ajax if I'm going to reload it all anyway?

Share some good suggestions please!
>>
>>59576353
you wish
>>
File: 786786746.jpg (32KB, 506x230px) Image search: [Google]
786786746.jpg
32KB, 506x230px
>>
>>59576515
>spanish browser
>ukrainian google
>chrome """private""" browsing
wew lad
>>
>>59573403
Neither are functional and both are blub languages. Learn a real language, like Lisp.
>>
>>59576547
>ukrainian google
>>
>>59576578
What's blub about Rust?
>>
>>59576547
>ukrainian google
>>
File: 1730175038.jpg (62KB, 800x800px) Image search: [Google]
1730175038.jpg
62KB, 800x800px
>>
>>59576603
oh fuck
>>
>>59576602
>>59576579
>google.co.uk
>>
>>59576616
>ukraine
>>
>>59576616
>https://en.wikipedia.org/wiki/.uk
>>
File: 1361125257555.jpg (11KB, 327x388px) Image search: [Google]
1361125257555.jpg
11KB, 327x388px
>>
>>59573953
It's all right. It's really hand-hold-y and is really only useful if you're new to programming in general.
>>
File: 1489688086408.jpg (5KB, 119x125px) Image search: [Google]
1489688086408.jpg
5KB, 119x125px
>>59576616
>>59576547
>>
>>59576593
>no HKTs
>only a limited form of higher rank polymorphism
>good luck implementing anything really abstract without lots of boilerplate/passing instances yourself
>>
>>59576616
(you)
>>
>>59576634
Lisp is dynamically typed garbage though so it's not really better.
>>
NEW THREAD
>>59571246
>>59571246
>>59571246
>>59571246
;)
>>
>>59576623
>>59576626
>>59576633
The UK's TLD is .gb, for "Great Britain"
Ukraine's TLD is .uk

>inb4 I'm being trolled
>>
File: 1361918527799.png (93KB, 171x278px) Image search: [Google]
1361918527799.png
93KB, 171x278px
>>59576647
Wait, you're serious
>>
>>59576645
Before the bump limit, invalid
>>
>>59576645
Retard
>>59576647
Oh boy, he's going all in
>>
File: 1484031578357.png (130KB, 327x481px) Image search: [Google]
1484031578357.png
130KB, 327x481px
>>59576645
>>59576660
>>
NEW THREAD!

>>59576677
>>59576677
>>
>>59576685
Before the bump limit, invalid
>>
>>59576685
before bumplimit, retard
>>
>>59576692
>>59576697

Are you sure about that?
>>
File: AND HE SAID.jpg (247KB, 664x613px) Image search: [Google]
AND HE SAID.jpg
247KB, 664x613px
>>59576647
>nothing can't stop him anymore
>>
Bump limit achieved!
>>
>>59576644
You can have types in Lisp, that's nothing special.
>>
New thread:

>>59576713
>>59576713
>>59576713
>>
>>59576723
stop spamming the board delete your thread
>>
>>59576647
.co.uk
>>
>>59576647
(You)
>>
>>59576707
Yes, the bump limit on /g/ is 310.

A shame, because your image was appropriate and amusing, but you blew your load too soon.
>>
>>59576742
fucking premature ejaculators
>>
>>59576742
at least he's able to ejaculate, unlike rust cucks
>>
>>59576029
>ATS
Is it any good though?
>>
>>59576578
>Lisp
Why would I be learning literal webdev garbage?
>>
>>59576718
Are all lisptards this stupid? He never said you can't have types in your shitlang.
>>
lmao. what a shitty thread.
>>
>>59576893
Static typing in Lisp isn't impossible, you retard.
>>
>>59577095
You said "You can have types in Lisp", not "You can have static typing in Lisp". I'm guessing your retardation prevents you from seeing the obvious difference between these two.
>>
>>59577095
Speaking of static typing in Lisp
I'm writing a macro library for Lisp (Racket) that lets you encode logic in the style of inference rules.
Eventually this will let you encode any sort of concievable type system direcly in macros.
It's not there yet, right now it can only do peano arithmetic
;; current demo
(define-syntax zer
(judgement-parser
#:literal-sets (peano)

[(zer) P+ n
---------
[⊢ => n]]

[(zer) P* n
---------
[⊢ => (zer)]]
))

(define-syntax suc
(judgement-parser
#:literal-sets (peano)

[(suc n) P+ m
[⊢ n P+ m => s]
-----------
[⊢ => (suc s)]]

[(suc n) P* m
[⊢ n P* m => p]
[⊢ m P+ p => s]
------------
[⊢ => s]]))
>>
>>59579010
Now apply this to Racket itself so it isn't complete garbage.
>>
>>59579034
Fuck off, not every language has to be statically typed. Especially a language who's entire point is to be every-paradigm and never force itself into a specific style
>>
>>59579140
>not every language has to be statically typed
I didn't claim that. A language does have to statically typed for it to be even remotely non-garbage though.
>Especially a language who's entire point is to be every-paradigm
"every paradigm "includes "dynamically typed", making it instant and utter garbage.
>>
>>59573389

Exciting!

How do I go about using it?
Thread posts: 330
Thread images: 70


[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.