[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 | | Home]

/dpt/ - Daily Perentie 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: 329
Thread images: 39

File: prog.jpg (105KB, 473x496px) Image search: [iqdb] [SauceNao] [Google]
prog.jpg
105KB, 473x496px
What are you working on, /g/?

Previous thread: >>61172149
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [iqdb] [SauceNao] [Google]
old_hag_langs.png
173KB, 600x355px
>>61175574
First for C.
>>
Pretend I don't know anything about C development aside from writing some source files and running them through gcc.

Where can I find information on the full toolchain for C dev (unit testing, debugging, makefiles, etc...)?
>>
>>61175501
>>61175525
You've got it anon. Most of my complaints in one box. A lot of these are solved in strict mode, though, and most of the rest are solved in TypeScript.

But then there's problems endemic to both languages (TS and Python) in my opinion that TypeScript can't solve, such as not knowing statically whether reading/writing to a property of an object has side effects.
>>
>>61175574
Working on trying to understand Rust's borrow checker. Progressing quite slowly.
>>
File: 1494459298349.png (218KB, 504x475px) Image search: [iqdb] [SauceNao] [Google]
1494459298349.png
218KB, 504x475px
>>61175574
C influenced languages get an automatic F in my book.
>>
Compiler now features some actually useful test programs thanks to a researcher who allowed me to use the ones he wrote.
>>
>>61175677
Dumb Yui poster.
>>
>>61175660
Well, I'll be more specific. If you purely keep to TS, you shouldn't run into problems, but interacting with third party libraries exposes the fact that you're actually using JS's object model.
>>
File: clever thoughts.jpg (18KB, 500x265px) Image search: [iqdb] [SauceNao] [Google]
clever thoughts.jpg
18KB, 500x265px
>>61175574
Is OOP acceptable as long as you maintain referential transparency?
>>
>>61175886
Languages with referential transparency aren't acceptable.
>>
File: 1498827530190.jpg (24KB, 400x399px) Image search: [iqdb] [SauceNao] [Google]
1498827530190.jpg
24KB, 400x399px
>>61175886
OOP is never acceptable.
>>
File: oh_boy_here_we_go.png (277KB, 416x406px) Image search: [iqdb] [SauceNao] [Google]
oh_boy_here_we_go.png
277KB, 416x406px
>>61175886
OOP is fine as long as you komment your kode!
>>
>>61175976
klossy go home please
>>
>>61175886
>referential transparency
I don't see how that could be constructively achieved in OOP.
>>
>>61175986
why not?
>>
>>61176014
It's kinda at odds with OOP.
https://wiki.haskell.org/Referential_transparency
The statefullness ruins it.
>>
>>61176052
How are classes and methods inherently stateful?
>>
>>61175986
Replace all mutator methods with named constructors/factories
Done.
>>
>>61174563
Yay, fixed it
(let [n (Integer/parseInt (read-line))
xs (for [i (range n)] (Double/parseDouble (read-line)))]
(doall (map println (map (fn [x]
(loop [i 0 acc 0]
(cond
(= i 0) (recur (inc i) 1)
(= i 1) (recur (inc i) (+ acc x))
(= i 10) acc
:else (recur (inc i) (+ acc (/ (Math/pow x i) (reduce * (take i (next (range))))))))))
xs))))
>>
>>61175951
this
>>
>>61176052
>Shitkell
Stopped reading right there.
>>
nice twitter picture faggot
>>
>>61175986
try Erlang
>>
How do I make a small (< 1 GB) Linux virtual machine for software development? All I need is a terminal, an editor and gcc.

I'm running low on space, if it's not possible I think I'll try one of those cloud IDEs
>>
>>61176138
Is Erlang better than Shitkell? If so, why?
Haven't heard much about it but I'm looking for a language.
>>
>>61176062
I did say constructively.
If all you're after is calling methods on stateless objects that's OK I guess. I didn't think that was what you're after.
>>
>>61176158
>install virtualbox
>pick a tiny distro like puppy
>get to work
Freebsd has premade virtual disc images though if youre lazy.
>>
>>61176158
>>61176235
Not programming related.
Try either >>>/g/fglt/ or >>>/g/sqt/
>>
>>61175574
Learning C; going through K&R
/* compute the gcd of two numbers */
int
gcd(int a, int b)
{
if (b == 0) return a;
return gcd(b, a % b);
}
>>
>>61176264
Your post isn't programming related either but you don't see me shitposting about it. Oh wait
>>
>>61176327
>K&R C

Enjoy unlearning it all later because it's dated as fuck
>>
How the fuck do I come up with a name for my fucking project
>>
>>61176499
>unlearn
It's C. All of it still holds.
>>
>>61176558
make new project that generates project names.
First you have to come up with name for the generator project though.
>>
>>61176620
That's absolutely wrong. Just because it *might* compile (and some of it won't under C99/C11), that doesn't mean you're doing it right.
>>
>>61176558
Pick out a minority group you want to trigger with the project name.
>>
Can men learn to program?
>>
File: board example.png (127KB, 760x570px) Image search: [iqdb] [SauceNao] [Google]
board example.png
127KB, 760x570px
I'm trying to learn C by making a simple board game. What kind of data structures should I use for representing a simple game board as in the picture?

I've already written some code which reads two tab-separated files. The first file contains all the nodes ("cities" and all the individual "steps" between them) on the game board. The second file contains the connections between every node and the type of each connection (airplane/car/boat).

This is basically my first programming project that's larger than Hello world.
>>
Trying to implement a kernel from scratch with no reference to see how much I remember, so far I'm having trouble.
>>
File: 1490062756843.png (102KB, 600x730px) Image search: [iqdb] [SauceNao] [Google]
1490062756843.png
102KB, 600x730px
learning java...having trouble with this problem. can anyone tell where i'm messing up?

stuck on this. not sure how to fix the issue with needing to add to the list as input comes in, what i have now goes on forever. before i only had one line.

https://gist.github.com/yvesklein/273d0726f7abc71999ef73be75eca2c5

prompt: http://www.codeabbey.com/index/task_view/modular-calculator
>>
>>61176806
>This is basically my first programming project that's larger than Hello world.
That's pretty fucking ambitious, especially considering you'll need to learn how to abstract visual data structures into computational ones.

I would create a "city" struct that contains an array of city structs, and call that "connections". Then for each city a given city is connected to, you populate that array with pointers to the other city struct objects.
Look up doubly-linked lists to get a grasp on how to work towards that.
>>
>>61176806
Use a graph/adjacency list
>>
>>61176868
what is your program even supposed to do?
>>
>>61176868
>list
Pointless.
Read the first line in and add it to a "total" variable.
Then keep your while loop and just += or *= based on the switchcase result.
>>
does the idris guy / welshfag use /dpt/?
>>
>>61176868
>what i have now goes on forever
Please tell me why you are expecting that do-while loop to stop. From what I can see, i = L and the length of the array list is L+1 at all times.
>>
>>61176900
its supposed to take input like this:
5
+ 3
* 7
+ 10
* 2
* 3
+ 1
% 11

and run through each successive line, operating according to what symbol is there.
then it prints the result.

for the above input, the result is 1.

>>61176928
why is the list is pointless? i don't see how this would lead to the desired output...

>>61176967
i know its wrong, i don't expect this to stop. i want to code it to stop...but i don't know what to do.
>>
>>61175677
Posts worst girl and has the worst opinion. Funny how these things works, huh?
>>
>>61177000

The idiomatic way to loop over every line in an input is this.
String currentLine;
while ((currentLine = stdin.nextLine()) != null)
{
// Code that runs for every line
}
>>
>>61177094
!
thank you anon
>>
>>61176891
Much appreciated Anon, thanks. I'll keep your suggestion in mind.
>>
>>61176499
second edition is ansi c genius
>>
>>61177381
>C
Obsolete.
>>
>>61177430
Tell me, meme-kun: what obsoletes C?
>>
File: 1406064339668.jpg (37KB, 540x370px) Image search: [iqdb] [SauceNao] [Google]
1406064339668.jpg
37KB, 540x370px
>>61177430
C the strongest
>>
>>61177464
>meme
>>>/v/
Opinion discarded.
>>
>>61177489
Sure, it's the strongest, but it's obsolete.
>>
>>61176868
You're only reading from the scanner once. Last line in the while loop should be something like
currentLine = stdin.nextLine();
>>
File: der_ewige_C.png (339KB, 387x550px) Image search: [iqdb] [SauceNao] [Google]
der_ewige_C.png
339KB, 387x550px
>>61177464
Rust-lang.
>>
Recommend me a name for imageboard software written in Java. Please no references to India and public shitting.
>>
>>61177568
AHAHAHAHAHAHHAHAHAHHAHAHAHA
>>
>>61177569
नामित शिटिंग बोर्ड
>>
File: 0321928423.jpg (49KB, 504x648px) Image search: [iqdb] [SauceNao] [Google]
0321928423.jpg
49KB, 504x648px
Is this a good book to lean C for a beginner?
>>
>>61177615
No. C(ancer) is obsolete. Learn Rust.
https://www.rust-lang.org/en-US/conduct.html
>>
>>61177631
Go back to tumblr, you SJW scum.
>>
File: CLW_OgzUwAAGh4q.jpg (105KB, 600x709px) Image search: [iqdb] [SauceNao] [Google]
CLW_OgzUwAAGh4q.jpg
105KB, 600x709px
Any other Rustaceans in this thread?
>>
File: fatniss.jpg (151KB, 634x1024px) Image search: [iqdb] [SauceNao] [Google]
fatniss.jpg
151KB, 634x1024px
>>61175679
>programming font without colors.

What the fuck
>>
>>61175574
Is it true that C is considered obsolete?
>>
>>61177700
No, because there is no viable replacement.
>>
>>61177720
what about this? seems like a good replacement. >>61177631
>>
>>61177750
No, Rust is not a viable replacement.
>>
File: image.jpg (164KB, 1430x2023px) Image search: [iqdb] [SauceNao] [Google]
image.jpg
164KB, 1430x2023px
>>61177615
I'm studying with this, I think it's pretty good and has plenty of exercises.
>>
>>61177786
why not? it seems like a good one.
>>
>>61177792
see >>61177631
>>
>>61177750
>rewrite your program every 3 months because shit keeps changing
Sounds perfect for a kernel or large program.
>>
FORTRAN
>>
>>61177837
Yeah,
IMPLICIT NONE
like a boss.
>>
>>61177837
This.
>>
So many autistic children in this thread.
>>
>>61177834
this. I am currently writing my own kernal and large program in C89.
>>
>>61177889
C confirmed only sane choice for kernel or large program.
>>
>>61177917
this! C89 and machine codes of course.
i'm trying to write a hand compiled kernal in x86 intel machine code.
>>
>>61177792
>C
Trash language, what it does is probably wrong.
>>
>>61177794
A proper C replacement would not have garbage collection (reference counting is a kind of garbage collection).
>>
>>61177889
>C89
>2017
Please anon, at least use C99.
>>
>>61177962
But what if it does reference counting without freeing memory with zero references?
>>
>>61177966
why? C89 is more hacker-like.
>>
File: 1495786516316.jpg (830KB, 1600x1200px) Image search: [iqdb] [SauceNao] [Google]
1495786516316.jpg
830KB, 1600x1200px
>>61175574
Jesus fucking Christ I've never seen a thread filled with so many incompetent retards.
>>
>>61177997
It's missing a lot of very useful features.
Mixed declarations/code, and designated initialisers are the ones that first come to mind.
All of this code is invalid C89.
printf("Hello\n");
int a = 10;

for (int i = 0; i < 10; ++i) {
/* ... */
}

struct thing a = {
.a = 10,
.b = 20,
};
>>
>>61178023
Go to >>>/vg/agdg for actual programming discussion
>>
>>61178023
Fuck off and write your micro kernel or small program in Rust, faggot.
>>
>>61178051
>games
Trash.
>>61178064
>Rust
>micro kernel
Trash.
>>
>>61178077
>>games
>Trash.
Because they have a purpose, they're more focused on getting stuff done than engaging in pointless language wankery and college first week homework.
>>
>>61177631
>No. C(ancer) is obsolete
kek
>>
>>61177660
What? I have syntax on for C++, the Pascal code uses a non-standard file extension though.
>>
>tfw you don't know what would be more efficient, memcpy'ing a few hundred bytes or recreating the data in place using a simple algorithm
>>
What do you do in Idris if it can't even check a basic case like this?

>f (C1 t) = t

>type mismatch between t
>and f (C1 t) (expected)
>>
>>61178265
If it's already in cache go for the memcpy
>>
>>61178267
(the latter error is using f elsewhere in the return type of a dependent function)
>>
>>61178267
>>61178284
Apparently it's been marked as partial
>>
>>61175652
dunno I just found it out as I went along

that zed shaw C book talks about debugging and makefiles
>>
>>61178430
Zed Shaw is a fucking hack, and his books are terrible.
>>
Is Scott Meyers worth reading/watching?
>>
>>61177962
>reference counting is a kind of garbage collection
And a bad one on top of that, but it's not what RAII is.
>>
>>61178466
yeah I know haha
>>
>>61178472
yes excellent prose
>>
>>61178472
holy trinity of cplusplus
meyers, sutter, alexandrescu

throw a bunch of bjarne in there and youre golden
>>
i KNEW kernighan was underselling D is for Digital saying its for tech illiterates. so many little nuggets of things i didn't understand from my professors. i just learned assembly from it (my operating systems professor didn't know the subject matter, genuinely. my school has 12 professors in the computer science dept). and that 132 represented in binary on your fingers is two middle fingers
>>
>>61175652
>debugging
just think really hard about what you're doing and put printfs everywhere
>>
Let's say I have a grid that can scale. in this case, height is 3, width is 4

abcd
efgh
ijklm


How can I mathematically only retrieve the letters from the top row? this means it should return abcd. language doesnt matter, but it can use any built in methods
>>
>>61178813
You can store the grid in a two-dimensional array and then access only the top row with a constant index:
gridArray[0][col]

where col is the index of the column.
>>
>>61178813
return A[0]
>>
>>61178813
head
>>
>>61178851
>>61178852
I see, thanks
>>
>>61178271
it's most likely not in cache but i think i'll go with memcpy anyway
>>
dpt what should I name my lisp-inspired programming language?
>>
>>61178889
/g/isp
>>
>>61178889
/g/ypsy
>>
>>61178889
gaylisp
>>
>>61178889
lisp inspired programming language or LIPL
>>
>>61178051
>click and drop game engines
>programming
???
>>
>>61178889
Linsp
>>
Was I being too nitpicky with my code review?

The issue: There was a line of code which was basically 2 / func(x) / 5. I wanted parenthesis so that it would look like (2 / func(x)) / 5.

I always prefer putting parenthesis around ambiguous lines even if it's obvious how it's interpreted.
>>
>>61179103
This is retarded, you are retarded.
>>
>>61179103
return ((((((6))) * (((1000000)))))); /* (((ambiguous))) */
>>
>>61179103
>around ambiguous lines
>even if it's obvious how it's interpreted.
what
>>
Anyone familiar with ncurses? Are these ancient tutorials from the 90s and 00s still relevant? It seems to have gone through several version updates since then, but I can't really tell if they've changed much or just did optimizations and bug fixes.
>>
>>61179103
fuck that shit, as long as you don't get a -Wparentheses warning you shouldn't have excessive parentheses
>>
>>61179117
In my retarded defense: I've encountered cases before where the issue was specifically that line of code. Someone prior had wrote it with a different order of operations in mind and as a result they weren't getting the correct value out of it.

>>61179124
Not asking for parenthesis around everything, but when you introduce cases where the order of operations actually matters I believe it's a good idea to delimit things with parenthesis so that it's not only explicitly clear that the line written is doing what it was intended

>>61179145
What I mean is you can look up the operator precedence table and immediately understand how it's interpreted at runtime. Sometimes things get mixed up when you're writing code though.
>>
>>61179145
>>61179117
>>61179161
how is it obvious what that's interpreted as? it depends on if the order of evaluation is right to left or left to right, which is shitty
>>
>>61179176
Ignore the Not Only there. Fuck I'm tired.
>>
>>61179176
Just use a language that uses the polish or the reverse polish notation instead of pushing parens into things that they do not belong to.
>>
> THIS IS /PROG/
resurrect it already ffs
>>
>>61179178
it's usually left to right regardless of the language
>>
>>61179207
>resurrect it
?
https://freesoftwarefoundation.org/prog/ and
https://dis.tinychan.org/prog/
>>
>>61179243
>>61179207
http://goatfinger.ga/
http://4-ch.net/code/
>>
S P E C T R U M
>>
Why should I wrap a C macro in a do{}while(0) loop?
>>
>>61179266
So it will work fine with things like if (...) macro; else if
>>
>>61179218
you're going to get bit in the ass one day with a bug you're never going to find because you're going to use a certain compiler for a certain language where it's not the case. till then whatever floats your boat
>>
>>61179103
Yes this is too nitpicky. Even if I have something more similar to your preference. I prefer to wrap high precedence operators in parenthesis like so 2+(3/5), which probably seems more stupid than what you're doing but I'd never complain at someone for not using or using parenthesis, within reason.
>>
>>61179207
Prog was made shit though.

I'd like if we had a board where you're intended to filter the text yourself to get it readable. So we can keep the worst of the scum out.
>>
>>61178764
That's the patrician way to debug desu. You may only need valgrind from time to time when you really can't figure out where you fucked up
>>
>tfw you make posts reaching the edges of your knowledge hoping for someone to correct you
>nobody responds so you don't know if you were wrong or right or if people just don't care
I do get a lot of corrections though. Thanks /dpt/
>>
>>61179264
What am I looking at
>>
>>61179469
You're probably just the smartest person on /dpt/
>>
>>61178764
>>61179464
Using printf for debugging is dumb. You take what's an automatic process and do it manually instead. Use a debugger. At worst it's equivalent to printf debugging.
>>
>>61179483
it's a waste of time unless you're really interested in low level details

fuck gdb
>>
>>61179493
>unless you're really interested in low level details
That's what I'm most interested in and debuggers provide no help. Plugging gdb into qemu is a guaranteed mistake
>>
Hi, I'm well versed in Python and I wanted to learn some c++.

Specifically I wanted to learn it to do some competitive programming, so if there are any resources to learn stuff about standard library, data structures and general syntax for competitive programming, please let me know.
>>
>>61179510
>competitive programming
Unrelated to your post but I still don't get how this is a thing
>>
>>61179474
c64 basic
>>
Imagine a very simple function, as an example. It calls some other function, blocks until that other function returns a value, and then returns that value itself. You're probably thinking of something like:
func(param) {
let result = some_function();
// if there is a problem, some_function will throw and func will too.
// very simple. happy days. :)
return result;
}

Right?
Now, imagine you also need to use Node and want this behaviour (instead of callback hell). Pic related is what you need. This is what almost every method looks like in the huge monolithic webapp I'm working on.

Fuuuuuuck Node.
>>
>>61179506
If you're most interested in low level details how about you compile with -S and check out the asm for yourself

>>61179510
Look at Herb Sutter's C++ books
>>
I like math and competitions, programming is like an extension.
>>
>>61179493
>gdb
It needs a new interface to be decent.
It's not designed with rapid debugging in mind.
Use something like NetBeans if you like. It still beats printf.
>low level details
You mean like breaking execution to inspect once you run into a special case? Come on. Trudging through millions of lines of print is not worth it.
>>
>>61179474
A typo.
>>
>>61179469
Are you me? I do the exact same thing to bait /g/ into answering me.
>>
>>61179584
gdb-tui
>>
>>61177654
I like Rust, but I'll probably take more time getting used to it.
>>
>>61178713
>alexandrescu
Of course!
module linq14;

import std.stdio, std.range, std.algorithm, std.array, std.conv;

void perform()
{
immutable numbers_a = [0, 2, 4, 5, 6, 8, 9];
immutable numbers_b = [1, 3, 5, 7, 8];

writeln("Pairs where a < b:");

numbers_a
.map!(n => numbers_b
.filter!(m => n < m)
.map!(p => n.to!string ~ " is less than " ~ p.to!string))
.each!(each!(writeln));
}
>>
>>61179826
haskell
import Text.Printf (printf)

numbersA = [0, 2, 4, 5, 6, 8, 9]
numbersB = [1, 3, 5, 7, 8]

perform = mapM_ putStrLn
[ printf "%s is less than %s" (show a) (show b)
| a <- numbersA,
b <- numbersB,
a < b
]
>>
>>61179867
Nice, anon
>>
>>61179867
n.b. in this instance printf is acting like sprintf and producing a pure string (it can do both, i suppose i could have done sequence_ rather than mapM_ putStrLn)
>>
Thing is, the more expressive you get the less efficient you become.
These are dark days
>>
>>61179902
In the case of simple list comprehensions (particularly in something like Haskell with rewrite rules and laziness) this sort of stuff is actually really efficient

because of high level techniques like deforestation, you might never actually see the lists you're conceptually manipulating in memory, they might simply be converted into enumeration or for loops

depends though, obviously abstract is generally slower
>>
File: 1497412840206.jpg (212KB, 600x600px) Image search: [iqdb] [SauceNao] [Google]
1497412840206.jpg
212KB, 600x600px
>>61175574
Is it a stupid idea to program a AI that changes 1's and 0's in a set amount of memory randomly for I guess an infinite amount of time to see if anything ever comes out of it?

Sure would be interesting if the "AI" made some circuits.
>>
File: 1496020714139.jpg (1MB, 960x1280px) Image search: [iqdb] [SauceNao] [Google]
1496020714139.jpg
1MB, 960x1280px
>https://github.com/mythz/swift-linq-examples
Literally toddler tier functional programming. Is it sad that Microsoft pajeets swear by it like some kind of holy godsend?

Like honestly, all those examples are so....
..
...trivial!
>>
>>61177464
ATS2
>>
>>61177464
Visual Basic
>>
File: 1486113391254.jpg (125KB, 800x720px) Image search: [iqdb] [SauceNao] [Google]
1486113391254.jpg
125KB, 800x720px
>>61179973
C i r n o
u
t
e
>>
File: 1484563420550.png (271KB, 413x338px) Image search: [iqdb] [SauceNao] [Google]
1484563420550.png
271KB, 413x338px
Programming is a girl job

Real men should join the army or work in construction
>>
>>61180105
What if you work for the army in cyber construction?
>>
>>61180105
>she doesn't work in construction automation putting ugly burly men out of jobs
Good luck being unemployed.
>>
>>61180105
what about cybersecurity?
>>
>>61179973
Just use any random number generator with any seed. Can't see anything AI about that.
>>
>>61180153
>cybersecurity
What is this new meme term?
>>
>>61180159
CSI Cyber
>>
>>61179973
You mean like you give it a memory segment that's executable. Have it use one part for what it considers its 'running' program and one part for the generation.
If you start sandbox that and start out at random eventually a stable system should occur.

It's not particularly interesting because you'd get things that just don't really do anything.
What you'd really want is to do that except give it some scoring metrics and some evolution simulation that lets it evolve.
That way it could start achieving a goal.
>>61180159
Been around for a long time now. It's just security with computers protecting intellectual property usually. As opposed to physical security that's locks and stuff protecting physical property (or intellectual property in physical form like deeds).
>>
>>61180195
>It's just security with computers protecting intellectual property
Sounds retarded and cancerous.
In fact, it makes no sense.
>>
>>61180210
Intellectual property might not make sense to a brainlet but believe me it's real.
>>
>>61180195
Scoring metric? What kind of evolution simulation? What kind of "environment"?

A memory segment that's executable would work, but I was thinking more of a grid with 1's and 0's that maybe can connect or not connect to each other.

Only problem I have is I'm not sure whether it's a good idea to introduce a "motivation to evolve/change" artificially.
>>
>>61180224
You seem to be trying to redefine what "Intellectual property" means.
In any case, cybersecurity is a pajeet thing.
>>
>>61180238
if you do software development or aim to do that at any point in the future and you call cybersec pajeet you're projecting. if all you do is code golf at home then ok, i guess you can call anything pajeet unless you're indian yourself
>>
Cybersecurity is for people too retarded to become cryptographers and too ignorant to know about safe languages and formal verification.
>>
>>61180265
>I know how to setup iptables
"cybersecurity"
>>
>>61180286
>i know how to write java and make UML diagrams
"software development"
>>
>>61180228
>a grid
How would you execute the grid?

My suggestion was basically have the program write binary instructions and then try to execute them until it figures out a system.
The scoring and evolution stuff is just machine learning. But usually with machine learning you give it inputs and outputs. You don't just let it go on a a piece of randomized data. What you could do is have some kind of metric as to how well its doing something. If it's a self modifying program you can run it over and over and have the score guide it in a direction.
A direction could be something abstract like system complexity (simply how many unique steps it goes through before it finishes/crashes.
Or something like
https://youtu.be/qv6UVOQ0F44
Where you actually have a goal and you evolve the program towards that goal.

In your grid scenario you could make what's basically a simulation game like the game of life where you let loose random inputs on it to explore things.

Just having a program that writes random data isn't particularly interesting.

Perhaps you should just elaborate on your idea yourself.
>>
>>61180294
I won't disagree, people who call themselves "software developers" or "software engineers" are dumb fucks, probably the same kind of people who call themselves as "cybersecurity experts".
>>
>tfw curry for lunch again.

currying leads to fewer arguments anyways
>>
File: 1474500624058.png (163KB, 653x892px) Image search: [iqdb] [SauceNao] [Google]
1474500624058.png
163KB, 653x892px
>>61180321
Do you happen to work in Microsoft?
>>
>>61180331
Excuse me, Sir?
>>
I bet the "cybersecurity" experts here don't even know how to use hash functions to encrypt data.
>>
How explicit about scope do I need to be in python?

If I have an instance method, do all the variables used internally/locally by the method need 'self.'? In what ways is it functionally different for me to just initialize my variables without 'self.' provided they're only intended to be used by my instance method?

Weird shit isn't going to happen, right? I'm not really a fan of all these implicit rules. I'm not going to end up with an instance method somehow initializing a static variable or something, right?
>>
>>61180312
if an administrator is calling himself a cybersecurity expert then he shouldn't be, but if you're working with a gov't security agency doing cybersecurity research or doing more than just implementation at a private firm who's purpose is hardening systems as a service then it's an apt term
>>
>>61180358
What is "#function"?
>>
>>61180358
i bet you don't even use a private key in your hashes, pleb
>>
How much should I charge to complete someone's CS class project? Similarly, could doing CS students' class projects be a lucrative side gig now that every dumbass and their mother are majoring in CS?
>>
>>61180362
>cybersecurity research
lmao

>>61180372
What does that mean exactly?
>>
File: IMG_2992.jpg (1MB, 1200x1600px) Image search: [iqdb] [SauceNao] [Google]
IMG_2992.jpg
1MB, 1200x1600px
>>61180309
That's pretty helpful, thanks anon.

I was just thinking more along the lines of binary circuits when I was talking about the grid.

0 = false
1 = true
- or | = connected
~ or \ = not connected
1 turns 0 on
0 turns 1 off

1-0~0~0
| \ \ |
0~0-1~1
| | \ |
1~1-0~0


Basically it creates its own binary circuits, and hopefully it can create something complex or more "structured" over time.

Eventually hopefully creating something useful or even intelligent.

I would LOVE to see it create some form of data processing and memory storage.
>>
>>61180386
>What does that mean exactly?
using a private key (that only you know) to sign the hash function, otherwise it could be easily replicated
>>
>>61180382
400-500 pounds, depending on the difficulty
>>
>>61180401
pounds of what?
>>
>>61180401
>pounds
>>
>>61180415
Fresh semen
>>
>>61180415
>>61180401
>2017
>pounds
Brainlets
>>
>>61180423
https://en.wikipedia.org/wiki/Pound_sterling
>>
>>61180436
Is this 1455?
>>
>>61180436
they're called quid
>>
>>61180358
You don't encrypt with hashes dummy. Hashing destroys information. You use a cipher to encrypt data. You can use hashes to verify that you (extremely likely) have the same piece of data without giving anyone the possibility of knowing what it was. But that's the extent of my knowledge of use of hashes in security.
Also nobody here claimed to be a security expert. Why don't you leave our thread if you're not even a programmer.

>>61180382
They're cheating so they pay a hefty premium on the actual work. Seems very lucrative actually.
>>
>>61180463
By turds
>>
>>61180479
does tha not know owt?
>>
>>61180394
So how would you have it modify the connections?
The state of the grid isn't that interesting to change manually.
>>
>>61180477
>You don't encrypt with hashes dummy. Hashing destroys information. You use a cipher to encrypt data. You can use hashes to verify that you (extremely likely) have the same piece of data without giving anyone the possibility of knowing what it was. But that's the extent of my knowledge of use of hashes in security.
You clearly don't seem to know much about them, huh? Saying that "You don't encrypt with hashes" is simply false.

>Why don't you leave our thread if you're not even a programmer.
I am a computer scientist and I have read my SICP.
>>
>>61180105

Historically, yes.

Turns out we're so much better than women that we out-competed them at programming too. We dominated it as a free market.

Women are so useless, they were so bad at the one intellectual pursuit that was originally DESIGNED for them that men completely overtook the industry too.

Now they need special help just to use tmux. Its sad really. Why is being female such a disability?
>>
>>61180490
>you don't know
God what a lame answer. Clearly know more than you who haven't shown a single ounce of knowledge of the topic.
>I've read SICP
Yeah yeah you've read the meme book. Great. You clearly don't have the mind for this anon so fuck off?
>>
File: 1498868356185.jpg (99KB, 1225x720px) Image search: [iqdb] [SauceNao] [Google]
1498868356185.jpg
99KB, 1225x720px
>>61180386
>What does that mean exactly?
>right after mocking based cybersecurity reseachers
>>
Why is /dpt/ so easy to troll? Stop giving 'duhhh guys I've never heard of cybersecurity duuuhhh i promise' any more You's.
>>
>>61180489
I have no clue, honestly.
>>
File: 1471639202610.jpg (96KB, 675x900px) Image search: [iqdb] [SauceNao] [Google]
1471639202610.jpg
96KB, 675x900px
>>61180509
>God what a lame answer. Clearly know more than you who haven't shown a single ounce of knowledge of the topic.
I would if you had kindly asked me.

>Yeah yeah you've read the meme book
A great book actually, you should check it out too, I doubt that you are smart enough for it though.

>You clearly don't have the mind for this anon so fuck off?
The mind for what?

>>61180519
Saying "use a private key in your hashes" to describe signing is just retarded so of course I had to ask what he meant.
>>
>>61180530
I bet you don't even know how to encrypt with a hash.
>>
>>61180543
>I would if you had kindly asked me
Oh its too late for you to actually show you're worth a damn now? How convenient.
>you should check it out
I've read it. It has a few useful bits to it but it a computer scientists view. Not useful for me.
>>
>>61180553
>Oh its too late for you to actually show you're worth a damn now? How convenient.
Not really, I will still reply to you if you ask me kindly.

>Not useful for me.
Of course someone of low intelligence such as you would not be a computer scientist.
>>
whats the most robust programming language
>>
>>61180580
every intelligent "computer scientist" wasn't a computer science major. they were physics and math majors. computer science is a joke. cybersecurity is a separate matter and is generally based
>>
File: 123.webm (2MB, 800x570px) Image search: [iqdb] [SauceNao] [Google]
123.webm
2MB, 800x570px
>>61175574

Making weird 3d shapes in fragment shaders.
>>
>>61180598
>they were physics
Physics majors who did well in CS are an extremely rare sight actually.

>and math majors
And this makes absolute sense because CS is literally maths.
In any case, I am not talking about degrees.

>cybersecurity is a separate matter and is generally based
As I said before, cybersecurity is for people too dumb to become cryptographers.
>>
>>61180580
OK. Reply. I'm asking kindly.
>computer science is great
This is simply not true. At least learn the history of your field. Even linguists are better than computer scientists (see Noam Chomsky)
>>
>>61180598
Then why do physicists and mathematicians write such awful code, and use such terrible languages?
>>
>>61180596
Java
>>
>>61180634
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra
https://en.wikipedia.org/wiki/Donald_Knuth
think of a famous computer scientist, search him on wikipedia, and then look at what he majored in
>>
>>61180596
Erlang
>>
C++ is the most beautiful functional programming language known to man.
>Write a function called appearances that returns the number of times its first argument appears as a member of its second argument.
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

template <typename Needle, template <typename...> class Haystack>
long in(const Needle &needle, Haystack<Needle> haystack) {
return std::distance(std::begin(haystack), std::rotate(std::begin(haystack), std::remove(std::begin(haystack), std::end(haystack), needle), std::end(haystack)));
}

int main(int argc, char **argv)
{
using namespace std::string_literals;
std::cout << in('i', "This is a big test"s) << std::endl;
std::cout << in('X', "This has none of the letter we are looking for"s) << std::endl;
std::cout << in('X', ""s) << std::endl;
std::cout << in(1337, std::vector<int>{5, 7, 1337, 1337, 21, -1337, 1337}) << std::endl;
return 0;
}

$ clang++ -oin ./in.cxx -std=c++14
$ ./in
3
0
0
3
$
>>
>>61180644
>OK. Reply. I'm asking kindly.
Read what a random oracle is and think how someone could use one to produce an OTP.

>This is simply not true. At least learn the history of your field. Even linguists are better than computer scientists (see Noam Chomsky)
How is that relevant to your quote (>computer science is great)? (The quote says that CS is great while you are arguing that computer scientists are shit - who entirely different things)

>>61180647
Proper ones like DJB (author of qmail and many other things) do not.

>>61180671
>https://en.wikipedia.org/wiki/Donald_Knuth
This article seems to agree with my post: he had a maths degree.
In any case, I do not see how this is relevant to the topic, especially when considering that CS was not a degree back then.
>>
>>61180596
something totally useless like haskell
>>
File: 1486428981152.jpg (111KB, 420x550px) Image search: [iqdb] [SauceNao] [Google]
1486428981152.jpg
111KB, 420x550px
>>61180678
EWWWW
>>>/trash/
>>>/trash/
>>>/trash/
>>>/trash/
>>>/trash/
>>
>>61180678
That's fucking garbage
>>
>>61179979
>fake asians
why would you do that to me
>>
>>61180737
It has a pemis.
>>
>>61180678
import Control.Monad.State

inA f m = execState (mapM_ (incIf f) m) 0

inc = modify (+1)
incIf f x = when (f x) inc

elA = inA . (==)
>>
>>61180737
>!nv
This tripcode reminds me of something
>>
>>61180761
,,,
continue
...
>>
>>61180678
What the fuck, pajeet?

auto count_appearances(T) (T target, T[] source)

{

return source

.filter!(x => x == target)

.count;

}

unittest

{

assert(count_appearances('i', "This is a big test") == 3);

assert(count_appearances('X', "") == 0);

assert(count_appearances(1337, [5, 7, 1337, 1337, 21, -1337, 1337]) == 3);

}
>>
>>61180703
>oracle & OTP
>confirm they share a piece of information
So exactly what I said then.
Anon you're fucking worthless. And you didn't even tell me shit.
>how are those two related
The people practicing CS and the field?
>it agrees with my post.
Except you belittle a math major for not being a computer scientist in complete opposition to your current attitude. CS isn't even programming related so I don't see why you bring your shit here.

What recent projects have you done anon?
>>
https://www.usajobs.gov/Search/?k=cyber
hmm... but cybersecurity is a meme, you just set up ip tables... easy money i guess
>>
>>61180760
better

inA f = foldr (\x -> if f x then (+ 1) else id) 0
elA = inA . (==)
>>
>>61180678
"This is a big test".count("i")
"This has none of the letter we are looking for".count("X")
"".count("X")
[5, 7, 1337, 1337, 21, -1337, 1337].count(1337)

even python can do it more elegantly
>>
>>61180817
import solution;
>>
>>61180703
>DJB
He wrote one piece of software long ago. His only achievement as a programmer is implementing his algorithms well. He doesn't write good systems at all.
>>
>>61179437
You mean it was the best board.
>>
>>61180822
#include boost
>>
>>61180703
>>61180826
more importantly, finding a small number of mathemeticians or physicists who can do it right doesn't change the fact that the overwhelming majority of them can't.
>>
>>61180802
>Anon you're fucking worthless. And you didn't even tell me shit.
If you weren't a total retard you would find it trivial to figure it out.

>Except you belittle a math major for not being a computer scientist
Except if you are claiming to be a math major I am not belittling anyone with a math degree. Also as I said before as well, I can't see how degrees relevant to this at all.

>What recent projects have you done anon?
I half-finished a dependent-typed lisp-like language, how about you anon?

>>61180826
He also wrote tcptools, dnscurve, some other dns tools, created the maildir format, etc.
>>
>>61180857
Actually, here https://cr.yp.to/software.html
And of course NaCL, how could I forget?
>>
File: 1498663897936.jpg (57KB, 540x532px) Image search: [iqdb] [SauceNao] [Google]
1498663897936.jpg
57KB, 540x532px
>he doesn't listen to fashy retrowave while programming

It's like you purposely DON'T want to be programming at maximum efficiency
>>
>>61180822
>>61180833
i don't get it, are you guys mocking or approving?
>>
>>61180857
>trivial to figure out
From that super vague description?
And you wanted this specific use case where I already presented you with the general principle of the usage of hashing?
I haven't read any security stuff at all and you posed that as a challenge.
>I can't see how degrees are relevant
You brought it up. I never said they were relevant. In fact I think any discussion of CS and relevant degrees is completely irrelevant here.
>I half finished a language clone
I imagined someone who primarily identifies as a CS person would do that.
I've written a generic output filtration system. It samples outputs (just text right now) and figures out the ways to categorize it and speculates on their relationship. It's a very useful tool for me.
>DJB projects
Again. Do these seem like merit in programming? I don't see that at all.
>>
File: 19429926.jpg (66KB, 750x695px) Image search: [iqdb] [SauceNao] [Google]
19429926.jpg
66KB, 750x695px
>>61180901
I don't listen to anything because it's easier to concentrate that way
>>
File: 1498790642513.png (25KB, 669x514px) Image search: [iqdb] [SauceNao] [Google]
1498790642513.png
25KB, 669x514px
>>61180917
>t. brainlet

https://www.youtube.com/watch?v=OzoSOTdEyRo
>>
You have 1minute to write a node for a binary tree GO
>>
File: 1485665922653.jpg (327KB, 900x861px) Image search: [iqdb] [SauceNao] [Google]
1485665922653.jpg
327KB, 900x861px
>>61180913
>You brought it up
I never did, don't put words in my mouth please.

>I half finished a language clone
Heh, of course you would ignore the dependent typing part, I bet you don't even know what it is.
Have you ever tried to design and implement a proper language, even without a proper type system anon?

>Again. Do these seem like merit in programming? I don't see that at all.
How dare you insult one of the greatest cryptographers and mathematicians of the current era? Aren't you aware that you are using his code and algorithms every single day?
>>
>>61180935
dumb frogposter
>>
>>61180678
In C++ this is just
template <typename T, template <typename...> class U>
unsigned count(T t, U const &u) {
unsigned r = 0;
for (auto const &e: u) if (e == t) r++;
return r;
}
>>
>all these people who worship cybersecurity without even knowing the basics about cryptography
Really makes you think, huh?
>>
>>61175679
Awesome, any specific book to make a compiler?
>>
>>61180969
U needs template args
>>
>>61180969
errrr, oops
template <typename T, template <typename...> class U>
unsigned count(T t, U<T> const &u) {
unsigned r = 0;
for (auto const &e: u) if (e == t) r++;
return r;
}
>>
>>61180977
thanks
see: >>61180979
>>
>>61180979
In D it's just
auto appearence(T)(in ref T target, in ref T[] source)
{
import std.algorithm;
return source.count(target);
}
>>
>>61180989
now extend it to take an arbitrary predicate rather than (== x)
>>
>>61181003
>only works with []
>>
>>61181015
Give me an edge case
>>
>>61181031
anything that isn't a [] array
>>
>>61180956
var exec = require('child-process').exec;
exec('/usr/bin/env tree', function (err, stdout, stderr) {});
>>
>>61181004
template <typename T, template <typename...> class U>
unsigned count(T t, U<T> const &u,
auto c = [](T const &a, T const &b) {
return a == b;
}) {
unsigned r = 0;
for (T const &e: u) if (c(t, e)) r++;
return r;
}
>>
>>61180956
typedef struct node node;

struct node {
void *value
node *left;
node *right;
}
>>
File: 1498370543100.gif (982KB, 320x287px) Image search: [iqdb] [SauceNao] [Google]
1498370543100.gif
982KB, 320x287px
>>61181107
>typedef struct node node;
>>
>>61181126
Got a problem with that?
>>
What are your arguments against Garbage Collection?
>>
>>61181129
>polluting two whole namespaces for one fucking type
>>
>>61181134
1) It's expensive and its side effects are invisible.
2) It really seems like there should be a compile time algorithm for it.
3) It doesn't even do anything you can't do on your own for a much lower cost in processing time, it's just that doing it on your own is really inconvenient and can be an intellectual challenge.
>>
>>61181205
>3) It doesn't even do anything you can't do on your own for a much lower cost in processing time, it's just that doing it on your own is really inconvenient and can be an intellectual challenge.
So in other words, your argument against it is that it's abstraction.
>the state of c tards
>>
I just want to acheive satori status with my programming
>>
>>61181167
this is exactly why c++ is masterrace
>>
>>61181205
>2) It really seems like there should be a compile time algorithm for it.
If you could always predict when a dynamic object goes out of scope, you could always predict when a dynamic object comes into scope.
If you could always predict when a dynamic object comes into scope, it wouldn't have to be dynamic.
Therefore, as long as we still need dynamic memory, we'll still need to compute its garbage collection at runtime.
>>
>>61181246
it uses heuristics to tell when something's garbage. if it went in your brain and could tell when you weren't using something anymore then maybe it'd be better
>>
>>61181246
>abstraction
>c tards
>assumptions

Ask any C++fag, RAII is a pretty good abstraction for managing objects.
>>
>>61181341
>RAII
that's a technique, not an abstraction
>>
>>61181376
it is an abstraction in a sense that it hides most of the resource allocation/deallocation.
>>
>>61181443
only a few stl classes in C++ follow RAII -- for anything else, you have to implement it yourself. that's why >>61181246 is talking about
>>
>>61180678
>>61180969
>>61180979
Friendly reminder that HKTs are completely and utterly useless.
>>
someone posted a nice cmd tutorial like 2 weeks ago and I lost it, help
>>
>>61180543
Who is this qt pa2t
>>
>>61175652
I like cgdb for debugging. It's literally gdb but it displays the file as well. For unit testing, Gtest is pretty commonly used for both C and C++.
>>
>>61179979
Cute
>>
File: itsatrap.png (873KB, 1275x677px) Image search: [iqdb] [SauceNao] [Google]
itsatrap.png
873KB, 1275x677px
>>61181723
>>
>>61180678
>unironically using clang
>>
>>61181522
>all stl classes
ftfy

And you only have to implement it yourself if you're creating objects using new/delete. Stuff like shared_ptr can be used to make things easier in that regard.
>>
>>61181723
it's a boy
>>
Give me a practical example pf HKTs in C++
>>
>wasted days trying do debug vulkan only to realize trying to enforce q'ing was not needed
Maybe i should read the book.
>>
>>61179320
https://stackoverflow.com/questions/25589257/what-does-left-to-right-associativity-mean
>>
A question about c++ coming from Python.

In Python you have to be careful about whether the data type you are passing through the function is mutable or not.

In c++ is the equivalence like mutability is passing a pointer and passing by regular variable name copies it in c++, like immutable data types?

Because if not I don't get the basic purpose of a pointer.
>>
>>61183328
>C++
>immutability

read up on reference vs value.
>>
>>61183328
read up on "const" in the context of pointers and references. you can control the mutability of pointers/references passed to functions. you can also qualify methods as const (this promises that the method doesn't mutate the object's state). such methods can still be called through const pointers/references
>>
>>61181015
>>61181035
That's a range, not an array.
>>
>>61183328

Sorta. There are a lot of different options for passing parameters to functions.
void pass_by_val(std::vector<int> vec);
void pass_by_ptr(std::vector<int> *vec);
void pass_by_const_ptr(const std::vector<int> *vec);
void pass_by_ref(std::vector<int> &vec);
void pass_by_const_ref(const std::vector<int> &vec);

int main()
{
std::vector<int> my_vector;
pass_by_val(my_vector);
pass_by_ptr(&my_vector);
pass_by_const_ptr(&my_vector);
pass_by_ref(my_vector);
pass_by_const_ref(my_vector):
}


Pass_by_val will copy the whole object using the copy constructor. Since the object inside the function is different to the object outside, any changes to the object inside will not change the object outside.
To use pass_by_ptr you must obtain a pointer to the object using the & operator, and then pass that to the function. Any time you mutate the object through that pointer, the original object outside the function is also altered, because that is the object which is pointers to.
You can use pass_by_const_ptr as well. This works exactly the same, except the compiler will detect any attempts to mutate the object within the function and raise an error. This is very useful for avoiding expensive and needless copies while also preserving immutability.
pass_by_ref and pass_by_const_ref work similarly to pass_by_ptr and pass_by_const_ptr. The difference is that you don't need to explicitly take the pointer with &, and you don't need to follow the pointer with *. References are fairly controversial.
>>
>>61183447
>References are fairly controversial
how so? reference semantics are simply pointer semantics with the appearance of value semantics. that is to say the only real difference is that use of references is very slightly less syntactically verbose (avoids explicit dereferencing, allows use of "." instead of "->"). the only reason i could imagine someone having a problem with references is misguided purism coming from C developers (aka "ignorance"). am i missing something?
>>
>>61183556
I for one hate not knowing whether
foo(bar); will mutate bar.
>>
>>61183560
i'm not sure what you mean. if foo takes a const reference, it won't mutate bar. and in the case of a pointer, without additional context, foo(&bar) doesn't tell you whether bar will be mutated, either
>>
Ohayou, /dpt/-chan~~
>>61183729
>>61183729
>>61183729
>>
>>61183649
in a pass by value language, you know 100% that foo(bar) will not mutate bar, because you're just passing it as a value. but of course, in C++ pass by reference is ok because of the convenience, and the programmer is expected to deal with the mental overhead of checking all the function arguments thoroughly
>>
>>61183649

The suggestion is that mutation may occur if you pass a pointer, but there is no suggestion of that if you pass a value or a ref. If it looks like you're passing a value then it should work like you are.
I use references only if they are const, rvalue or are in certain operator overloads.
>>
>>61183777
this is precisely what const-qualification of pointer/reference arguments is for. if you always qualify pointer/reference arguments as const *unless* the function does mutate that argument (you should do this; it's universally considered a best practice), you create a contract by which you always know whether or not the argument will be mutated
>>
>>61183850
It's better if the code tells you what to expect at the call site as well as the declaration site.
>>
>>61183813
>If it looks like you're passing a value then it should work like you are
i don't see that as being a serious problem when there's no excuse not to use tooling which makes the constness of an argument immediately available. given that, my reasoning here >>61183813 is sufficient

>I use references only if they are const, rvalue or are in certain operator overloads
i do generally agree with this, however. i don't often see cases where a non-const reference argument is genuinely appropriate/the best option

>>61183878
i see where you're coming from, but in this case i disagree. tooling to make this information clear is trivially available and additional syntax would be redundant. it would simply introduce a new range of potential syntax errors stemming from inconsistency between declaration and call
>>
>>61183813
oops, i meant here >>61183850
>>
>>61183850
later on, if the function argument changes from const to non-const with mutation, there is no compiler error or anything, and the programmer might overlook it
>>
Creating a school project with voice and facial recognition in openCV and Microsoft Cognitive services. (chosen by product owner) Give tips or ask questions. Programming it in python since it's easy as fuck and it's for a prototype anyway.
>>
>>61183977
there would be a compiler error if the function were called in a scope where the argument passed was already a const reference, which would actually be a very common (if not the most common) case, given the nature of abstraction. that's a bit beside the point, though. the reality is that such a change (const to non-const) is not likely to occur in well-written code because non-const reference arguments would generally only occur in functions whose entire purpose is to mutate the argument
>>
>>61183977
>>61183919

I see your point, and it's a good one.
I still prefer my code to speak for itself, rather than the IDE.
At the very least, I feel happy to say references arecontroversial.
>>
>>61184070
>I still prefer my code to speak for itself, rather than the IDE
consider this: the IDE simply reminds you how you declared the function at another location. it's not speaking for you, your code is indeed speaking for itself
>>
>>61184197
We're back to the old point, that I prefer functionality to be obvious at the call site as well as the declaration site.
>>
>>61184218
think about what a function or subroutine really is in the context of calling code. basically a giant question mark. the whole point of abstraction is to do the work explicitly once, and then greatly simplify the repetition of that work. you're okay with the actual code to execute being entirely implicit/declared elsewhere, so why not metadata like function or argument properties or qualifications? food for thought
>>
>>61184268
Whether a function takes a value, a const ref or an rvalue ref makes no difference to client code. The same expectations hold either way so it suffices as an abstraction. With a mutable ref, the semantics are changed so it's no longer a clear abstraction.
>>
>>61184367
that's why it naturally emerges that well-written code avoids use of non-const references where semantics would be ambiguous. intent is clear if a function called "SortVectorInPlace" takes a non-const reference to a vector. in my experience, the implicit contracts upheld by conforming with relevant best practices eliminates all ambiguity or potential confusion
>>
>>61184443
That's correct, to some degree.
Nobody is surprised when operator[] returns a mutable ref.
>>
>>61181075
taking T t is a bit redundant since you could do that in the predicate if you wanted

>>61183436
how does this change anything
Thread posts: 329
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]
Please support this website by donating Bitcoins to 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
If a post contains copyrighted or illegal content, please click on that post's [Report] button and fill out a post removal request
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 4Archive shows an archive of their content. If you need information for a Poster - contact them.