/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1550204543821.png (315x320, 109K)

Other urls found in this thread:

en.wikipedia.org/wiki/One_instruction_set_computer
en.wikipedia.org/wiki/1-bit_architecture
stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
github.com/xoreaxeaxeax/movfuscator
twitter.com/SFWRedditGifs

None of the people who complain about C++ in these threads have written any noteworthy software.

job hunting
pic unrelated

Attached: 1549494840908.png (550x783, 382K)

cute anons ITT

Attached: 1489949173240.jpg (1280x720, 130K)

No C++ program is ever finished or noteworthy just like JS frameworks

What's so wrong about C++ maps?

Rather than returning some kind of proxy object, std::map returns a reference to value_type when you use operator[]. That means it will implicitly construct one for a given key using the default constructor if you ever form an expression using operator[].
Beside that, iterator spec requirements require the map to use a horribly inefficient implementation.

I like C#

I like you

But I don't like C#

I know multiple programming languages but never made anything of value

I hate both of you.

friendly reminder that most of programming is just writing trivial proofs for trivial propositions

I love everyone here

Attached: 1469228315259.png (466x632, 188K)

It's good for counting stuff tho

Maps in general are good for that. std::map and std::ordered_map technically meet the requirements of one. They just fail at both implementation and interface.

S-senpai...

u2

Attached: 1554729601400.png (873x1079, 929K)

16bit computers are enough
we could have stopped there.

C Hashtag is like a less shitty Java

>millenials actually think the # symbol is called hashtag

Unironically this. Fast computers encourage lazy programming

>company I work at
>old machine had very low level program written in C and Assembly, didn't even have a screen just printed out the result
>new machine is a smartphone board running Android, that boots into a fucking app
>it's actually slower than the old one

#me

you're not sharp my friend

octothorpe

Attached: 1551640701429.jpg (669x746, 42K)

>writing unit tests
>1000 random tests
>run it 20 times, no errors

>show it to prof
>runs it once
>"Uncaught exception!"
>smiles at me
>Maybe next time user

Attached: 1554840773157.jpg (500x514, 27K)

>property testing

Horrible teaching style.
Reminds me of that one x86 assembly project I did. So many lines of assembly, obviously my team and I understood the language, one test segfaults, failed.
It's like failing you in English because you made a single grammatical error.

kek

Attached: 1554457238319.png (700x700, 21K)

>write an autopilot software
>it segfaults only just once, crashing the plane
>africans start chimping over one little mistake
Shaking my head

Just as deprecated as Java.

Woah! JavaScript rocks!

Attached: 1487999008154.png (767x598, 427K)

Where does /dpt/ pirate his programming books when googling "[title] + pdf download" fails?

libgen

I recognize this elf

Fuck guys. I feel like such a fucking retard. I look at the leetcode questions and I dont even know how to solve the easy questions or where to start when I try to do a problem. I'm a freshman CS Major, and my school has taught me fuck all about c++ or any language. How do I deal with this feeling? Should I just accept that I'm a brainlet that will never be able to code and apply to mcdonalds?

Attached: SmartSelect_20190125-122334_Google.jpg (1080x702, 161K)

post an example
I ain't registering to that site

Can you solve it without any code? On logical steps, not "python will do magic if I believe in it"?

ask for help with the questions you can't solve
what classes have you taken?

Thanks, but Google is telling me this site is dangerous
I'll just buy it for 90 bucks

(you)

Attached: 1503336438913.png (600x497, 128K)

Progress:
- Added stripped highlight to indicate what is outside the selected node context.
- Fixed rotation widget fade in.

Attached: context.webm (904x510, 1.51M)

>what classes have you taken?
Object oriented programming in Java and Women in Computer Science

Attached: 1553812940492.jpg (600x538, 112K)

This is an example I saw the other day and just felt so overwhelmed. My current c++ is really easy because she literally already gives us the code completed, we just have to edit it so that it gives the values and things that are specific to the problem she gave us. So it's not really a good way to learn at least in my opinion, because idk what the fuck does, I'm just mindlessly replacing things already coded.

Attached: SmartSelect_20190411-112711_Chrome.jpg (1050x1308, 420K)

still working on that anti-weeb AI

Attached: fucking weebs.png (642x336, 120K)

Also just as a side note, I'm just desperately trying to learn things on my own because I dont feel like my current university will prepare me for the industry

still working on that anti-pepe and anti-wojak AI

Attached: 1453062891381.jpg (1440x1080, 99K)

sounds right to be concerned. what exactly do you have to edit?

based

the fuck is this nlp garbage
this is why I never sign up to these sites

What's a good langauge if I want work, but don't want to write JS?

That's not a c++ üroblem, it's a logical problem. Can you solve it in the pseudoest of pseudo code?
After about a year in university everyone has the language skills to solve this, yet many people can't.
Give me an algorithm in English if you think it's about your c++ knowledge.

This is an example of code that is given. She gives us notes with the code we need to write already done, and for this project she already gave us the code that we need to edit. What scares me is that I take a look at this picture and idk what the fuck is going on, I want to understand what esch line of code does, but it seems like an impossible task because it will lead me down a rabbit hole of various things that I would have to learn. And I have to know this shit asap to get at least a shitty internship in the summer of my sophomore year.

Attached: 20190411_113726.jpg (4032x3024, 2.49M)

Probably stupid design question.

Lets say I have pic related, where I have a drawable interface, an abstract shape class implementing it, a decorator and then multiple kinds of shapes.

These shapes implement code required to calculate what points are inside the shape (e.g. ellipse) or on the border of the shape.

However, let's say I want another piece of code to calculate if a certain point is inside an ellipse, without having a drawable ellipse.

How do I decoupe this in a clean way?

Attached: Screenshot_20190411-173619_Squid.jpg (1536x2048, 263K)

this is just a definition for a class named 'Grosspayclass' and all of those are definitions for methods and variables, some being overloads.
It just states what the names of methods are and what kind of arguments they take. Also variables in the private: section
there's no implementation here

Shape
Ellipse : Shape
Box : Shape
Triangle : Shape
Drawer
EllipseDrawer : Drawer
BoxDrawer : Drawer
TriangleDrawer : Drawer

Or just live with the fact that shapes are drawable without necessarily drawing them.

See like that I understand. What I have an issue is that it seems so hard to memorize or come up with that type of code in general off the top of your head. It's easy to look at code and explain what it does, at least for me it is. I have difficulty with coming up with it in the first place

>CObject
>CString
>CObList
>CStringList
Yikes

So you'd say you struggle with syntax.

Yea, I want to be able to look at a problem and solve it with my own skill and intuition without the need to look up answers. What good will it do me if I can only say what my code should do without ever being able to practically manifest into existence

that's still not a C++ problem imo. It's more of a design problem, you need to know what the problem is and be able to break it up to make sure you understand how the program should work. After that you can start implementing it.
Honestly anyone who gives out these financial problems should be shot in the fucking head because that shit is so fucking boring. Glad I had a creative cpp teacher who came up with his own problems about hobbits and military actions

That seems like a good solution (for now atleast)

Want to get better at software design, so I don't want to create any holes

Knowing the problem and breaking it up is the easy part. Making the code is what trips me up

Then start solving problems, and start as simple as you need to. If you're used to having a harness like that, forgo one and choose problems that are as simple as is necessary to succeed in those circumstances.

Alright I know python quite well and I know C to some degree. What's the best C# book out there? It's time to learn something statically typed that's actually comfy

Didn't mean to sage

Attached: 1554235590615.jpg (444x464, 45K)

then I don't know, is the lack of knowledge about c++ features the problem? Just practice writing it then I guess

Is "code reuse" just another way of saying "deliberately introducing unnecessary dependencies"?

Where can I find good problems to do ? Can you give me good books or places to start in order to learn and do problems?

>He uses a bloated programming language
en.wikipedia.org/wiki/One_instruction_set_computer

Attached: laughs1.jpg (238x212, 12K)

Yea, exactly the lack of knowledge of the language is the problem. And trying to learn it seems daunting, I wouldnt know where to start it what to do, and what if I forget everything I'm trying to learn

>he uses a bloated 4bit, 8bit, 16bit, 32bit, 64bit etc. architecture
en.wikipedia.org/wiki/1-bit_architecture

Attached: laughs2.jpg (300x168, 9K)

Stick to the basics. You can solve basic problems if you know variables, functions, loops and conditionals.
C++ has a lot of features but you don't need any of them until you're comfortable with the basic things.

Attached: announced sage.png (330x109, 9K)

you can either go continue with the leetcode bullshit while looking stuff up until you see it used enough to understand how and when to use it, it shouldn't be a problem IF you do understand how to solve the problem. Or maybe go read a book to learn c++ on your own. I studied c++ like 5 or so years ago and now I don't remember jack shit about it since I never had the chance to use it, so gotta start from scratch, but I'm trying the faster books instead (accelerated cpp, tour of cpp and specific topics afterwards)
stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

github.com/xoreaxeaxeax/movfuscator

So is c++ even worth learning? Are there better languages that are more used in industry and will increase my chance of getting hired ?

Should I bother learning Java if I'm starting Kotlin, or will it be fine to dive right in then look up specific stuff exclusive to java retroactively?

>xoreaxeaxeax
Based

C++ is absolute shit. Stick to C.

depends what you want to work with or in
either way Im no qualified or knowledgeable enough to say, but if you just want a job then learn webshit and go to >>>/wdg/

you should know Java if you're going to write in kotlin. You should know how kotlin translates to Java otherwise you'll end up writing very inefficient code.

Lads. I'm learning c++, since it's what we use for our computer science classes, and I'm loving it more as I read the chapters in our text. I'm at pointers now and everything just makes sense, I feel like I can make any data structure if I plan properly before I type.

Is C even more interesting? Wouldn't mind digging in deeper in the future for lower level work.

Attached: 012120190110jpg.jpg (1142x649, 233K)

See

Does using undocumented internal APIs of proprietary software constitute reverse engineering? I'm just trying to develop a plugin, could this get me in trouble?

Attached: 1538547627774.png (200x200, 93K)

Thought so, been doing java for the past 2 weeks with the intention of moving into Kotlin. Thanks for the confirmation lad.

C is pretty much a subset of C++.

>Is C even more interesting?
no

That doesn't refute shit.

Stop being a brainlet, please. C++ is trash.

You've never written something beyond a simple toy program in your entire life, you c hacker syndrome ridden faggot.

C++ is trash, yes. What I'm asking is, though, how is C better?

This. Everything wrong with C++ is legacy shit inherited from C. Like headers.

it's not a hash, it's four pluses
C++++

Guys how do I use libraries in C++?
nothing works

Static or dynamic linking? Which OS?

Why would you assume that? is what I'm currently working on as a hobby, is it a toy program? I am currently working for a company also writing C desktop software.

C++ is trash because it complicates what already worked by adding unnecessary syntax that only makes things messy.

Include the .h
link against the .lib
have the .dll in your .exe directory when you run it

Anyone here know how to use springboot? I have a program that needs to be finished in the next 2 days and would be willing to pay a bit to get it done. All that needs doing is adding the ability to upload files to and download from mysql. I have the login system done and want it to be setup so user can only download the files they upload.

>C++ is trash because it complicates what already worked by adding unnecessary syntax that only makes things messy.
Yeah, because

double (*func)(double)


Is so much easier to read and write than

std::function func

>>C++ is trash because it complicates what already worked by adding unnecessary syntax that only makes things messy.
reminder that c programmers criticism of C++ is literally just
>me brainlet, me not understand complex things like metaprogramming or lockfree
i respect functional fags for their criticism
i do not respect cniles