[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: 328
Thread images: 16

What are you working on, /g/?
Old thread: >>58611896
>>
first for nodev
>>
First for Go!
>>
fuck you for using an anime image
>>
install gentoo
>>
Is Win32 as awful as people say?
>>
>>58618212
Yes.
>>
>>58618215
Could you explain why?
>>
>>58618227
No.
>>
>>58618092
C external libraries in windows

what do?

I want to mess with web pages
>>
>>58618227
Not him, but one word: Legacy
>>
/dpt/ is dead when the americans are sleeping

why cant europe into programming
>>
curl -sH "User-Agent: Mozilla/6.0" 'https://www.reddit.com/r/Rule34LoL/new/.json' | grep -o '"url": "[^\"]*", "[^\"]*": "[^\"]*", "[^\"]*": [a-z]*, "[a-z]*": "[^\"]*"' | sed 's/^.*rl....//g;s/\".*tle..../::/g;s/^\(.*\).$/\1/g' | awk -F "::" '{printf ("%s\n--> %s\n\n", $2, $1)}'


i really like masturbating to game characters
>>
>>58618368
Europeans are still at work when Americans are sleeping.
>>
>>58618368
I am at work and I don't post on 4chan about my work
>>
Daily reminder that you're not a real programmer unless you're into traps.
>>
>>58618512

also daily reminder that self admitted gay men are not attracted to traps
>>
>>58618368
Because europeans have jobs and are functioning people who dont post anime shit in a programming thread.
>>
>>58618544
I'm european, but almost every EU country has a higher unemployment than the US, and those that don't are
UK - Cucked, can't watch fetish porn
Fr - Cucked by blacks
Ger - Cucked by syrians
>>
Round Robin is literally the best scheduling algorithm.

>CPU time allocation is completely fair, no task is starved, and no task can hog
>O(1)

All other algorithms BTFO. Prove me wrong.
>>
#include <stddef.h>
#include <stdint.h>

char *strfsm(const char *str, void (*(*st)(int, void *))(void), void *dat)
{
for (int ch; (ch = *str) != '\0'; ++str)
if ((st = (void (*(*)(int, void *))(void))st(ch, dat)) == NULL)
return (char *)str;
return NULL;
}

// tests

#include <ctype.h>

static void (*even(int, void *))(void), (*odd(int, void *))(void);

void (*even(int ch, void *is_even))(void)
{
return (void (*)(void))(isspace(ch) ? (*(_Bool *)is_even = 0, odd) : even);
}

void (*odd(int ch, void *is_even))(void)
{
return (void (*)(void))(isspace(ch) ? (*(_Bool *)is_even = 1, even) : odd);
}

static _Bool even_no_of_ws(const char *str)
{
_Bool res;
strfsm(str, even, &res);
return res;
}
// ...


I wish C either had
A) a standard generic function pointer type à la void *)
B) an anonymous inline typedef feature, so that instead of void (*fn(int))(void) you could use, for example, _Typedef(void (*)(void)) fn(void)
>>
>>58618576
Doesnt fucking matter, Germany for example has an unemployment rate of 4.1% but 50 million citizens, the US has 4.7% but 300 million citizens, so there are way more unemployed Americans.
>>
>>58618615
>Open photoshop
>Wait for 100 MS BG services to get their fair share
>Pick tool
>Wait for 20 chrome processes
>Draw point
>Wait for Steam, Discord, Skype and Spotify
>Audio lags like shit
>>
>>58618576
Why are you so defensive? The question was about low activity during daytime /dpt/, why the fuck are you going into full defence mode and spouting this /pol/ shit?

>>58618615
Underutilization
>>
>>58618662
>20 chrome processes
>Steam, Discord, Skype and Spotify
Found your problems.
>>
>>58618656
There are 556 million citizens in EU28, average is 9.8%, so there would be almost 2x many unemployed EU'ians than US of A'ians
>>
>>58618656

america is 1/3 african negroids
>>
>>58618680
>Using programs on your computer
>Found your problem
>>
>>58618649
>_Typedef(void (*)(void)) fn(void)
_Typedef(void (*)(void)) fn(int) rather
>>
>>58618680
>my algorithm sucks
>its the user's fault
>>
>>58618649
>static void ((*(even(int, void *)))(void))
ftfy
>>
Are nested attributes for a ML as important as I think, or could I get away with 1D arrays max?
>>
>>58618781
>even
doesn't a function call have higher precedence than a pointer dereference? so your grouping doesn't really change anything
>>
File: anim.webm (545KB, 1143x846px) Image search: [Google]
anim.webm
545KB, 1143x846px
I added a download queue so you can add songs and start downloading them all at once

Think I'm gonna make sure it works properly and I'm gonna build binaries and make it another release
>>
>>58618689
EU isn't one country.
>>
>>58618917
>EU isn't one country.
And the United States of America isn't just one state.
>>
>>58618917
Economics and demographics wise it might as well be.
>>
>>58618932

germany is not a single state either
>>
>>58618940
Not really
>>
>>58618880
he used redundant parentheses so I gave him more
>>
>>58618932
But it is one country. Compare like to like.
>>58618940
Are you fucking implying that, for example, the Baltics and France have the same or even comparable economics and demographics?
>>
>>58618296
Then I don't believe it's bad.
>>
>>58616819

Do you fucking that program or not, i have already made it
>>
>>58618969
cool i learned something today, thanks friend
>>
File: 1471761644797.jpg (100KB, 500x500px) Image search: [Google]
1471761644797.jpg
100KB, 500x500px
So I learned Haskell.
Where do I collect my well-paid job?
>>
>>58619005
actually no you're wrong fuck you
>>
>>58618972
Are you implying that North Dakota has similar economics and demographics to California or New York?

The only thing that matters is that a french citizen is also an eu citizen and by extension a latvian, german and swedish citizen, same with companies.
>>
>>58618988
>Do you fucking that program or not
What did he mean by this?
>>
>>58619013
https://www.gov.uk/browse/benefits/
>>
>>58619014
but you're not me tho
>>
>>58618946
you meant cuckistan?
>>
>>58619013
Did you get your maths PhD as well?
>>
>>58619013
let's not get ahead of ourselves here; there's still coq to learn before you can get a job
>>
>>58619019
The difference is that one is a country and the other is a not, retard. Guess what, we have states with different economics and demographics here too.
>>
>>58619031
don't fuck with me troll i will end you
>>
>>58619013
the dole
>>
>>58619077
Are you fucking retarded?
>>
>>58619078
fire me irl
>>
hi where are the disgusions aboud brogramin :DDDDDDD
>>
>>58619099
/wdg/
>>
>>58619029
fucking need* that program
>>
>>58618576
Switzerland master race. Most free nation on Earth right now
>>
>>58618988
>>58619131
That anon probably came to vomit his post and left immediately without even seeing if there would be a response/feedback.
>>
>>58619099
That copy pasta is as relevant as ever.
>>
>>58619013
https://yourtexasbenefits.hhsc.texas.gov/programs/snap

>>58619099
C# is literally the most practical programming language
>>
>>58619154
Too bad for him, it was a nice practice of webscraping, although my program runs pretty slow, it takes like 3-5sec to parse through subcribers and channel names for my test 4 youtube channels
>>
Would you program for ternary computer?
http://trinary.ru/projects/setunws/
>>
>>58619165
except coq
>>
How do real interpreters do it? I look for the block start, then if another block start is found, I pass the string sliced from the index till the end, and so on, until the end of the file/it runs out of blocks to interpret, seems like it would be incredibly slow and take up geometrically more memory as the files grew.
>>
>>58619298
Sounds about right
>>
Anyone know of a way to generate a string that will match a RegEx? I'm using PHP.

My regex:

[A-Za-z0-9]{8}(-[A-Za-z0-9]{4}){3}-[A-Za-z0-9]{12}
>>
>>58619343
Looks like a template for registration keys.
>>
>>58618576

>realizing people die if we don't help them
>EU doesn't give a crap because "lol, who needs humanity when we have da money? XD"
>UK are too good for the EU
>france treats people like animals and votes Le Pen
>germany helps people
>germany gets shit from every other nation
>based germany doesn't care
>based germany upholds the european values and humanism


>>58619135

The only good thing about Switzerland is Scala
>>
>>58619430
Just saying, I was kidding, but raw #, EU/Europe still has more unemployed than the US.
>>
>>58619091
Not sure, but you seem to be.
>>
Is there a way to delete the last element of a dynamically allocated array in C++ or do I have to delete the whole thing and make a new one with 1 less length?
>>
>>58619077
>>58619522
EU - economic federation between sovereign states
USA - republic federation between sovereign states
>>
If I'm making a simple Android app using Java, like a math game or text messages thing.
Could it still work if I made everything public vs void?
I know it's not done this way, theoretically...
>>
>>58618907
Looks cool.
Where's the source hosted @ ?
>>
>>58619582
Edit
Public vs private
>>
>>58619538
Call the destructor on the last element and decrement the length (might involve casting to an array of -1 length).
>>
File: 1484828462949.jpg (10KB, 249x248px) Image search: [Google]
1484828462949.jpg
10KB, 249x248px
>>58619582
>poo in loo
>>
>>58618907
Try a lighter font
>>
>>58619601
Doesn't free the pointer memory
>>
>>58619601
Forgot to mention that I'm working with c-strings not an object.
>>
I've always wanted to get into programming, but never had the time. Now that I've made some money and become NEET, with the help of free money from gubmint, I'd love to devote time to learn something useful.

Can someone suggest the best no-nonsense book for a complete beginner to programming for learning C?
>>
>>58619614
Use realloc to a smaller size instead of new and delete.
>>
>>58619612
It would be later.

>>58619614
Then set the last character to null.
>>
File: 1484908025864.gif (371KB, 400x300px) Image search: [Google]
1484908025864.gif
371KB, 400x300px
>>58619626
ah, thx anon
>>
>>58619623
Don't learn C, it's obsolete

You can learn programming basics in other languages also

http://www.introprogramming.info/english-intro-csharp-book/

if you want to learn c# and general programming basics at the same time. Beware though, in this book you won't learn GUI programming
>>
>>58619298
What are you talking about? Interpeting a file as you read it?
>>
>>58619612
>>58619633
Though it does assume it's been allocated with something like malloc that doesn't require a length to free.
>>
>>58619548
One provides more autonomy than the other.
>>
File: 1478102008250.jpg (31KB, 313x286px) Image search: [Google]
1478102008250.jpg
31KB, 313x286px
>>58619650
C obselete? It's still the best low level and highest performing language out there.
>>
>>58619538
Yes you would. Use std::vector for this. Do not use "new Type[Length]" arrays unless you have explicit good reason to
>>
>>58619298
>How do real interpreters do it?
Build an AST you stupid moron.
>>
>>58619679
Really? Because compared to state laws and regulations, there aren't a lot of federal laws.
>>
>>58619690
Other way around mate. You should only use std::vector if you have good reason to use it over an array. And you should only use std::list if you have good reason to use it over a vector.

Arrays allocated with malloc can always be shortened.
>>
>>58619682
TL note: C is obsolete, if you can throw endless piles of hardware at your problem. In many case you can.
>>
>>58619682
How does being low level and high performance make it a viable language for learning? That doesnt really make sense
>>
>>58619589
https://github.com/nukeop/nuclear

>>58619611
The font gets lighter when you hover your mouse over it. I might try a different face eventually, I don't like everything about this one
>>
>>58619710
new and malloc are different things.

One implicitly calls constructors, the other simply reserves a continuous memory range
>>
>>58619650
Personally, I think the yellow book is better for someone who has never programmed before: http://www.robmiles.com/c-yellow-book/

>>58619682
I don't think C is obsolete, but it's silly to learn as your first language unless you actually want to get into hardware drivers and kernel dev.

The vast majority of programmers would be better served by a popular modern, high-level language, both for job-availability purposes and for comfy hobby dev.
>>
>>58619732
Which is why I specified to call the destructor on the last element.

If you don't understand how to separate the allocation from the data then you might as well not bother using C++ (or C, etc.)
>>
>>58619710
Explain your reasoning.
Oh wait youre probably one of those C assholes who gets off to making programming difficult for themselves and prematurely optimizes every line of their code
>>
>>58619623
>>58619650
C is absolutely not "obsolete". However, I would recommend some another first language, as C, even though a "simple" language, has large amount of corner cases and gotchas due to its historical background.
BASIC and Pascal are actually fine and good, no matter what anyone says, but due to their now unfashionability, finding help online on anything on a requisite beginner level might learning them impractical.
>>
>>58619724
Well, those things mean it's not obsolete, generally speaking. C is not obsolete as a systems language.

If >>58619650 had specified that C is obsolete for general application development or beginner learning purposes, that'd be more accurate.
>>
Any Boost.Asio gurus here?
Most of the documentation and examples imply light load - get some data, write a simple response.

But what if you need to handle something heavier? Like database queries or some computation when a client requests something?
Certainly you wouldn't do that in the read handlers since even though you'd call async write it'd still block the callback that invokes the async write.
>>
>>58619756
See >>58619746.
>>
>>58619740
Rob's book is too simplistic imho, although good
>>
>>58619746
>Which is why I specified to call the destructor on the last element.
You're retarded, because your solution involved casting to a shorter-sized array, which isn't even legal C++ (or C), instead of, you know, calling realloc on a pointer retrieved with malloc.

>If you don't understand how to separate the allocation from the data then you might as well not bother using C++ (or C, etc.)
We know you are trying to save face, anon, but trust me. Just let it go. We all make mistakes sometimes.
>>
>>58619780
>because your solution involved casting to a shorter-sized array, which isn't even legal
Yes it is. Why wouldn't it be?

>calling realloc on a pointer retrieved with malloc
Literally the same thing if the size is smaller.
>>
>>58619740
>>58619724
>>58619721
Sure C can be hard to learn but I still find it a good learning experience. Because it makes you think more about how the hardware is functioning and use this knowledge to produce better functioning code in higher level language.
>>
>>58619746
You probably dont understand C++.
The entire point of destructors is that they are called automatically. When you allocate an array with new[], and then delete it with delete[], it will call the destructor on every element of the array. Therefore if you manually called the destructor on the last element, then later deleting the array would probably call the destructor TWICE which would cause some sort of horrible undefined behavior.
If you just fucking used vector you wouldnt have any problem
>>
>>58619800
>Yes it is. Why wouldn't it be?
int array[5];
(int[4]) array;


In what world is this valid C++?

>Literally the same thing if the size is smaller.
No, it's not. Just calling the destructor on the last element doesn't free the memory. Realloc, on the other hand actually frees the memory.
>>
>>58619821
>>58619800
>>58619780
>>58619746
How do you even call the destructor without using delete?
>>
>>58619809
>then later deleting the array would probably call the destructor TWICE
Oh yeah, I suppose delete[] gets the length information from the size of the allocation.

>Just calling the destructor on the last element doesn't free the memory. Realloc, on the other hand actually frees the memory.
That's not the issue, but I do realize my mistake now. That said, with a POD type it would still be legal since there are no destructors involved. You could still do it with a non-POD but you'd have to loop through the new length and call the destructors manually. That's how std::vector works.
>>
>>58619837
// p : *T
p->~T();
>>
>>58619691
AST has nothing to do with my question, stupid moron.
>>
>>58619808
That doesn't necessarily translate to best-practice programming in higher level languages.

Also, how many months do you spend learning all the intricacies and "gotchas" of C before you become productive? Someone can begin moving data, pulling from APIs, and creating usable GUIs in something like C# in a very short timeframe. As soon as you can demonstrate a basic proficiency in something like C# or Java, you can probably get a junior dev job.

Contrast to jobs with C, where there are not only less jobs overall, but the jobs that exist are becoming more and more geared towards the 20-years-of-experience C wizard that needs to maintain a legacy clusterfuck. Very few beginner jobs in C these days.
>>
>>58619808
>to produce better functioning code in higher level language
You made a logical leap by assuming that understanding hardware makes you write better code in higher level language.
It might make you write more efficient code, MAYBE, but knowing the exact memory model that goes on in e.g. a lisp interpreter, requires more than just a knowledge of pointers and C strings.
If anything learning C is going to make you prematurely optimize and become attached to avoiding abstractions
>>
>>58619809
>>58619842
>you'd have to loop through the new length and call the destructors manually
And then use free instead of delete[], of course. delete would still attempt to call the destructor on the first element.
>>
>>58619854
Yes it does. You're asking how you parse code blocks without running out of memory, and the answer is you do multiple passes of the file and build abstract syntax trees.
>>
>>58619854
You're wondering how "real interpreters do it" and the answer is that real interpreters build ASTs
>>
>>58619808
I think it's absolutely worth it to learn C, at the very least in maybe your second year of programming, even if only because of its impact on large number of popular languages that were affected by it.
However as a first language it lacks a certain level of intuitiveness as it's syntax is very, how you say, computationalistic, due to its age.
>>
>>58619866
>If anything learning C is going to make you prematurely optimize and become attached to avoiding abstractions
Holy mother of fuck, this.

I knew a dev that spent like two weeks going into unsafe code in a C# project so they could save a tiny percentage of performance on a fairly long-running process. Now the code is much harder to read, and all that time was spent on doing something that provided less value than fixing other actual issues in the codebase or implementing new functionality. Bonus points on the fact that no one even had an issue with the performance of that particular data mashup.
>>
>>58619867
How much C++ have you written?
Youre not supposed to use malloc() free() and realloc() in C++ because it provides you with a handful of abstractions that are not only safer (less error prone) but also 1) easier to use 2) better express *intent* of your code rather than just being minimal pointer allocation routines
>>
>>58619918
He's pretending to be knowledgable
>>
>>58619864
>pulling from APIs
ask me how I know you're a webshit
>>
C is only better at allowing the programmer to micro-optimize. But micro-optimization is something a compiler for a higher-level language can do reasonably well, especially if the types are very strict.

Macro-optimization, such as laying out data structures to work well with cache, is something you can do easily even in high-level languages, as long as they have value types and contiguous arrays, like C#.

>>58619918
>Youre not supposed to use malloc() free() and realloc() in C++
You're allowed to, and it's how you would do this. std::vector is more heavyweight than necessary for having an array that you can shorten. If you don't care, don't use C++.

If best practices make worse code, then fuck them. It's got nothing to do with exception safety or anything either, since arrays allocated with new[] are not automatically destroyed when they go out of scope.
>>
>>58619941
Using malloc and free is not idiomatic C++ because it violates the concept of RAII

But an array of a POD type I agree, use malloc/realloc to shorten it.
>>
>>58619941
>C is only better at everything
ftfy
>>
File: 1482257252634.png (1MB, 1280x720px) Image search: [Google]
1482257252634.png
1MB, 1280x720px
So if C is too much of an hassle too make something worthwhile, what other tech can I use to make a desktop app? Java,C#,...?
>>
>>58619963
>it violates the concept of RAII
Which doesn't apply here, as I have pointed out.
>>
>>58619937
>guy who's giving shit to another guy for writing internet facing software, who probably is online themselves practically 24/7, but because of some greybeard pseudo-macho startup culture-backlash bullshit thinks its baby programming, or some shit
>>
>>58619966
Coq and Haskell; but mostly Coq
>>
>>58619941
std::vector is not "heavyweight"
Length and capacity is ***8-16 BYTES***
BYTES
That is NOTHING
You really want to fuck around with free() and MANUALLY CALL THE DESTRUCTOR (which should literally never be done unless youre implementing the inner functionality of a safe container, LIKE VECTOR) just to safe 16 bytes of fucking memory?
Fuck you
>>
>>58619937
I'm not a webdev.

Being able to work with an API is important for literally any programming role.

For example, a client wanted custom reporting on LogicMonitor data. I wrote an integration piece that pulls from their APIs and keeps historics on their VPN logs and other bits, and then merges that into a data warehouse used for company-wide reporting so it can be mashed up with some financial information. After that, I also set up a few automated alerts that trigger on excessive data use or if connections from the same account appear quickly at different geographical locations.

I'm genuinely curious, though. What makes you think that an API is only for webdev? Are you claiming that any time information is pulled in any format outside of your firewall, that you're doing "webshit" at that point?
>>
>>58619966
C#, C++, JavaScript, Java
>>
>>58619966
(D)
>>
>>58619966
Desktop, as in Windows? Or linux/mac?

For Windows,, c# hands down

For Linux i guess Java, but maybe Python is better

For Mac - i have no idea, maybe Objective C or Swift

I recommend learning c#
>>
>>58619966
use Swift
>>
>>58619979
>What makes you think that an API is only for webdev?
I said no such thing
>>
>>58619968
You come off as severely autistic
>>
>>58619966
C#/WPF is really easy to get up and running with.
>>
>>58619966
What are the requirements of this desktop app?

Portability? Speed? Dynamic content?

There isn't a Jack of All Trades for desktop apps.
>>
>>58619996
>I got told
indeed
>>
>>58620001
Only if you have an Indian Federation passport though :(
>>
>>58620005
>I deliberately misinterpret replies thus arguing a strawman argument so I can get the last reply in and have the final word
Got it.
>>
>>58620003
>There isn't a Jack of All Trades for desktop apps.
Anon, have you never heard about Electron? It's based on node so it can do anything!
>>
>>58619994
Then what do you mean by "webshit"?

Is it "webshit" if at any point one accesses data outside of their firewall?

What does your post even mean? It's clearly insulting, but I have no clue what you're actually trying to insult me with.
>>
>>58620019
>LITERALLY told
;^)
>>
class 


>>58619978
>You really want to fuck around with free() and MANUALLY CALL THE DESTRUCTOR (which should literally never be done unless youre implementing the inner functionality of a safe container, LIKE VECTOR) just to safe 16 bytes of fucking memory?
Don't use C++ if you aren't ready to exert a tiny bit of effort to profit from how memory works.

>>58619996
>>58620019
That's not me, but feel free to enlighten me as to how RAII applies for an array allocated with new[].
>>
>>58619978
yeah, you can implement in std::vector easily in C by prepending your buffer with some metadata and using malloc_size()/[your os alternative]
it's cheap
>>
>>58620020
>Simple calculator app, 5 processes, 50 megs each
Shiggy diggy
>>
>>58620024
just ask, don't be shy
>>
>>58620034
>That's not me, but feel free to enlighten me as to how RAII applies for an array allocated with new[].
I didn't say it was, I made a comment about generally avoiding the use of new/delete/malloc/free because it's not considered safe but that it in this specific case of a C string was appropriate.

Manually calling destructors is the wrong way to go about it though, why do something the compiler will automagically do for you by using proper C++ semantics?
>>
>>58620043
>muh rendering thread
>muh hardware accelerated gradient
>muh isolation
>>
>>58620034
Forgot to finish my code.
template<class T>
class ShortenableArray {
public:
ShortenableArray(size_t length) {
this->length = length;
this->data = new T[length];
}

~ShortenableArray() {
for(auto i = 0; i < this->length; i++) {
this->data[i]->~T();
}
free(this->data);
}

T &operator[](size_t index) {
if(index < this->length) {
return this->data[index];
} else {
throw std::out_of_range("You done fucked up");
}
}

shorten() {
this->length--;
this->data[this->length]->~T();
}

private:
size_t length;
T *data;
};
>>
aren't new and delete compiler dependent?
>>
>>58619978
>Length and capacity is ***8-16 BYTES***
bloat
>>
>>58620082
Their implementation is, yes.
>>
>>58620076
>and calculations run on a single thread
>>
>>58620061
>Manually calling destructors is the wrong way to go about it though, why do something the compiler will automagically do for you by using proper C++ semantics?
Because we've already established that that will lead to a double free. Instead of giving up and going with the less efficient std::vector solution, you can deal with destruction manually.
>>
>>58620091
do they use libc malloc() and free() underneath?
>>
>>58620078
You're reimplementing std::vector, although inefficiently.

Why?
>>
>>58620101
>separated from the UI thread
as they should
>>
Character recognition software.

>take photo/scan of handwritten words
>convert .png/.jpeg to .pgm
>program reads .pgm as text file
>segments image into individual characters
>pipe to neural network mapped to a TeX dictionary
>generate TeX markup, pipe to LaTeX and then to .pdf

Video related: https://www.youtube.com/watch?v=p1Fi0f1L3HQ

The above video is just the segmentation portion. Can see input image and output .pgms. It takes a long-ass time but it works more or less.

Some problems I'm trying to overcome:

>noise in image, esp. photographs: scanners work "OK", photos need major tinkering
>if words are written on a tablet or paint program, it works flawless, but what's the point, then?
>>
>>58620112
It's not a reimplementation. Where do you see capacity, pushing, reallocation?

Sure, you only save a few bytes, but a few bytes can be pretty significant for cache if they're part of every element of an array.
>>
>>58620119
they should get to run on more than one thread
>>
>>58620078
>>58620104
>less efficient std::vector solution
>you're literally literally reimplementing std::vector with less functionality and exception safety
This doesn't make any sense, anon.

>>58620106
It's implementation defined (so they can, but not necessarily).
>>
>>58620129
>but a few bytes can be pretty significant for cache
you don't even know what the fuck you're talking about
>>
>>58620078
This is the right way to go about this.
However you should implement iterator and proper container methods (size(), pop_back(), empty(), etc)
This way if the demands of the program change you can always swap out the class for a different one like std::vector, and the code will continue to compile
However its a lot of tedious work to write an entire container class just to squeeze out 16 bytes (work you could spend finishing more important parts of the code) so its probably best to just use vector and if it becomes apparent that you need a more efficient container, then you would change it (hence avoiding premature optimization)
>>
>>58620139
>std::vector with less functionality
That's the point.

>and exception safety
An exercise to the reader, irrelevant to the discussion.

>>58620153
>However its a lot of tedious work to write an entire container class just to squeeze out 16 bytes (work you could spend finishing more important parts of the code) so its probably best to just use vector and if it becomes apparent that you need a more efficient container, then you would change it (hence avoiding premature optimization)
To write an entire container to only use it once, yes. But you could do it for the specific use case in place with no issues.
>>
>>58620129
Are you autistic?

You're literally not saving any bytes, the code is not stored in the same part of memory as the object members. Only code that is actually used is included by the compiler, in addition to std::vector specialisation for POD types such as ints are basically malloc/realloc with a memset
>>
>>58620151
Finish the sentence.

>>58620171
std::vector has an additional field for the capacity.
>>
>>58620170
>That's the point.
No, it isn't. See >>58620171

You're not saving any bytes. std::vector<T> is literally a T pointer and a size_t
>>
>>58620106
yeah probably, or some for purpose designed replacement
>>
>>58620170
>my point is that it's useless and wrong
ok
>>
>>58620185
See >>58620184.

Well, it might not have an additional field for the capacity but if it doesn't then it's going to be super inefficient in general.

>>58620199
Less functionality means more assumptions and more optimization.
>>
>>58620204
>more assumptions and more fuckups
ftfy
>>
>>58620213
I'm proving a point, not demonstrating my ability to write tedious copy/move constructors and assignments or properly exception safe operations (though I'm pretty sure it is exception safe, just potentially leaky).
>>
>>58620185
ya c++ kids haven't heard of offsetof() and linux kernel style container_of() specifically, absolutely
another reason why you should learn c before you start trying to act like a c++ big shot baka
>>
>>58618212
I don't know what people have told you.
It's not good. But it's not a horrible broken mess. It's not buggy. It has a mostly consistent design.

You'd do best to avoid it but it's entirely workable. I wouldn't go looking for other API if I found I needed to poke at something.
>>
File: 1478880532694.jpg (274KB, 940x1123px) Image search: [Google]
1478880532694.jpg
274KB, 940x1123px
Is it true that you guy hate Javascript?
>>
>>58620129
Do you realize that pushing and resize methods add absolutely zero overhead if you never call them? You can use reserve() to specify size beforehand so that you wont cause a reallocation if you never push. Also, the standard library has a lot of very helpful things implemented that you forgot to and that you will probably implement incorrectly, like
- swapping entire containers
- correct copy constructor
- correct move constructor
- erasing mid container
- constructing from iterator range (e.g. for converting one type of container to a different type)
None of these features incur overhead if you dont use them. However youd waste a lot of time trying to implement them yourself. Good thing you saved those 8 bytes though, well done.
>>
>>58620233
>I'm proving a point
but we already knew you're a moron
>>
>>58620255
It's overused
>>
>>58620258
If the compiler can elide a field by inferring that it's never used (forgetting about undecidability and that boring stuff) then I guess you're right.
>>
>>58620078
This is unspecified behaviour

this->data = new T[length];

Using MVSC, this will create a an object stored as a length and a pointer.

free(this->data);

this will only free the object, not the actual array, thus be a corrupt free.

Do NOT mix malloc() and new and free() and delete, new/delete are implementation defined and you might end up with unspecified behaviour.

>>58620204
See above
>>
>>58620242
what about traps?
>>
>>58620267
Why is it overused?
>>
>>58620255
It's a bad language, but there are no alternatives.
>>
>>58620275
Then swap new[] with malloc and a loop calling the default constructor in place.
>>
>>58620258
>C++ doesn't incur overhead if you don't use it
ftfy
>>
>have learned new language from book
>sit down with an empty main function, a cup of hot tea and a heated blanket.
>don't know what to write or have any desire to explore functionality
What do? I want some challenge where I can facilitate D's fancy new features (contrasting C++) stuff to my advantage and feel good about having learned D.
>>
>>58620286
C, C++ and Rust compile to ams.js.
>>
>>58620304
>What do?
jerk it off to animu
>>
>>58620300
That's the claim.

Surprisingly true in a lot of cases thanks to the work of compiler devs but it's not true always. Not by a long shot.
>>
>>58620242
Code and data members are not stored in the same memory.

Also, offsetof() will lead to undefined behaviour on most class types.

Anyway, it's funny that you mention Linux kernel macros as I'm hacking on my own module right now.
>>
>>58620313
wasm doesn't (and never will) support the DOM. real useless if you're doing things that aren't webGL / crypto / computation heavy stuff.
>>
>>58620296
You're literally just implementing a less effective std::vector
>>
>>58620315
>jerking off
But I want to do that in D
>>
>>58620319
>it's not true always.
it's always true
>>
>>58620304
try writing a Forth interpreter (or x86 compiler for it..)

or just use the dpt roll thing: https://better-dpt-roll.github.io/
make sure to (ab)use D's amazing templates and metaprogramming, though
>>
>>58620326
asm.js and WASM can both call into JS, which supports the DOM.
>>
>>58620313
More like autism.js
>>
I decided to continue learning Racket. Even though Common Lisp is well... more Common, Scheme & friends seem to be easier.
>>
>>58620350
It's not anon. But I can't be bothered to elaborate so consider yourself right if you wish.
>>
>>58620106
See >>58620275
>>
>>58620348
Which doesn't store its capacity and thus is smaller. Assuming a cache line is 8 words, you can fit 50% more of them which is a big gain where it's needed.
>>
>>58620354
but you'll still be using javascript (with your own glue layer, at the very least). c/cpp/rust can target asm.js implied they can replace javascript in the browser when you'll still have to write/maintain shims and glue layers (or rely on others..)
>>
>>58620352
>telnet server
Well.. I don't see many ways to exercise the language in this but it should be a quick one.
>>
>>58620377
nice assumption faggot
>>
>>58620370
>It's not anon
it is
>I can't be bothered to elaborate
because it's impossible
>consider yourself right
I always am
>>
>>58620421
Well, no matter how big the cache line is you can fit 50% more.
>>
>>58620363
I'm a big Racket fan and I dont like Common Lisp... everything has fucked up naming in CL (prin1, princ, dotimes, mapcar) where as Racket is so clearly laid out.
>>
>>58620377
>saving a size_t
Premature optimisations are the root of all evil.

Also
>assuming std::vector has specific members
It's implementation defined, especially since vector::size() is always O(1) but no such guarantee is stated for vector::capacity() AFAIK
>>
>>58620383
Assuming all your client-side code is asm.js, you can simply use header libraries to define JS API functions, that get compiled to JS calls. So all you would have to do is include/import a library for browser APIs. I know that Rust has those.
>>
>>58620322
yeah offsetof() has requirements on what's it's used on
however that doesn't constitute any compiler and runtime implementation from not trivially having equivalent knowledge of any class layout internals
>>
>>58620437
>Premature optimisations are the root of all evil.
It may be a premature optimization, but it's not exactly a heavily involved one (unless you go full retard and implement the full structure with iterators and everything when you don't need it for your own code).

>It's implementation defined, especially since vector::size() is always O(1) but no such guarantee is stated for vector::capacity() AFAIK
In practice, it's usually an extra field. In theory, it might be no extra field, it could also be way worse. I suppose it would be possible, if it was based on malloc, to use the allocation size for the capacity, but there must be some reason they don't.
>>
>>58620437
>premature optimization
Well its defining the data. How much work do you have to do if you need to remove it later for performance reasons?

Usually it's the other way around though. But in general leaving yourself with a more limited set of data to maintain is a good way of keeping code malleable and efficient.

I hate people who mindlessly repeat what others say.
>>
I called my end-index variable endex, on a scale from Wozniak to Zukerberger how smart would you say I am.
>>
File: img.png (76KB, 900x773px) Image search: [Google]
img.png
76KB, 900x773px
>when a bunch of new code compiles the first time, every time
>>
Ok /dpt/, I fell for your memes.
I have some experience with programming.
What should I read first, K&R or SICP?
>>
>>58620473
>when you don't need it for your own code
How do you know you don't need it? What if you later realize the need for a move constructor? What if you fall victim to C++'s implicit copy and you go bug hunting for an hour because it wasn't correctly copied? What if your POD data that you free()'d suddenly owns a refcounted pointer and now you have memory leaks?
This is why premature optimization is called the root of all evil. Not because the optimization is difficult, but because it causes headaches down the road.
>>
>>58620473
> but it's not exactly a heavily involved one
You managed to write unspecified behaviour, which would potentially have you spend hours upon hours trying to figure out why it works with GCC but not with MSVC.

>In practice, it's usually an extra field
I agree

>. I suppose it would be possible, if it was based on malloc, to use the allocation size for the capacity, but there must be some reason they don't.
The reason is because it isn't any portable way of doing it. You, however, might do some inline assembly or mmap magic in order to retrieve it.

>>58620481
>I hate people who mindlessly repeat what others say.

I would say that replicating a subset of std::vector in order to shave of a couple of bytes is very much a premature optimization, especially when anon managed to write unspecified behaviour into his custom container class. In other words, it was the perfect example of why you should avoid spending time trying to optimize the most trivial things.
>>
>>58620481
it's good wisdom, i think, to prematurely optimize your data but not your code
>>
>>58620516
OP
>>
>>58620529
read both, quadruple the fun
>>
>>58620530
I was more implying not implementing it in a structure at all unless you need it more than a few times across your code.

>>58620536
>You managed to write unspecified behaviour
I don't use C++, so I don't know the specifics of a lot of things. I assumed new[] and delete[] were just malloc and free plus looping to call constructors and destructors.

So yeah, I see your point.
>>
>>58620536
>it was the perfect example of why you should avoid spending time trying to optimize the most trivial things.
I'd say you oppose microoptimizations then. If you care about performance there's no such thing as "premature optimization" because you need to think about it all the way through at different granularities.
>>
File: vsc.png (259KB, 1223x630px) Image search: [Google]
vsc.png
259KB, 1223x630px
>>58618092
Is Visual Studio Code a good IDE for C#?

I fell for the Visual Basic Studio meme, a monstrous 8GB install filled with tons of Microsoft nonsense, basically a billboard of ads and services. I want something simple and streamlined and this looks like the one.
>>
How can some languages not have memory addresses

it's a computer

you need them
>>
>>58620537
Data often implies what code is like at a fairly coarse level. It's a lot better to think that way than to think that "premature optimization" (which is an incredibly broad and fuzzy statement) is bad.
>>
For all aspiring game developers in /dpt/, just know that if you make an anime style video game, it might be banned from Twitch.

https://www.youtube.com/watch?v=hS6GLrM0mVA
>>
>>58620559
Well if you put a raw pointer array in any class then suddenly that class has incorrect copy semantics unless you write all of the RAII constructors yourself.
Or you could use a vector, ya know, like someone who isnt delusional
>>
>>58620588
They do, they're just hidden from the programmer at some level.
>>
>>58620582

Visual Studio is GOAT, though.
>>
>>58620582
It's not an IDE, just code editor.
>>
>>58620561
I do not oppose microoptimalizations, but I do oppose dismissing std::vector as memory inefficient based on an assumption that you're going to rapidly access a lot of them as a premature optimization.

In order to optimize, even microoptimize, you must always identify your bottlenecks. When you're saying that you need to "think about it all the way through at different granularities" you're literally saying the opposite of premature, because you're actually thinking it through.
>>
>>58620593
That guy is the biggest faggot. Have you ever seen the shit code he writes?
>>
>>58620597
Given the nature of C++ it's definitely easier to use an std::vector if it needs to interact with RAII like that.
>>
>>58620582
>>58620600

you fucking cucks...

enjoy your sabotaged compilers
>>
>>58620593

Shieeeeeet we wuz samurais n shiet
>>
>>58620613

What in god's name are you talking about?

>inb4 MSVC telemetry
>>
What is the relationship between being a good programmer, traps and anime?
>>
>>58620582
>Visual Studio Code a good IDE
I thought it was just an editor and they made that quite clear.
>>
>>58620558
>What should I read first
>first
>read both
I know, I want to read both, but which one is better to read first?
>>
>>58620561
you always profile first unless you think your and your codevelopers time is near worthless
just some small n percent of your code will spend spend 100-n running
>>
>>58620634
You need at least 90 hours of hardcore german trance to be considered even an entry level programmer.
>>
>>58620593
OMG, BASED TWITCH
>>
>>58620593
>anime
>banned from twitch
BASED
A
S
E
D
>>
@58620522
haha upvoted
>>
>>58620598

but that's fucked up

anyone who knows even rudimentary assembly knows computers are just turing machines with a tape and some operations

memory addresses are like half 1/4 of what computers do

computers are also 1/4 data, 1/4 conditionals/jumps and the other 1/4 is things you can do to manipulate data
>>
>>58620593
she has a very manly voice
>>
>>58620713
>anyone who knows even rudimentary assembly
Very few so-called programmers, unfortunately.
>>
>>58620649
I'm the guy that first mentioned premature optimizations, but it's not so simple that you can always do a profile - identify - optimize loop.

Anon is correct in that you always need to keep in mind what you are doing, like using SSE where it is appropriate, or using a cache-friendly data structure where that is appropriate etc.

I do support writing optimized code, but I am always more concerned with writing correct code. There are some pretty nice optimizations in C++ container classes, you should rely on the guys implementing GCC or Clang or whatever to know what the fuck they are doing and call standard library when it is appropriate.
>>
>>58620648
i meant reading both at the same time, intermitten
the juxtaposition of paradigms makes both far more interesting, and enhances their pedagogic effect
>>
>>58620601
>>58620613
>>58620644

I probably am asking the wrong question. Let me try again.

If I am new to coding, starting in C#, and absolutely tired of Microsoft jewery, is Visual Studio Code good?
>>
>>58620613
You're hating on Visual Studio for the sake of hating.
>>
>>58620634
Orthogonal.
>>
>>58620728
You can't get away from Microsoft Jewery with C#, C# is literally Microsoft.
>>
>>58620720
>>58620713
>every computer architecture has load/store semantics
What about virtual machines where you have a gazillion registers instead of load/stores ?
>>
File: 310px-Rust_on_iron.jpg (40KB, 310x207px) Image search: [Google]
310px-Rust_on_iron.jpg
40KB, 310x207px
>>58620721
>I do support writing optimized code, but I am always more concerned with writing correct code.
Given this particular discussion, Rust is really good at RAII. There's no rule of 0/3/5 nonsense. If your type has a destructor (which is recursive on fields), it's affine and always moved (which is just memcpy, since Rust doesn't allow objects to depend on their locations in memory and the type system prevents use-after-move) unless you explicitly clone() it. If not, it can be copied around, which is again just memcpy.

You only have to implement the destructor and cloning if you want that.
>>
Seriously hope you don't release you code under the meme GPL licence, /dpt/.

MIT > GPL
>>
>>58620748
Then the pointers are used when implementing the VM itself. Anything non-trivial-to-the-point-of-uselessness requires pointers on a von Neumann computer.
>>
>>58620721
i agree, in the sense that when you're not able to in the future to backport more optimized code, that it's worth it to consider complexities, and make an api promise to abide by those requirements
but this i feel this is only a consideration for end user facing library code
>>
>>58620774
>MIT, not BSD 2-clause

Might as well Kys, anon
>>
>>58620644
but it can run the compiler for you, has an integrated debugger,can run interface with your test runner and also has some refactoring (nothing as indepth as R# but thats not VS either, but rather a (paid) extension)..

mousing over things (like var statements) show their real types, has cross-project (full-solution) goto symbol and basically the same autocomplete as vs2013 and above (thanks to omnisharp and roslyn..)

sounds like an IDE to me :)

but for >>58620582
it works okay, as long as you're not doing anything with winforms or wpf (unless you really like doing everything from the code-behind and never touch the designers), or wcf or any of the mobile/crossplatform tools in vs2017. also doesn't give you the nice dao/dto stuff for iis express (or iis7+). uh, it doesn't really generate projects or solutions for you but if you use the new json format (.net core-style) its not bad to set up new stuff. nor does it have that nice tfs integration.

tl;dr its good enough for console, library and limited asp.net stuff.
>>
>>58620774
I don't. GPL is for chumps.
>>
>>58620728

You are doing the absolute worst language in the absolute worst environment if you are tired of microcuck and there bullshit

get ubuntu (you don't have to get rid of windows if you are hesitant)

then get code blocks

then learn c or c++ with GCC/G++

>>58620736

I'm hating because I don't like microsoft

they did literally just get caught sabotaging the compiler for C++ in visual studio, so they deserve it
>>
>>58620766
Indeed. Modern C++ variants also have correct move and copy semantics, which means that the second you introduce a raw pointer, you violate this and need to start re-implementing every RAII constructor yourself.
>>
File: pepe_enough.jpg (14KB, 316x202px) Image search: [Google]
pepe_enough.jpg
14KB, 316x202px
>>58620745
But C# is what a lot of people use!

Assuming I want to be a coder, is Visual Studio Code a good way to MINIMIZE the amount of shit I get from Microsoft?

Cmon guys, I want to learn but I don't want to do it with jew cock down my throat.
>>
File: file.png (27KB, 372x373px) Image search: [Google]
file.png
27KB, 372x373px
>>58620728
I have no clue but just look at the way they advertise it.
All these buzzwords.

Why would you use an editor like that when you can use the very rookie friendly and simple Atom editor.
Visual Code is also 'Microsoft jewery'.

I have a sneaking suspcision that you might not quite understand what your concerns are if you're thinking of moving from visual studio to this thing.

You presumably still want a compiler for C#.
>>
>>58620774

I prefer Apache2 for everything.
>>
>>58620805
this is the worst advice btw
>>
>>58620805
>then get code blocks
Qt Creator is better than Code Blocks imo, even when you don't use QT.
>>
A.php
$foo = "bar";


B.php
require 'A.php';
var_dump($foo);


Why does this result in nothing more than int(0)?
>>
>>58620806
C++ doesn't understand moving, though, so you need every "managing" type to support a null object which you can use when you move out of it since the destructor still gets called.

Rust completely prevents using something after it's been moved.
>>
>>58620745
>>58620805
>>58620807
what about mono, roslyn or dotnet core?
>>
>>58620782
>Then the pointers are used when implementing the VM itself.
So? I can implement the VM in hardware if I want.

>Anything non-trivial-to-the-point-of-uselessness
Well, yes. But that wasn't the point.

>>58620794
>but this i feel this is only a consideration for end user facing library code
I disagree, because there is always some poor sucker that needs to maintain your code after you move on to something else or get hit by a bus and proper semantics helps you express your original intent and design.
>>
>>58620845
>what about memes
>>
>>58620848
>I can implement the VM in hardware if I want.
Then it wouldn't be a von Neumann computer (which is generally inferred if you just say "computer").
>>
>>58620848
>I can implement the VM
no, you can't
>>
>>58620851
an argument other than just calling them ebin mémés?
>>
>>58620848

> VM in hardware

so... not a virtual machine, just a machine?
>>
>>58620878

non-virtual machines will never catch on.
>>
>>58620862
>Then it wouldn't be a von Neumann computer (which is generally inferred if you just say "computer").
True

>>58620868
Someone can.

>>58620878
Technically, yes. The JVM has several hardware implementations, and there are both virtual and actual Lisp machines.
>>
File: 1423430088363.jpg (37KB, 497x305px) Image search: [Google]
1423430088363.jpg
37KB, 497x305px
>>58620812
>I have a sneaking suspcision that you might not quite understand what your concerns are if you're thinking of moving from visual studio to this thing.

I agree.

I just want something that will work. That's all. I don't want to spend a week learning the history of computer programming. I'm trying to get off the Microsoft dick in the meantime, so the last thing I want is a Microsoft product.

Is Atom what I'm looking for? Does it have a compiler?

Should I be learning C++ instead of C#?
>>
>>58620911
Atom is just a text editor with fancy plugins, like Emacs, it doesn't come with a toolchain.

Pretty sure you're autistic FP shill trolling again, the style and mannerisms are identical.
>>
>>58620911

You want Mono
>>
>>58620911
I feel you anon. Computers have gotten overly complicated. If this were the 80's you'd have just written your programs and they would run.

But now you have a toolchain to deal with before you start doing anything.

I'm not a C# programmer but I suspect your best bet is just dealing with Visual studio. Your editor doesn't really help you that much.
Atom is just an editor, much like Visual code, it doesn't help you. They're just for typing in code better.

>should I learn C++ instead?
No probably not.
>>
>>58620911
Try out Qt Creator senpai.
>>
>>58620812
>buzzwords
Do you know what a buzzword is?

It is literally free and open-source, and other things you underlined are specific OS packages.

>>58620728
>>58620911
If you are new to programming, starting in C#, Visual Studio is the absolute best IDE for it.

Visual Studio Code is very nice, and you can certainly get by in it, but most major books and tutorials of any sort are going to be utilizing Visual Studio to help you program. VS is part of virtually all C# developers' workflow.

C++ is also a fine language to learn first, but be aware that it is going to be more difficult to use than C#, and doesn't have some of the nice tools like Xamarin.
>>
>>58620840
global $foo?
>>
File: 1444475596795.jpg (266KB, 905x881px) Image search: [Google]
1444475596795.jpg
266KB, 905x881px
>>58620941
I'm not trolling. I'm an idiot who's looking to get away from Microsoft, and learn to code. These two things are unrelated, they're just occuring simultaneously.

While trying out Visual Basic Studio, I was tricked, yes, literally tricked into signing up for something called Azure.

The next day, after a computer shutdown, I booted up VBS to practice coding, went to start a C# project like I had the previous day but there was no option of C#. None at all. I'd already been cucked twice, in the span of two days.

I want to live in the proverbial woods, far away from Microsoft and all their Jewish business practices.
>>
>>58620971
It's the sole content in A.php, and is required in a class method from B.php.
>>
  if(args.length>=2){

}
else
{

}

Why is this so much better than
  if(args.length>=2)
{

}
else
{

}

?

I don't get it. #2 just looks ugly to me.
>>
>>58620941
don't \x0xF0\x0x9F\x0x91\x0x8F use \x0xF0\x0x9F\x0x91\x0x8F autist \x0xF0\x0x9F\x0x91\x0x8F as \x0xF0\x0x9F\x0x91\x0x8F a \x0xF0\x0x9F\x0x91\x0x8F derogatory \x0xF0\x0x9F\x0x91\x0x8F term
>>
>>58620966
>If this were the 80's you'd have just written your programs and they would run.

I wish we could go back to the Amiga days.
>>
>>58620774
I use AGPL for web servers and MIT for everything else.
>>
>>58621012
if args.length >= 2 {

} else {

}
>>
>>58621012
you get used to it; it's cultural
working with other people, always use whatever style is the common denominator, or a standard
>>
>>58621012
} else {
>>
>>58621012
Both are heretic tier.
This is the one >>58621046
>>
>>58621067
That one doesn't even compile.
>>
>>58621082
What language are we compiling here?
>>
>>58621089
Any that require "(condition)" for their ifstatements.
>>
if and while are not functions
>>
>>58621088
please don't be racist on this inclusive and safe board
>>
New thread:

>>58621095
>>58621095
>>58621095
>>
>>58621100
yes, they are
>>
>>58620955
Can you link me friend? "Mono" is pretty broad to google, I don't want to download just anything.

>>58620970
>If you are new to programming, starting in C#, Visual Studio is the absolute best IDE for it.
then why did the option to start a new C# project literally VANISH from my options in the span of a day?
>>
>>58620911
Atom and VSC both use Electron.

a bit of history: Microsoft made VSC originally as a web-based "cloud" editor called Monaco to leverage their soon-to-be released language Typescript and the massive changes they made to the C# compiler and turning it into a compiler-as-a-service (Roslyn). Around the same time Github has an opportunity to get into the editor meme game 'cause of people bitching about Sublime Text and its lack of regular updates (a few per year, basically). and Sublime Text's price tag. So they created Electron using ideas gained from node-nw (which reimplemented shoes (ruby gui framework) with nodejs) but embedding chromium/v8 and node.js with some native api stuff. Then they used it as a basis for Atom (also there's some Sparkle stuff, the (at the time) recent hire of some Windows guys to help work on Github for Windows -- which taught them a lot of lessons about supporting things that aren't called OS X). Microsoft then took Electron and fixed a fuckton of amateur mistakes (read: tons of optimizations) while porting Monaco to it, creating Visual Studio Code. Atom is still extremely sluggish and slow when it comes to anything other than 1-2 documents, while VSC feels almost as fast as Sublime Text.

as for C# and mono: VSC and Atom (and emacs and vim) have plugins that use the great OmniSharp project (basically "intellisense" (code completion) and refactoring + other things dealing with parsing of the language and tooling) along with Roslyn (and Cecil..). So any of those editors can deal with C#, but they'll never provide the coherence of Visual Studio -- which since VS2008 has been massively shaped around C# (lock-step development and C# being the massive selling target for VS).

personally I've used both Emacs, VSC and Atom for doing C# work. VSC is the easiest / least amount of friction, Atom is similar but feels like a weak port of the VSC extension. I normally use VS for real development and Emacs for minor changes/bug fixes.
>>
>>58620124
That sounds neat
>>
>>58621100
Are you saying parenthesis are somehow intrinsicly associated with functions?
>>
>>58621116
Try "mono C#".
>>
>>58621123
forgot to mention during my rambling that you can use those free editors with mono, dotnet core and .net clr

but if you're scared of microsoft pulling the rug out from under you, or vendorlocking you then you probably should stay away from C#... (the ECMA standard is rather old now and C# 7 still won't update it -- and Microsoft bought Xamarin and technically owns Mono (but most of Mono is under MIT and the newer stuff is under the .NET CLA)
>>
>>58621082
It could be Go.
>>58621088
Did you just assume my race?
>>
>>58621200
Terry?
>>
>>58621200
>shit opinion
and now you're sexually harassing me?!
>>
let's say that I wanna conquer the world one day. how would I start doing that if my starting point is jobless with a masters degree in software engineering?
>>
>>58621355
make 2d into touchable 3d.
>>
>>58621355
Conquer by force or just whatever arbitrary route into being official ruler of the world (earth?)?
>>
Let's talk Go.

There's this culture in the community which demands you only use the core/standard libraries, and always make your own solution. Sounds great for /g/ right?

Now take web applications, and routing/mathcing URL's. Sure, the "net/http" package works marvelously. You can use it, and people do. A lot. They follow the advice they're given precisely. They make their own solutions. The result? There are now DOZENS of routing implementations that are all ALMOST THE EXACT SAME where none offer any real benefit over the other besides often negligble performance boosts.

If you want to use an existing solution, good fucking luck finding the best one. Enjoy parsing dozens of documents.

fucking gopher faggots
>>
>>58620610
Nope. Care to provide a link to some of his source?

>>58620716
Pretty sure that developer's male, Anon.
>>
>>58622288
So basically the same situation as in JavaScript, can it be safe to assume that Go is just the JS of compiled languages?
Thread posts: 328
Thread images: 16


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