[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: 252
Thread images: 15

What are you working on, /g/?

Old thread: >>59301737
>>
File: CIA3.gif (3MB, 280x358px) Image search: [Google]
CIA3.gif
3MB, 280x358px
first for /bane/?
>>
>>59314495
Are you a weeb, /g/?
>>
File: 1389567984959.png (123KB, 600x811px) Image search: [Google]
1389567984959.png
123KB, 600x811px
>>59314512
>Asking people on a weeb website if they're weebs
What a pointless question.
>>
Ask an employed Haskell programmer anything.
>>
>>59314690
Do you work in the finance industry?
>>
On wednesdays we kode

#include <stdio.h>

long int x_to_the_n (int x, int n)
{
int i = 1;

do{
x = x * x;
++i;
}
while (i < n);

return x;
}

int main (void)
{
long int x_to_the_n(int x, int n);

printf("2 to the 2 = %ld\n", x_to_the_n(2,2) ) ;
printf("3 to the 2 = %ld\n", x_to_the_n(3,2) ) ;
printf("4 to the 2 = %ld\n", x_to_the_n(4,2) ) ;
printf("6 to the 12 = %ld\n", x_to_the_n(6,12)) ;

return 0;
}
>>
>>59314690
What language do you use at work?
>>
>>59314721
If you were trying to implement of power function, you did it wrong.
>>
>>59314836
>of
a*
>>
I got tricked into reading Zed Shaw to learn python

His explanations are all a bit weird and since I started the book I've heard he's a bit of a meme. It also seems a bit too simple for me personally. But whatever, I'm halfway through so I might as well finish.

Here's some code he writes for one of the examples:

def bear_room():
print ”There is a bear here.”
print ”The bear has a bunch of honey.”
print ”The fat bear is in front of another door.”
print ”How are you going to move the bear?”
bear_moved = False

while True:
choice = raw_input(”> ”)

if choice == ”take honey”:
dead(”The bear looks at you then slaps your face off.”)
elif choice == ”taunt bear” and not bear_moved:
print ”The bear has moved from the door. You can go through it now.”
bear_moved = True
elif choice == ”taunt bear” and bear_moved:
dead(”The bear gets pissed off and chews your leg off.”)
elif choice == ”open door” and bear_moved:
gold_room()
else:
print ”I got no idea what that means.”



He's not explained "while True" very well, just said that it results in an infinite loop, which is a pretty obvious, useless and tautological explanation.

I have a question about it. In python, does a function call cause the infinite loop to break then? Typically I'd be used to a break; after the function calls in order to exit the loop.

Basically I don't quite understand how the infinite loop is being broken, and he's not explained it anywhere. My limited knowledge of programming tells me that infinite loops are dangerous and need to be properly exited with a break or something that causes a break.

What breaks an infinite loop in python? And what specifically is breaking the loop here? The function calls? It seems weird that a function call would break a loop without "break" being explicitly stated.
>>
>>59314870
Python has a break statement that works the same way it would in C.

Most likely, the program stops when dead() is called, but to be sure of that, you would have to look what's inside the dead() function.
>>
"Oh, downloading a file via PS is simple, it's just"
 $client = new-object System.Net.WebClient
$client.DownloadFile("http://www.xyz.net/file.txt","C:\tmp\file.txt")

What the fuck is this, maybe I should just download wget for windows?
"Count to 10:"
 PS> for($i=1; $i -le 10; $i++){Write-Host $i} 

Eh... I feel like downloading files manually could be faster at this point.
And "-le" is a comparison because "<=" is atrocious to type in command line, apparently.
>>
>>59314924

Yeah, dead() just prints a message and calls python's exit().

Say gold_room() is called from within the loop. His intention is to confine each "room" of the game to a function. So the gold_room() function runs and waits for whatever input is required there and call whatever function is going to be called from the gold room.

But seeing as the while loop was never broken, is it still running? Did we move outside of the scope of the bear_room function by moving to a different function thus the loop is destroyed automatically?

I don't really understand why there's no break.
>>
>>59314870
>What breaks an infinite loop in python?
A break or return statement. Or something that removes control from the application (i.e., os.exit or an uncaught exception).

> And what specifically is breaking the loop here?
Depends on what `dead' and `gold_room' does.
>>
>>59314982
>Did we move outside of the scope of the bear_room function by moving to a different function ...
yes
> ... thus the loop is destroyed automatically?
no

The loop resumes when gold_room returns.
>>
>>59314964
i fucking hate powershell.

today i wanted to make a script that would upload a 2 byte file to an ftp server. it's like 20 lines and the syntax is so inconsistent it makes me cringe. i should have just used the first suggestion on stackexchange to just use the ftp cmd line program but i wanted to do it the Right Way
>>
>>59314994
Can't do things in a convinient way without 3rd party software? Yeah, probably.
for($i=1; $i -le 10; $i++){$client.DownloadFile("http://xy.z/"+$i+".jpg","D:\file"+$i+".jpg"}

From what I understood this code should download 10 files from xy.z, and do it, like, xy.z/1.jpg to D:\file1.jpg.
>>
>>59314995

gold_room() "goes" to a different room and carries on with the game from there, just printing text and giving the user the option to move to a different room by calling its function.

Is it enough that exit() is called in the program somewhere eventually? Even if we were calling bear_room, calling gold_room from inside, then calling bear_room again, then gold_room, then some other *_room, then doing a whole bunch of other shit. Provided we eventually meet an exit(), shit's not going to cause memory issues?
>>
>>59314982
Function calls are stacked, so when the callee returns, control is given back to the caller, right after the function call.
>>
>>59315026
Regarding the memory issue, that obviously depends on how many function calls are made.

For example something like

def f(n):
if n == 1000:
exit(0)
f(n + 1)

f(0)


Would probably crash with some like 'Max recursion depth' or whatever, because it makes to many function calls before reaching the condition where it exits.

Functions normally works as >>59315034 describes. Calling 'exit' breaks this by simply stopping. So does raising an exception for that matter.
>>
>>59314870
>>59314982
>>59315026

I think the problem is that you seem to have a newbie/bad understanding of a different OOP language -- likely C++ -- before you started on Python?

This, plus the way the book has presented each function as an "object" in the game, is causing you to try to think like an OOP programmer, except you don't understand OOP properly yet and you're not dealing with OOP code right now. So stop.

The program you're dealing with is simple and very procedural. You can consider the loop as having "paused" whenever a function is called, because at that point the computer is going to that procedure(function) and doing whatever is there before going back to carry on the loop. If it never comes back, that's fine - sure there's probably an issue with stack optimisation there eventually but that's not something you have to worry about - the computer is happily just doing whatever is handed to it at that moment, the loop doesn't continue looping until the function it has called returns, if it never returns, and the program instead exits via sys.exit() or something, that's fine too.
>>
>>59315104

Could I overcome the stack depth issue by putting a break in the loop myself then?
>>
>>59315166
There's probably no issue, if your functions return. When a function returns, its 'context' is removed from the stack.

The problem in >>59315081 is that the function only stops (if you replaced exit(0) with return, the same crash would still happen) after 1000 calls. At that point, you'd have 1000 times whatever size f requires lying on the stack, which is to much for python.

Something like
def f(n):
if n == 1000:
exit(0)

i = 0
while True:
f(i)
i = i + 1


would not be a problem as f returns before the next call to f is made.
>>
>>59315166

No, because where would you put the break?

Say you do this:
        elif choice == ”open door” and bear_moved:
break
gold_room()


Then you never call gold_room(), the game "goes" nowhere.

Otherwise, if you did this:
        elif choice == ”open door” and bear_moved:
gold_room()
break


Then yes, the loop breaks after gold_room() returns, but:

If gold_room() isn't written with a return, and is instead written to sys.exit(), the program exits anyway.

If gold_room() is isn't written with a return, and is instead written to call another function from itself - because I imagine each "room" in this game has its own function, and all the game does is switch rooms by calling another rooms function - then one of those functions will eventually result in sys.exit(), surely, or the game will carry on forever.

If gold_room() is written to return, then gold_room returns, and the player should be "back" in the bear_room(), and should be again presented with the same options as before. But if the break is there, then that doesn't happen. The program goes nowhere again.

Point is, its written correctly for its purpose, at least as far as I can infer.

You can't call functions inside functions without increasing stack depth. That's true regardless of you using while True or not. Stack depth isn't an "issue" either, its normal for programs to increase stack depth, that's why the stack exists.

Stack depth only really becomes an issue in programs that are calling recursive functions repeatedly when the program is designed to be highly optimised. Or when Stack depth is being increased for no reason due to an error in the program's logic.

This code is fine.
>>
>>59315217
void dostuff(int i){
if (i>1000)
return ;

writeln(i);
dostuff(i+1);

}
>>
roast my exception handling /g/
>>>https://github.com/jwt27/libjwdpmi/blob/master/src/scheduler.cpp
>>
File: tmp_7314-1488961972535191148772.png (151KB, 640x564px) Image search: [Google]
tmp_7314-1488961972535191148772.png
151KB, 640x564px
Tell one good thing about the programming language you hate
>>
>>59315299
>That doesn't nearly answer my question.
it does. when doing recursion, contract based programming is gold.
>>
>>59315306
Knowing Java is good for getting a job.
>>
>>59315306
>Hating a programming language
It's like hating a hammer or a wrench.
>>
File: php_hammer[1].jpg (183KB, 612x612px) Image search: [Google]
php_hammer[1].jpg
183KB, 612x612px
>>59315385
>>
>>59315319
>C is small
not really.
>>
>>59315385
Not really.

It's more like hating a particular brand/type of hammer.
>>
>>59315306
php helped me get into programming
>>
>>59315414
compare to lips, lua, prolog, ...
>>
>>59315414
wew.

you sure showed him with that image. Epic post friendo
>>
>>59315430
>beginner friendly
wtf? never
>>
>>59315461
>I learned C at the age of 17 and it was my first language

everything make sense now
>>
>>59315461
Anon, just because it was the first language you learned, doesn't mean its simple or beginner friendly.
>>
>>59315306
T-SQL lets you script MS SQL Server.
>>
Whats the best book for someone who can
1. Never think of things to code
2. Wants exercises/project ideas along with new concepts/libraries and things so I can get better
I don't need a beginner book as I can already use the languages, I just want to keep doing stuff and improving.

Any ideas? Often I can never think of anything and go without coding for ages. I would like to change this and always have something to work on
>>
>>59315485
Baby duck.
>>
>>59315586
Does this somehow deny there are languages easier and more friendly to learn for begginers?
>>
>>59315634
wrong.
>>
>>59315634
it's not about the difficulty relative to other languages, it's about the difficulty relative to, say, not learning a programming language at all. which is obviously nonzero. it may have been easy for you, but clearly you have autism to thank for that
>>
>>59315634
>students find basic or C equally hard/easy
yeah, no
>>
>>59315706
when c came out. it already was considered as a poor programming language.
>>
>>59315706
i don't see how that's what i said, but that aside, do you really mean to tell me you don't think a bunch of them were?
>>
>>59315732
>I can't read
The Rust Evangelism Strikeforce, everyone.
>>
>>59315532
I feel like the true way of the samurai is to write obvious shit. Want to edit text? Write a text editor from scratch, learn how buffers work. Want to visualize something? Get some opengl from ground and get going, learn how gpus work Want to work with net? Create a shitty email client. You won't complete any of those but you will gain vital knowledge pieces
>>
>>59315306
templates are kinda fun
>>
>>59315306
At least the compiler was first written in Ocaml.
>>
In Python how do you multiply the contents of a list with an integer?

I'm doing
[/code] i * list[0][/code] and getting a typeerror can only concatenate a list
>>
>>59315949
map
>>
>>59315949
l = [x * 2 for x in l]
>>
File: spiral.jpg (20KB, 644x183px) Image search: [Google]
spiral.jpg
20KB, 644x183px
Any way to optimize this? I spent like 3 hours trying to make this work. This problem really shouldn't have been in chapter 6 in intro programming book (although it was the hardest problem in chapter)

 pic related


My solution

            Console.WriteLine("Insert N and it will print matrix spiral");
Console.WriteLine("Insert N");
int n = int.Parse(Console.ReadLine());

int[,] arr = new int[n, n];

int positionX = 0;
int positionY = 0;

int direction = 0;
int stepsCount = 0;
int stepPosition = 1;
int stepsToTravel = n;

for (int i = 1; i <= n * n ; i++)
{
arr[positionX, positionY] = i;

stepsCount++;
if (stepsCount == stepsToTravel)
{
if(stepPosition == 1)
{
stepsToTravel--;
}
stepPosition++;
stepsCount = 0;
direction = (direction + 1 ) % 4;
}

if (stepPosition == 2)
{
stepPosition = 0;
}

switch (direction)
{
case 0:
positionY++;
break;
case 1:
positionX++;
break;
case 2:
positionY--;
break;
case 3:
positionX--;
break;
}
}

for (int q = 0; q < n; q++)
{
for (int j = 0; j < n; j++)
{
Console.Write("{0, 3}", arr[q,j]);
}
Console.WriteLine();
}

Console.ReadLine();
}
>>
Do any of the Haskellers on this thread have experience with classy-prelude? Should I stop using the default standard library?
>>
What do you do when you've been skipping so many exercises because you didn't know how to do them? But they've been adding up overtime and now there's a shitload of exercises that you didn't do and you have even less of an idea of how to do them than before when the material was fresh in your mind? The exercises I'm supposed to do are really hard.

I'm learning procedural programming (using python) so googling isn't often helpful to me since the stuff I'm learning to do with python isn't pythonic. If I google for help I'll get a pythonic solution to a problem and that's not how I am supposed to do it.
>>
>>59316242
>I'm learning procedural programming (using python) so googling isn't often helpful to me since the stuff I'm learning to do with python isn't pythonic. If I google for help I'll get a pythonic solution to a problem and that's not how I am supposed to do it.
what
>>
>>59315400
C has less datatypes
C doesn't involve OOP and FP
It's really the small language.
>>
>>59316242
>since the stuff I'm learning to do with python isn't pythonic
Why do you learn Python then?
>>
>>59316284
compare c to scheme
>>
>>59316242
>what do you do
discuss them with my colleagues
>>
>>59316288
I'm not learning python. I'm learning procedural programming. I'm just using python.
>>
>>59316293
Well, indeed, though Scheme isn't one of the most popular languages. I rather compare C to other popular languages.
>>
File: Screenshot_2017-03-09_15-20-48.png (32KB, 945x594px) Image search: [Google]
Screenshot_2017-03-09_15-20-48.png
32KB, 945x594px
Friendly reminder to not use nested unnamed tuples in your fucking JSON API.
>>
>>59316284
C is larger than rust yet rust includes that. C is only small in the sense that it wastes all its girth on being as exploitable as possible.
>>
>>59316329
Why do you use the language which is not intended to support the paradigm you learn?
>>
>>59316376
Almost as bad as xml!
>>
>>59316177
I would appreciate to see anyone else's solution to this
>>
Does Java Runtime Environment run on browsers and mobile phones?
>>
>>59316397
This Pajeet has never heard of objects.
>>
>>59316377
Rust is written in C

BTFO
>>
>>59316433
Rust is written in Rust
>>
>>59316377
>C
>larger than the language which is claimed to replace C++ in Firefox
>>
>>59316419
> Browsers?
No.
> Mobile phones?
Some of them.
>>
I want to make a webapp with a compiled language.
C++, go, rust or even c# or java. No javascript or python.
What language and framework do you recommend?
>>
>>59316419
Kindof. If you installed JRE on your PC with the browser plugin, it will, but there is almost no reason to nowadays. Android apps are written in Java, but the are meant to run on a JRE. Other mobile OSes simply don't support Java in any form.
>>
>>59316459
https://crystal-lang.org/

The only sane choice.
>>
>>59316459
>language
Go
>framework
net/http
>>
>>59316459
Pascal
>>
>>59316496
>Have a syntax similar to Ruby
Stopped reading there.
>>
>>59316433
C stands for CIA. Don't trust this shill!
>>
>>59316459
https://learnbchs.org
>>
>>59315008
tell me about Akari
Why does she wear the mask?
>>
>>59316459
Memes aside, ASP.NET is bretty easy to set up and use. It's insanely common, one of the most popular web frameworks, and you can use ASP.NET Core if you want to host on Linux.
>>
>>59316559
The CIA is a communist organization.
>>
in python

if "x" and not "y" in foo:
bar


is incorrect, right?

How do I write this properly?
>>
>>59316459
>a compiled language
You're shit out of luck. There is no such thing.
>>
How does static linking work in cmake?

https://github.com/clementine-player/Clementine/blob/master/CMakeLists.txt

I tried adding the lines below to the file above but the output is still dynamically linked.

SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBRARIES OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static")


All the other suggestions I could find suggest adding STATIC to either target_link_libraries or add_library but these commands are not being used in Clementine's cmake files.
>>
>>59316604
I would prefer to eval myself instead.
>>
File: 1478365617617.jpg (51KB, 600x600px) Image search: [Google]
1478365617617.jpg
51KB, 600x600px
>>59316610
>work
>C(ancer)make
>>
>>59316604

Damn, I thought this was likely the way I -could- do it, but thought python, what with the 80 character funkiness, would have been a little less longwinded with it.

Typing out the variable name each time seems pretty inefficient for a language that seems to be all about writing code to fit in a twitter comment.
>>
File: tmp_12987-148441485725910193806.gif (278KB, 640x360px) Image search: [Google]
tmp_12987-148441485725910193806.gif
278KB, 640x360px
>>59315009
>mfw I didn't like Powershell from the day 1
>>
File: 14715296417416.png (134KB, 500x500px) Image search: [Google]
14715296417416.png
134KB, 500x500px
What language do the folks at Langley use?
>>
>>59316442
>>59316445
>>59316461
>>59316545
The Rust compiler is LLVM which is written in C++ which is written in C. So Rust is written in C.

All your Rust code is passing through C code. Rust needs C but C doesn't need Rust.

BTFO
>>
>>59316696
Does that exen still exist?
>>
File: 1486566107280.png (147KB, 591x694px) Image search: [Google]
1486566107280.png
147KB, 591x694px
help help heeelp /g/

making some drawing program (lel).
When i clicked, little rectangle point must be the same location with grids intersection points. what should i add to code?

http://pastebin.com/BuTihxNW
>>
>>59316477
The browser plugin will go away with Java 9.
Fucking finally.

Nobody likes that fucking thing.
>>
>>59316702
>le not an argument
>>
>>59316653

Surely its just a matter of programming the interpreter to read it as

check (x and !y) in foo

rather than

check x in foo and !y in foo

doesn't seem too strange for a language as abstracted as python to understand that if there's only one variable named, then we're clearly trying to find x from that one variable, no.
>>
>>59314964
>for loops
1..10 | % { $_ }
>>
>>59316641
No one likes powershell at first glance. It's honestly an acquired taste because it's not very similar to what people are used to.
>>
>>59316717
33
>>
>>59316683
C11
>>
>>59316177
Too lazy to read your code, but here's what I'd do.

You only need to think in terms of outer "layer" or border of the matrix. First you draw the outer border of 4x4 matrix, starting at 0,0 with value 1. Then you draw the outer border of a 2x2 matrix, starting at 1,1 with value 13. Hope I explained myself clearly.
>>
>>59316733
>idiot
Excuse me?
>>
>>59316733

le epic trole
>>
>>59316692
>C++ which is written in C.
>>
Rust, Swift, C#, Go = one-day meme language.
>>
how do you make a compiler that compiles itself
>>
>>59316702
>>59316710
>>59316717
>>59316726
>>59316754
>implying Rust code can compile itself.
Rust needs a compiler and what is the compiler written in? Not Rust.
BTFO
>>
>>59316764
>outer border of a 2x2 matrix
>>
Appease NSA-chan by writing insecure C code!
>>
>>59316813
char password[10]; //only 10 chars
scanf("%s",password);
>>
>>59316813
// todo: write literally any non-trivial C code
>>
>>59316754
>>59316702
>implying C niggers don't rage at the first mention of C++
>implying C niggers don't rage when someone says C++ is C
First day on the Internet?
>>
>>59316810
Yes, it's a terminal, degenerate case of a problem
>>
>>59316820
>implying every time you compile Rust code, C code isn't executing
BTFO
>>
>>59316813
>by writing insecure C code
So just by writing C?
>>
>>59316853
> /v/ outta nowhere

hello /v/ toddler
>>
Boss expecting me to create a REST API in Django...

I have no previous experience in django, or the rest framework...

Anybody recommend any good guides, books or anything?
>>
>>59316807
>what is the compiler written in? Not Rust.
are you sure about that?
>>
>>59316845
>not programming Assembly
C is compiled to Assembly that goes to machine code.

C needs Assembly, but Assembly doesn't need
C.

BTFO
>>
>>59316871
as far as I know the first compiler was written in C, and latter versions in Rust. Then you just use the older version to compile the new one...
>>
>>59316857
By writing so obviously complicated programs in [insert your favorite language here] that there are no obvious deficiencies.
>>
>>59316868
http://www.django-rest-framework.org/ <-- this is great

https://code.tutsplus.com/courses/create-a-rest-api-with-django

https://scotch.io/tutorials/build-a-rest-api-with-django-a-test-driven-approach-part-1

https://impythonist.wordpress.com/2016/04/30/a-practical-guide-for-building-restful-api-with-django-tastypie/

http://stackoverflow.com/questions/17577177/creating-a-rest-api-for-a-django-application
>>
>>59316884
It's called bootstrapping.
>>
>>59316881
so the compiler is written in rust. why are you saying otherwise?
>>
File: roll-safe.jpg (39KB, 1200x784px) Image search: [Google]
roll-safe.jpg
39KB, 1200x784px
>can't write an exploit if nothing is written in your language
rust fags everyone
>>
>>59316904
>tfw getting paid $96K year to write C

kys
>>
>>59316881
It was written in OCAML.
>>
Thank you!
Time to sit down and read....
>>
>>59316920
well a thai street whore is paid more than you, why you care what C devs and JS devs get paid?
>>
>>59316926
>>59316920
yeah, but i work 3 hours a day

beat that
>>
>>59316947
wut
>>
>tfw you live in Brazil and $96k is a "rich person" salary
>tfw C programmer salary here is $7500/year
>>
>>59316968
lol wut
>>
>>59316914
>$96K
my ex room mate earns ~300k/year as a cobol programmer. maintenance of legacy softwares pay a lot.
>>
>>59316963

Very few people actually earn $96k+/yr with JS, more people probably earn $96k+/yr with C, still not a lot. Most of them, either language, will have decades of experience.
They're just trying to meme on C programmers and probably don't write code themselves.
>>
>>59316982
wait wut?
>>
>>59316987
>>59316963
i earn $96K but i'm fresh out of college.
i'm 22
>>
>>59317012
What city do you live in?
>>
I think the problem with non-C users is, it attracts people who would rather "script" than actually program. C is a programming language and idiots feel safe to be contained in other less powerful "scripting" languages.
>>
>>59317025
?
>>
>>59317024
LA
>>
>>59316940
>tfw i'm not the guy who posted salary
>this retard doesn't realise this
>because he is stupid as fuck
Well it looks to me like the best part of you ran down the crack of your momma's ass and ended up as a brown stain on the mattress! I think you've been cheated!
>>
>>59317012

SF or no you don't.
>>
>>59317024
SF
>>
>>59317027
C isn't by "powerful" by any stretch of the imagination. It's pretty much a scripting "language".
>>
>>59317042
Anyone who doesn't despise both C and C++ is simply delusional.
>>
>>59317031
>>59317040
Not sure which is faking, but either way you might as well cut that number in half due to cost of living.

Making <$100k in California is lower-middle class.
>>
>>59316985
300k rupees is not much, pooloo. Now get back on the street and dance, nigger.
>>
>>59317060
it's in SF.

i live with my parents, so rent's free and all costs
>>
>>59316803
>C#
>one-day meme
It's popular in MS environment, though.
>>
>>59317074
>i live with my parents
That explains a lot.
>>
>>59317063
>300k rupees is not much, pooloo.
for a programmer? sure
>>
>NO JOBS IN RUST
>NOBODY USES RUST
>NO PROJECTS IN RUST
>FORCED BY SJW BOTNET CORP
why would anyone even mention rust is beyond me. its like publicly admitting you're gay - you are stained for life
>>
>2017th millenium
>not programming in D
>>
>>59317096
Why are you mentioning Rust?
>>
>>59316803
swift c# and go are well installed in the enterprise, only a fool would call them "memes"
>>
>>59317108
top retard
>>
>>59317080
>C++
>intelligent programmers
You have to be a drooling pseudo-intellectual retard to believe this.
They are both pretty much the same in terms of being absolute garbage no human should ever think of taking seriously.
C++ itself is very much a scripting language underneath all that bloat.
>>
C for CIA
>>
>this one fag that constantly shitposts about rust ruining my /dpt/ experience
>>
>>59317108
It's the CIA.
>>
>>59316459
Lisp.
>>
>>59317116
>only a fool would call them "memes"
Correct. But you are yourself a fool for failing to realize that no programming language can be called a "meme".
>>
>>59317140

for real
hormones will do that to ya
>>
Rust is shit, plain and simple. If it wasn't so shit, everyone would be writing everything in it. But only dying Mozilla with pathetic 10% market share is writing in Rust and others choose to stay away from it, which is somehow telling.
>>
Are there closed source programming languages?
>>
>>59317180
Yes, my language.
>>
>>59317080
If you think C makes a disservice to programmers, then what should I say about C++ and the billions of dollars and work hours it made losing because no one master the language fully. Its complexity and verbosity are uncontrolled, hence explaining the lack of productivity-enhancing tools for it...
>>
>>59317166

Rust is a meme
>>
Anyone know a sweet CMake tutorial?
>>
>>59317190
yours don't matter
>>
>>59317199
Not even Stroustrup knows C++ fully.
>>
>>59317195
If you think that being shit and being a "meme" are somehow even close then you should fuck off back to the shithole you came from.
>>
>>59317180
You can't have a closed source language but a closed source implementation. Examples are Intel's icc and Oracles JDK. As long as the specs for a language are out (aka it's usable by the public) nothing stops anyone from writing a compiler or interpreter for it.
>>
>>59317200
https://>>59317210
www.c-make-for-toddlers.com
>>
>>59317210
>(((GCC))) is garbage
Fixed that for you.
C is garbage as well, but your post doesn't really show that.
>>
>>59317096
>all that roosters butthurt because they can't argue with sad reality that rust is a meme for wannabe virgins
>>
File: Stupid Nigger.png (33KB, 895x361px) Image search: [Google]
Stupid Nigger.png
33KB, 895x361px
>>59317091
>>
>>59317193
At least C++ gave us Java, a better language in every way.
>>
>>59317199
Hating on C is the meme of the month. I wonder where the Go-haters went.

I'm definitely not closed to any language, I merely know one language per main programming paradigm enough to make non-trivial projects with them. My job is mainly a C++ one, so I'm well versed on the powers and weaknesses of C++.
>>
>>59317249
>I merely know one language per main programming paradigm
So you're a code monkey in other words?
>>
>>59317258
shut up, toddler
>>
Are we going to reach 6 /dpt/ per day speed with Rust shitposter?
>>
I have to make a project during the next 3 months to validate my Java training.
Is a music player with drag and drop, library sorting and visualizations doable (using javafx) for someone without much experience in that amount of time?
>>
>>59317280
>Java
I'm sorry, but you must be confused, redditor.
Never ever recommend usage of objects or OOP here.
>>
>>59317272
Just report and filter the keywords, like "C(ancer)".
>>
>>59317291
you
>>
>>59317291
Some Indian retard.
>>
>>59317243
Java is the academic reference for teaching OOP.

Too bad the JRE is bloated as hell, but Eclipse and the others Java-centered IDE saved it when C++ was about to make a comeback with Qt and Nokia's effort to make it the industry standard framework. They failed and Java kept the upper hand.
>>
>>59317210
CL-USER> (let ((i 3))
(format t "~a ~a ~a GO!!!~%" i (decf i) (decf i)))
3 2 1 GO!!!
>>
>>59317316
meme meme?
meme meme!
>meme
>>
>>59317309
>language "meme"
Learn to use your words correctly, retard.
>>
>>59317269
No, it means I'm not focused on hating one and only one language. Programming is not bound to language marketing. Algorithmics, theory of complexity, of graphs, of computation, etc. are all related to it.
>>
>>59317327
>xd
Nice post... Gold!
>>
>>59317281
You didn't your second sentence.
But it sounds doable.
>>
>>59317335
edit: thanks everyone!
>>
this thread is fucking garbage everyone ITT is an example of everything wrong with /g/
>>
>>59317349
>everyone ITT
I think you meant everyone in this ITT
>>
>>59317353
everyone in this ITT thread
>>
>>59317353
kill you're self
>>
>>59317350
Congratulations on moving from one shitty language to another.
>>
>>59317349
It's usually good until the C-hating shills show up.
>>
>>59317345
Thanks senpai.
>>
>>59317353
my bad senpai
>>
>>59317349
It only takes one asshole to taint a room.

Look, ITT 55 unique posters for 289 posts. Because the dedicated C hater posts one insult per minute doesn't mean there are 100 dedicated C haters in this thread.

Such is life on 4chan big boards.
>>
>>59317369
I'm their leader. Little do they know that I've actually been double-crossing them this whole time.
>>
>>12345678(You)
OK
LETS RESOLVE C VS RUST DEBATE FOR LIFE

1. random anon propose a function spec
2. rust and c fags implement said spec
3. anon records screen and posts to /dpt/
4. the fastest implementation wins

loserlang users will benefit from additional privilege of sucking my cock. the lang will also be banned from /dpt/ for life. if you don't do this, you admit you cant code in either C or Rust and are only good for shitposting.
>>
>>59317369
>It's usually good until language wars start.
FTFY
>>
>>59317391
Repent and return to the one true path of C. I'm worried about your soul, anon. D has failed you and will be forgotten.
>>
>>59317391
can /fdpt/ please become a thing? these threads aren't worth coming to anymore.
>>
>>59317209

I think you don't understand what a meme is anon

Rust is a meme in the same way Gentoo is a meme

Its a meme to talk about it, to tell people to use it, to pretend you use it. Its more of a meme to actually use it because you fell for the meme.

Its pretty common for /g/ to say lots of stuff about technical stuff that isn't true or is just baseless opinions because other people are saying it and they think its funny to say it too. Rust is one of those things. Its a meme.

What about memes aren't you understanding?
>>
>>59317391
Either way clearly reports aren't doing anything since we get the same retarded posts over and over.
>>
>>59317412
>that reddit spacing
>this retarded usage of the word "meme"
Somehow I'm not really all that surprised. At least now I know your true nature.
>>
>>59317433
/fpt/ existed some time ago
>>
>>59317433
considering that nobody on this board actually programs functionally, i don't know if that would catch on
>>
>>59317412
A programming language cannot be a "meme". There can be memes about doing something with the language, but the programming language itself can't possibly be a meme. You have to be a brain-dead plebbitor to believe otherwise.
>>
>>59317407
They are, until *those* guys show up and derail them.
>>
New thread:

>>59317445
>>59317445
>>59317445
>>
>>59317443
It was also pretty good for a while.
>>
maybe we just have to split up into
/cpt/, /cp3t/, /dpt/, /jpt/, /hpt/ ...
>>
>>59317442
Not in a generic way, no.
You can special-case them in and build something that has the properties of monads, but you can't have full-on monads like you do in functional programming languages like Java and Haskell.
>>
>>59316881
It was written in OCaml. Nobody would be stupid enough to write a new major compiler project in plain C these days.
>>
>>59317468
It died after holidays on itself.
>>
>>59317491
What should I write my major fizzbuzz language in? OCaml is fucking garbage so that's not an option.
>>
>>59317446
>considering that nobody on this board actually programs
ftfy
>>
>>59317469
>/jpt/
Japanese Programming Thread?
Sugoi!
>>
>>59317521
senpain (katana) {
desu;
guro;
guro(konittiwa);
}
>>
>>59317166
https://pyos.github.io/dg/
you said?
>>
>>59317510
FORTRAN
>>
>>59317521
not what I had in mind, but I'd be down for that.
>>
>>59317549
You could show me an infinite list of languages based on memes and it wouldn't change anything.
Something which is a programming language is by definition not a "meme".
>>
How do you organize C++ code if your style is a mix of functional and OOP, to make it look more professional?
>>
>>59317442
I hate C, but let's dispel with the myth monads are a make-or-break language feature.
>>
>>59317684
Turn your functional code into either:
- functors overloading the () operator of a class (super pro)
- object methods (poo-in-loo pro)
- static methods of class (quite pro)
- namespace functions (less pro, C-tier)
>>
>>59314836
If it works it's not wrong
>>
>>59317607
a meme can be anything
>>
>>59316719
python is imperative not declarative
>>
>>59315306
java's .jars are relatively "cross-platform".
>>
I know you can check a program's characteristics by looking in the /proc/ folder, but what if you want to characterize individual threads from one program? Wouldn't all threads be under a single /proc/ file?
>>
>>59319557
nvm got it thanks /g/
>>
>>59317684
There's nothing professional about OOP
>>
>>59320284
But it is used in most professional software. Like Linux for example.
>>
I just recently read the Linux kernel coding style
https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst
One thing I don't understand is his take on typedefing. Why is it bad to remove the struct/enum/union prefix from every single type? Those are needlessly verbose.
>>
>>59320443
>Why is it bad to remove the struct/enum/union prefix from every single type?
They never said every single type, in fact, they have very clear rules when it is ok to typedef.
>Those are needlessly verbose
Look at the example they are giving, it's pretty clear it's not needless.
>>
>>59320443
>>59321910
Another example would be the win32 api,
INT is
typedef int INT;

what is INT_PTR, here's a hint, it's not a pointer?

So, to avoid shit like this, they just say, unless your code matches a few special cases, don't typedef.
Thread posts: 252
Thread images: 15


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