Old thread: What are you working on Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
gist.github.com
github.com
twitter.com
what's the type of undershirt called that has thin straps
it's like a training bra but the straps are thin and it's longer
Tank top?
Camisole?
Learning C#.
Should i use ReSharper or will it just automate shit for me that i'd be better off doing myself?
>Rust
>17
2017 Year of the Rust Programming Language
fuck of shills
>"c++ is easier, user"
>virtual function calls
>vtable
>shitty implementaton of mutexes
>procedures/methods are recognized by arguments and may have same names
>"lol, you don't need copy and paste, just slap these definitions 50 times in front of procedures/methods"
>template bloat
>c++11
>new versions being released like new OS
>streams
>STL / Boost
CPP should've been just C with classes and namespaces.
such retarded thing couled've been only designed in university
OCaml master race!
>CPP should've been just C with classes and namespaces.
No. Good generics (ie. templates) and namespaces would have been enough.
Fuck off nigger
>C++ is too complicated for me :'(((
Then fuck off back to some baby language like Go or PHP
I hope you mean properly parametric rather than with template specialization (which completely destroys any semblance of reasoning).
How do you write DRM for software?
Enjoy your buffer overflows.
>if you don't like the insane complexity of C++ it's because you're a bad programmer lolol
Delusional C++ fags.
you dont
good quality products is your DRM
>generics
surprise, they're part of C11
I would, but that usually only happens in C
The bad programmer blames the tools.
>buffer overflows
>C++
>The bad programmer blames the tools.
Doesn't apply. That would be me using C++, making bad software, and blaming C++ for it. I don't use C++.
Oh it does still apply, yes. And not using a tool before criticizing it isn't exactly something to be proud of.
I've used C++ in the past so I can speak from experience.
you're misinformed user
How does a product being quality stop people from uploading it to the internet?
Ok, so the crux of your argument is you've tried X and you don't like X so anyone who uses X is delusional.
I don't know what the world would be doing without your opinion — except, you know, using one of the most popular and powerful languages in the world.
You don't. The only safe thing is to not put it, or at least a crucial component, on the user's machine at all. You can sell services, but not bytes.
Some people might want to still give you money in exchange to support you. DRM may turn these people away.
No, the argument is that I've used C++ and agree with most of from experience, but it's not like I'm a bad programmer and blaming it on C++.
Of course. Otherwise I would have just say template.
Well, you did say template, so I'm just making sure.
Most of is complete bullshit, though. Half of it is a list of feature, the other half is plain wrong, and the premise that C++ is easier is a strawman.
If you agree with that then clearly you haven't seriously used C++ before.
gist.github.com
template engine i wrote last week. can any anons give feedback on this so i can add/fix things?
>Half of it is a list of feature
Bad (-ly implemented) ones. Though it doesn't touch on the particularly bad things at all, like how badly C++ implements copying and moving for RAII, the proliferation of different kinds of references, how it uses exceptions in general, etc.
>the premise that C++ is easier is a strawman
I don't agree with that part or the "C++ should have been C with classes" BS.
What would you recommend me lord
D?
>graduate
>unemployed for two months
>get a job
>lose it two and a half months later for bullshit reasons
>job hunt for a month and a half
>get to the last stage with a company then they decide they're not going to hire anyone
>job hunt for three more months
>get to the last stage with a company then they just ghost me for a month
>tfw I've now spent ~8/10 months sinceI graduated unemployed
programming was a mistake
>mytpl.php
enjoy your shitposts user
Hell yeah (different user tho)
Enjoy your GC, tbqh
Might as well use Java or Python at this point
It seems like you stopped hunting for jobs once you got to a good standing with a company.
Dont. I also needed 7 months until my employment started after graduation, and only got the job after being unemployed for 5 months.
@nogc
it's just a placeholder name. why would anyone shitpost because of the name?
Rust
Not used by any library, not even the standard library, so you can't really ever escape it.
If it exists at all, GC should be opt-in, not opt-out.
>php
>If it exists at all, GC should be opt-in, not opt-out.
And it shouldn't be global. It should be done regionally. And it shouldn't be tracing, it should work with RAII and simply make it more efficient to allocate and free memory.
In C, how do I send two functions for different types (one for int and one for char) to a generic function depending on the type entered?
For example two print functions to a generic print function?
So, essentially Sutter's GC library.
github.com
Jai
>Might as well use Java or Python at this point
lmao no, those languages are garbage
My point exactly
>generic
>c
Use macro.
so? it's still being used and i don't see why i shouldn't use it unless i wanna be a hipster.
I'm just practising.
I have two inputs, one char and one int,
Then I want to print all my chars in a way and all my numbers in a different way, but I want to have a generic print functions that sets up a printing loop instead of doing it separately in each function.
D isn't even dissimilar enough from C++ for C++ to not incorporate its features and make it pointless. Sad!
I keep hunting, it's just going nowhere
Was that a sentence?
>Sad!
kys for real
I'm learning C# today and I was nailing this series of video tutorials and questions until I got to this one.
Go for it Sup Forums, I already fucked up, I'm curious to see if anyone makes the same mistake.
If you have 2 different vars, of 2 different types.
why do you want a to plug them both into the same function?
Make 1 function for each type...
If you have 1 abstract var which can be 2 types, then i understand where your coming from.
In which you need an id along with that abstract var to remember what the type is.
Then use that id to decide which of the 2 previous functions to call.
>java
>no struct, union, enum, unsigned, typedef
kek
why even bother with C++?
>/dpt/
>What are you working on Sup Forums?
>NEETs proceed to argue about which language is best
>No mention of what anyone is actually working on
why am I not surprised?
Hey
Why don't you post something
Because Java is hot garbage
Answer is D. car - 2
(userValue == 1) is false so message is set to "car"
I'm actually here looking for ideas. I've recent set up some infrastructure for kicks on AWS and I am looking to put something on there.
I thought it was C, 2 - Car
But now I see where I fucked up. Those {} kind of confuse the shit out of me.
Hey /dpt/ heres what im working on, a C SDL GL, txt editor/IDE.
The purpose is to minimize visual clutter (maximize code space) and allow easy and remap able click-buttons to my scripts.
Since your so interested please tell me what you think.
I'm reading through "The D programming language" and testing every feature I come across to build a solid understanding of the language, before I write any actual code.
>tfw can't fizzbuzz in c
don't bother reading that book
it's irrelevant management masturbation material
what do you get out of making something that's not interesting and has already been made
>The purpose is to minimize visual clutter (maximize code space) and allow easy and remap able click-buttons to my scripts.
#include
int main()
{
fizzbuzz();
return 0;
}
it was sort of a trick question
for things like Console.WriteLine() and String.Format()
the first argument goes to {0}, second to {1}, and so on
Oh and so far it doesn't seem like a language that actually lets me do MMM conveniently. Which is extremely disappointing considering its advertising itself as a systems language. I'm sure there's some flag that disables all GC but to me that looks like you're basically disabling associative arrays and plenty of other nice features. There's no place where I can define an allocator for these features it seems.
I hope I'm wrong. Because down the road being locked to GC will be awful. My programs normally don't actually allocate memory with unpredictable sizes. And that's the only place where completely dynamic allocation shines.
>hot garbage
just be productive, write java code and don't spend half your life learning C++ you dummy
'no'
class yes {
public static void main( String [] args )
{
System.out.println("yes!");
}
}
>just be productive, write java code and don't spend half your life learning C++ you dummy
I always wonder if these people realise what they're saying. This person is actually encouraging not knowing what the fuck is going on and leaving his fate in the hands of others completely.
And when you've chosen java, tried to avoid knowing intricate detail. You've also removed any attempt at relatively OK performance.
So why pick java then? It's not particularly expressive. The only advantage which isn't nullified now is its expressiveness and perceived portability among management. And even python manages to do both of those better.
>Welcome to Java, where even the fucking main function has to be in a class
No thanks
Not him, but performance is a feature.
If out of the box performance is "good enough" for your app why not focus on the app itself instead of wrestling with the language? productivity and being able to ship in a timely manner is also very important.
>C++ outperforms Java meme
nice try but smart compilers do all the work anyway and Java is just as fast nowadays
but what's true C++ is nowhere near as fast as pure C, so that gotta make you realize that you've been wasting your life you colossal faggot
value YOUR time and use Java!
>I will remain a C++ cuck because of a made up problem
whatever, user.
I've got you beat my friend:
>Graduate with ChemEng PhD
>Thesis primarily experimental but significant element of theory/modeling using both commercial and Fortran/Matlab simulations
>On-site interviews at oil and biotech companies but no job offer
>Desperately accept academic postdoc for shit pay thinking it will be similar work
>Find out it's 100% simulations
>Numerical method is fucking obscure shit nobody in industry will ever fucking use
>Prof keeps asking for more simulations so I can never try to work out my own ideas/experiments
>Finish postdoc
>Fucking NEET for 10 months now
still waiting to hear back from another interview but yeah, programming is a fucking mistake
Where is this meme that C++ is somehow less productive than Java coming from
And why do I use C++ all of a sudden
this
these faggots act like Java is Python or something when in reality it's on the same level as C++ without the headache
It's actually part of a bigger problem, OOP-only
I'd rather use a language that gives me a choice
Damn my dude take the PE exam and go make concrete, beer, or some comfy shit like soap.
You will make good money and can work on your own stuff in your spare time.
you don't need to actually implement with OOP in your apps
>Java is just as fast
Toppest of keks.
Java only comes close in some cherry-picked benchmarks, and even then only after fighting the garbage collector like mad.
With Java, yes
Everything is an object
>having objects = OOP
fuckin newfags
I'm not a c++ programmer but C++ can certainly be as fast as C. You can be limited in certain choices you make, and sometimes (fairly rare if you avoid msvc) the compilers aren't up to snuff. But most abstractions are actually zero cost in C. Which would be impressive if it wasn't so extremely specific and limited.
If you don't understand what the limitations of compilers are and how java's JIT doesn't compared to people who care then you really shouldn't comment on this topic.
Yes. Exactly. If your out of the box performance is fine (aka, 'performance doesn't matter') why pick a language that's not more expressive than Java.
People don't pick C++ because it's the easiest language they know or because it's the easiest language to write their shit in. It's because it has characteristics that allow them the control they need.
Java just doesn't make sense for this hypothetical application we have. I'm not a high level programmer when we're talking java and C++ but I know they're quite far down the ladder if high level of expression is the goal.
But you're using a language that's built around oop entirely. The libraries you use provide an OOP centric interface more often than not etc.
You could do OOP in C but the lack of language supported inheritance would make it a mess relatively speaking. And I doubt the compiler could keep up. You run into the same (but opposite) issues in java/c++. Though the C heritage and multiparadigm of c++ leaves you more options.
It can reach near C++ performance on optimised code after the JVM has had time wasting gigabytes of RAM on building caches and optimising it further. And then GC pause happens.
>Java isn't OOP only
What am I reading
>then GC happens
Hey. user. That's not what we're benchmarking here. We only time our inner loop. Don't be 'unfair'.
It isn't. Programming with object doesn't mean you program in an object oriented manner.
But as I said here It doesn't make sense to use java if you're not doing oop because it's among the only convenience it provides.
>nearly everything is an object
>not object-oriented
being forced to do shit inside an object is not OOP
just write a fucking object you lazy fuck
*object=class
>nearly everything
I thought even 'primitives' inherit from object.
What doesn't inherit from object in java?