[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: 329
Thread images: 19

File: CfZiWjQW8AAbYUW.jpg (127KB, 600x863px) Image search: [Google]
CfZiWjQW8AAbYUW.jpg
127KB, 600x863px
old thread: >>59057215
What are you working on, /g/?
>>
trying to make a JSON parser for school
>>
>>59060949
I love this meme.
>>
>>59060989
/g/ working on things?
>>
>>59060989
:3333
>>
>>59060996
No, the skirts.
>>
haven't done much programming because my job is obsessed with the docker meme lately
>>
What's the easiest way to make an inner class object aware of an outer class member in C++?
>>
>>59060944
>>59060983
>>59060855
I figured out the solution.

So, to generate a psuedorandom sequence of unique pairs, we need to make an assumption: the range of x and y in the tuple (x,y) are the same, meaning that they both go from 0 to n.

Literally all you have to do is generate a psuedorandom unique integer sequence with a maximum value of n*n, and then x = f[i] / n, y = f[i] % n.
The psuedorandom unique sequence generator would be written according to the blogpost: http://preshing.com/20121224/how-to-generate-a-sequence-of-unique-random-integers/
Boy, that was easier than I thought it would have been.
>>
>>59061021
dependency injection by passing the outer class into the inner class

https://en.wikipedia.org/wiki/Dependency_injection
>>
>>59061026
This solution is O(1) in time AND memory complexity by the way.
>>
Rate my tic tac toe made in python 3
pls be gentle senpai
# Tic Tac Toe Try 2
#Define space object
class Space:
def __init__(self,x,y,S=0):
self.x = x
self.y = y
self.S = S
def __str__(self):
if self.S == 1:
return "X"
elif self.S == 0:
return " "
elif self.S == -1:
return "O"
else:
return "Error"
def update(self,n):
self.S = n
#Lists with the 9 spaces
SPACE1L = [Space(1,1),Space(1,2),Space(1,3)]
SPACE2L = [Space(2,1),Space(2,2),Space(2,3)]
SPACE3L = [Space(3,1),Space(3,2),Space(3,3)]
#Board printing function
def printboard():
board = '''
y
|
|3|%s|%s|%s|
|2|%s|%s|%s|
|1|%s|%s|%s|
|1|2|3|--x ''' % (SPACE3L[0],SPACE3L[1],SPACE3L[2],SPACE2L[0],SPACE2L[1],SPACE2L[2],SPACE1L[0],SPACE1L[1],SPACE1L[2])
print(board)
#Function that checks for line of three
Statuzer = lambda x: x.S
def checker():
S1L = [Statuzer(x) for x in SPACE1L]
S2L = [Statuzer(x) for x in SPACE2L]
S3L = [Statuzer(x) for x in SPACE3L]
D1L = [Statuzer(x) for x in [SPACE1L[0],SPACE2L[0],SPACE3L[0]]]
D2L = [Statuzer(x) for x in [SPACE1L[1],SPACE2L[1],SPACE3L[1]]]
D3L = [Statuzer(x) for x in [SPACE1L[2],SPACE2L[2],SPACE3L[2]]]
DiaRL = [Statuzer(x) for x in [SPACE1L[2],SPACE2L[1],SPACE3L[0]]]
DiaLR = [Statuzer(x) for x in [SPACE1L[0],SPACE2L[1],SPACE3L[2]]]
for a in [S1L,S2L,S3L,D1L,D2L,D3L,DiaRL,DiaLR]:
global PWON
if sum(a) == 3:
PWON = P1NAME
return True
if sum(a) == -3:
PWON = P2NAME
return True
else:
pass
#Winner function
def winner():
if k == 0:
print("Congratulations %s you won!" % (PWON))
else:
return
>>
>>59061039
cont
#Get Coordinates from Input Function
k = 0
def askcord(ps):
global k
checker()
if checker():
winner()
k = 1
else:
avail = ["1","2","3"]
if ps == 1: det = P1NAME
elif ps == -1: det = P2NAME
print("Please enter a coordinate (Player %s) (x,y):" % (det))
rawcord = list(input("> "))
cord1s = [n for n in rawcord if n in avail]
if len(cord1s) != 2: askcord(ps)
cord1s = [int(x) for x in cord1s]
if cord1s[1] == 1:
if SPACE1L[cord1s[0]-1].S == 0:
SPACE1L[cord1s[0]-1].update(ps)
printboard()
else:
askcord(ps)
elif cord1s[1] == 2:
if SPACE2L[cord1s[0]-1].S == 0:
SPACE2L[cord1s[0]-1].update(ps)
printboard()
else:
askcord(ps)
elif cord1s[1] == 3:
if SPACE3L[cord1s[0]-1].S == 0:
SPACE3L[cord1s[0]-1].update(ps)
printboard()
else:
askcord(ps)
else: askcord(ps)


printboard()
#Ask for names
P1NAME = str(input("Player 1 Name: "))
P2NAME = str(input("Player 2 Name: "))
askcord(1)
askcord(-1)
askcord(1)
askcord(-1)
askcord(1)
askcord(-1)
askcord(1)
askcord(-1)
askcord(1)
if not checker():
print("Game end, Nobody won")
>>
Is posting broken
>>
>>59061074
Clearly.
>>
>>59061039
>>59061045
professional python programmer here.

- work on your variable names. things like S1L and S2L don't make any sense. good code doesn't need comments because you can tell what it does from variable names and control flow
- proper scoping of data. stay away from the global keyword
- lot's of if/else statements is a kind of code smell; there is most likely a simpler way of doing things
- you have lot's of "magic numbers" (eg. sum(a) == 3)in your code; stay away from them or make constants for them to show they are special

https://en.wikipedia.org/wiki/Magic_number_(programming)#Unnamed_numerical_constants
- lot's of repetitive code like [Statuzer(x) for x in blah]
>>
>>59060949
BIP 44 Derivation paths for our product
>>
I'm getting the impression the rust devs are synthetically targeting the benchmarks game programs to make it look faster than they do in the real world.
>>
>>59061087
Everybody does that tho.
>>
>>59061039
Your x row comment is triggering my autism, it doesn't line up.
>>
>>59061084
>>59061084
But how can I reduce the quantity of if/else?
Was thinking on defining a function but I would prefer to read what would you do
>>
#include <iostream>
#include <string>
#include <functional>

class Foo
{
public:
Foo() {
arry[0] = "foo";
arry[1] = "bar";
arry[2] = "baz";
arry[3] = "qux";
}

// template <typename T>
// void each(T func)
// void each(const std::function<std::string (std::string ele)> &func)
void each(std::string (* func)(std::string ele))
{
for(int i = 0; i < size; i++) {
func(arry[i]);
}
}

int size = 4;
std::string arry[4];
};

int main(void)
{
Foo foo;

foo.each(
[](std::string str) -> std::string {
std::cout << str << std::endl;
return str;
}
);

return 0;
}

Reposting this from previous thread, having issue with C++ lambdas. There are 3 member functions called each in the class Foo. The 2 that are commented out seem to work fine. The one that is not commented out causes a runtime error. What am I missing here? It feels like something stupid.
>>
>>59061133
>C++
Why on earth would you use that shit?
Also, I doubt that a C++ lambda is compatible with a function pointer.
>>
>>59061103
Maybe the maintainers of jruby or some trash, but the previous top 3 have been consistent for years but in two weeks rust jumps from #4 to #2? I'm dubious.
>>
>>59061126
it usually means you need to come up with a better algorithm. you built a program around an algorithm that handled a few cases, but now you have to use a bunch of if/else statements to handle everything else.
>>
>>59061142
>>59061142
>>C++
>Why on earth would you use that shit?
cause I wanna make money
>>
>>59061143
>for years
Rust has been stable for less than two years, it takes some time for people to come up with implementations that are competitive with benchmarks for languages that have been around for decades. There's no reason for Rust to be slower.
>>
>>59061126
>>59061148

so let me give you an idea of where you could take this...

instead of seeing tic-tac-toe as a cartesian graph that has X's and O's in it what if we saw it as a matrix of just 0's and 1's? what if we had a matrix for player 1 and matrix for player 2? could we use matrix math to compute intersections and so on?
>>
>>59061177
>matrix operations
>in python
>>
socialism doesn't work, neither does gpl
forcing people to do a certain thing never works
it's why there's barely any contributions to open source
>>
>>59061133
> The one that is not commented out causes a runtime error.
It works just fine - https://ideone.com/lJdnsz . What compiler/version do you use?
>>
Which is better for fibonacci.

Number 1:

#include <iostream>

using namespace std;

int main() {

int r, ft = 0, s = 1, f = 0;

cout << "Enter range for terms" << endl;
cin >> r;
cout << "Series up to " << r << endl;

for ( int t = 0; t < r; t++ ) {

if ( t <= 1 )

f = t;

} else {

f = ft + s;
ft = s;
s = f;

}

cout << f << endl;


return 0;
}


or

Number 2:

#include <iostream>
#include <vector>

using namespace std;

typedef unsigned long long int ULL;

const int MAX_N = 93; // fibonacci(94) goes beyond the range of ULL

ULL fibonacci(const int &N, vector<ULL> &fiboMemo) {
if (N == 0 or N == 1)
fiboMemo[N] = N;
else if (!fiboMemo[N]) {
fiboMemo[N] = fibonacci(N - 1, fiboMemo) + fibonacci(N - 2, fiboMemo);
}

return fiboMemo[N];
}

void getN(int &N) {
cout << "Enter the value for N (max. " << MAX_N << ") : ";
cin >> N;

if (N < 0 or N > MAX_N) {
cout << "Invalid value! N should be between 0 and " << MAX_N << ".\n";
getN(N);
}
}

int main()
{
int N;
getN(N);

vector<ULL> fiboMemo(N + 1, 0);

cout << "\nFibonacci(" << N << ") = " << fibonacci(N, fiboMemo) << "\n";

return 0;
}
>>
>>59061196
Both are retardedly over complex for fibo.
>>
>>59061143
So they came up with a more efficient code, it doesn't mean there's some sort of conspiracy. Rust is a compiled language without GC with LLVM backend, there is no inherent reason it shouldn't be on par with C/C++.
>>
>>59061196
you should learn haskell, which is objectively the #1 lang for writing fibonacci
>>
>>59061039
>>59061045
the win condition checker makes me sad.
i suggest you make one that can test n in a row in an x*y grid and just set them all to 3 in the beginning so you can easily make the game more customizable
>>
>>59061173
The two weeks part is the interesting part. It wasn't incremental increases over months.
>>
>>59061196
no this one is
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
>>
Any of you faggots signed up for https://hashcode.withgoogle.com/ ?

You do compete, don't you?
>>
>>59061237

No.
>>
>>59061234
Nice exponential solution you have ther.e

>>59061196
Holy fuck, your code is hideous.
>>
>>59061243
>he doesn't compete
>>
>>59061237
>unironically doing Google's work for free
>>
>>59061226
That's because they updated the regex library used in regex-dna to a newer and faster version and replaced the standard library (unordered) hashmap in k-nucleotide with a insertion-order preserving hashmap (Literally a drop-in replacement). These two small changes made Rust first in both benchmarks.
>>
>>59061133
>void each(std::string (* func)(std::string ele))

Why is the function parameter returning a string? Unless I'm missing some functionality you're looking for in returning a string (and it doesn't look like it looking at the way you're calling it), just make it a void function:
#include <iostream>
#include <string>
#include <functional>

class Foo
{
public:
Foo() {
arry[0] = "foo";
arry[1] = "bar";
arry[2] = "baz";
arry[3] = "qux";
}

// template <typename T>
// void each(T func)
// void each(const std::function<std::string (std::string ele)> &func)
void each(void (* func)(std::string ele))
{
for(int i = 0; i < size; i++) {
func(arry[i]);
}
}

int size = 4;
std::string arry[4];
};

int main(void)
{
Foo foo = Foo();

foo.each(
[](std::string str) -> void {
std::cout << str << std::endl;
}
);

return 0;
}


also interesting is that it compiles under clang but not under gcc. It's a grey-enough area such that I've literally never seen somebody try to use a lambda function with a function pointer in my 5 years working.
>>
Hey tic tac toe guy. Check this link out and compare it your own program. See how you can improve.

https://inventwithpython.com/chapter10.html
>>
>>59061298
That is fucking awful. It's overcomplicated as fuck.
>>
>>59061312
That because it is a tutorial you retard. It is supposed to be complicated for teaching certain concepts. Doesn't mean the implementation of certain functions are bad. If you don't compare your code with others good or bad, you will never learn.
>>
>>59061322
>It is supposed to be complicated for teaching certain concepts
That's fucking ass-backwards. Teaching materials should be simple and well-written.
You're going to give the impression that this is how you should write code.
>>
>>59061191
>It works just fine - https://ideone.com/lJdnsz . What compiler/version do you use?
g++ 5.4.0 was crashing for me after printing foo. I compiled using VS2013 on another computer and it ran fine. Go figure.

>>59061262
>>59061262
>Why is the function parameter returning a string? Unless I'm missing some functionality you're looking for in returning a string (and it doesn't look like it looking at the way you're calling it), just make it a void function:
I originally had the returned string getting assigned to something, but I removed it for clarity. Was the original code crashing for you at all using gcc or clang?
>>
What's the easiest way of implementing a fully-functional binary search tree? With a collection of structs?
>>
>>59061248

It's not my code. It's code from a github project. I was just asking lol.
>>
>>59061328
It is over complicated for a tic tac toe program but the logic and design steps are sound. Of course these steps are meant for more complex programs but they use tic tac toe as an example because it is a tutorial and people understand the concept of tic tac toe.
>>
>>59061347
Yes.
struct bst {
int data;
struct bst *left;
struct bst *right;
};

is literally all you need.
The actual trick to it is height-balancing.
>>
PYTHON HELP
so I have
    if "good" or "great" in choice:
print("Glad to hear that!")
start()
elif "bad" in choice:
print("Sorry to hear that "+username+"...")
start()
else:
print("Sorry I didn't recognize that")
start()

but it wont output Sorry to hear that "+username+"..." when I put bad been happening since I added if "good" or "great" in choice:

did I retard it up? what did I do wrong?
>>
>>59061344
Yeah, crashed when I compiled with gcc but ran fine with clang.

I wonder if it would crash using a primary type rather than a string. It didn't crash with void
>>
>>59061262

Also worth asking is why we're passing std::string by value and not by const reference.
>>
>>59060949
When I use fork() in C/C++, does the kernel allow me to take advantage of multiprocessing without any additional effort on my part?
>>
>>59061352
Just skimming over the code, I'm seeing all sorts of travesties.
Duplicated code.
Not taking advantage of loops in some situation.
Using poinless loops in other situations.
Using strings when some sort of enumerated type is more appropriate.
Pointless functions.
Being written in memesnek.
And so on.
>>
>>59061387
>without any additional effort
No. Now you have IPC to deal with, which is not a trivial thing to do.
>>
>>59061363
elif means else if
If good or great has been detected it will skip lines with else
>>
Convince me that using void pointers as numbers is wrong (example below)

#include <stdio.h>
#include <stdlib.h>

typedef struct VectorList
{
int size;
int count;
void **data;
} VectorList;

VectorList *Vector_create(void)
{
VectorList *vector = malloc(sizeof(VectorList));
vector->count = 0;
vector->size = 0;
vector->data = NULL;
return vector;
}

void Vector_add(VectorList *vector, void *element)
{
if(vector->size == 0)
{
vector->size = 8;
vector->data = malloc(sizeof(void*) * vector->size);
}
if(vector->size == vector->count)
{
vector->size *= 2;
vector->data = realloc(vector->data, sizeof(void*) * vector->size);
}
vector->data[vector->count] = element;
vector->count++;
}

int main(void)
{
VectorList *vector = Vector_create();
int i;
Vector_add(vector, (void*)5);
Vector_add(vector, (void*)44);
Vector_add(vector, (void*)3);
Vector_add(vector, (void*)50);
Vector_add(vector, (void*)5);
for(i = 0; i < vector->count; i++)
{
printf("Element %d is the number %d\n",i,vector->data[i]);
}
}
>>
>>59060949
Can someone explain this stupid meme?
>>
How does python development work?
For my job I said, "yeah learning python should be easy," because purely from a programming perspective it shouldn't be that difficult to pick up.
but then I was like
>fucking packages
>fucking fragmented versioning system
>fucking shitty IDEs
>fucking having to use Python 2 and 3 at the same time
What masochist uses this language for actual software engineering and how do they do it?
>>
>>59061396
tried changing the elif to an if and it still has the same problem, have i misunderstood you?
>>
>>59061387
>>59061387
Well you won't lock or run into concurrency errors or anything (assuming you're only accessing local variables), but unless you have a clever way of dividing up the problem in a fundamentally parallel way, you're probably just running a bunch of duplicate threads doing duplicate things. Which isn't exactly what I would call "taking advantage of multiprocessing."
>>
>>59061410
Pycharm is fine. Legacy code is always cancer and because it is my job.
>>
Do any of you dudes have an interesting project idea for a multilayer system? Need to pick a semester long project for school
>>
>>59061387
Yes, the kernel tries to distribute the load evenly on all cores, so it will schedule the new process on an idle core if it has one.
>>
>>59061387

fork() creates a second process that is an exact copy of its parent. The kernel should allow both processes to be scheduled simultaneously if need be. However, since they are both different processes, they cannot share the same address space. They will need to communicate through some other means, such as IPC sockets, pipes, etc...
>>
>>59061418
>but it wont output Sorry to hear that "+username+"..." when I put bad been happening since I added if "good" or "great" in choice:

Explain this sentence again since I get the impression you want bad to happen if good or great are also present in choice.
>>
>>59061248
>exponential
lmao fucking idiot
>>
>>59061433
no I want it to say "Glad to hear that anon" if the user inputs a sentence containing good or great so like "doing good" or "I'm doing great" or any variants containing good or great, but if the user puts bad in the sentence it says "sorry to hear that anon..."
>>
>>59061387
I'd tell you ``Just use MPI'', but then I realized you're probably a student.
Good luck fgt you're gonna need it
>>
>>59061446
>but if the user puts bad in the sentence it says "sorry to hear that anon..."
should say I want it to say "sorry to hear that anon"
>>
>>59061453
>>59061446
Ah I see. Easy.
Here if what you think is happening:
If (good or great) in choice
What is really happening:
If (good) or (great in choice)

Or is for two conditionals
Not for combining 2 conditions
>>
>>59061402
cause you'll be wasting space in a 64-bit environment

and also the practice is horrid unless you have an explicit reason why you need to do it
>>
>>59061402
It's inelegant, cast-heavy shit.
>>
>>59061481
formatting like this solved it
>If (good or great) in choice
thanks anon
>>
>>59061402
Why don't you just use C++, this shit is easier, safer and more efficient with templates.
>>
>>59061431
Ruby senpai, I really love D lang. Please say some good things about it.

>market share
I never care about it, I dualboot Linux and FreeBSD
>>
>>59061501
>sepples
>ever
go away nobody likes you.
>>
>>59061495
You can also use the find method to make it clearer. So
 
if choice.find("good") or choice.find("great):
>>
>>59061507
>I don't want my code to be cleaner, safer and more efficient because memes
Whatever you say, bud.
>>
>>59061524
>template mess makes you code cleaner
Were you always retarded or did programming in sepples turn your into one?
>>
>>59061536
if you think templates obfuscate code, git gud

thats really all there is to it
>>
>>59061487
Well, if I wanted to use that data structure for say, a list of numbers, then my alternative is to either modify it to use macro templates, or malloc(sizeof(int))

Or, more relevant was using a struct that was basically a generic action:
typedef struct 
{
void (*callback)(void *data);
void *data;
} Generic action;

that had a function pointer and then a void data pointer that could be anything, and the function pointer would have to interpret it. So I was thinking I could skip allocating more RAM for the integer and use the void pointer.

>>59061507
Sometimes I think that would be nice but I'm in a strange situation where C++ might be slow (working on 486)

(Sorry for bad formatting I'm phoneposting right now)
>>
>>59061559
Post acknowledged.
Opinion discarded.
>>
>>59061559
>That spacing and formatting
It's no surprise that the fucking sepplesfag is a redditor.
Piss off.
>>
>>59061559
Haskell polymorphism is much better than C++ templates
>>
>>59061573
>templates make ur code messy

>"hurr its much cleaner in >>59061569 's situation to use either function pointers or a whole mess of macros"
C autists everybody
>>
>C
Why isn't C banned yet? Why are idiots circlejerking about retro trash language like C?
>>
>>59061602
t. Rust code artisan
>>
>>59061559
>>59061586
For instance

template <typename T, typename R>
vector<R> map(std::function<R(T)>, vector<T>);
//n.b. i am ignoring qualifiers, enable_if and other stuff necessary to use non-std::functions, etc

haskell:
(t -> r, Vector t) -> Vector r
>>
>>59061605
t. turbo expert super secret kernel hacker of 4chen
>>
>>59061605
I prefer the term 'code cuckold', thank you very much
>>
File: Screenshot_2017-02-21-23-58-15.png (212KB, 1080x1920px) Image search: [Google]
Screenshot_2017-02-21-23-58-15.png
212KB, 1080x1920px
How to trigger /dpt/ and simultaneously show that you're capable of earning money, unlike the /dpt/ autists: the image
>>
File: 1474227596647.gif (607KB, 800x792px) Image search: [Google]
1474227596647.gif
607KB, 800x792px
>>59061614
get on my level faggot
>>
I'm born in the wrong generation. I wish more of my generation would appreciate C. 80's was the best XD
>>
>>59061621
>not in java
>>
>>59061621
I'm only triggered that you haven't replaced your stock Samsung ROM
>>
File: autismlevels.jpg (32KB, 420x322px) Image search: [Google]
autismlevels.jpg
32KB, 420x322px
>>59061623
What level are you currently?
>>
>>59060949
What is this source of this picture?
>>
>>59061621
>unironically doing if cond return x else return y
>>
>>59061618
This.

Rust is communist trash. C is for uncucked white men and not controlled by kikes
>>
File: 2017-02-22-104832_558x438_scrot.png (42KB, 558x438px) Image search: [Google]
2017-02-22-104832_558x438_scrot.png
42KB, 558x438px
>>59060949
Wrote my script in dash, want to integrate it in screenfetch, Gentoo release already there, but still can't find how to add new entity.
>>
>>59061646
grandad have you had your meds yet?
>>
>>59061569
There are alternatives to what you're currently doing. You just need to use the language features correctly.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

struct vec {
size_t size;
size_t taken;
size_t capacity;
unsigned char data[];
};

struct vec *vec_new(size_t memb_size, size_t capacity)
{
struct vec *v = malloc(sizeof *v + memb_size * capacity);

if (!v) {
// Maybe handle this differently
perror("");
exit(1);
}

v->size = memb_size;
v->taken = 0;
v->capacity = capacity;

return v;
}

void _vec_add(struct vec **vec, void *data)
{
struct vec *v = *vec;

if (v->taken == v->capacity) {
v->capacity *= 2;
v = realloc(v, sizeof *v + v->size * v->capacity);

if (!v) {
// Maybe handle this differently
perror("");
exit(1);
}

*vec = v;
}

memcpy(v->data + v->taken * v->size, data, v->size);
v->taken++;
}

#define vec_add(vec, type, val) do { \
assert((*vec)->size == sizeof(type)); \
_vec_add(vec, &(type){ val }); \
} while(0)

void *_vec_get(struct vec *v, size_t i)
{
if (i >= v->taken) {
// Maybe handle this differently
exit(1);
}

return v->data + i * v->size;
}

#define vec_get(vec, type, i) *(type *)_vec_get(v, i)

int main(void)
{
struct vec *v = vec_new(sizeof(int), 2);

vec_add(&v, int, 2);
vec_add(&v, int, 7);
vec_add(&v, int, 10);

for (int i = 0; i < v->taken; ++i) {
printf("%d\n", vec_get(v, int, i));
}

free(v);
}

There isn't a whole lot enforcing type safety, but your solution had the same problem.
>>
>>59061518
the best way to do this is:
if choice in ("good", "great")
since
 if "string" or "other" in iterator
just becomes
 if True or "other" in iterator
>>
>>59061675
you might as well write c++ if youre going to abuse macros like that
>>
File: 1469302035515.png (463KB, 716x647px) Image search: [Google]
1469302035515.png
463KB, 716x647px
>>59061646
>implying C isn't a Mossad psyop designed to maximize amount of security vulnerabilities in software
>>
>>59061757
>abuse
How is that "abusing" macros?
I just chucked compound literal on the argument, so that integer literals could be passed into the function.
>write c++
That would be one of the last languages I would choose to use.
I would design and implement another programming language before I use that clusterfuck.
>>
>>59061784
Well said anon
>>
>>59061675
>storing datatype size at runtime
>checking it on every insertion
Wow, for a C-fags you don't care about memory or performance at all. Neither do you care about type safety as long as types have the same size, or code maintainability. But hey, at least this isn't C++, amirite?
>>
you guys seem to hate every programming language

which languages do you not hate?
>>
>>59061820
C#
>>
>>59061815
When posting C code on place riddled with sepples fags you have to assert that they don't go changing the values of struct fields. Otherwise they will do that and claim that C is shit because the struct can't be protected with private:
>>
>>59061815
>memory
What do you even mean? Memory is being handled properly in my code.
>performance
What exactly is unperformant with my implementation?
>type safety
Yes, I'm aware that my code isn't type safe.
It's really just one of those "it's UB to use another type" situations.
>as long as types have the same size
This is just a very trivial protection that may catch some of the more basic errors.
>maintainability
What's unmaintainable about it?
Are you implying that C++ template clusterfucks are maintainable?
>But hey, at least this isn't C++
Exactly.
>>
File: rust_power.png (49KB, 600x400px) Image search: [Google]
rust_power.png
49KB, 600x400px
>>59061820
/dpt/ actually likes Rust, except for a couple of raging autists.
>>
>>59061820
C, except when I need more safety.
Go, except when I need generics.
Rust, except when I need two mutable references to the same variable.
TypeScript, except when I need performance.

Every language has a lot of benefits, but there are always those one or two cons that make you hate it.
>>
>>59061848
Performant is not an English word, Hans.
>>
File: Paris_2010_-_Le_Penseur-620x330.jpg (37KB, 620x330px) Image search: [Google]
Paris_2010_-_Le_Penseur-620x330.jpg
37KB, 620x330px
Are our brains self-hosting interpreters for the languages we know?
>>
>>59061965
As mentioned in >>59061995 I actually quite like rust, except for 2 pain points:
- No non-lexical lifetimes yet.
- I can not have 2 mutable references to the same variable. Before you go claiming that's unsafe, 2 mutable references are fine, as long as neither of the references escapes the thread. I've had problems replicating very simple stack-only algorithms, that simply do not compile in Rust, because the compiler can not understand, that the referenced variables would never be modified concurrently.
>>
>>59062053
JIT compiler, execution is done by God.
>>
>>59061848
I was just comparing your implementation with a trivial std::vector.
>memory
You waste size_t per vector to store size of an element instead of keeping it at compile time.
>performance
You waste time checking this size on every insertion, and all of this because of
>type safety
This is the root of your problems, without templates you can't have real type safety, so you have to waste memory, performance and make half-assed size checks just to get somewhat closer to what you get out-of-the-box with std::vector.
>What's unmaintainable about it?
Lots of macros, unintuitive API with explicit typing everywhere, ad hoc checks instead of true type safety.

So, to reiterate, std::vector is more memory efficient, faster, has true type safety and more intuitive api, but hey, it's C++ so fuck all these things.
>>
>>59061965
>black and red
Fuck off.
>>
>>59062042
It's valid and widely-used jargon.
>>
File: redblacktree.png (11KB, 406x283px) Image search: [Google]
redblacktree.png
11KB, 406x283px
>>59062085
What's wrong with red and black?
>>
>>59062099
The context you used it in. Don't even pretend you don't know what I mean here. Your little mind games won't work on me.
>>
>>59062067
> - No non-lexical lifetimes yet.
I feel you.
> - I can not have 2 mutable references to the same variable.
The idiomatic way is to use RefCell. I know it looks kinda ugly at first, but it works pretty well. I don't think it's possible to have the borrowchecker working otherwise.
>>
>>59062115
I didn't make or post that logo, I was just asking a question.
>>
Hello guys
I want to pick up a Object-Oriented programming language. Which one would you recommend for learning?
>>
>>59062160
Haskell.
>>
>>59062160
>>59062160
Elegant Objects, the ultimate OOP language: http://eolang.org/
>>
>>59062142
So? Do you have to make the original image to send a message? If I just find a random picture with some sentence that fits the current discussion, would you just ignore it since I wasn't the original creator?
>>
>>59062067
>- No non-lexical lifetimes yet.
What for? Can't Box solve that? What would you base the lifetime on exactly if not lexically?

>I can not have 2 mutable references to the same variable.
That may not only be a question of safety, but also of caching access: if you know there's no ro reference and only 1 rw reference to an int, and it's the one you have, you can keep the transient value is the int in a register and only commit it to memory when you give the reference back no? That's the point of the
restrict
qualifier in C I believe. http://en.cppreference.com/w/c/language/restrict

> very simple stack-only algorithms
Which ones? I'm curious.
>>
File: CSUEf0kUwAAoqFo.png (50KB, 600x400px) Image search: [Google]
CSUEf0kUwAAoqFo.png
50KB, 600x400px
>>59062186
Wow, chill the fuck out, bro. He didn't post >>59061965, I did. I've found picrel on google and then I realized it's too close to you-know-what to post it without a little fix. No mind games, just a little joke.
>>
>>59062125
>RefCell
>runtime costs
>unsafe
>panics on error
What's the point then?
>>
>>59062248
>What for?

See the problem cases non-lexical lifetimes would solve: http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/
>>
>>59061965
Rust confirmed for Nazism.
>>
What are the main state affecting operators that can be used kind of like this(i'm including call as an operator)?
testou = 1;
eat(testou);
testou += 2;
>>
Is talloc the answer to the C memory management question?

#include <stdlib.h>
#include <immintrin.h>
#include <talloc.h>

int main() {
char *a = talloc_strdup(NULL, "Hello");
a = talloc_strdup_append(a, " , World!");
unsigned short r;
_rdrand16_step(&r);
if (r < 0xffff/2) {
int *x = talloc(a, int);
*x = 5;
printf("%s, %i\n", a, *x);
} else {
printf("%s\n", a);
}
talloc_free(a);
}


Seems perfect for independent requests/calls where you have alot of dynamic allocations and want to make sure you cull everything in the end without an
goto errorN;
orgy.
>>
>>59062317
???
>>
>>59062340
I'm really confused on how to ask this question?
I'm trying to parse a language, and i'm doing some basic string searching for operators and i'm to figure out what operators to look for.
>>
>>59062278
RefCell itself is pretty safe. I mean, it has some unsafe code inside, but so does Vec and everything else. You can use try_borrow if you don't want panics, but since it's strictly single-threaded you can be pretty sure it won't panic once you tested the code.
>What's the point then?
Safety. Also it's not like you have any choice.
>>
>>59062362
so do you mean like + - * / >> << ^ & | ~
>>
>>59061965
This
>>
>>59062375
yes
>>
>>59062248
>What for? Can't Box solve that?
What if the value is on the stack? You are then needlessly pushing it onto the heap.
>What would you base the lifetime on exactly if not lexically?
Inferred.
>That may not only be a question of safety, but also of caching access: if you know there's no ro reference and only 1 rw reference to an int, and it's the one you have, you can keep the transient value is the int in a register and only commit it to memory when you give the reference back no? That's the point of the restrict qualifier in C I believe. http://en.cppreference.com/w/c/language/restrict
Yes, but that should be an opt-in or opt-out, not simply impossible.
>Which ones? I'm curious.
It was a stack-allocated struct, that was modified from a for loop in the function and also modified itself through method calls. The struct did not escape the function, so the compiler should have been able to infer, that any mutable references to the struct could not ever conflict. Don't have the code with me anymore.
>>
>>59062315
It's strange that you see "nazism" there and not something totally different and more associated with rust.
>>
I want to learn Rust but there is no book for a beginner.
>>
>>59062374
>it's not like you have any choice
The other option is to wait for Rust to mature a few more years and stick to the more functional C/C++ or Go (in some cases) instead.
>>
>>59062449
there is though
>>
>>59062449
What about https://doc.rust-lang.org/book/ ?
>>
>>59062449
Don't bother, Rust isn't worth learning anyway.
>>
>>59062467
Link?
>>59062474
It doesn't have exercises.
>>59062475
Fuck off, every language is worth learning.
>>
Is asm for the insane like they read ancient forbidden knowledge from a Lovecraft story?
>>
>>59062489
not really
>>
>>59062487
>Fuck off, every language is worth learning.
Yes, once it is actually finished. Rust was released prematurely. Wait 3-5 more years.
>>
>>59062487
>Fuck off, every language is worth learning.
Wrong.
>>
>>59062487
>It doesn't have exercises.
which are fucking pleb garbage. use the K&R ones if you need them so much.
>>
>>59062516
>>59062475
>le veteran programming language expert and kernel engineer at Nasa
>>
>>59062500
Oh, so it's just an exaggeration by people who don't use asm.
>>
>>59062538
>he's mad no one is using his language like he intended
>>
>>59062538
>Nasa
CERN actually, but whatever.
>>
>>59062545
asm itself isn't hard, interfacing with c libraries is harder, but it isn't nigh impossible like everyone acts like it is. you'll really just be missing the lack of proper data types.
>>
>>59062563
What sophisticated fizzbuzz project are you employed on? Is NASA happy to find your level of purist expertise in ANSI C89?

Are you implementing the newest Fibonacci algorithm in C using the undefined behavior to run faster than assembly?
>>
>>59062593
>What sophisticated fizzbuzz project are you employed on?
It's confidential.
>Is NASA happy to find your level of purist expertise in ANSI C89?
I work for CERN, not for NASA.
>Are you implementing the newest Fibonacci algorithm in C using the undefined behavior to run faster than assembly?
Not quite.
>>
>>59062593
I am currently uncucking NASA with my unique pointer dereferencing skills in C. At time I am getting rid of all the blue pilled code base there already was and introducing to the functional paradigm of C89 to them.
>>
>>59062489
>Is asm for the insane
yes
>>
>>59062618
>functional paradigm of c89
pgud
>>
>>59062628
This is something beyond functional, I like to call my method of C programming "Dis functional C" which only works with C89 standards. Produced binaries are unstable but I pride myself in assuming the users of the binaries know what they are doing.
>>
File: ASLL.png (47KB, 604x503px) Image search: [Google]
ASLL.png
47KB, 604x503px
I'm pretty sure this is a linked list, not a tree anymore.
>>
>>59062656
Would you write your own pacemaker in C89?
>>
>>59062672
Excuse me sir, do you have a moment to talk about ANSII C? You should not use any other languages and they are not worth learning
>>
>>59062680
Currently I am working on a hello world project in x86 asm which has inline C codes. My job doesn't late me do any other projects. My private bitbucket repository has 200 lines of sophisticated C codes that follows POSIX
>>
>>59062727
Trash language, what it does is probably wrong.
>>
I was writing my own kernel in C89 last week, it went pretty okay but I could not compile it using GCC's LLVM backend
>>
>>59062742
Watch it, cuck!

I wrote 5 AIs and 13 compilers with my C89 with my self defined dysfunctional C89 POSIX standards.
>>
>>59062748
Epic dude! Have you tried compiling your code by hand? It usually makes your binaries slightly less stable but the optimization by undefined behavior is worth it.
>>
>>59062792
Actually it's pretty stable. The TCP/IP stack is written in machine codes and it uses my Deep Learning algorithm written in C89.
>>
>>59062460
>wait for Rust to mature
This won't happen in your lifetime. Just write in C.
>>
>>59062813
>This won't happen in your lifetime
I'm a time traveler though.
>>
>>59062813
How many blue pills do I have to take before learning C to produce ultra sophisticated expertly written pure C hello world?
>>
If I'm not mistaken, he wrote it in C++, making the project immediate garbage.
>>
>>59062792
Forgot to mention: I'm using C
>>
I'm using C btw
>>
>>59062848
You take the other kind of pill for C.
>>
>>59061187
>barely any contributions to open source
WTF are you on about? The majority of the Linux kernel has been written by companies as big as Google, Samsung, Intel, IBM, etc. Many open source projects have hundreds or thousands of active contributors.
>>
>>59062865
>>59062882
Just letting you know: I'm using C
Use C
>>
Using C tho
>>
using C here. feelin' pretty good
>>
>>59061621
Please use C
>>
>>59062932
I'm using C btw
>>
Guys how can I average two integers?

FYI I'm using C :DD
>>
File: 1486170337578.jpg (106KB, 593x578px) Image search: [Google]
1486170337578.jpg
106KB, 593x578px
Terry Davis writes a complete kernel, assembler, disassembler and compiler on a single monitor with 640x480.

/g/ """needs""" 3x 30" screens for failing at FizzBuzz
>>
>>59062965
false
>>
>>59062965
Terry Davis sucked his brothers cock, jerked of to his cousin like a true redneck, put his dick inside a dogs mouth and severely autistic as well.
>>
itt: https://www.youtube.com/watch?v=XHosLhPEN3k
>>
>>59063007
Please remove this jewtube link and uncuck yourself by writing a C code for a fizzbuzz that counts upto 100
>>
>>59062965
>complete kernel, assembler, disassembler and compiler on a single monitor with 640x480.
Still less usable than Emacs lol
>>
>>59061576
>calls someone a redditfag for splitting post into two lines
>in a post split into two lines
>>
>>59063061
Who are you quoting, plebbitor?
>>
File: Rustacean flag.png (18KB, 4096x2048px) Image search: [Google]
Rustacean flag.png
18KB, 4096x2048px
>>59061965
>>59062271
Obviously you meant to post this.
>>
>>59063093
>[s4s] memes
Thanks for confirming your redditor status
>>
>>59063093
ur mum :DDDD
>>
>>59063108
>[s4s] meme
Plebbitor confirmed. You can proceed to deport yourself from this website.
>>
Why is C such a trash?
http://hmarco.org/bugs/CVE-2015-8370-Grub2-authentication-bypass.html
>>
Anyone have an idiot-proof step by step tutorial on how to create a cryptocurrency?
>>
>>59062792
>optimization by undefined behavior
get a load of this cuck
>>
>>59062999
Yet you fail to write a compiler, kernel or something of similar complexity :)
>>
>>59063133
C isn't trash. You are trash for relying on other people's code. Real men write their own code on their own hardware.
>>
>>59063173
Watch it, cuck!

I wrote 5 AIs and 13 compilers with my C89 with my self defined dysfunctional C89 POSIX standards.
>>
>>59063173
>compiler
>complexity
only if you're some kind of mentally deficient plebian.
>>
>>59063133
80's language had no concept of safety checks
>>
>>59063194
Speaking of mental deficiencies, it's spelled "plebeian".
>>
>>59063173
>what is OSdev
why are you trying so hard, autismo manchild?
>>
>>59063173
Other people have done it without sucking brothers cock, jacking off to sister and touching a dog with dicks
>>
Is there any reason to use one of these over the other? Is there any difference?

namespace Bar
{
int var;
int fun();
}


class Bar
{
public:
static int var;
static int fun();
}
>>
>>59063237
Use C
>>
I'm using C btw
>>
I generally like python for fast scripting but recently I had to study numpy and honestly it makes me kinda sad.
looks at this for example:
import numpy as np

def smooth_win(x, h, datas):
arg = np.exp( -np.abs(x - datas)**2/(2*h**2) )
return np.sum(arg)/(datas.size*np.sqrt(2*np.pi)*h)

dataset = np.array([4, 5, 5, 6, 12, 14, 15, 15, 16, 17])
h=2
smooth_win_vfun = np.vectorize(smooth_win, excluded=["datas"])
p_x = smooth_win_func(x, h, datas=dataset)
plt.plot(x,p_x)


Every operation on a numpy array is made through some built-in function, in the previous example:

you have "element-wise" operations between numbers (int, floats, etc) and numpy arrays:
x-datas

this return an array which elements are "x-data[i]" (x is an int).


You calculate the sum of a the elements of an array, or get its length with:
np.sum(arg)
datas.size



If you want to "apply" a function on every element on an array, instead of iterating on the array, you do some kind of mapping:
def smooth_win(x, h, datas): # x,h are ints, datas a numpy array
...

smooth_win_vfun = np.vectorize(smooth_win, excluded=["datas"])
p_x = smooth_win_func(x, h, datas=dataset)

The "np.vectorize" "mapping" will iterate on the "x" array, passing one element at time to the "smooth_win" function, then it returns a numpy array containing the result of every iteration.
Note the "excluded" option, which make sure to pass the entire "datas" array instead of iterating on that one too, it works by making some kind of hashing to recognize the correct variables once you actually call smooth_win_vfun (haven't looked at the code yet).


Honestly it feels weird, it's like using some kind of programmable calculator. You don't get more "high level" of this.
>>
>>59063258
Why are you not using C instead? It's a red pilled language
>>
Why do Python docs suck so much?
They only give you the bare minimum of information.
What about fuckin' exceptions? Return values?
How can any widespread language have such shitty docs? Even fucking Prolog is better documented.
>>
>>59063267
C has not exceptions or return values.
>>
>>59063200
What? Because any normal person is born with inherent knowledge of how to spell Latin?
>>
>>59063237
Can't
using namespace Bar; 
on the class. Both are pretty close tho. Not sure how a SEPPLESfag would realistically defend the scission.
>>
>>59063245
Fuck off.
>>
>>59063289
>t. webfag nu-male
USE C
>>
>>59063289
How about shilling your shitty language somewhere else?
>>
>>59062680
I would write my own pacemaker in Common Lisp.
>>
Just use C and nothing else
>>
>>59063258
>Honestly it feels weird, it's like using some kind of programmable calculator. You don't get more "high level" of this.

What were you expecting?
numpy caters to scientist with very limited knowledge about programming. In what it does it is very successful.
>>
Guys help
Can you find me a web browser that does not use nu-male languages like JS or python etc
>>
>>59063281
You shouldn't be
using namespace
anyway.
>>
Which are more cancerous rust shills or c# shills?
>>
>>59063304
*GC starts*
*dies*
>>
>>59063322
C toddlers
>>
>>59063334
Your kernel is written in C
>>
>>59063322
Rust shills. C# is actually good and deserves to be shilled. Rust is a meme and cancer and a tool of propaganda of the SJWs, having them around will bring down western civilization and they must be stopped.
>>
>>59063350
Your browser isn't, how about you close and remove your browser then?
>>
>>59063350
Just because Linus is a good programmer doesn't make you any less of a cancerous C toddler.
>>
>>59063360
>C# is actually good
Sanjay my son
>>
>>59063360
>C#
>Good
Oh hi pajeet
>>
>>59063383
C# is made by Microsoft, an American company that makes America strong and is in America, and created by Americans.
>>
>>59063396
IN AMERICA
>>
File: 1469018259252.png (661KB, 1366x768px) Image search: [Google]
1469018259252.png
661KB, 1366x768px
>>59063396
>an American company that makes America strong
LOL
https://www.inverse.com/article/27165-microsoft-amazon-fight-trump-muslim-ban
>>
>>59063310
I don't know honestly, during my bachelor's is physics I had two courses about programming (one about data analysis and another about numerical computations).
In both of them we used C/C++ (with cern's ROOT library). It's somewhat strange that they step back to python's numpy for a more advanced course about data analysis, but I do understand that there are good reasons to do that.
>>
>>59063360
Is Rust the reason all western women are all promiscuous sluts who wont fuck me?
>>
>>59063429
Yes, rust is the reason why you are still a fat virgin
>>
Why are C toddlers so mad today?
>>
>>59063382
So you're basically admitting that in order to use C effectively you have to be a good programmer and if you can't do that yyou might as well off yourself?
>>
>>59063462
>y-you might as well off yourself
post boipucci
>>
Guys, how can I print all the even numbers from 1 to 100?

I'm using C if that mattes
>>
>>59063462
#REKT
>>
>>59063462
No, i'm saying that C is a decent language, and so is C++ and many other languages, but using any of those doesn't automatically make you a good programmer and if you can't do that you should shut the fuck up.
>>
>>59063391
I've been working on some GUI stuff in C#, it's pretty funny that all the tutorials out there are written by pajeets. Honestly though I can't think of a better language for GUI stuff. As a language C# is eons ahead of Java, plus it has bindings to most native toolkits.

Fuck, I should really just give in and learn C++/Qt.
>>
>>59063586
>that C is a decent language
>C
>Decent
lmao what does the autist mean by this?
>>
>>59063594
C++ is nothing like C#
>>
>>59063426
They step back to Python's numpy because that is what most data analysis companies are using. That is it. You can have a 10 times faster way to implement code but if your company says no you are fucked.
>>
>>59063594
Qt is teh horror.
>>
What games do you play guys?
>>
>>59063617
There are some similarities.
>>
>Java

How do I call a method outside of main ?
I have a little method called printCats that should print "cats" but it doesn't. Do I need to add a return type ?
   
main....
{ printCats() }

printCats(){ println "cats"}


IT compiles and runs but does nor print to screen.
>>
>>59063603
>should be banned
>the weaboo opinion is important
bwahahahahahahaha
>>
Fuck, i picked a bad time to post a question on /dpt/. I stepped right into a shitposting period.
>>
>>59063329
I'd just opt for a Lisp without GC.
>>
>>59063594
>better language for GUI stuff
delphi
>>
>>59063666
>>59063666
Use C
>>
>>59063639
Have not played anything in weeks, but every once in a while I play a few hours of 100% Orange Juice and then go back to not playing anything for weeks. It's a very simple game and good to relax with.
>>
>>59063683
>shitposting period
There's no shitposting period. There's only shitposting.
>>
>>59063683
>implying it ever ends
>>
>>59063693

Me: Sir, I have my homework. It is written in C.
Prof: This is Intro to Java
Me: Yes.
>>
>>59063677
Isn't it ironic that most C toddlers in /g/ are weebshits

>>59058606
>>
>>59063617
Where did I imply that it was? I'm just thinking it'd be nice to deploy a cross platform app without a managed runtime. The only real options there are C (GTK+) or C++ (Qt).

>>59063625
Honestly it can't be any worse than GTK.

>want to display a list of items
>make a treeview
>add column to tree view
>add cell renderer to column
>bind columns to model
>bind model to tree view

Then when you want to get the current selection of your "list" you get to iterate over a tree datastructure. Whee.
>>
NEW THREAD WHEN?
>>
>>59063639
I'm waiting for battle borthers to release pre-RC beta before I start my new campaign.
>>
>>59063727
>app
lad...
>>
>>59063732
When post limit is hit.
Duh
>>
>>59063727
LAZARUS
A
Z
A
R
U
S
>>
>>59063713
There's alway *some* shitposting, but i've had some very useful help from /dpt/ in the past. It's why i keep coming back.
Today though the shitposting is drowning out any reasonable conversation.
>>
File: C5QFc0hWYAAumsR.jpg (75KB, 1200x675px) Image search: [Google]
C5QFc0hWYAAumsR.jpg
75KB, 1200x675px
>>59063766
WHEN IS THAT?
>>
>>59063727
>>59063594
USE C
S
E

C
>>
>>59063795
310
>>
>>59063795
When you find gensokyo
>>
>>59063727
I've never used GTK, but my impression was that it can't be worse than Qt.

Honestly, Qt is pretty good for what it does as a language, but that's just it: it's pretty much it's own language. It needs it's own precompiler, for fucks sake.
>>
>>59063906
>it can't be worse than Qt
you'd be surprised
>Qt is pretty good for what it does as a language
it does fucking everything; it's not only its own language, but also its own platform; the GUI toolkit is only a small part of Qt
>>
>>59063322
Rust shills, because they actually ruin the thread
>>
>>59063992
Fuck off pajeet
>>
>>59063992
Use C please
>>
>>59064023
Sorry nobody wants to use your dumb language
>>
>>59064049
I know you are slipping in your C# shilling agenda pajeet, you are not fooling a single soul
>>
>>59063804
It's not really about picking a language, it's about picking a UI toolkit that has a snowball's chance in hell at running on the four operating systems I use daily. I don't really care what language I have to write in.

>>59063780
Actually that looks pretty legit. I was just reading about Delphi the other day too. If there's Pascal bindings for libpq this might actually work.

>>59063906
That's my biggest beef with C/C++, compilation always ends up as a project-specific nightmare with a Makefile that looks like an Eldritch horror. I guess I've become pretty damn spoiled by Cargo/Maven/Gradle/Bundler et al.
>>
>>59064060
I don't use C#
>>
>>59063278
Why are you using words than you can't spell? :)
>>
>>59063360
>C# is actually good
LOL

https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=java&lang2=csharpcore
>>
>>59064078
That was a fine demonstration of backpedaling, pajeet. How will they ever notice?
>>
>>59064092
>using either Java or C# for arbitrary performance-critical algorithms
>>
>>59064080
Because archaic spelling.
>>
>>59064107
>of backpedaling
That would imply I mentioned being a C# user. Do you even know what backpedaling means? I thought Rust users were supposed to be smart.
>>
>>59064142
>I mentioned being a C#
You sure didn't, cheeky pajeet :^)
>>
>>59064142
Why are you responding to shitposts/bait?
>>
>>59064142
>>59064164
>resorts to samefagging
who knew
>>
>>59064163
>You sure didn't
Confirmed retarded, you don't even know what you're saying now
>>
>>59064194
Didn't work Microsoft, you can go now
>>
>>59060949
Meta question

Why is /g/ so obsessed with cross dressing?
>>
>>59064069
>Pascal bindings for libpq
just write your code logic in whatever you want, export a C api, build GUI in whatever you want, wire it with whatever ffi (everything has a C ffi); it falls apart if the core of the application IS the UI though (eg. something like photoshop/krita/cad/whatever-complex-custom-drawing) and you're forced to use the UI's language for everything
also: http://wiki.freepascal.org/postgres#Direct_access_to_PostgreSQL
>biggest beef with C/C++, compilation always ends up as a project-specific nightmare with a Makefile that looks like an Eldritch horror
well, it doesn't have to be; simply most developers are cargo culting idiots; cargo/gradle/etc fixes the problem by offering a less flexible opinionated build system
>>
How much do you all make your C development jobs?
>>
Hello /g/ents

friendly reminder that if your brain is too small to use Rust, then
you should head on back to >>>/v/.

cheers
>>
>>59064218
Because it makes you a better programmer, duh. Haven't you been paying attention?
>>
>>59064255
>Rust
Nice try, pajeet.
>>
File: trap programmer.jpg (2MB, 1700x2470px) Image search: [Google]
trap programmer.jpg
2MB, 1700x2470px
>>59064218
>>
>>59064232
>cargo culting
What does this mean in this context?

I know what a cargo cult is but don't see how that applies to /dpt/.
>>
>>59064218
/a/ is leaking, they don't program and just spread their shit around.
>>
>>59064272
assert_eq!(you, brainlet)
>>
Post your zygohistomorphic prepromorphism implementations in C.
>>
>>59064248
Java programmers are employed
>>
A N A L

N

A

L

Made a python script to make these. Get user's word as an argument when running from the terminal.

import sys
def meta():
loop = 0
string = sys.argv[1]
for c in string:
print(c + " ", end="")
print('\n')
for x in string:
if x == string[0] and loop <= 0:
pass
else:
print(x + "\n")
loop += 1
meta()
>>
New thread:
>>59064420
>>59064420
>>59064420
>>
>>59064392
int i = 0;
i--;
>>
>>59064294
https://en.wikipedia.org/wiki/Cargo_cult_programming
it means they don't know exactly what the fuck they're doing, they're simply doing it because "hey, someone else did it this way! let's copy that configure.ac and simply add our files to the SOURCES= line"; that's how you get to the present day when a pure C application build takes 5 minutes with useless checks like seeing if you have a fortran compiler installed and weather it supports various dialects of the language
>>
Why the fuck are all these graduate job interviews so god damn shit.

why don't they test on your ability to think about and solve problems, instead of asking me random trivia bullshit along with stupid HR questions like "what is your greatest weakness". I feel like such a clown firing off these stupid rehearsed lines like some sort of robot
>>
>>59064488
But that's pretty much all programming. Programming modern is way too complicated to fully understand everything that's going on. Calling people idiots for that seems a bit harsh.
>>
>>59064553
Because programming is teamwork and they want to get a sense for how your personality will fit in the team.
>>
>>59064570
>Programming modern is way too complicated to fully understand everything that's going on
it's dangerous to get comfortable with that thought; because when shit breaks (and it does, as history shows again and again) who's going to fix it? how about we take a step back, remove the worthless fluff and make systems that can be reasoned about? unfortunately the trend seems to be on piling shit on top of shit til the day UEFI rom is an electron app; I fear that day
>>
>>59064677
A thing i always say is that
>If i don't reinvent the wheel, i won't understand how the wheel works.
I like to understand things as deeply as i can. The problem with that is i spend all my time doing things that's already been done, and nobody wants to pay me for that.
>>
https://github.com/ableiten/Doggo

this
>>
>>59063666

I had to go learn classes but i got it sorted. thanks r/programmingQuestions
xoxo
Thread posts: 329
Thread images: 19


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