[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: 334
Thread images: 39

File: as3.jpg (95KB, 823x595px) Image search: [Google]
as3.jpg
95KB, 823x595px
old thread: >>60697393
What are you working on, /g/?
>>
>>60704655
Lisp is the most powerful programming language.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>60704655
First for Fortran (FfF).
>>
>>60704655
HTML is the most powerful programming language.
>>
>>60704655
Ruby is the most powerful programming language.
>>
I'm bored and I want a project to do. I have money. I recently got done with an android/arduino dog door opener with a linear actuator (which was fjvking $100) and some other electronic shit and im bored. Also my dogs are dead now so the door is useless. Any various household shit that sounds interesting to make?
>>
>>60704691
Complete home automation
>>
File: test.png (111KB, 600x355px) Image search: [Google]
test.png
111KB, 600x355px
>>60704674
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); she's super duper cute; and she's a blast to write in! Say something nice about her, /dpt/!

>Features
https://dlang.org/comparison.html
>Standard library
https://dlang.org/phobos/index.html
>Package manager
https://code.dlang.org
>GC
https://dlang.org/spec/garbage.html
https://dlang.org/blog/2017/03/20/dont-fear-the-reaper/
https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
>Books
https://wiki.dlang.org/Books
>>
>>60704721
D looks gay as fuck. D is definitely not straight.
>>
>>60704701
that sounds fun as fuck and that's part of the goal with my dog door. I want to make a base system to control other shit in my house with a universal protocol. I think the dog door is just a component of more shit. And hey I could sell it. A lot of shit already exists however. Like fridge cameras, thermostats. Id love to make an app to control my entire house with various little machines sending data to each other. The best part is that there's no botnet because I made it all.
>>
>>60704734
Tomboys have a tendency to fill out later, anon. Though personally, I hope the chest stays small and the hips and butt become reasonably big and firm.
>>
Anyone here plays with obscure/retro languages/dialects like Quick Basic?
>>
>>60704769
Learn Shen.
>>
>>60704769
There's an anon in these threads that uses D
>>
>>60704769
i have used ladder logic for plc programming.. and proton basic, both are shit
>>
>>60704764
muh boi, flatchest/fullass/widehips is fucking tippytop tier
>>
File: 4chan-1448474243333.jpg (310KB, 1280x1810px) Image search: [Google]
4chan-1448474243333.jpg
310KB, 1280x1810px
>>60704855
Damn straight, anon.
>>
>>60704669
cl-user> (length (lisp-users))
3
>>
>>60704938
You, me, and the Sussman.
>>
Why does everyone use Python for software like wicd and not Ruby? Ruby is much more comfier than Python.
>>
Does anyone here /GIS/?
I took two semesters of ArcGIS courses in college and just started playing with Grass today. I'm still getting used to the interface (pretty shit compared to ArcGIS), but I think I can make it work. I should just bite the bullet and do tutorials for a day, but that's not as fun as trial and error.
Thinking about making a python script that would make print-quality maps (pdf format) from a cluster-fuck of geological shapefiles in the state GIS data repo. We'll see.
>>
>>60704985
They fell for the bait.
>>
File: 1330368205825.jpg (105KB, 1280x1440px) Image search: [Google]
1330368205825.jpg
105KB, 1280x1440px
>>60704985
use javascript

pretty comfy, a little ugly, but a lot more useful
>>
File: ZenOfRuby.png (643KB, 1000x500px) Image search: [Google]
ZenOfRuby.png
643KB, 1000x500px
>>60704985
>Ruby is much more comfier than Python.
how so?
>>
File: 1.jpg (62KB, 860x573px) Image search: [Google]
1.jpg
62KB, 860x573px
What would I be expected to know for a graduate/junior position in ruby on rails? I only started learning it last week.
>>
>Start learning Python
>Nice, easy to learn, clean looking language
>Start using classes
>self self self self self self self

Am I wrong to be bothered by that so much?
>>
>>60705123
No. Python is shit.
>>
first week of php holy shiit this syntax is ugly
>>
File: mmm.png (38KB, 188x125px) Image search: [Google]
mmm.png
38KB, 188x125px
>What are you working on, /g/?
Storage analyzer program to find old and useless files/directories.
I would rather go back in time and shoot every developer who thought "my program should have a .folder in user's home directory", but that would take too many bullets.
>>
>>60705115
Is that young Carrie Fischer?
>>
>>60705123
Python is literally a beginner language so the problem lies in you if you're being bothered by things.
>>
>>60705142
>php
It doesn't get better.
>>
>>60704985
because they're retarded. wicd-curses frequently breaks for me during runtime. connman is better

>>60705142
http://news.php.net/php.internals/70691
daily reminder
>>
>>60705161
Where should you store data that should be preserved then?
>>
>>60705166
It's Millie Bobbie Brown
>>
File: truly_free.png (35KB, 753x241px) Image search: [Google]
truly_free.png
35KB, 753x241px
>>60704674
>>
>>60705238
What is that?
>>
>>60705105
That's the opposite Zen of Python. The philosophy of Ruby is to be comfy and fun.
Read: https://en.wikipedia.org/wiki/Ruby_(programming_language)#Philosophy
>>
>>60705222
.config is the right place for that kind of storage.
There are 157 .folders in my home directory, it's autism. Most of those are probably have probably been useless for years now.
>>
>>60704985
I have no choice in what programming language I use at the moment.
>>
>>60705254
A gpr config file
>>
>>60705278
Use Lisp.
>>
>>60705255
not an argument. the motto of python is also about making good apps easier to develop than making bad apps harder to develop
>>
>>60705284
This, it's the final language to learn.
>>
>>60705252
Prove this wrong.
>>
>>60705324
Why?
>>
>>60705324
Solve the problem of proving God exists.
>>
>>60705362
There is no problem.
God exists.
There is nothing to prove.
>>
File: file.png (41KB, 489x321px) Image search: [Google]
file.png
41KB, 489x321px
>>60705362
>>
>>60705362
Terry could solve this in like 10 seconds. Send him an email.
>>
>>60705362
Mathematically, the existence of a god is undecidable, therefore it is true.
>>
>>60705191
man it must feel good when a tool you shat out for yourself to shit out html faster is used worldwide, industry standard even
>>
>>60705407
If it's true then it can't be undecidable. Doesn't that contradict itself?
>>
>>60705434
Are you suggesting there can't be a true decision you can't reach?
>>
>>60705441
No, I'm aware that there exists truths that cannot be proven true within our systems of logic and mathematics, but I don't see how that can be applied to God.
>>
stuck with a girl alone in class we have 15 min break dubs decide what i do
>>
>>60705479
shit your pants
>>
>>60705434
Undecidable with our math, and we haven't found a counter example yet, so it's probably true.
>>
>>60705311
No? Python was about being easy to learn and use, not necessarily about being productive. Especially since Python is more explicit compare to Ruby which removes a lot of boilter plate.
>>
>>60705479
teach her lisp basics
>>
>>60705479
smash her
>>
>>60705479
OP Here
teach her the glory of AS3 <3
>>
>>60705479
just treat her right
>>
Why the fuck is developing for Windows in C++ so fucking awful? I don't know what other language I could use that would be better.
>>
>>60705538
C#
>>
>>60705533
kek
>>
>>60705538
Can you describe what's awful about it?
>>
>>60705538
>Why the fuck is developing in C++ so fucking awful?
fixed
>>
>>60705538
What do you mean? If you want gui use .net and c hash
>>
File: 1463930928711.jpg (42KB, 807x659px) Image search: [Google]
1463930928711.jpg
42KB, 807x659px
any open source libs for generating reports and documents like invoices and shit?
>>
File: Screenshot_20170602_013016.png (47KB, 1200x841px) Image search: [Google]
Screenshot_20170602_013016.png
47KB, 1200x841px
I'm succumbing to the Plan 9 disease of quirky color schemes...I can't resist it. Help.
>>
>>60704655
im working on PepeCoin and we're about to launch a decentralized asset creation exchange on kekdaq.com
>>
>>60705551
He probably can't figure out how to link libraries properly.
>>
>>60705572
Go is disgusting.
>>
>>60705597
can you tell me why without babbling on about OO properties it doesn't have?
>>
>>60705572
>mouse-driven editor
Wow, it's almost like it's the 80s and GUI is so hot we reinvent everything around it.
Too bad it's not.
>>
>>60705618
The syntax is horrible.
>>
>>60705491
Python first purpose was to be the programming language of Amoeba, an experimental operating system by Tanenbaum. Python never was intended to be an educational language.

""
My original motivation for creating Python was the perceived need for a higher level language in the **Amoeba project. I realized that the development of system administration utilities in C was taking too long. Moreover, doing these in the Bourne shell wouldn’t work for a variety of reasons. The most important one was that as a distributed micro-kernel system with a radically new design, Amoeba’s primitive operations were very different (and finer-grain) than the traditional primitive operations available in the Bourne shell. So there was a need for a language that would “bridge the gap between C and the shell.” For a long time, this was Python’s main catchphrase.
""
>>
>>60705618
>language gets posted
>/dpt/ losers sperg out
thats why
>>
>>60705618
From the top of my head
- No generics
- Fucked up error handling
- Ugly syntax
- GC
- Lack of proper type system with ADT and pattern matching
>>
>>60705618
It's an insult to Lisp.
>>
>>60705640
But it was also strongly influenced by ABC which was a language created for teaching purposes.
>>
>>60705626
This was brought up, more politely, in the thread before. Basically it comes down to the fact that since it makes viewing lots of files at once much eacher(and getting them in and out of view, or as in view as they need to be), combined with contextual abilities such asclicking build above a file in one project building that project in specific and being able to jump to the line and file where errors occurred by middle clicking; that it ends up just being a faster and smooth process than I had with vim. Some processes in vim were faster of course, but the overall ease of use just works out better.


>>60705654
Are there literally any languages that aren't at least partially OO with generics? I'm a C programmer and I don't fucking need that shit.
>>
File: VstEcEi.jpg (52KB, 720x540px) Image search: [Google]
VstEcEi.jpg
52KB, 720x540px
>>60705626
http://www.plan9.bell-labs.com/wiki/plan9/mouse_vs._keyboard/index.html
>>
>>60705684
>Are there literally any languages that aren't at least partially OO with generics? I'm a C programmer and I don't fucking need that shit.
Haskell
>>
>>60705691
You're not helping yourself
>>
>>60705684
So it's like Visual Studio/Eclipse/IDEA only shittier?
>>60705687
>The most common complaint is that using the mouse is slow compared with cursoring around, whether via arrow keys or via hjkl (in vi, etc.). This simply isn't true.
Oh well, if he says so. Also he's comparing acme to dumb old vi, not vim or emacs.
>>
>>60705699
???
>>
>>60705723
Come on this is stereotypes, people like boring languages like C and Go are gonna scoff at stuff like Haskell
>>
>>60705533
sick fuck
>>
>>60705719
>Oh well, if he says so. Also he's comparing acme to dumb old vi, not vim or emacs.

If he says so?

have you read the three links from *TOG? He spent 50 millions of dollars on R&D at Apple where he did extensive tests that showed that using the mouse is more intuitive and faster than using the keyboard.

for example

""
The test I did I did several years ago, frankly, I entered into for the express purpose of letting cursor keys win, just to prove they could in some cases be faster than the mouse. Using Microsoft Word on a Macintosh, I typed in a paragraph of text, then replaced every instance of an "e" with a vertical bar (|). The test subject's task was to replace every | with an "e." Just to make it even harder, the test subjects, when using the mouse, were forbidden to just drop the cursor to the right of the | and then use the delete key to get rid of it. Instead, they had to actually drag the mouse pointer across the one-pixel width of the character t o select it, then press the "e" key to replace it.

The average time for the cursor keys was 99.43 seconds, for the mouse, 50.22 seconds. I also asked the test subjects which method was faster, and to a person they reported that the cursor keys were much, much faster. This was a classic example of the difference between subjective time (the passage of time the user experiences) and objective time (the passage of time the clock experiences). Put simply, the more mentally engaging the task, the shorter the time appears.
""

* https://www.wikiwand.com/en/Bruce_Tognazzini
>>
>>60705479
teach her Haskell
>>
>>60705762
of course mouse is faster than cursor keys. good thing we have vim so we don't have to use either of them
>>
>>60705762
These aren't professional programmers who spent some time to actually learn the editor they use tho. I mean, ofc you mum would be more efficient with a mouse than with vim, but that doesn't mean I am.
>>
>>60705762
uhhhh

first_row, last_row s/|/e/g


???
>>
>>60705640
How is that an argument for productivity? It merely states that he wanted a language which could bridge the gap between shell and C, not necessarily a long for productivity.
>>
File: cuddle.png (153KB, 700x599px) Image search: [Google]
cuddle.png
153KB, 700x599px
When I program in Ruby I am so happy >.<. Ruby is so fun and comfy to program in. I can't stop smiling.
>>
>>60705569
nothing?
>>
>>60706166
What do you expect? This is /dpt/ where third year college students come to circle jerk that anything OOP is trash and C is the best programming language so that they can boost their ego that they are intellectual contrarians who know better than the mainstream.
>>
File: R14kkDj.png (13KB, 657x527px) Image search: [Google]
R14kkDj.png
13KB, 657x527px
How can I practice programming when I'm just shit at logic? Everytime I try to do something, I end up copying all the code off of stackoverflow or something, not progressing at all.
>>
>>60706359
that "logic" you're talking about IS programming. just keep writing code, reading code and googling shit and you will improve.
>>
>>60705569
>>60706166
JasperReports
>>
>>60706411
Makes sense, thanks
>>
>>60706260
Excuse me? I'm about to drop out of the first year for a second time.
>>
What's /dpt/'s take on clojure?
>>
>>60706587
It's the best lisp out there, but that's not saying much.
>>
>>60706601
explain further
>>
Inb4 pajeet language
https://bitbucket.org/Wepawowet/memefinder

Any ideas for stuff to add to this?
>>
>>60706644
It's better than CL, mostly because it's ditched most of the legacy shit and has access to Java libraries, but it's still dynamic shit without syntax tied to JVM, so you'd be better off with Scala or even Kotlin.
>>
Interesting stuff: https://web.archive.org/web/20160304055308/http://sites.ieee.org/scv-cs/files/2013/03/Right-SizingPrecision1.pdf

Still haven't finished reading but in case someone has went through this before, do I take it that I need new hardware to take advantage of this new conceptualisation?
>>
File: braveclojure.png (104KB, 900x900px) Image search: [Google]
braveclojure.png
104KB, 900x900px
>>60706587
it's lisp with special needs but better than nothing, i guess.

http://www.braveclojure.com/
>>
>>60706659
>imgui
use electron faget
>>
>>60706690
>>60706709
So neither of you likes Lisp.
>>
>>60706738
>JavaScript, HTML and CSS
not him but this aint /wdg/
>>
File: IMG_0351.png (66KB, 1000x1000px) Image search: [Google]
IMG_0351.png
66KB, 1000x1000px
>>60704655
Could anyone give me the rundown on Mooc.fi? I kept hearing about their Java course being good, I started 2 days ago and I'm already almost on week 4. There's hundreds of exercises but so far I've worked through every single one of them without any real difficulty. It's nice because the sheer volume of exercises reinforces syntax familiarity, but I can't tell if it's really improving my actual programming skills at all. In the almost hundred exercises I've done, not once have I felt even half as challenged as I did doing just the first 3-7 assignments from the CS50 Harvard course on C.

Does it get harder? I want to finish it just to say I did something from start to finish, but I don't want to waste valuable time.

Also, what should you be capable of before being prepared for an internship? How about for a code monkey job?
>>
File: 13775726487.png (557KB, 650x800px) Image search: [Google]
13775726487.png
557KB, 650x800px
>>60706780
i am a lisper, actually.
>>
>>60704669
>>60704676
>>60704685
What is a ``Powerful" language?
>>
>>60705407
Prove its undecidability.
>>
>>60706797
I haven't seen a lot of Star Trek. Can someone explain this image please?
>>
>>60706709
>http://www.braveclojure.com/
are you trying to meme people?
>>
>>60706837
>meme
Use >>>/v/
>>
Why does this segfault?
Its a prototype and just for visual effect, but it kills itself immediately

http://cpp.sh/4cpgg

pls b nice
>>
>>60706791
>java
siis hyi vittu, 0/5
>>
>>60705485
A counterexample to what? "god exists" isn't universally quantified.
>>
>>60706853
easy. it segaults because


it's written in a memory-unafe language
>>
>>60706853
> Protocol *close_connect = (Protocol*)malloc(sizeof(Protocol*));
It's malloc(sizeof(Protocol)), and why are you even using mallocs, it's not C.
>>
>>60706886
Thanks anon
>>
>>60706858
>hurr you should learn machine code or else you're a pajeet
Meme me all you want, it's the best way to get a job being a codemonkey.
>>
>>60706853
At a quick glance I don't know, but question, why do you typedef structs but then write C++?
>>
>>60706853
LOL this faggot cannot even write sepples!
>>
>>60706923
>hurr
>Meme
Use >>>/v/
>>
>>60706923
you've got no self respect do you
>>
>>60706923
>code
>>>/g/wdg/
>>
>>60706942
Does RMS belong in /wdg/? After all he says coding means very low level code (machine code/assembly) and programming means writing anything higher level than that.
>>
>>60706983
>Does RMS belong in /wdg/?
Yes. His kind belongs solely in >>>/g/wdg/
>coding
>>>/g/wdg/
>>
File: IMG_0306.jpg (82KB, 750x627px) Image search: [Google]
IMG_0306.jpg
82KB, 750x627px
>>60706937
I need money, I enjoy programming but it isn't necessarily some deep passion or anything. It's something I like enough where I wouldn't mind doing it for a job. I want a cushy office job. Fuck me, right?
>>60706933
Fuck off
>>60706942
>>>/out/

If there's anything I've learned from posting on this website for nearly a decade, it's that you guys a bunch of contrarian assholes. I've seen people told to go back to /v/ or /wdg/ for mentioning any language, fuck right off if you're not gonna answer my question.
>>
File: new_meme_arrival.gif (1MB, 300x168px) Image search: [Google]
new_meme_arrival.gif
1MB, 300x168px
>>60706990
nice
>>
>>60707014
>meme
>>>/v/
>>
>>60707012
>I enjoy programming but it isn't necessarily some deep passion or anything
Then you don't belong here. Use >>>/g/wdg/
You will seriously make more money that way.
>>
>>60706926
I fixed it, so thats fine
cause im packing a much shit as possible into it
>>60706928
>LOL this faggot cannot even write sepples!
Whomstever requested thine opinion lord fag-alot?
>>
Still playing around with C#, this time learning xamarin and .net class library. This language is comfy as fuck
>>
>>60707070
How can a language be ""comfy""? Especially such a shit one.
>>
>>60707079
Try it yourself and see. Don't imitate everything /g/ says, think for yourself.
>>
>>60707086
>Try it yourself and see
You didn't answer my question.
>Don't imitate everything /g/ says
I have my own algorithm for determining if a language is shit, I don't think anyone else has it.
>>
>>60707070
C# is one of the least comfiest languages I know, fuck wrapping every function within a datatype.
>>
>>60704655
Magic numbers! This smells
>>
File: cake.jpg (32KB, 462x375px) Image search: [Google]
cake.jpg
32KB, 462x375px
>want a certain program on my phone
>check google play
>top 5 apps with functionality I want
>a lot of great reviews
>alright, let's check em
>100mb+
>wacky xD animations everywhere
>slow as shit
>"LOGIN WITH FACEBOOK"
>gazillions of ads
>"LEAVE A REVIEW LOL PLS"
what a great technology age we live in my dudes

fuck this shit, fuck this shit so hard
gonna write my own in fucking C
>>
>>60707176
What kind of programs are those, anon?
>>
>>60706853
Even looking at your code for 5 seconds I immediately see that you're writing C with classes instead of C++. Learn C++, with all the nice idiomatic stuff that comes with it.

Some small things:
* Don't malloc without a very good reason. Prefer not to use the heap, or when you have to, new with a smart pointer or some shit. Also the malloc you did allocates the size of a pointer, not the size of the actual object.
* Do RAII, don't make objects with a zombie state, for which you then have to fill in an arbitrary amount of members with `foo->bar = cuck` in order for them to work properly. If I had to work with your code, then I'd have absolutely no clue what magic buttons to press before it works without going through your entire code.
* Don't define without a very good reason. For a string constant use a `const char[]` instead.
* Prefer enum class to raw enums
* Prefer references to pointers. References means less worrying and more dereferencing (if needed, try to avoid raw pointers) in a higher scope.
* Nice memory leaks. If you have to work with heap allocated stuff, make sure you clean it up in a destructor. That way, when an object leaves scope, it's ALWAYS cleaned up (unless you abort or get fucked by SIGNALs or something)
>>
>>60707288
>* Prefer references to pointers. References means less worrying and more dereferencing (if needed, try to avoid raw pointers) in a higher scope.
C++ references are fucking retarded though. It is seriously one of the biggest misfeatures of that giant clusterfuck.
Why would you tell someone to use them, let alone C++ at all?
>>
>>60707451
k tard
>>
>>60707451
Not him, but I'm often torn between references and pointers. Usually I lean towards pointers because I'm a control freak and I feel like pointers provide me with more control (and with more ways of shooting myself in the foot).

Could you elaborate?
>>
>>60707451
I would recommend pointers instead, makes it clearer when you're referring to an existing structure and when you're handling a new one.
>>
>>60707469
>>60707487
C++ references are literally invisible state changes.
>>
>>60706738
>electron
why would i use that in place of imgui?
>>
>>60707487
>>60707514
You should use references wherever you can because they can't be null, you should annotate the use of non-const references in the code tho.
>>
>>60707451
>C++ references are fucking retarded though.
pls explain.

I personally like them because it combined with the const keyword allows you to express intention really well, and means that the user of the reference doesn't have to worry about it being in a null state or some shit.

const ref = You can use this object I pass to you without modifying it.
ref = You can use this object I pass to you, and are free to do with it as you please.

Using references just means less `if (foo)` checks since it's guaranteed to be valid.
>>
>>60707451

I like explicit pointer usage because of the separation of value and reference semantics, it's always clear what the handle on your data is that way.
But without references we wouldn't have good stuff like operator overloading. And I don't see how move semantics could have worked.
>>
>>60707514
>makes it clearer when you're referring to an existing structure and when you're handling a new one.

Wut. References always indicate that you're using an existing structure, right?
>>
>>60707551
see >>60707529
>>
>>60707529
same for pointers?
>>
>>60707571

You have to refer back to the declaration to know. "Looks like a value, acts like a pointer" is not a good trait.
>>
>>60707585
int a = 10;
myfn(a);
assert(a == 10);

Tell me, is this assertion true?
>>
>>60707586
But if you want a parameter to be passed as a value without a needless copy taking place, you just make the parameter a const ref, no?
>>
>>60707613

Yeah, const references are harmless enough but I feel like they damage the purity too much.
>>
>>60707604
So your gripe with references is that you don't annotate that you're passing a reference like you would with normal pointers (using &)?

That's understandable, I suppose. Thanks for explaining.
>>
>>60707604
stupid example. first, you would not use myfn without know what it does. second, it would be the same with a pointer (
myfn(int *n)]/code]). this is why you have const.
>>
>>60707632
What defines purity for you then? I personally think that it's great that a language allows you to so firmly express the intent of a parameter like this, since it tells whoever makes use of your function what you aim to do with the object, without them having to look further than the function signature.
>>
>>60707649

To pass a pointer you'd have to do myfn(&x). That's explicitly declaring that my x might mutate, since a reference is being passed.
>>
>>60707649
It's more for when you're reading code later, or code you didn't write yourself.
All of this invisible garbage and implicitness makes C++ MUCH harder to reason about.
If I see
int a = 10;
myfn(&a);
assert(a == 10);

I would think "I see a pointer being taken; the value of a might change".
>>
>>60707671
>>60707662
>I would think "I see a pointer being taken; the value of a might change".
and what would you do then?
>>
References are good but implicit casting to non-const references are bad. In my C++ code, I always annotate every use of non-const reference, like
 fun(/*out*/var); 
, this is why I kinda like Rust's requirements to explicitly use & and &mut to cast a value to a reference, even if it clogs the code somewhat.
>>
>>60707655

It should be clear what everything means at a glance.
If I see fn(x), I should know that means my x won't mutate. If I see fn(&x), it suggests the opposite. If I see x.doThing();, I want to know it won't have side effects outside of my scope like x->doThing();.

Value semantics are one of the most powerful features of C++ over many other OOP languages so I think it's helpful to be clear what is a value amd what is not.
>>
>>60707690
I would be able to make better conclusions about the state of the code, and possible execution paths it might take.
>>
>>60707721
I personally don't mind having to look at the function signature to figure that out, but I can definitely see why you think it's shit.
>>
>>60707514
Use reference wherever you can, pointers wherever you must. Using pointers is rare in modern C++.

https://isocpp.org/wiki/faq/references#refs-vs-ptrs
>>
>>60707853
This is some of the most retarded non-justification for references I have ever seen.
How can you take those WG21 fucks seriously?
>>
>>60707837

I'm not the original guy.
const Foo& is useful because you get one less copy and the guarantee of no mutation. Foo&& is useful because the original Foo won't live long enough for you to see the mutation. But Foo& breaks the rules, so I prefer against using it.
>>
>>60707872

There's some weird shit on that site.
Like recommending ditching raw arrays and using shit like
template <size_t n> void myFunc(std::array<foo, n>  arr)
over
void myFunc(int n, foo arr[])
everywhere.
>>
>>60707926
>type safety is weird
>>
>>60707975

It seems excessive to create a new function for each different array size. Won't that bloat the code?
>>
Hey /dpt/, is this a dumb way to concatenate numbers and strings together for output? How do you usually do that in Scheme?

(display (string-append(number->string(+ 1 2 3))"A"))
>>
>>60708014
(map display '(your list of items faggot))
>>
>>60708033
I'm a statically typed brainlet, sorry. Guess I'm used to the overloaded + operator too much.
>>
>>60708033
Doesn't that operator return its input verbatim though?
>>
>>60708048
>I'm a typed brainlet
Removed the redundant words.
>>
>>60707540
I don't see the big deal with the fact they can be null. If its possible to pass in a null value, then your program should handle it in some way, be it via an assertion or an error return code.
>>
>>60708014
in racket

(displayln (~a (+1 2 3) "A"))
or
(printf "~AA~%" (+1 2 3))

i think chicken scheme has printf

otherwise

(format #t "~AA~%" (+ 1 2 3))

see https://srfi.schemers.org/srfi-48/srfi-48.html
>>
>>60708189
That's a lot of checks for something you already know at the compile time, namely, that the reference can't be null.
>>
>>60708189
>>60708220
The key point is, using references forces your calling code to be correct. It changes the design in a way that you know to be correct. There's no possibility of it being potentially wrong/null
>>
File: 1493420738148.jpg (286KB, 1920x1080px) Image search: [Google]
1493420738148.jpg
286KB, 1920x1080px
>>60704655
I'm probably the smartest person in the room. Just saying.
>>
>>60708235
>using references forces your calling code to be correct
An assertion does the same while keeping the code clearer to read (as discussed earlier.) Besides, its not as if references are completely waterproof either.
int *n = new int;
*n = 3;
int &nr = *n;
delete(n);
/* What's does n point to? */


Null pointers are hardly a problem and if they are, a null pointer error is extremely easy to detect. Its another thing with invalid pointers, and references don't protect from that.
>>
>>60708360
> An assertion does the same while keeping the code clearer
How is it clearer if it's just an additional line with assert? Then again, static guarantee >>> run-time assert in any case.
>>
>>60708389
Clearer as discussed earlier, in that while working on the insides of the function itself, a pointer is more easily distinguished from having been passed in by reference rather than by value. Its the syntax with references that bothers me, in that you can't tell just by looking at the use of the object whether or not its an existing object or something in local scope.
>>
>>60705284
Which dialect?
>>
>>60708415
Well, I agree, implicit casting to/from reference was a mistake. Still, I think it's better than the shit you can get yourself into with raw pointers.
>>
>>60708426
Shen
>>
>>60704655
What's a good book for learning C?
>>
>>60708601
Common Lisp the Language, 2
>>
>>60707604
yes
>>
As an Indian, should I learn Haskell or Rust?
>>
>>60708625
In C++, you can not guarantee that from that code snippet alone.
>>
>>60708639
Neither, these are languages for whites only, you should really stick with Java.
>>
>>60708639
Java is the language for you
>>
>>60708639
>Indian
You can maintain your lifeforce only by using Java-related languages.
>>
>>60708643
that seems dumb
>>
>>60708660
So, you're saying should learn Scala or Clojure? Latter is dynamically typed, which I do not like.
>>
>>60708643
Neither can you in C, t b h, myfn can be a macro, and many function-like things in the stdlib are.
>>
>>60708673
Sure, using anything unrelated to Java would be like eating garlic as a vampire.
>>
>>60708673
Scala is a pretty pajeet language, but it's an advanced pajeet language that only the upper pajeet castes can learn
>>
>>60708674

Macros are evil.
>>
>>60708710
#NotAllMacros
>>
>>60708710
Only non-hygienic ones.
>>
>>60708733
>hygiene
>>>/trash/
>>
File: 5.jpg (44KB, 1217x709px) Image search: [Google]
5.jpg
44KB, 1217x709px
Javalets, when will they learn?
>>
>>60708710
So is Google.
>>
>>60708738
t. pajeet
>>
OK I'm gonna learn Scala. Seems like a good blend between functional and oop features.
>>
>>60708759
http://www.lihaoyi.com/post/WartsoftheScalaProgrammingLanguage.html
>>
>>60708750
Python is slow and gay.
>>
>>60708674
>and many function-like things in the stdlib are
I'm not aware of any standard C function that modifies an argument without taking a pointer to it first.
Also, people are generally aware of how shitty non-hygenic macros are, and try to make an effort not to betray expectations.
Only ONCE have I ever run into a library macro that modifies its arguments in a weird way without making you take a pointer to it first, and that was ncurses.
>>
>>60708750

>python
>>
>>60708776
Yeah..no
>>
>>60708750
Python 2:
print "Hello World"

1 character less, therefore, obviously, Python 2 > Python 3
>>
File: bakabaka.png (510KB, 782x1238px) Image search: [Google]
bakabaka.png
510KB, 782x1238px
>>60708750
>>
>>60708791
I don't care, as long as it's Python
>>
>>60708788
https://benchmarksgame.alioth.debian.org/u64q/python.html
https://benchmarksgame.alioth.debian.org/u32/python.html
Python BTFO by pajeet lang
>>
>>60708819
I'd take a few seconds extra of execution times over hours of extra coding work required to code in Java over Python.

But maybe you wouldn't
>>
>>60708800
My post was supposed to demonstrate that "the less characters I need for Hello World, the better the language" logic is inherently stupid and doesn't even make a bit of sense.
>>
>>60708829
>coding
>code
>>>/g/wdg/
>>
>>60708833
Maybe not better, but definately more convenient and less prone to errors.
>>
>>60708750
# bash
echo hello world

What do I win?
>>
>>60708829
>a few seconds

>n-body algorithm
>Python 3 : 787.02 seconds
>C++ : 9.31 seconds
>>
>>60708837
>>>/autism/aspergers/
>>
>>60708860
That's about 13 minutes difference, now factor in the extra time it took to write that code
>>
>>60708847
Are you clinically retarded?
How does a length of some arbitrary entry level program corelate to error safety??
Or are you just trolling? If you are, then good job I guess, since I fell for it...
>>
>>60708875
Less characters means less room for errors and less debugging
>>
>thread full of autistic posting about things these people don't know about but just meme about yet again
>>
>>60708900
>meme
>>>/v/
>>
>>60708894
>one liners are very much readable and not prone to mistakes ;^)
>>
>>60708872
> time it took to write that code
if you're using a tool that relies on that code do you think someone is going to care how long someone took to write it? programming is something you take your time with
>>
>>60708900
It's a thread about coding, ofcourse there's going to be autists
>>
>>60708902
>everyone who calls us out on crapping up yet another thread is from >>>/v/
>>
>>60708911
If you are billed by the hour, he sure as heck is going to care
>>
>>60708911
Don't even bother talking to him, even Lisp dominates Python, and Lisp is more expressive.
>>
>>60708912
I don't know why programming specifically brings out the worse autists though. you can post perfectly clean, fast and optimized code and some mega autist will completely ignore that to point out something inane
>>
>>60708927
To be fair nearly everything on that site dominates Python. I believe it's the 3rd slowest language listed.
>>
>>60708872

>Programs only run once
>>
File: tepru_emacs.jpg (136KB, 960x1280px) Image search: [Google]
tepru_emacs.jpg
136KB, 960x1280px
What is the best editor and why is it Emacs?
>>
>>60708958
Because Lisp.
>>
>>60708958
spacemacs
>>
>>60708958
Multithreaded emacs when?
>>
>>60708930
>it brings out autists who know nothing and thats something you should begin to see after dealing with this thread's posting
>>
>>60708958
atom and visual studio code are the two current best editors. it's where all the cool stuffs are not happening and where the packages are kept being updated. programming in a reactive environment like atom is comfy and joyful. the truth is that wed dev is making desktop development great again.
>>
>>60708978
Fear not anon.
It's in """""""""""""""""""""""""""""""""""""""""""""active""""""""""""""""""""""""""""""""""""""""""""" development.
>>
javascript:quote('60701248');
i know it works dumb butt, i was asking if an interviewer would think i'm retarded for doing it that way and if it's a cop out
>>
File: 1488455828323.jpg (71KB, 718x783px) Image search: [Google]
1488455828323.jpg
71KB, 718x783px
>when he's too much of a brainlet to understand useful programming abstraction
>>
>>60709115
What is useful?
>>
>>60705538
#define DECLARE_HANDLE(HWND)
#define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef name##__ *name
HWND thisIsYouMainWindowFaggotInHungarianNotation;

Why is this hard? If you have "expertise" in C/C++ windows programming is easy

>Software Architect
>Microsoft
>$120K salary
>>
I'm retarded
How to return an enum in Java?
>>
File: 1496165557716.jpg (329KB, 1834x1200px) Image search: [Google]
1496165557716.jpg
329KB, 1834x1200px
>>60709147
>>
>>60704738
You ARE the botnet, Anon.

Anyway, I don't know how to code. I feel ashamed, since my old man's a sysad of legend.
>>
File: 1477638246484.png (834KB, 1200x1080px) Image search: [Google]
1477638246484.png
834KB, 1200x1080px
can someone confirm this?
>>
>>60709225
Years of industry experience confirm this.
>>
>>60704655
I'm trying to clean up AGS source code.
>>
File: 1415091883626.png (184KB, 392x766px) Image search: [Google]
1415091883626.png
184KB, 392x766px
>>
>>60709204
>implicit parallelism
kek. like with ocaml, amiright?
>>
>>60709335
Can we not, though?
>>
>>60709400
I don't see why you wouldn't do something like this.
>>
>>60709225
Inventor of Turing machines was a gay man and the first programmer was a woman. Makes you think
>>
>>60709415
Because it's sepples. You don't use macros in sepples. You use templates.
Program in real language if you want to use macros.
>>
>>60709335
>russian hackers
>>
>>60709419
>(((Inventor of Turing machines was a gay man and the first programmer was a woman.)))
it does make you think, huh
>>
>>60709486
alonzo church also developed turing machines at the same time as turing himself but he gets none of the glory
>>
>>60709472
иди нaхyи
>>
File: Sophie_Wilson.jpg (291KB, 640x426px) Image search: [Google]
Sophie_Wilson.jpg
291KB, 640x426px
>>60709419
The designer of ARM processors is a transgender.
BSD and TCP/IP were created by gays from Berkley.

It's like straight males aren't even trying.
>>
>>60709524
I don't know what this means but I assume it is a virus intended to hack the UK General Election
>>
>>60709567
eбaл cyкa
>>
Are there any articles for memory management with custom networking protocols built on top of UDP?

I need to implement a UDP server that can handle quite a lot of users (hundreds), but I'm really uncomfortable with the memory management part. Should I really just malloc every packet and keep it in memory until it gets acked (or is too old to be valid for an ack)? Should I just have one large memory pool for all the users' packages, or separate, per-user pools? I've done small scale UDP before and there, per-user memory pools were valid, but I don't know how valid they would be with a larger amount of users.

Any pointers?
>>
>>60709594
oh shit my bitcoin farm

now it's making rubles
>>
>>60709606
What's wrong with TCP or SCTP if you need acks anyway?
>>
I just made game loop class but instead of making the update and render functions overloadable methods I made them attributes that are lambdas.
So instead of making your own class that inherits the loop you just instantiate the loop and assing the attributes some lambda function.

How bad of design is that?
>>
>>60709630
Its a real-time app so there are some messages that are time-critical, but don't need to be super reliable.
>>
>>60709633
Its not any worse than virtual methods certainly, though relying on lambdas smells a bit of the old "using a feature just because its there" syndrome.

Anyway, in both cases you would only have one instance of the object in total, so either method is fine. I've made some game engines and usually for the different game state's I've made a struct that has a couple of function pointers in it (update_and_render() etc.) Which is essentially the same thing.
>>
>>60708905
do you have a moment to talk about our savior, lord haskell?
>>
>>60708978
tfw your text editor needs to be multithreaded to work in a timely fashion
>>
>>60709518
Turing got attention because he was timid, cuck and gay and Jew media wants to potray a "communist" image to greatest thoery of that time. Simple
>>
File: 871c3cea692b45c89fa0d93f717154fa.jpg (229KB, 1600x1200px) Image search: [Google]
871c3cea692b45c89fa0d93f717154fa.jpg
229KB, 1600x1200px
Do I exclusively need Steam to publish my game?
Can I not publish my game on my own website or blog?
>>
>>60709962
Plenty games are distributed on steam + gog + other platforms
>>
>>60709962

You can publish your game anywhere. Steam just makes it more likely that you'll get sales.
>>
>>60709962
There's nothing stopping you from releasing it on both, though releasing it on your own personal site is redundant as everyone will just buy it from Steam.

It's rare for a dev to have enough visitors for it to be worth publishing on their own site. If you can't make up the difference Steam takes(30~40%), then don't bother.

also, >>>/vg/agdg
>>
>>60709962
release core game on steam
release 'critical' DLC at half the price of the game on personal site
>>
>>60710073
what if your game is entirely f2p?
not the op of that question
never read the steam contracts

will they just charge me something?
>>
File: 547575757.jpg (58KB, 720x480px) Image search: [Google]
547575757.jpg
58KB, 720x480px
>taking database organization tut for college
>people actually do this boring data entry shit for a living
>this hell of boredom
I just want to be done so I can go back to learning programming and making stuff.
>>
How do you announce a project you have written on git and when should you do it? (As early as possible? usable version? stable version?)
>>
>>60710042
>>60710061
>>60710073
>>60710125
Ok thanks.
I liked the anon's idea of selling DLC through website. Thank you very much. Now I can plan to have "attractive" things in main release and put "enchanting" things in DLCs.
>Although I am not sure about if steam has a policy regarding this.
Also, my game is top down one with multiplayer support. Think of Stardew Valley mixed with Don't starve but its very retro with graphics like old time. Not using any XNA or builder. Pure DirectX/OpenGL.
>>
>>60710188
> Now I can plan to have "attractive" things in main release and put "enchanting" things in DLCs
kek, don't actually take my advice anon I was shitposting. you'll possibly look like a dick for doing that
>>
>>60710148
some people are autistic and enjoy organizing entries
>>
>>60710220
This is what EA and Ubisoft do.
>>
>>60710258
Those people need to be automated
>>
>>60710158
What do you mean announce a project on git? You put a clone link on your website or something if that's what you mean (if you use Gitlab or Github or a similar website, you'll find it on the front page of your project).
>>
>>60704655
Rust is the most powerful programming language.
>>
>>60704655

Cringeworthy code OP.
>>
>>60706359
gitgud at chess
>>
All memes aside, what's the best language to learn if I just want a job, and already have experience programming in Java? Also, how do I know if I'm actually good enough to have a position programming except for the obvious "pass an interview"?
>>
>>60710441
its not cringeworthy its just non-scalable and not abstract

looks like they're manually adjusting velocity based on difficulty. what if there were multiple difficulty settings? would anon then say "if(difficulty == "easy", do this", if("medium", do this". screams of boilerplate

they'll learn the hard way when that shit implodes on them mid-development.
>>
>>60710450
>memes
>>>/v/
>>
File: p16017-Amber-Anti-Rust_2.jpg (68KB, 600x600px) Image search: [Google]
p16017-Amber-Anti-Rust_2.jpg
68KB, 600x600px
>>60710414
>>
File: 1493970686877.jpg (84KB, 560x452px) Image search: [Google]
1493970686877.jpg
84KB, 560x452px
>>
>>60710500
I like this >memes meme.
>>
>>60710524
>memes meme
>>>/v/
>>
>>60710450
>Also, how do I know if I'm actually good enough to have a position programming

by not asking if you're good enough
>>
>>60710450
>All memes aside, what's the best language
I'm not in the industry or anything but the fact that Java is the most taught language at universities and has virtually become the standard should be a hint.

Intuitively thinking, that and the fact that programmers are required to work together as groups should mean that in all likelihood the best language to learn if you want a job is simply the most popular. Going by this logic the best choices are probably Java and Python. Again, this is if you just want "a job." You're more likely to be hired if you're proficient in a language people know about because it's popular, and if you use the same language as the other guys on the team, so statistically it's simply more likely to land a job with the most popular language(s)/languages taught at universities.

By contrast if you're an some elitist programmer who only uses Lisp and Assembly or something you might be leagues better than the Python and Java scrubs but employers aren't going to care if you can't work with them.
>>
File: 463636.png (1MB, 811x1024px) Image search: [Google]
463636.png
1MB, 811x1024px
>>60710148
>doing SQL
>>
File: 5.jpg (10KB, 300x100px) Image search: [Google]
5.jpg
10KB, 300x100px
Working on my imageboard, 4kev.org
>>
>>60710564
>Java is the most taught language at universities
That's just sad.
>>
>>60708328
Seeing how you're the only person in your room, that's not saying much.
>>
>>60708328
Go back to the 80's little Carmack
>>
As a Romanian, what is the best language for me?
>>
>>60710614
yerp
https://www.joelonsoftware.com/2005/12/29/the-perils-of-javaschools-2/
>>
File: andrei.gif (2MB, 304x256px) Image search: [Google]
andrei.gif
2MB, 304x256px
>>60710668
Why do you even ask?
>>
>>60710614

You're telling me, I actually fell for the CS meme.
>>
new thread
>>60710740
>>
>>60710678
top fucking kek, this guy thinks that the diffrence between "great programers" and "mediocre programers" is understanding "pointers and recursion."

Surely someone with such great credentials would have contributed to some great open source projects ...

https://github.com/jspolsky

oh ...
>>
>>60710707
>meme
>>>/v/
>>
>>60710564
>Java
I believe MIT only uses python
>>
>>60710851
berkeley uses scheme
>>
>>60710759
Not saying he has contributed to any project, but you're talking as if Github was the only place hosting projects.
>>
>>60711007
just saying it doesnt jive well when his definition of great programer is "one who understands pointers and recursion"
>>
>>60711046
Where did he claim this?
>>
>>60711090
>Java is not, generally, a hard enough programming language that it can be used to discriminate between great programmers and mediocre programmers.
>there are two things traditionally taught in universities as a part of a computer science curriculum which many people just never really fully comprehend: pointers and recursion.
>>
>>60704985
Many programs, like wicd, are just plugging together libraries and doing I/O and configuration. I'm sure there are some languages that tend to make programs like that easier to write. I don't think Ruby is one of them however.
>>
>>60712751
>I/O
Stopped reading right there.
Thread posts: 334
Thread images: 39


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