/dpt/ - Daily Programming Thread

New one because old one hit bump limit.

What are you working on, Jow Forums?
What's your favorite memory of programming?

Attached: -g- Hope ya took notes!.jpg (1920x1080, 290K)

Other urls found in this thread:

boost.org/doc/libs/1_66_0/libs/test/doc/html/index.html)
personal.cis.strath.ac.uk/conor.mcbride/pub/hasochism.pdf
medium.com/@jcoterhals/perl-6-small-stuff-3-custom-operators-and-overloading-d3a76554d5d8
tutorialspoint.com/cplusplus/cpp_inheritance.htm
twitter.com/SFWRedditGifs

Previous Thread:

Salesforce development is bullshit.

Dumb boost::test question:

I'm trying to create several unit tests for my "Pixel" structure (a wrapper around a vector of four ints) by using the test boost library (boost.org/doc/libs/1_66_0/libs/test/doc/html/index.html)

However, whenever I compile the following code:
#include


//Include the file we're going to test (duh)
#include "../imageProcessor/Pixel.cpp"
#include "../imageProcessor/printContainers.cpp"

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Pixels
#include


BOOST_AUTO_TEST_SUITE( inversion_test )
BOOST_AUTO_TEST_CASE( inversion_test1 )
{
Pixel testInv = std::vector {15, 30, 45, 60};
testInv.invert();

std::vector rhs ={255-15, 255-30, 255-45, 255-60};
std::cout

Attached: Screen Shot 2018-06-24 at 6.09.04 PM.png (1234x1160, 233K)

>#include "../imageProcessor/Pixel.cpp"
>#include "../imageProcessor/printContainers.cpp"
Why have you done this

All ERP "development" is bullshit, my friend.

quality

Attached: python-pass.jpg (901x1755, 179K)

>dopey_man_holding_a_diploma.png

do people actually care about gotos that much

200 pages into Lutz's Learning Python. The first real programming I've done. Hating my job and a having a couple projects in mind is solid motivation for working my way towards something hopefully more technical.

Attached: IMG_0213.jpg (640x640, 130K)

fn foo() {
label loop(int num_bottles) {
sing(num_bottles)
if x > 0 {
goto loop(num_bottles - 1)
} else {
return
}
}
}

yeah, especially in this kind of context. if the reason for the goto is clear and the label is right above then who gives a shit?

controlled goto via labeled blocks is okay. But goto is rarely the correct choice, and most often just the laziest way to do things.

goto is the correct way to do error handling and resource management in C.

Well it's C, so the "best" is usually pretty grim.

Yes. It's a cargo cult mentality among inexperienced programmers. The elders said X is bad so it's really bad and should never be used. They're actually supposed to avoid it until they know how to use it only when appropriate, but most of them never get to that point. This happens constantly with all sorts of things, sometimes with entire languages.

Don't call C "grim." It's the correct way to code.

Goto being avoided isn't really the best example of cargo cult programming (that's reserved for OO). The simple fact is this: if you're relying on goto to do your control flow, you haven't abstracted enough, or your language hasn't provided you with sufficiently advanced tools to abstract over whatever you're trying to solve with goto.

This. All you need is C and Lisp.

C is pretty grim though.
Especially after having used a modern lang for so long.
C lacks so many QoL stuff.
I'll kill myself before i go back to a module-less language. As well as having a proper package manager + build system.
Make can go die in a fiery pajeet hell.

Strange way to write Rust and Haskell.

Incredibly odd way to write Nim & Idris.

>Idris
I hyped as FUCK for dependenthaskell to bring more type-level metaprogramming into the mainstream.

We can only hope the brainlets abandon haskell for the superior language. But i don't have much hope.

Nim and Idris are trash. What's wrong with you?

And they're trash because?

>the paper for dependently typed haskell is literally called `hasochism`
personal.cis.strath.ac.uk/conor.mcbride/pub/hasochism.pdf

Try Agda or Coq.

Oh lord, are you the agda autist that sperged out about those debug functions awhile back?
haskell is more embarrassing by the year.

Haskell is to Emacs Lisp as Idris is to Common Lisp as Scheme is to Agda.

>nonsense is to nonsense [..] my biased subjective preferences [...] i don't like thing
you can stop posting any time.

You can start writing code any time, but I doubt you will.

i already am, what about you?
How's that totally serious lisp interpre- i mean project coming?

this shit tier online lecture c++ class

Attached: Untitled.png (1920x1050, 170K)

Sup Jow Forumsentlemen? How do I get my flow back? Worked a job for a couple of years after college. Frequently had to leave my desk to go do IT stuff. Now that I'm in grad school and working on my dissertation project, I find it incredibly difficult to work for more than half an hour without wandering away from the desk or tabbing out to Jow Forums. I know I gotta get this shit done and see if it works, but this all seemed so much easier when I was a kid zoning out into visual basic for 5-6 hours a night after school. It just doesn't feel magical anymore my dudes.

What do the 3 braces after "return" do?

Lisp is shit but you'll get nowhere arguing with that retard. Let him feel intelligent or superior while he shows his lack of experience.

>while he shows his lack of experience.
???

Any decent software is basically written in Lisp with a small C core

>Any decent software is basically written in Lisp
wwwwwwwwwwwwwwwwwwww
lisplet delusion could power the Earth.

Start smoking.
Im not kidding either, having an excuse to get up, walk around, lounge outside for awhile really fucking helps me. It also gives me an excuse to remove myself from difficult problems and let my brain think about it idly, which solves a lot of stuff

It applies to everything from text editors to operating systems.

Emacs has never been relevant outside of Lisp circle-jerks.
>OS
wwwwwwwwwwwwwwww

what is guixsd

we should have had scheme in the browser, not javascript

Is there a C++ equivalent to C# {get; set;} in classes?

That...
...that might actually work. Thanks user, gonna go hit up the store for a pack of smokes and a spiral notebook.

you want something like haskell, not c++

Any better ways? I don't want to put everything in the same folder.

That, and I still can't find what's causing the error

Employed Haskell programmer reporting in

Attached: 1470792067398.png (268x237, 36K)

Best Java IDE? I've used Eclipse in the past just wondering if there's one better.

>what is guixsd
An OS even less relevant than BSD.

Must be nice to work with a programming language and not a shitlang

Can programmers wear fursuits to work?

How hard was it to get a job in haskell?

Use Intellij, eclipse is a bloated pile of shit.

IntelliJ IDEA is good. The community edition is free

Netbeans is alright.

thanks, just downloaded IntelliJ

How much does Mc Donalds pay you?

pretty sure he's asking why you're including .cpp files

Generally, most C/C++ projects have a separate "include" directory for header files. You can pass an argument to the compiler on the command line to tell it where to look for header files (just use the path to your "include" directory). Then remove the "../" from your include statements and they should work.

because c++ still doesn't support putting template declaration and definition in different files

I started learning Python today and am reading through some online books. I got a giddy feeling inside me when the first few lines of code I wrote worked.

That is all.

Attached: 1505775254640.png (346x413, 108K)

>Python
Wow, Python's a pretty difficult language, last time I tried it I couldn't manage it

Congrats, mate!!
You're gonna do great things!!

Any projects planned or things you might wanna do?

compilers are neat.

Attached: Capture.png (1054x599, 181K)

I never thought about posting when I started, oh well.

listen up. this place didn't exist when I started programming. quit yer whining

I've just always wanted to learn how to program, and I know many of the people in my career field (Biomedical sciences) use Python too

Python is fiendishly difficult to use. I'm surprised you didn't start with something easier like Idris or Agda.

I haven't touched programming since i finished uni 5 years ago. Some familiarity with java and c++. Been looking to get back and am interested in mobile dev. What's the standard these days? Is it still glorified web dev? Kotlin worth a look? Flutter? What's the future here, assuming it takes 2ish years to get back into the swing of things.

Attached: 1529164289941.jpg (485x443, 39K)

>mobile dev
swift for ishit
unironically kotlin for androidshit

Have you heard about Typescript in conjunction with Apache Cordova?

sub postfix:($a) {
return ($a - 32) * 5/9;
}
sub prefix:($a) {
return $a.round(0.5);
}

say 85F; # Output: 29.44444...
say ~85F; # Output: 29.5.


how do I do this in Python?

Have you heard about Purescript? It's an actually good language for the web.

just use Elm
It's an actual FPL for front-end webshit.

You can redefine ~ but not F

What language is that btw?

Perl 6
medium.com/@jcoterhals/perl-6-small-stuff-3-custom-operators-and-overloading-d3a76554d5d8

just a neat article about some quirks and was curious how to do it in another language. like this

sub infix:($a, $b) {
return $a - $b;
}
say 80 + 20; # Output: 60

>buy a cheap chromebook for programming since i everything i don't need anything that powerful
>everything i do is on a vm, so no actual processing happens locally
>install ubuntu on chromebook
>chromebook works fine until i try to open atom and chrome at the same time
>chromebook shits itself
>memory usage: 95%
>switch to vim
>huge learning curve, but once i got past that i actually prefer it over gui editors now

ok i like vim now, so how do i make vim not look like ass.

Attached: Screenshot_2018-06-24_22-06-27.png (1366x768, 105K)

>vim
>in 2017+1

Laugh at this boomer

>using an imageboard in the current year
Yep. This ones going in my boomer folder

Attached: 1b4.jpg (585x357, 28K)

Why does C have header files if it's not OOP?

so you can split files up?

Just include the C file?

>module-less language
Aren't all languages capable of moduling?

WHAT THE FUCK IS nullptr???????????

Attached: 4463468.png (290x286, 87K)

Function prototypes for dynamic linking.

what if your function is used before it is declared?
in a header file you can declare all your functions and then define them in the .c file and it won't matter what order you use them in.

Dumb question here.
If my base class has private variable members, and my derived class has a public inheritance.
Do I have to redefine those variables in my derived class?
For example I can't do below because 'name' and 'num' are private variables. I can define the variables as protected and it will work. But I was under the impression even though the members are private, they are still inherited and can be accessed within the derived class. The restriction is that the derived class can't access the private variables of the parent class.
class A{
string name;
int num;
public:
A();
A(string s, int n){
name = s;
num = n;
}
};

class B : public A{
string address;
public:
B(string s, int n, string a) : A(s, n){
address = a;
}
};

Not sure try dereferencing it

declare* i mean

Where can I download programming?
Surely I need programming installed before I can move on to more advanced languages like python?

Attached: Chris Pietrantonio Bunny.jpg (627x480, 42K)

THE COMPILER DOESN'T ALLOW IT, YOU FUCKING NIGGER

Attached: 26516.jpg (248x250, 8K)

Ugh so much programming languages

Why not create a meta-programming language that codes for me? I just give it my thoughts and outputs code, we did the same with assembly and compilers, why this wouldnt work?

tutorialspoint.com/cplusplus/cpp_inheritance.htm

try class B: private A {...};

types prevented this

(((Poos))) will not allow you to. You will be promptly get rid of if you try something like that. We've lost one too many good men already to them. Do you also want your body to be found in the shitting street?

I know it points to 0x00000000. I just wanna know, when should it be used?

Attached: 9986884.jpg (420x550, 25K)

It's just a safety precaution to make sure that in case you do deference it it fails in a way that isn't horrifying.

Of course if you never make that one highly-specific mistake then it's fairly useless.

>why this wouldnt work?
Because your thoughts are useless mess.
Preferably -- never.