[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: 320
Thread images: 27

File: C++.jpg (1MB, 2048x1536px) Image search: [Google]
C++.jpg
1MB, 2048x1536px
Old thread: >>61585395


What are you working on, /g/?
>>
gamemaker tutorials.
I don't actually know how to program.
>>
>>61589593
https://en.wikibooks.org/wiki/Haskell
>>
How do I start with parsers, lexers etc? Does anyone have course material for that?
>>
>>61589615
>>>61589593
>https://en.wikibooks.org/wiki/Haskell
is haskell even worth it?? or just for hobbyist??
>>
union {
struct {
float foo[2];
float bar[8];
};
float foobar[10];
};


what should the static_assert look like to make sure that this will work:

bar[0] = 1.2345f;
printf("%d", foobar[2] == 1.2345f); // 1
>>
>>61589577
I love that picture. It just goes to show how much more advanced and better C++ is even though it evolved from C. I applaud whoever made it.
>>
>>61589617
http://jakewheat.github.io/intro_to_parsing/
>>
>>61589064
the C++ standard didn't define RVO. the fact that it didn't, but was permissive enough to allow it in compiler implementations, could arguably be called a bug (or at the very least an oversight), considering it did lead to issues (most notably the one anon referred to). however, those issues were addressed with C++17's "guaranteed copy elision" proposal
>>
>>61589521
> you are either too inexperienced to have a valuable opinion on the matter or actively engaging in doublethink.
It's funny 'cause I can say the same about you if you fail tot realize the benefits of RAII. You either have never used std::vector/fstream, or malloc/free/FILE.
> i guarantee the same way you do that an algorithm specific to your implementation
What can be specific about sorting algorithm? Unless it's some extreme cases of almost-sorted data, you can't beat the state-of-art algorithm.
> an inline assembly sorting algorithm that uses your data structures directly and has been profiled and optimized by hand
So you have not actual experience, I see.
> [some bullshit damage control about C compilers not inlining stuff]
That's simply because it's impractical for them to do inter-unit inlining with external libraries since they have no access to the source code. This is exactly the problem templates solve.
> the ~3 cycles that creating the stack frame and returning add are of no consequence even in the hottest of loops
How dense should you be to ignore literally half a dozen benchmarks and analyzes out there inventing some bullshit explanations instead? Inlining is the reason qsort sucks and std::sort doesn't.
>>
>>61589669
Thanks
>>
>>61589165
Most (all?) POSIX functions work in Windows, so use those whenever possible for maximum portability. For other things you'll need to use macros to set up different code blocks depending on the targeted platform.
>>
>>61589720
it uses parser libraries though
>>
>>61589747
I think I can write myself one if I know what it exactly does. But do you know resources where there are no parser libraries being used?
>>
>The required alignment for an array of float is the same as the required alignment for a single float object. If float is 4 bytes, then that alignment can be no greater than 4 bytes, since arrays do not have gaps between their elements.
is this true? so >>61589657 should be safe or at least work in practice?
>>
>>61589788
http://dev.stephendiehl.com/fun/002_parsers.html
>>
I'm really into the crypto-currency meme now and there are a few projects that are aimed to be alternatives to kickstarter

ref link
https://coinstarter.com QUESTIONMARK ref=dndn3tntj

I have a broad background in math and physics theory - do you have an idea what a good pitch would be to just monetize the content I provide online (e.g. youtube videos). I feel there's a chance to "get financed" for good content this way, next to my 40h job.
I'd like to do (continue, really) a project on logic and dependent type theory, and walk towards coding applications in stochastics.

But those kickstarter projects usually give back some intake and features for milestones and I don't quite know what to offer in this case.

Any input welcome.
>>
>>61589807
Thank you
>>
PS I really dig the wooden table.

I have to learn C++ at work too, <memes>but I'd really like to use more Idris</memes>
>>
Why does everybody shit on C ?
Its a perfectly good language, as far as safety is concerned the compiler can implement buffer and pointer checks.
Whats wrong with it ?
>>
>>61589838
> I'm really into the crypto-currency meme now
You're at least 5 years too late, the crypto-meme has been debunked time and time again.
>>
>>61589577
What would a good Java pile look like?
>>
>>61589867
It's pajeets wanting to shill their brainlet languages.
>>
>>61589867
>as far as safety is concerned the compiler can implement buffer and pointer checks.
then why are they not doing it with every existing codebase?
>>
>>61589717
>if you fail tot realize the benefits of RAII
>You either have never used std::vector/fstream, or malloc/free/FILE
this is not an argument, so my only response is to ask that you actually explain how you think streams are better than file buffers, and how vectors are better than just reallocing manually.
>What can be specific about sorting algorithm?
everything
>you can't beat the state-of-art algorithm.
uh yes you very much can
if your data set is small you can do a time-space tradeoff that makes sorts practically free, if you only need an arbitrary amount of the array sorted it can often be beneficial to use a number of iterations of an insertion/selection sort equal to the amount of the array you need.
>So you have not actual experience, I see.
lmao nice argument
>[some bullshit damage control
ah yes just ignore my entire explanation to prevent yourself from having to actual argue any of my points, very good, that makes your point look of very high value.
>that's simply because it's impractical for them to do inter-unit inlining with external libraries
it's because it's rarely of any value AND that, as i explained.
>How dense should you be to ignore literally half a dozen benchmarks and analyzes out there inventing some bullshit explanations instead? Inlining is the reason qsort sucks and std::sort doesn't.
a dozen benchmarks done by the people who desperately wanted to spread their cancerous language to things like gcc, benchmarks that run once for some arbitrary quantity of iterations and then exit.
if you don't realize how programs that run for 10 seconds that are written in full c style for extremely large projects like the kernel are going to have little benefit compared to hacked together examples using the very large c++ stdlib (which practically fucking contains the entire benchmark), you're a fucking moron.
educate yourself on the thing you're shitposting about at least far enough that you can come up with real arguments.
>>
>>61589867
> Why does everybody shit on C ?
Because it indirectly caused the recent security fiascos by allowing and even actively promoting unsafe programming practices.
> the compiler can implement buffer and pointer checks.
1. Optional safety is unsafe.
2. It's a solution from outside the language.
3. Run-time checks defeat the purpose of having a fast simple language, you might as well write in Java.
>>
File: 1479069999159.jpg (38KB, 657x527px) Image search: [Google]
1479069999159.jpg
38KB, 657x527px
union {
struct Foobar {
float foo[2];
float bar[8];
};
float foobar[10];
};

static_assert(sizeof(Foobar) == 10 * sizeof(float), "");


how about this
>>
>>61589941
dumb frogposter
>>
>>61589867
It is pretty insecure because you have so much control over memory, but that's the only thing I can think of
>>
>>61589064
>It's not a language bug you fucking idiot.
No you're the fucking idiot here. RVO is what he used in lieu of move semantics because of the language bug that makes move semantics not work as it should in this instance.
Listen and use your brain for one moment, or execute yourself. People who are as stupid as you are shouldn't live. You're doing a diservice to the rest of us.
>>
>>61589701
God you don't get it either. See >>61589967
kys.
>>
Any good and straightforward ressources about design patterns?
>>
>>61589577
reading documentation on my SoC CPU.

It's like an information jungle.
>>
Heya all, I'm an older guy here who has been out of the game for a good while, cut my teeth on LOCO BASIC, graduated to C but not done anything in years.

Recently had a yearning to get back into it and I find the programming world has changed immensely, everything I knew is so obsolete it isn't even funny and I'm a little lost.

Is Python a good place to get back into the swing of things? Rust?
Any advice would be greatly appreciated.
>>
>>61589937
>optional safety is unsafe
clearly we need architectures that enforce memory cucking upon us to truly be safe.
>it's a solution from outside the language
compilers are a solution from outside the language, the language should standardize it's own compilation, clearly.
>run-time checks
nobody implied this and it's also retarded
gcc already does check pointer bounds in all common bug cases if you enable all warnings

rust is overcomplicated trash and it needs llvm, the actual compiler part of the compiler, which is written in c++ (it's main target) just to be compiled.
>>
>>61589521
>in any case where the function call overhead of qsort is going to be relevant
If your compiler can't inline qsort it can't inline the comparison function. That's the problem, not the qsort call inlining.

Unless it generates multiple qsorts with the same comparison function. Which would be a very odd circumstance and I doubt it ever actually happens in good code. Maybe if you repeatedly call qsort in a loop. But that's a very odd case.

>an inline assembly sorting algorithm that uses your data structures directly and has been profiled and optimized by hand is never going to be beaten by a function in your standard library
This is true a lot of the time though.
>>
>>61589937
>3
Cant you run a static C code analyzer in that case ?
Also it becomes more of a code base issue when it comes to runtime checks, i assume that the main reason for them is not actual speed and safety but a means to an end when it comes not porting your code to another language and giving safety.

Which brings me to my main point.
Safety in C is possible even if its not built in to the language, which i guess sort of add on to my first point that you don't have to worry about modifying code.

I assume that you need formal safety specifications in the language but still, i think that a solution like this is favorable rather than rewriting code in something like rust
>>
>>61590014
if you were comfortable with c i don't think it's going to be too hard. i don't like python much but i think it's a good choice here, unless you can be more specific about what you want to accomplish
>>
>>61589920
> my only response is to ask that you actually explain how you think streams are better than file buffers, and how vectors are better than just reallocing manually.
You can never forget to free/close them.
> uh yes you very much can
This is why most of the generic sort implementations check for the size of the data first and even try to detect partially sorted parts. In almost no case is it practical to write your own sorting algorithms for every specific case you have.
> lmao nice argument
It's a good argument since anyone who thinks writing sorting algorithms in assembly by hand is somewhat realistic and even efficient clearly have no idea what he's talking about.
> just ignore my entire explanation
The explanations go against the benchmarks.
>it's because it's rarely of any value
Except for literally every benchmark out there showing how it's actually important.
>a dozen benchmarks done by the people who desperately wanted to spread their cancerous language
Wew, lad, so now you're saying all the benchmarks that don't confirm your point of view is FAKE NEWS.
>>
>>61590014
Definitely skip on Rust for now, it will feel too "advanced", and you will feel even more lost.
Python is alright but you have to keep in mind that it's an interpreted language and it might not be suited for all tasks.
>>
>>61589958
Ignoring security issues why do people dislike it feature wise, i know its apples to oranges but lets compare C with python.
>>
>>61590033
>Unless it generates multiple qsorts with the same comparison function.
Different, not same.
>>
>>61590077
>>61590083
Excellent, Python it is then. Thanks fellas.
>>
>>61590014
Something like python is fine. Depends on what you aim to do. I think Java/C#/other has more job opportunities and overall better jobs than python. But for hobby programming it's absolutely not a bad choice..
>>61590077
No things were different. I'm not gonna argue that if you can learn C you're not likely to be fit for other languages but they're different skillsets.
>>
>>61589577
>Effective C++
>Moar Effective C++
>Effective Modern C++
Is this a fucking joke, Meyers?
>>
>>61589799
hm... is that from the standard? i could swear it's still possible to have padding *after* an array (though not between elements, of course, unless the type the array contains is itself aligned to a boundary larger than its contents)
>>
File: 1396279863788.jpg (28KB, 250x250px) Image search: [Google]
1396279863788.jpg
28KB, 250x250px
What stuff should I be able to program from scratch before I become hire-able? I'd like to think I know enough to get a job being a good little monkey, but having not been able to find an internship near me I don't really know that.
>>
>>61589577
Just how many books do you need to learn C? It's not that hard.
>>
>>61590163
They probably don't even agree with each other on what's the best way to program.
>>61590192
>2
I say they don't actually teach you enough. But I don't know any good learning C books.
>>
>>61590163
it does sound ridiculous but cut him a little slack given what makes for effective C++ changes every time they release a new standard. kek
>>
>>61590080
>you can never forget to free/close them
that doesn't make them better, especially when they go out of the scope they're supposed to by accident and you end up carrying around the memory for the life of your program.
>This is why most of the generic sort implementations check for the size of the data first and even try to detect partially sorted parts.
not talking about partially sorted arrays, explained this already, read my argument or i'm not arguing with you
>anyone who thinks writing sorting algorithms in assembly by hand is somewhat realistic and even efficient clearly have no idea what he's talking about
maybe in (((extremely high level))) world where nobody has even seen inline assembly, sure, but some of us live in the real world where computers execute instructions.
if you think inline assembly as a whole isn't "efficient" you're a fucking moron, i can't sugar coat that.
>The explanations go against the benchmarks.
>Except for literally every benchmark out there showing how it's actually important.
>Wew, lad, so now you're saying all the benchmarks that don't confirm your point of view is FAKE NEWS.
it really doesn't have anything to do with benchmarks, and seeing as your entire argument has been reduced to them, i will have to explain in full detail.
when you write a benchmark that heavily uses features in the standard library of one language and uses one specific element of another, you are automatically favoring the former.
in such a benchmark, since it runs for a very limited time, inlining the function has no downsides, but in the real world, people use qsort multiple times in a single project with multiple different comparison functions, and in hotpaths, they write their own implementation, (usually in inline assembly, if this is a **hot** hotpatch, but apparently that is a difficult concept for you) in which case, the cache usage of having multiple sorts inlined with slightly different comparisons is a much bigger deal.
>>
>>61590086
Because you need to write about 8 times more lines in C than in Python to implement the same algorithm.
>>
>>61589577
What's the book under K&R?
>>
>>61590263
the first edition?
>>
File: 4chan.png (37KB, 303x87px) Image search: [Google]
4chan.png
37KB, 303x87px
>>61589867
>Its a perfectly good language, as far as safety is concerned the compiler can implement buffer and pointer checks.
The problem is that finding these errors through static checks is not an easy task. I certainly don't think it's as unsafe as people think it is but it won't have the same guarantees other languages like Rust give you.

I think the problem is that people are terrible at cost benefit analysis. They use the wrong languages for the task and would often prefer universal solutions over solutions fit for specific situations.
>>61590238
But you end up hundeds of times faster. Most likely. It's not a reason to dislike the language. But if development time is much more valuable than performance you just shouldn't have picked C for that task.
This is also why end-user software is stupid slow. Because we have powerful machines where we can waste. Sometimes people go overboard and shit that you'd expect to run on an i586 runs poorly on the monster computers we have today. When that happens it's because the dev doesn't have the skillset to cope with the problems. She doesn't know C. Knowing C lets you call C code from most other languages using their FFI. So you can meet the demands without problems. People don't do that enough.
>>
>>61590181
>What stuff should I be able to program from scratch before I become hire-able?
Most hired programmers only modify code.
Find ways to make yourself a more attractive hire instead. Perhaps that is making a project from scratch and putting it up on github. Perhaps it's being better at interviews.
>>
Are header-only libraries a meme?

How do they protect themselves from multiple includes?
>>
>>61590327
languages that require header and source files are a meme
>>
>>61590163
(((Meyers))) doesn't have to have a real job anymore
>>
>>61589869
Too late to get rich, not to late to make 200$ a week from clicking a few buttons at the right time.
>>
>>61590327
#pragma once
>>
>>61590327
#pragma once
or
#ifndef _HEADER_NAME_
#define _HEADER_NAME_
#endif

They are usefull because managing libraries with C is tedious.
They are usually shit because instead of just providing functions they might use some static variable for global state. Depends what it does and who wrote it.
>>
>>61590307
You can call C from Python, if you create a wrapper for it. And the speed differences are not really that significant. Especially if you consider non-linearly scaling problems. Then it's all about the algorithm, and only about the language if you want to squeeze the last few extra percents.
>>
>>61590378
>#pragma once
doesn't solve the redefinition problem
>>
>>61590327
>Are header-only libraries a meme?
They're the only sane way to do libraries in C or C++ imo. But that's not to say they're amazing compared to other languages options. They're just very easy to integrate.
>They are usually shit because instead of just providing functions they might use some static variable for global state.
I haven't seen this.
Should be easily remedied though right?
>>
>>61590380
see >>61590402
>>
>>61590413
Usually they tell you to define
LIBRARY_NAME_IMPLEMENTATION
in only one .c file.
>>
File: doge.jpg (32KB, 480x320px) Image search: [Google]
doge.jpg
32KB, 480x320px
>>61589867
>Why does everybody shit on C ?
They have envy because C has remained pure due to not being OO. Because of this blessing from heaven, pajeets in the 90s had to move to C++, Visual Basic, pascal and Java to do their boring CRUD desktop apps.

C++ has aged badly, and now that it pretends to be pythonic its even more abhorrent. C on the other hand is the patrician language. Its small yet powerful, old but capable.
>>
File: 0321356683.jpg (108KB, 515x648px) Image search: [Google]
0321356683.jpg
108KB, 515x648px
>>61589872
-Some basic manual of your choice
-Effective Java
-Java Concurrency in practice
That would be the basic pack.
>>
>>61590380
>instead of just providing functions they might use some static variable for global state
the problem of global state is by no means limited to header-only libraries
>>
>>61590395
>The speed differences are not really that significant
Not true. The multiplier you take by using python is massive. All the benchmarks will show you ~10-100 times improvements going from python to C++ for instance. Depends on the task and if they're just racing to call out to pre-compiled code (as is often the case in benchmarks).
If you consider normal naively written python code that is the nice stuff you'd like to get from the language to keep development times low
(unlike http://benchmarksgame.alioth.debian.org/u64q/program.php?test=binarytrees&lang=python3&id=1 for instance, ìs this a big win in readability compared to C or C++?) you'll have a much larger problem.

And while bigO matters when you have millions upon millions of entries that doesn't matter so much when you consider the difference between neat python and normal C/C++.

Whenever performance starts being a concern I advocate just writing it in C. The FFI for most languages are nice enough that you shouldn't be all that worried about it. Most of the time you just create a .so/.dll and ship it with the script.

Other compiled languages tend to have less of a case for writing C and using FFI but for interpreted languages it's uncommon that they perform well enough to be sensible to use for an entire application.
>>
>>61590237
> that doesn't make them better
Yes, it does, this is why every modern language has a variant of RAII, even the ones with GC.
> if you think inline assembly as a whole isn't "efficient" you're a fucking moron, i can't sugar coat that.
It's not the 90s anymore, grandpa, your hand-written assembly will never be anywhere near as efficient as the one generated by a modern compiler on a modern architecture. The only exception is AVX and likes since compilers suck at autovectorizing for now.
> [benchmarking doesn't represent the real world experience]
It's close enough tho, you can't just disregard all the benchmarks just because these specific ones don't reinforce your pre-existing position. I mean, all the claims of C being fast are based on benchmarks, should we ignore them too?
>>
>>61590631
Writing RAII code is an overhead productive programmers shouldn't bother with.
>>
File: 1501165143898.jpg (130KB, 652x592px) Image search: [Google]
1501165143898.jpg
130KB, 652x592px
>>
>>61590535
It's not bad because "hurr some blog poster said global variables are bad" but it's bad because if you load dynamic libarary and want to reload it the static variable resets. So when providing some functionality you should let the user define the variable that holds the state if it needs to be stored somewhere.
>>
File: 1470828515872.jpg (47KB, 474x479px) Image search: [Google]
1470828515872.jpg
47KB, 474x479px
>>61590653
excellent oc
>>
>>61590653
>0.14% cross dressing index score
Sounds very low.
>>
>>61590736
it's logarithmic
>>
>>61590653
Noice
>>
>>61590653
homosexual post
>>
'Real World Haskell' or 'Learn You a Haskell for Great Good'?

I remember reading the introduction to the latter and thinking that the explanations were a bit janky.
>>
File: pG3q7.jpg (125KB, 847x556px) Image search: [Google]
pG3q7.jpg
125KB, 847x556px
WHERE MY C-MEN AT???
>>
>>61590850
Real World.

LYAH is too simplistic, and I don't like her 'humour'.
>>
>>61590850
PS. The Allen and Mononuki book, can't remember its name, is better than those two.
>>
>>61590917
needs haskell
>>
>>61590680
i'm aware, thanks. i'm not some memeing sperg. and that's not the only reason it's bad. a well-designed API should be arbitrarily instanceable, and the instances should be allowed to have independent and differing states if that's what the user requires. this is easily achievable with context objects, so there's no real excuse for global state. also the issue you're referring to applies to dynamic libraries which are, by nature, not header-only
>>
https://www.youtube.com/watch?v=hxzkcXhwx-8
>>
>>61590919
>I don't like her 'humour'
I think that's what I disliked about her explanations--she would try to frame them as jokes that I didn't find funny.

Also, hello, fellow Britfag. I wonder how many Britons there are in this thread at this time of day.
>>
>>61590981
Why does he move his mouth like that?
>>
apples = 5;
show(apples);
>>
>>61591011
i guess he's reading off a script and trying too hard
>>
>>61591062
That language has one of the worst syntaxes ever.
>>
>>61590946
Really? I don't particularly trust a book that cherry picks reviews for its website and doesn't even provide sample excerpts.
>>
>>61590631
>this is why every modern language has a variant of RAII, even those with GC
source pls, that reeks of bullshit
>your hand-written assembly will never be anywhere near as efficient as the one generated by a modern compiler on a modern architecture
if you actually think this then you haven't seen assembly generated by a modern compiler. they are not perfect by any means whatsoever.
also, you can totally just take the assembly a compiler generates and tweak it, but whatever
>It's close enough tho
it really isn't, and i explained why
the cache is never going to be anywhere near saturated in a <100 line benchmark of stdlib functions, and in big projects, that's what matters.
>>
>>61590163
I don't think people realize just how lucrative it is to invent a problem and then "solve" with your new book every few years.
All those programmers who invented a language, and then wrote their own authoritative book are now fucking rich off the consultancy fees alone.
>>
In my website, I'm going to send cookies to their personal address, to anyone who accepts cookies.

Is this a good idea?
>>
>>61591370
how will you get their personal address though¿
>>
>>61591380
people would have to fill out a form, obviously
>>
>>61591011

Autism.
>>
>>61591380
>he doesn't require people to sign in before they can access your website
What are you from the 90s?
>>
File: 1501161617280.jpg (37KB, 686x576px) Image search: [Google]
1501161617280.jpg
37KB, 686x576px
Can one of you please develop me a rope to hang myself with?

[spoiler]Which programming language would make the sturdiest rope? Rope that would never break.[/spoiler]
>>
>>61591445
?
>>
>>61591445
Rust will never break or let you down. It's the safest and cutest language, anon-kun!
>>
>>61591237
> source pls, that reeks of bullshit
Python's with, C#'s using, Java's try statement, Go'd defer. And ofc D and Rust just have determined destruction.
> if you actually think this then you haven't seen assembly generated by a modern compiler. they are not perfect by any means whatsoever.
Well I have, I do low-level profiling at work occasionally, I read assembly just fine and I used to write it as well. It was quite easy and straightforward back when i386 was a norm, but nowadays you have to know stuff like http://www.agner.org/optimize/ by heart and know low-level specifics of the concrete CPU architecture you're writing for to achieve the level of modern compilers. And this code becomes outdated the moment new uarch is released, while with C/C++ all you have to is -march=whatever to get close to optimal code.
> the cache is never going to be anywhere near saturated in a <100 line benchmark of stdlib functions, and in big projects, that's what matters.
Well from my experience saturation of icase is never a problem mostly because multi-stage pipelines and prefetchers do exist. If anything, having your functions inlined simplifies BP a lot and doesn't require any """random""" loads to cache. Besides, inlining allows advanced optimization so the resulting code is usually smaller than a standalone function.
>>
>>61591295
nigga are you seriously implying that a collaborative effort by academics and industry professionals (with legitimate stake in its effectiveness) has been discreetly manipulated for decades to contain intentionally bad functionality in order to sell books and consultations
>>
>>61591445
Java. Java has so many failsafes that it's damn near impossible to break a Java program.

Although detractors consider it a disadvantage that Java forces its programmers to take these measures, the effort needed to do so is negligible if you have a fully-fledged IDE (or you've sufficiently customized Emacs/Vim, for you daddy-o's who were programming in the early 80s). It also means that even novice programmers can produce cutting edge programs, even if their methods are inelegant.

And compiled Java still has a smaller memory footprint than Python and C++ programs, some C programs, and even some assembly programs.
>>
Is Visual Studio 2017 = msvc15?
>>
>>61591119
I've read most Haskell books, and this is, honestly, one of the best.

I know that they're tumblr-tier hipsters, but they write a good Haskell book: lots of examples, properly explains monoids, applicatives, etc.
>>
>>61591585
Yes?
It's incredibly easy to see it in retrospect.
>>
>>61591614
Alright, thanks. I'll give it a shot.
>>
>>61589617

1. Use lisp syntax it will make your life 500x easier

2. Learn how to write a regex
>>
>>61591614
what's the benefit of learning Haskell instead of other functional programming languages?

I don't see the appeal. Plus other fp languages have jobs using them
>>
>>61591666
>2. Learn how to write a regex
Satan pls
>>
>>61591686
I'm not a programmer, so I'm free to explore whatever languages take my fancy.

I just really dig Haskell's type system, so much so that I end up writing Haskell-like type declarations in all the other languages I use, as comments.
>>
>>61591666
>1. Use lisp syntax it will make your life 500x easier
Was already planning to do this
>2. Learn how to write a regex
I thought regexes weren't used for parsing? Don't they first split everything before e.g. a space to an array and then find out the type of every array element?
>>
>>61591724
>I'm not a programmer,
>I end up writing Haskell-like type declarations in all the other languages I use
?
>>
>>61591776
I assume he means a professional programmer.
>>
> 61591776
Yes? I just fuck around with languages as a hobby.

>>61591785
Not a professional, yes. I'm a chemist really.
>>
>>61591554
>python's with
>go's defer
holy fucking shit if you think this is RAII (RESOURCE ACQUISITION IS INSTANTIATION) i have no words for you
>and this code becomes outdated
have never had this happen to me in my entire life, i've had it become inferior to other options but never "outdated"
x86 and it's extensions have been rock solid for several years now, mainly because nobody WANTS to break everything, and if you're simply writing inline assembly you're almost guaranteed to have it be forwards-compatible.
>saturion of icache is never a problem
the cache never getting used in short synthetic (in the literal sense) benchmarks that last less than 10s and don't do anything but spam qsort over and over is most certainly a case where it becomes a problem.
>inlining allows advanced optimization so the resulting code is usually smaller than a standalone function
that might be applicable in some rare cases, but we are talking specifics, and in a common case where you are using qsort with multiple different comparison functions several times throughout your code, inlining is definitely not what you want.
>>
>>61591776
YO CHECK THE LAST 4 DIGITS
>>
>>61591630
that's genuinely delusional. why would the billion-dollar industries which benefit from and contribute to C++ allow that to happen? not to mention there are tons of things about it for which there was no precedent until there suddenly was, however many years or decades in. a lot of the standard library was adopted directly from boost (which is not organized by the same people and anyone can contribute to it). to claim the creators/early contributors actually saw all that shit coming and sat on it is, frankly, giving them way too much credit
>>
>>61591857
>headscarves
cute
>muslims
absolutely disgusting
>>
>>61591866
Then explain why C++ aged so badly in the short span of 30 years and why a bunch of languages sprung up to fill the void?
>>
>>61591857
Nothing, it's how it should be in church.
>1 Corinthians 11:2-16
I'm a little miffed by the fact that only 2 women in my church wear veils.
>>
>>61590462
>C on the other hand is the patrician language. Its small yet powerful, old but capable.
lmao @ your wrong opinion

>>61590850
Are you trying to bait us into a false dichotomy?

>>61591630
It would be lunacy to think that this was the intention, but it is fair to see that this ended up being a result.

Bad thing happening doesn't mean there was a conspiracy.
>>
    //! Sounde Source Distance factors
// factorhaye mohasebe fasle har manbae
enum SourceDistanceFactor
{
/// bishtarin faselie ke manbe gabel shenidan hast (dar halate khati)
SDF_MAX_DISTANCE,
// faseleie ke volume manbae dar on nogte nesf mishvad
SDF_REFERENCE_DISTANCE,
/// mizane ofte seda nesbat be fasle (pishfarz = 1)
SDF_ROLLOFF_FACTOR
};
>>
>>61591857
>>>/pol/
>>
I'm currently an Android developer, but I don't really like front end stuff. To make things worse, people scooter around me with hoverboards and throw Nerf arrows. TL;DR hipster company.
So I want to spend my weekend looking for a new job. More specifically: I'm looking for a position as a Java back end developer (yes, I like Java). There are plenty of jobs out there and most of them are right up my alley.
There are also positions open at companies that outsource you somewhere else. Randstad is one of them. Do you guys have any experience on that?
>>
File: 1500821089376.jpg (32KB, 407x405px) Image search: [Google]
1500821089376.jpg
32KB, 407x405px
>>61591912
>I'm currently an Android developer,
I'm trying to get into this field. any books or recommendations?

what software do you use?
>>
File: 1420500175412.jpg (438KB, 900x2134px) Image search: [Google]
1420500175412.jpg
438KB, 900x2134px
>>61591897
>Are you trying to bait us into a false dichotomy?
My question was essentially, 'Which is better, book A or book B', which is a true dichotomy unless they're exactly equal in quality. These are the two Haskell books I've seen recommended most often, as well as the only two in this image. You're welcome to recommend others.
>>
I asked this a couple of threads before and didn't make any progress.
Basically I'm trying to log into my email account through the web (can't use IMAP). When I make a POST request with the login data and everything else I found looking at Firefox's request, it's giving me a "you must enable cookies in your browser" response.

What am I doing wrong?

Here's what I have with a test account in case someone can be bothered to check logging in.
https://gist.github.com/anonymous/8bc8bc5214ff5c2cf13fc2fb22cb4bbf
>>
>>61591941
>it's a true dichotomy
>except I'm allowing the introduction of other elements into the set

That's the entire purpose of me asking this. Fundamentally, your goal is to learn Haskell. However, I'd contend that your ultimate goal is even more basic than this. If your goal is to learn Haskell in order to accomplish some other thing, I'd like to know what that thing is.

Only when you lay your desires bare may we properly advise your next course of action.
>>
>>61591941

>best in their world
>two different books about haskell
>>
>>61591896
Just go to the nearest SSPX chapel, my friend.
>>
>>61591812
resources get freed when they go out of scope with RAII
resources get freed when they go out of scope with a with statement (files, locks, ..)
it basically serves the same purpose
>>
>>61592001
The question I posed was a true dichotomy--I asked which was better. Whether or not you recommend other books, one of the two I named is better than the other.

In any case, my goal is simply to learn Haskell. As far as I'm aware, no-one has used Haskell to accomplish anything of note.
>>
>>61591911
/pol/ doesn't mind women dressing modestly instead of being thots, lad.

/dpt/ is who took issue with it.
>>
>>61591812
> holy fucking shit if you think this is RAII (RESOURCE ACQUISITION IS INSTANTIATION) i have no words for you
How is it not? They had to invent some new syntax because of GC, but it's a functional equivalent of C++/D/Rust RAII.
> i've had it become inferior to other options but never "outdated"
By outdated I mean nonoptimal, and if you're desperate enough to write something in asm it should be the same for you.
> if you're simply writing inline assembly you're almost guaranteed to have it be forwards-compatible.
It also means you're missing on all the goodies new architectures bring and don't take into account all the quirks of the uarch like different methods of branch prediction and cache sizes, so what's the point of doing it in asm then?
> in a common case where you are using qsort with multiple different comparison functions several times throughout your code, inlining is definitely not what you want.
You still haven't provided any actual counter arguments besides "I think it works like this" and "I don't think the benchmarks are representative". On several occasions have I achieved 20%+ performance increase in a big project just by applying __attribute__((always_inline)) generously, so I find your unsubstantiated statements highly unconvincing.
>>
File: 1485589698444.png (304KB, 616x450px) Image search: [Google]
1485589698444.png
304KB, 616x450px
>>61591886
>Then explain why C++ aged so badly in the short span of 30 years

Most people still use it it as C with classes. It is much easier to read and understand. Terry Davis writes C++ in that style and emailed me that "only niggers are amazed by complexity" when I asked him why he doesn't try modern C++.

https://github.com/minexew/TempleOS/blob/master/TempleOSCD/Downloads/Linux/TOSZ.CPP
>>
>>61591981
maybe
import requests

s = requests.Session()
r = s.get('https://login.live.com',verify=False)
r = s.post('https://login.live.com', auth=('user', 'pass'),verify=False)
print r.status_code
print r.text


your code runs fine on my console (it outputs a HTML page)
>>
>>61591912
If you want to work somewhere else every 3 months or so you should go to an uitzendbureau but otherwise you should just get a job the "normal" way. I recommend the "normal" way.
>>
File: 1499632747254.jpg (98KB, 599x589px) Image search: [Google]
1499632747254.jpg
98KB, 599x589px
>>61592022
>Nearest chapel is 40 miles away from my current location and 80 miles from my university
I've bookmarked their Wikipedia article, though. Maybe some day.
>>
>>61591936
>I'm trying to get into this field. any books or recommendations?
I've heard good stories on the Android Udacity course. This is a popular book, but I don't know if it's any good: https://www.amazon.com/Android-Application-Development-Hours-Yourself/dp/0672337398
Your first step is to master Java. After that, I recommend writing a simple master/detail program. For instance: display a list of YouTube video from the YouTube API, play the video in a separate screen if the user clicks on it. Learning Kotlin is not a must, but a nice to have.
>what software do you use?
Android Studio (IntelliJ sprinkled with Android bloatware)
GitLab (tool for managing git repositories)
Jenkins (build server)
>>
>2017
>not writing in orthodox sepples
https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b
>>
>>61592090

>it outputs a HTML page
Yep, but it's not the proper account page, but a notice that "cookies must be enabled" page.

I'll try the "auth" parameter next.
>>
>>61591857
It's perfectly fine. I like the Judeo-Christian habit of married women wearing scarves. That way it's very easy to see who is available and who is not. Also, there's logic in that a woman needs to be attractive only to his husband. Unfortunately only Jews seem to be practicing this. Christians have all become some sort of atheists.

Muslisms can go die in a fire, though.
>>
>>61592091
I figured as much. I don't know if I like having a new project every 3 months. I preferably want a project that'll grow on me until it becomes my baby.
>>
>>61592137
>Don't use C++ runtime wrapper for C runtime includes (<cstdio>, <cmath>, etc.), use C runtime instead (<stdio.h>, <math.h>, etc.)
What's the difference?
>>
File: 1441915553589.png (128KB, 272x285px) Image search: [Google]
1441915553589.png
128KB, 272x285px
>>61592084
going to ignore everything else you said because it's just stupid and i am losing patience, i don't intend for this to be an argument because i stopped caring

>you still haven't provided any actual counter arguments
uh yes i have
i explained it to you multiple times, without literally referencing intel optimization manuals i can't get any more verbose
>i think it works like this
whatever you wanna hear
>on several occasions i have * performance increase in a big project just by applying * always_inline
if by "big projects" you mean <400 line single-file programs, i believe you, otherwise regardless of the size i doubt it's significance heavily, because you basically flat out said that compilers are perfect less than 2 replies ago and now you're saying that they don't know when to inline, which is something you can determine entirely mathematically.
>i find your unsubstantiated statements highly unconvincing
ok
>>
>>61592137
>it's not C++ with an Eastern Orthodox flavor
Dropped
>>
>>61592054
What's /dpt/?
>>
>>61592137
That's why I don't like C++. It's a complete clusterfuck.
>>
>>61592181
daily programming thread
>>
>>61592194
The fuck is that?
>>
>>61592181
You'd best start believing in /dpt/, Anon. You're in it.
>>
>>61592204
your mom's asshole
>>
Why is Python so damn slow with lists, tuples, strings etc?
>>
>>61592245
Because you're not using Nim.
>>
>>61592245
It isn't.

post your program
>>
File: jjjjjjjjj.jpg (258KB, 1200x1800px) Image search: [Google]
jjjjjjjjj.jpg
258KB, 1200x1800px
>>61592250
*tips
>>
>>61592204
>>61592227
GET REKT XDD

>>61592245
Python is just slow
>>
>>61592257
Take this, for instance:
http://benchmarksgame.alioth.debian.org/u64q/program.php?test=binarytrees&lang=python3&id=1
>>
>>61592245
Don't use Python for high performance code, dummy.
>>
>>61592088
wtf, Terry is almost always right

is he some kind of a high-functioning schizophrenic
>>
>>61592287
This. Use Ruby instead.
>>
>>61592297
That garbage is even slower.
>>
Where can I read about how jvm/.net things work from the inside?
>>
>>61592320
https://en.wikipedia.org/wiki/Java_virtual_machine
>>
>>61592281
of course recursion in python is slow
>>
>>61592320
Write your own bytecode interpreter.
>>
>>61592335
>https://en.wikipedia.org/wiki/Java_virtual_machine
Sorry, I don't read Internet. Any actual books?
>>
>>61592320
Java is proprietary so don't start with that.

.NET and even Lua you could read up about
>>
>>61592337
That problem is slow with a loop and a stack, too. And it gets even slower if you use lists or dictionaries instead of tuples.
>>
File: cool and nice.png (293KB, 455x455px) Image search: [Google]
cool and nice.png
293KB, 455x455px
>>61592356
>.NET

by this I meant the CLI which has an open specification (and open implementation in Mono)
>>
File: 1501161771232.jpg (89KB, 717x1213px) Image search: [Google]
1501161771232.jpg
89KB, 717x1213px
>>61592137
This guy has poor spelling and a poor command of the english language.
And all he did was "rename" C with Classes, which is already a well understood subset of C++, all so he could share it on Show HN and get free stars and attention to his profile.
It's so shameless too.
>>
>>61591886
>Then explain why C++ aged so badly
it didn't. ask anybody who is actually experienced with C++; it's so much better than it used to be, it's not even funny. if for some strange reason i found out that i had to start doing my projects in C++98, i'd go into a cold sweat. i'm already hopelessly attached to a number C++17 features, let alone former standards' additions. it's come a long way. i think people who don't know it imagine added functionality as having implicit cost, but the vast majority of abstractions have zero runtime cost, and "only pay for what you use" is one of the core design principles of the language

>and why a bunch of languages sprung up to fill the void
they didn't. not really. languages have sprung up that fit certain application spaces, and if your use case is in one of those, then by all means, use one of those languages. it's great that there are better options than C++ for a lot of things. it would suck if there weren't. i certainly don't use it for everything i do. but if your use case is large-scale hard real-time/performance critical applications (which, despite everything, is still a huge space), C++ has been and continues to be the only really viable option. nothing (not even any combination of languages) can categorically replace it as long as that's the case. Rust might (maybe) be a viable alternative at some point. we'll see. and either way, that's pretty damn recent on a scale of 30 years
>>
>>61592356
>Java is proprietary so don't start with that.
OpenJDK is more open that your mom.
>>
>>61592320
http://docs.oracle.com/javase/specs/jvms/se7/html/index.html
>>
>>61592389
No in this case I'm pretty sure the guy is actually autistic.
>>
>>61592407
Can anyone cumtribute?
>>
>>61592320
http://docs.oracle.com/javase/specs/jvms/se8/html/index.html
The majority of oracle's java is open source so you can look at the source code of openjdk if you want
>>
>>61592429
Yes. You can try work on Graal if you want an interesting project.
>>
>>61591295
it's more true for shitty meme languages like python and haskell. at least with C++ it's legitimately a good language depending on your use case
>>
File: filesmonster-500x500.png (39KB, 500x500px) Image search: [Google]
filesmonster-500x500.png
39KB, 500x500px
Filesmonster just sent me an email with my cleartext password in it. The one I used to sign up. I hope none of you faggots use this service.
>>
>>61592537
Why? I have nothing to hide. If they want to store my password not hashed, well okay... I don't care
>>
>>61592407
Literally no one is using that. It is also made by neckbeards.


Go with C#.
>>
>>61592584
C# is (((Microsoft))) shit.
inb4 >muh mono
>>
>>61592537
Many services send clear text passwords. Usually they are meant for the first login and to be changed afterwards.
>>
>>61592537
reddit this at some point, not sure if they do it anymore.
>>
>>61592602
No this was the exact password I typed in to sign up for it not a temporary password.
>>
>>61592584
The JVM is superior to any other VM out there. Guess why it's an industry standard?
>>
Is float always single precision and double always double precision in C?
>>
>>61592537
>Filesmonster
literally who?
>>
>>61592637
>industry standard
Not applicable

Java Enterprise is popular Sun shilled it. Same reason fucking Solaris is still abundant out there.
>>
>>61592597
>C# is (((Microsoft))) shit
this might have been a legitimate argument back when it was a closed platform. but now that it's opened up, and considering how much better C# is than Java as a language, there's no real contest
>>
>>61592657
C# is only popular because of Microsoft shilling its Java clone. There's no reason to use C# over Java.
>>
void *bitMapMemory;
if (bitMapMemory) {
}


c++, what the hell is happening here? how does c++ evaluate pointer as a boolean?
>>
>>61592646
Pretty sure its one of those file sharing sites thats just used for porn.
>>
>>61592680
linq
>>
What is a good way/method to determine the buy position based on the amount and price.

Example 1:

Price:                 Amount:
0.00244414 12.41045841
0.00244385 example <-------- the order needs to be placed here
0.00244384 25421.49999250
0.00243350 55.09370000
0.00243221 62511.24255008
0.00240323 875.54499918


Example 2:

Price:                 Amount:
0.00110315 158.09238424
0.00105804 example <-------- the order needs to be placed here
0.00105803 63.02394783
0.00105788 35.95463452
0.00105782 845.85935683


I want the order to be placed just above the buy wall (lots of buy orders around the same value or one buy order with massive amounts like in example 1).

What is the best way to calculate this?
>>
>>61592685
if the pointer == nullptr, it's false
else it's true
pretty simple stuff tbj
>>
>>61592660
C# is very ugly, Java isn't

>>61592680
This
>>
>>61592685
shorthand for
if(bitMapMemory != nullptr)
>>
>>61592685
it's checking if its not NULL
>>
Java has so many failsafes that it's damn near impossible to break a Java program.

Although detractors consider it a disadvantage that Java forces its programmers to take these measures, the effort needed to do so is negligible if you have a fully-fledged IDE (or you've sufficiently customized Emacs/Vim, for you daddy-o's who were programming in the early 80s). It also means that even novice programmers can produce cutting edge programs, even if their methods are inelegant.

And compiled Java still has a smaller memory footprint than Python and C++ programs, some C programs, and even some assembly programs.
>>
>>61592680
Except a growing job market where you aren't stuck in a cubicle working with your municipality's boring-ass legacy system

Jobs don't concern /g/ much though so moot point
>>
>>61592706
How is C# ugly in comparison to Java?
>>
>>61592704

what exactly is 'null' in a pointer? does windows reserve specific byte for NULL like in ASCII?
>>
>>61592719
this sounds like something a nonprogrammer would say
>>
if java is so good when is there no java operating system yet
>>
>>61592691
I've never used Linq, but it looks like a poor mans FP.
>>
>>61592739
There is proper one but there's also android.
>>
File: 1500922725243.png (56KB, 1790x1640px) Image search: [Google]
1500922725243.png
56KB, 1790x1640px
>>61592719
>And compiled Java still has a smaller memory footprint than Python and C++ programs, some C programs, and even some assembly programs.

Then why does a simple servlet application like JIRA require 1 GB to run?

It's a fucking webapp.
>>
>>61592692
in the first example why don't you want your order to be above 62511.24255008?
>>
File: 1387600282587.jpg (59KB, 500x539px) Image search: [Google]
1387600282587.jpg
59KB, 500x539px
>burn out of programming
>don't feel like programming at all
>don't feel like learning any new languages
>mfw I'm a CE student

Should I just drop out?
>>
>>61592739
>java operating system
It's called JVM.
>>
>>61592751
Who are you quoting, friend?
>>
>>61592728
It's the value 0.
>>
>>61592772
not always
>>
>>61592748
async/await is a much better reason anyway
>>
>>61592728
the kernel will give you a pointer to NULL if you request memory and it can't give it to you

>>61592772
it's implementation defined
>>
>>61592728
it's implementation-dependent :^)
>>
>>61592772

so 0x0 is null?
>>
>>61592796
It'll be as long as a pointer is on your architecture but yeah.
>>
File: 1407888206116.png (1MB, 1200x1800px) Image search: [Google]
1407888206116.png
1MB, 1200x1800px
What kind of kinky shit is your programming language into?
>>
>>61592796
on some platforms
>>
>>61592812
Mine sleeps around with everyone and likes to keep mementos.
>>
In C can you use functional fuckery and use only functions to implement something like structure hierarchy?
>>
>>61592761

Because the 25421.49999250 is also a major buy wall. It would take to long for the wall to go down. Therefore it would be easier to place the buy order just above it while avoiding the highest one 12.41045841.

Yet I am struggeling how to calculate this all automatic without human intervention in the bot.

Hope someone can help me with this.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>61592812
Handholding and consensual sex.
>>
>>61592812
Fucking shotas (Java)
>>
>>61592762
>Should I just drop out?
If you liked those things when you started, no, you're just a bit depressed. If you didn't, yes, drop out. There's quite a bit more to computers than just programming, too. You need to know how things work, how algorithms work, what tools you have available etc. You don't really need to learn new languages, since they're just tools to solve your problem. You need to, first and foremost, know how to solve the problem. As a project manager or similar you don't have to program at all if you don't want to.
>>
>>61592812
I don't know, but she's very popular in /dpt/ despite not having a job.
>>
>>61592830
can you provide more context about what these orders are and the order in which they are placed?
>>
>>61592812
I've never before masturbated to Visual Basic.
>>
>>61592844
>you don't have to program at all if you don't want to.
I hope I don't have to. I'll inherit my dad's company and it has almost nothing to do with computers. I'm just in college because everyone expects me to get a degree, including me, but I'm so bored of it.
>>
how do I parse args with mixed options (short) and regular arguments?
>>
>>61592895
What do you mean? Like -t and --time? Or literally short as a datatype?
>>
>>61592895
have you looked at getopt?
>>
>>61592812
c++ is hot
>>
>>61592796
NULL == 0x0
>>
>>61592915
But check out her mom
>>
I envy you motherfuckers who started learning to program since your early days, when internet was in its infant stage and all learning resources were hidden behind 20 proxies. Or werent present at all.
I hope I'm not the only one who has trouble actually sitting down and starting to learn something due to overwhelming number of books, videos and all that shit. Since everything is so accessible right now I can't be bothered to start learning in any other way than *the best* way. So I just spend my evenings browsing around and asking people for the best book about Python instead of actually learning it.
>>
>>61592909
>>61592910
./main arg1 arg2
./main -x arg1 arg2 -y
./main arg1 -xy arg2
etc
>>
>>61592928
oldfags just get stuck in their terrible old habits
>>
>>61592928
You could, you know, just start to write something. Start your debug console (F12) and write 'alert("wazzuuup")'. Congrats, it's your first functional script.
>>
>>61592928
You are not looking for the best book, you are procrastinating
>>
>>61592966
>>61592977
>>61592986
>Since everything is so accessible right now I can't be bothered to start learning in any other way than *the best* way. So I just spend my evenings browsing around and asking people for the best book about Python instead of actually learning it.
it's bait based on an /agdg/ meme
>>
>>61592938
You could consider the arguments as a stack and just start consuming them. If the argument you encounter requires a parameter, just pop the stack. There are a lot of librarires for this, though, so you definitely don't need to implement it from scratch. Python has argparse, for instance.
>>
>>61592751
>And compiled Java still has a smaller memory footprint than Python and C++ programs, some C programs, and even some assembly programs.
This is what pajeets actually believe.
>>
>>61592875

It is for a cryptocurrency bot I want to make. The example lists are the 5 highest buy orders that are currently made. I gather this data with the API's of the exchanges.

I have the buy/order function already working, I only need to figure out how to get the buy position (the number like 0.00105804 in example 2).

If you want a visual example:
https://www.cryptopia.co.nz/Exchange?market=ARK_BTC

Which is the exchange.
>>
>>61592680
value types, generic constraints, pattern matching, tuple literals/deconstruction, is-expressions, properties, nullables, null conditionals/coalescence, throw-expressions, covariance/contravariance, linq, delegates, unsafe, good C-interop, ref/out parameters, ref returns/locals, out variables, expression-bodied members, string interpolation, and more

admittedly a few of these are syntactic (though very convenient). others are things you may not need (or realize you need) as a novice (at that stage, C# and Java appear extremely similar), and it may seem like no big deal. until one day you realize you could *really* use one of them or another. with C#, you're golden. with Java, you're fucked. C# is basically just Java, plus a substantial list of nice shit that Java just doesn't have

>>61592706
>C# is very ugly, Java isn't
they're extremely similar, syntactically. however, C# can be far less verbose (thank christ)
>>
>>61592250
>nim
I wouldn't mind if Nim took over python.
It's similar enough that it can feasably replace the language and it's better on some many levels.

I wonder why we always have to have garbage languages before we get good languages.
BCPL->C
ALGOL->Pascal

Why can't we just jump to the end?
>>
>>61593167
I'm sure C# is good and all, but I'm a Linux weenie. That's why I prefer Java.
>>
>>61593002
Meme or not it's still pretty much relatable.
>>
>>61592287
>Python for high performance code, dummy.
Don't use it for running code rather. It's fine for occassional scripts, linking real software to other software. You shouldn't write software in it though.
>>
>>61593167
>, ref/out parameters, ref returns/locals, out variables
why would you want any of this shit
>>
File: 1483255133246.jpg (2MB, 3937x2362px) Image search: [Google]
1483255133246.jpg
2MB, 3937x2362px
>>61589577
How would you test this code?
I've never done unit testing before but I assume I'm gonna need more than just asserts and stuff right?
I'm using CUnit btw.

error_t parse_opt(int key, char *arg, struct argp_state *state)
{
struct args *args = state->input;

if (args->count > 128)
argp_usage(state);

switch (key)
{
case 'q': case 's':
args->silent = 1;
break;

case 'v':
args->verbose = 1;
break;

case 'o':
args->output_file = arg;
break;

case ARGP_KEY_ARG:
if (args->count-- < 0)
break;
break;

case ARGP_KEY_END:
if (state->arg_num < 1)
argp_usage(state);
break;

default:
return ARGP_ERR_UNKNOWN;
break;
}
return 0;
}

void parse_args(int argc, char **argv)
{
const char *argp_program_version = PACKAGE_VERSION;
const char *argp_program_bug_address = PACKAGE_BUGREPORT;
const char* doc = "Eternity - your window to the good";
char args_doc[] = "file1.jpg file2.png file3.bmp ...";

struct argp_option options[] = {
{"verbose",'v', 0, 0, "Produce verbose output", 0},
{"quiet", 'q', 0, 0, "Don't produce any output", 0},
{"silent", 's', 0, OPTION_ALIAS, NULL, 0},
{"output", 'o', "FILE", 0, "Output to FILE instead of std output", 0},
{0}
};

struct argp argp = {options, parse_opt, args_doc, doc, NULL, 0, NULL};
struct args args;
args.count = argc;
args.silent = args.verbose = 0;
args.output_file = "-";

argp_parse(&argp, argc, argv, 0, 0, &args);
}
>>
>>61593208
This. Python is a glorified Bash.
>>
>>61593234
you're thinking of perl
>>
>>61592928
It's easy to solve anon. Order a new router power supply cable from China.
Take a scissor.
Take your router power supply cable.
Unplug it, snip it.
Read your books/downloaded ebooks.
Do your projects.

A substitute for this process is dicipline.
>>
>>61593249
Fair enough, Python is also useful for writing a GUI wrapper.
>>
>>61593297
>Python is also useful for writing a GUI wrapper.
For what reason? So you can use python for your GUI? Why?
>>
Why do you fags spend so much fucking time arguing about languages instead of talking about what you are working on?
>>
>>61593332
https://en.wikipedia.org/wiki/Law_of_triviality
>>
>>61593332
Because I don't want to associate my projects with /g/.
The thing I'm currently working on analyses binary files to try and figure out their structure (and eventually it'll generate a parser) based on data the user provides that they expect to find in it.
But I don't want that tool associated with /g/.
>>
>>61593319
What langauge would you recommend to write a GUI wrapper in?
>>
>>61593353
I keep coming back to these threads because once in a blue moon there is interesting discussion. The rest of the time it is fucking language dick-waggleing.
>>
>>61590269
>>61590263
Some complete C reference or something, there was a thread about it
>>
>>61593380
Java, C, C++. Maybe Lua, since it's more accessible for end users than Python and you can have users customize their interface in so many ways using lua. With python people have too many expectations on programming paradigms. Lua doesn't come with that.

But overall I'm not too fond of GUI wrappers. Those are almost always superflous to actual tools that interface with the CLI tool. A wrapper is just a waste.
But I'm fine with you using python because I'll never use your wrapper likely. Not if you didn't have more to do than wrap the CLI.
>>
>>61589577
>What are you working on, /g/?
Trying to write an assembly-like programming language. It has to be like assembly but easier. It won't be useful but it's a fun project.
>>
File: trashkell_on_suicide_watch.png (448KB, 580x1500px) Image search: [Google]
trashkell_on_suicide_watch.png
448KB, 580x1500px
>>61593332
>make a post talking about what I've been working on
>zero replies
>"lol trashkell is shit xdd"
>15 replies
>>
>>61593069
if money is involved, the safest play is probably to set a threshold, of 10000 for example, go down the list and when you find two prices with >= 10000 difference in amount, place a buy order there
>>
>>61593469
Even easier bait is saying anything positive about Rust.
>>
>>61593332
Easiest way to get upvotes in dee pee tee

>>61589577
nothing, I am sick as shit
>>
>>61592088
>"only niggers are amazed by complexity"

The real problem is most of the complexity is unjustified, is there because of design mistakes or clinging to the idea of C compatibility even 40 years later.
>>
>>61593547
It's also ridiculous that all those people started "fixing" C++ and not starting from scratch.
The only decent ones went on to work on D, Rust etc.
>>
>>61593199
Microsoft has open-sourced the C# compiler and they've released and continue to expand a cross-platform version of the .NET runtime. setting aside that mono has technically long been an option, C# now has first-class/first-party support on Linux

>>61593210
ref/out parameters are for passing value types in/out by reference. it's good to have the option with a language that actually supports value types (Java's categorical lack of value types with the exception of primitives and arrays of primitives was a regrettable choice with numerous considerable consequences particularly in terms of performance). out variables are so you don't have to define an "out" value for capturing output on a separate line (you can do it inline instead). ref locals are basically a direct reference to a value without an indirection (you could for example have a local variable or a member of a class map directly to some index of an array from another scope, which can be very convenient and is more efficient than an indirection through a managed type reference)
>>
>>61593587
>Microsoft has open-sourced the C# compiler and they've released and continue to expand a cross-platform version of the .NET runtime. setting aside that mono has technically long been an option, C# now has first-class/first-party support on Linux
>.NET Core
>Core
It's just a subset. Besides, Mono is shit.
>>
>>61593508

I don't really about about the money atm (I will be testing it with super small useless coins like doge first).

I have thought about doing something like that before but you will often end up buying so far below the selling price that your order will never fill. Therefore I need a way to figure out how to calculate it of the 5/10 highest prices like in the examples.

But I am not sure how to achieve that, hope someone here can help me.
>>
>>61593571
D is kool
>>
>>61593611
Microsoft has a bug bounty program too

https://technet.microsoft.com/en-us/library/dn425036.aspx
>>
>>61593587
I feel like the whole distinction between value types and reference types is backwards-thinking. IMO that shouldn't be an aspect of the type itself, but a modifier as in C.
>>
>>61590917
on your face after I nutted in it
>>
File: trump_is_a_jew.png (152KB, 574x601px) Image search: [Google]
trump_is_a_jew.png
152KB, 574x601px
>>61591857
>>
>>61593636
So? .NET Core is far from being a Java replacement.
>>
>>61593636
>Microsoft retains sole discretion in determining which submissions are qualified, according to the rules of each program.
>If we receive multiple bug reports for the same issue from different parties, the bounty will be granted to the first eligible submission.
>If a duplicate report provides new information that was previously unknown to Microsoft, we will award a differential to the person submitting the duplicate report.
>The first external report received on an internally known issue will receive a maximum of $1,500 USD.
Great..
>>
>>61593635
Good libraries make languages kool. What the shit can you do in D? ""Kode"" with Klossy?
>>
>>61593791
Dicking Klossy.
>>
>>61593791
can you?
>>
>>61589577
i'll never understand people who have hard copies for programming books

get with the times grandpa
>>
>>61593791
>Good libraries
Too dumb to write your own shit?
INTO THE GAS CHAMBER YOU GO!!
>>
>>61593822
i think owning k&r is fine. it's not going to be obsolete anytime soon
>>
>>61593822
>grandpa
But it wasn't more than 5-7 years ago when ebooks weren't a widespread thing.
>>
>>61593822
My monitor is small.
>>
I'm about to pull my fucking hair out.
I pushed a bad commit that I can't leave in public view. I've managed to revert back to the last good commit using git push -f origin <commit-sha>, but whenever I try to push anything after that (e.g. redo the good changes) it just pops all the fucking commits I tried to get rid of back up.
What the fuck am I doing wrong?
>>
>>61593822
Some books don't age as quick as the new O'Reilly and No Starch Press ones.
Wouldn't you want to have an TAoCP v. 1-4a on your desk too?
>>
>>61593860
I had the same thing. I fixed it, but GitHub still displayed the fucked up commit.
>>
>>61593822
Having clrs lying on my table creates positive atmosphere
>>
>>61593881
>but GitHub still displayed the fucked up commit
Yeah that doesn't do me any good
>>
>>61593914
You're fucked senpai, delete your GitHub account and start all over again. Or do you want to be associated with kikedestroyer88?
>>
>>61593791
>tfw not koding on yacht in Cannes

https://www.youtube.com/watch?v=F5k5uqC062w
>>
>>61593881
>>61593860
>>61593926
Nevermind, I just had to do
git reset --hard <commit-sha>
>>
>>61593894
>keeping a school textbook around to impress people
oh anon that's just adorable
>>
>>61593943
>tfw your waifu prints her own clothes
https://www.youtube.com/watch?v=KoKCs0LaLZ8
>>
>>61593791
I said kool. C is not kool, its practical.

Go write your python script you fag.
>>
>>61593979
>impress people
What are you talking about?
He was clearly implying it has sentimental value.
>>
>>61593611
>It's just a subset
true, but a growing one. last i checked it seemed to be fast-approaching parity

>Mono is shit
also true, but that's why i see .NET Core as a good thing. something to keep an eye on, at least

>>61593640
it seems an acceptable middle ground to me, for a language that aims to be simpler than C++. and i'll take it over an all-out lack of value types any day. in practice, i find that the things you *really* want to be able to represent by value often end up being represented strictly/categorically by-value in code anyway (why have an array of pointers to 3D vectors? terrible for cache efficiency), and generally likewise for reference types (perhaps not as categorically, but that's what cloning functions are for). the distinction allows for simplification of the runtime and the interface. it manages to allow the functionality while being, notably, barely any more complicated than Java in that regard. and the benefits as far as performance (think cache efficiency, crossing binary boundaries, buffering data to a GPU, etc) are quite tangible
>>
>>61594026
>true, but a growing one. last i checked it seemed to be fast-approaching parity
In the mean time I'll be using Java. I might check it out because of F# though.
>also true, but that's why i see .NET Core as a good thing. something to keep an eye on, at least
It's a good thing, but I feel like it's too late.
>>
NEW THREAD!!

>>61594061
>>61594061
>>
I've taken a logic class and a visual basic class and have about a decade of experience working with computers and Linux in general. What should I do starting today to be able to contribute to open source projects?
C++?
>>
Real new thread:
>>61594070
>>61594070

>>61594070
>>61594070

>>61594070
>>61594070
>>
>>61593225
please respond
>>
Why was the first new thread deleted?
>>
>>61594159
Mods hate anime
>>
>>61594159
Mods are fags
>>
>>61594088
write test cases for it and test the boundaries too
>>
>>61589987
Just look for a book called Design Patterns
>>
I want to learn how to write software. Where do I start?
>>
>>61594907
Wax left, wax right
Thread posts: 320
Thread images: 27


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