[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 324
Thread images: 25

File: Algorithms.jpg (50KB, 420x475px) Image search: [Google]
Algorithms.jpg
50KB, 420x475px
What are you working on, /g/?

Previous thread: >>59204122
>>
>>59209636
hi
>>
>making a new thread before old one dies

But that's reddit tier.
>>
File: 1472870896801.png (78KB, 1089x751px) Image search: [Google]
1472870896801.png
78KB, 1089x751px
>>59209636
>tfw if I had more time, I would have written less code.
>>
If Java is so trash how come it is taught in every college and community college across the globe everywhere? Higher education cannot be wrong. Checkmate brainlets
>>
>>59209707
https://github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/runtime/ArrayUtil.java
>>
>>59209707

https://www.joelonsoftware.com/2005/12/29/the-perils-of-javaschools-2/
>>
>>59209721
* This is a generated class used internally during the writing of bytecode within the CallSiteWriter logic.
* This is not a class exposed to users, as is the case with almost all classes in the org.codehaus.groovy packages.


Hmm, really fires the neurons
>>
>>59209721
>This is a generated class used internally during the writing of bytecode
>>
>>59209636
Forth compiler as a thing to tinker on with optimization (off by default to encourage hand optimization).
At the moment the type system is limited but will get better as I work on the editor.
Also adding cycle and binary size info which will be exposed to the editor and any program using the profiler vocabulary.
>>
The level of "enterprise best practices" brainwashing everywhere is astounding. It's like people have had mantras drilled into their heads so long that they believe they're self-evident truths and that asking for proof is some unspeakable sin.
>>
File: unknown.png (162KB, 500x300px) Image search: [Google]
unknown.png
162KB, 500x300px
Oops, accidentally replied to the old thread.

Who needs Thompson and Ritchie when you have TAD & TAD?
>>
>>59209721
is that link saved in your "sick java burns" folder?
also, tell me how that same code would have been implemented in C or another non-OOP language.
>>
>>59209736
it makes me unreasonably mad every time i read the fucking word codehaus

fuck grails and groovy and java even more than that
>>
File: just-one-man.png (252KB, 579x329px) Image search: [Google]
just-one-man.png
252KB, 579x329px
>>59209736
>createArray overloads with 0 to 250 args
>this is java
>>
>>59209753
For example?
>>
>>59209774
>is that link saved in your "sick java burns" folder?
Nah I happened to have cat v harmful page opened in a tab. Lots of interesting and fun opinions there.
>>
>>59209774
In Rust it's done with a macro.
>>
I have literally never seen anything remotely impressive in /dpt/ in the 4 years that I have used this website.

Post your best project of all time anons.
>>
>>59209774
Variable length args? They exist in C
pretty much the same as lisp (define (array x . xs) ...)
And in forth you can abuse the return stack
>>
Haskell or Idris?
>>
>>59209837
start-code.
fizzbuzz of 1-100000 : optimize 100
end-code.

it's in my language. fizzbuzz is a built-in procedure.
>>
>>59209801
Design patterns
OOP
Mutable variables
>>
>>59209837
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

int64_t f(uint8_t n)
{
if (n <= 1) return n;
if (n > 92) return -1;
n -= 2;

uint64_t a = 1, b = 1, c = 0, d = 1, e = 1, f = 0;

while (n) {
uint64_t g, h;
if (n & 1) {
g = a * d + b * e;
h = b * d + c * e;
f = b * e + c * f;
d = g;
e = h;
}
g = a * b + b * c;
a = a * a + b * b;
c = b * b + c * c;
b = g;
n >>= 1;
}

return d;
}
>>
File: 1488150477576.jpg (66KB, 399x382px) Image search: [Google]
1488150477576.jpg
66KB, 399x382px
>>59209735
There are universities that only teach Java?
>>
>>59209801
A popular one is wasting time planning so that you can write shitty code that you ideally never have to change instead of just writing good code that can change without any trouble if it ever needs to.
>>
>>59209874
Hmm, I see. Can you give examples of said brainwashing, of those "mantras" being "forcefully drilled" into people's heads? Like, say, in literature for instance?
>>
>>59209825
In Lisp it's done with a macro. In Rust it's done with a Frankenstein abomination.
>>
>>59209854
Idris if it didn't throw an exception every time I try the repl
>>
>>59209854
Idris.
>>
>>59209899
>planning is a waste of time
Current state of /g/
>>
>>59209801
>>59209899
And when you ask these drones to convince me to do so, they can only sputter "muh industry standard" and "you're dumb if you don't already know this, I shouldn't have to explain it to you", etc.

>>59209916
Convince me I'm wrong. Let's see how this goes.
>>
>>59209735

I don't get how any accredited university could value a language based on OOP crap over a language that has actual memory addresses

Pointers are half of what a computer does. How do you even study a computer without a concept of a memory address.
>>
>>59209900
How about most CS or software degrees and books about programming for the last 30 years?
>>
>java

AbstractChan fourChan = AbstractChanFactory.getChanForNumber(new ConcreteChanNumber<Integer>(new Integer(4)));
AbstractChanBoard g = fourChan.getConcreteBoardManagerInstance().getBoardForName(new BoardName("/g/"));
AbstractChanThreadIndex catalog = g.getThreadManagerSingletonInstance().queryThreadIndexSynchronously();

if (catalog.getThreadSearchUtilityInstanceForStrategy(ThreadSearchStrategy.BY_OPENING_POST_NUMBER).searchForThread<Integer>(new ConcreteChanOpeningPostNumber<Integer>(new Integer(59209636))).getSearchResultsSynchronously().getSearchFindings().isThreadFound()) {

AbstractChanThread thread = catalog.getThreadLocatorUtilityInstanceForStrategy(ThreadLocatorStrategy.BY_OPENING_POST_NUMBER).locateThread<Integer>(new ConcreteChanOpeningPostNumber<Integer>(new Integer(59209636)));
AbstractChanOP op = (AbstractChanOP) AbstractChanOpManager.getInstance().getOpManagerForThread(thread).getManagedOP(thread.getThreadPostsCollection().getOpeningPost().asOP());

if (op.getAbstractFaggotryManager().getConcreteInstance().getFaggotryStatusTestingData().isFaggot(op).executeTest().getResults().evaluate<Boolean>()) {
System.out.println(">java");
}
}
>>
>>59209923
Haskell doesn't have pointers bro
>>
>>59209932
I don't see any library imports, I would not push this into production.
>>
>>59209940

Haskell is a language that exists only in academia

Neither do scripting languages which are optimized for automating things that the user could have done by hand

what's your point
>>
>>59209922
read thinking-forth and you'll understand
>>59209925
does said book above count in that brainwashing? It calls most of the other methods shit in the first chapter
>>
>>59209925
Wow, 30 years? Should be easy enough to show me a couple of concrete instances of it then.
>>
>>59209940
>Haskell
>>
>>59209955
import this.doman.does.not.exist.neetsoft.web.clients.abstract.chan.four;
>>
File: XGH.jpg (36KB, 318x374px) Image search: [Google]
XGH.jpg
36KB, 318x374px
>>59209916
/g/ is adept of the eXtreme Go Horse software development methodology.
>>
File: 1445825148013.gif (813KB, 303x303px) Image search: [Google]
1445825148013.gif
813KB, 303x303px
>>59209975
there we go
>>
>>59209966
>read thinking-forth and you'll understand
I'm not reading a whole book to be convinced of something that is apparently obvious.
>>
OOP = POO
>>
>>59209988
stealing this to make into a check'em
>>
Going to buy a VPS and do all my coding in it, I think I am done with Linux after 10 years
>>
>>59209923
>I don't get how any accredited university could value a language based on OOP crap over a language that has actual memory addresses
Maybe because the "OOP crap" has shown to work extremely well.

We're now also seeing it almost ubiquitously used on cloud clusters (the flexible supercomputers of our time) and personal smartphones.

Handling actual memory addresses is not a job most programmers need to be concerned about in most instances, you should worry about using algorithms that perform well and that are doing the correct thing.

> How do you even study a computer without a concept of a memory address.
You never went to university, right? Of course you also study that. That doesn't mean most of CS or related subjects focus on juggling fucking pointers.
>>
>>59210006
DO IT AND POST RESULTS
>>
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
>>
>>59209940
but it does... check out marshal
>>59209956
my company uses it and translates it to scala later
>>
>>59210012
>POO supporter
>rabbit spacing style
huh...
>>
>>59210027
>translates it to scala later
Oh my god, your scala code must be horrendous because scala's type inference is so limited
>>
>>59209992
read the first chapter you dimwit, it covers exactly what happens when you don't plan
read the rest if you care about writing good programs
>>
>>59210012
>Maybe because the "OOP crap" has shown to work extremely well.
Show me. On the contrary, it's subpar for safety and reasoning because of mutable state, it's subpar for efficiency because of virtual calls and bad cache layout, and its common usage is subpar for abstraction and code reuse because inheritance is mathematically nonsensical, subtype polymorphism is not polymorphism in general, and composition of objects rather than pure data leads to lots of boilerplate methods.
>>
>>59210028
>this pajeet again
kys
>>
>>59210054
we use the cats library which makes things a bit better
>>
>>59210027

> cross compiling haskell to scala

that's asking for a hernia
>>
File: 1485980874224.png (442KB, 500x712px) Image search: [Google]
1485980874224.png
442KB, 500x712px
>>59210028
>>rabbit spacing style
>>
>>59210092
Composition is fine if you use a good lens library.

Oh wait, OOP languages don't generally support good lens libraries.
>>
>>59210100
hey, you must be new here. we don't actually have identities on this subreddit.
>>
>>59210066
Can you summarize it for me?
>>
>>59210104
Why cats and not scalaz?
>>
>>59210115
... The fuck is a lens library?
>>
>>59210106
it's what they get for hiring haskell programmers for a scala job... shits a mess before we got here so we're not really adding mess by doing it. It's like a ball of mud but it's not lisp..
>>
>>59209923
>computer science
>memory addressing
ok, kid
>>
>>59210136
https://hackage.haskell.org/package/lens
>>
>>59210136
Something written by Edward Kmett.
>>
>>59210151
what shitfest

christ
>>
>>59210127
management wanted to move to cats from scalaz as they heard good things about it. Thing is close to haskell so most don't care at this point as we just want to keep our jobs. Last guy who complained was fired on the spot
>>
>>59210183
>Last guy who complained was fired on the spot
is this a joke? how much did he complain...
>>
File: check'em.gif (549KB, 216x202px) Image search: [Google]
check'em.gif
549KB, 216x202px
>>59210014
probably could've done better but this'll do for now
>>
>>59210151
>open lens package
>This package comes "Batteries Included" with many useful lenses for the types commonly used from the Haskell Platform

Yeah no shit...

>and with tools for automatically generating lenses and isomorphisms for user-supplied data types.

Sup guys download the lens package so you can make lenses and it also comes with some great built-in lenses!

>The combinators in Control.Lens provide a highly generic toolbox for composing families of getters, folds, isomorphisms, traversals, setters and lenses and their indexed variants.

... So it does what?

>An overview, with a large number of examples can be found in the README.

... I thought this was the README.

>An introductory video on the style of code used in this library by
>A video on how to use lenses and how they are constructed is
>Slides for that second talk can be obtained
>bla bla bla bla bla bla

You've got to be kidding me

You had ONE job.
>>
>>59210195
that will work
>>
>>59210183
cats is literally a worse scalaz. Your management is full of idiots.
>>
>>59210183
>. Last guy who complained was fired on the spot
>working in this shitty a company
>>
>>59210209
Lenses are the coalgebras for the costate comonad, what's the problem?
>>
File: file.png (177KB, 840x653px) Image search: [Google]
file.png
177KB, 840x653px
>>59210209
literally WHAT
>>
>>59210193
Enough, at least once or twice a week.
Was expected though as he didn't do much work and the complaining was the tipping point.

We want to re factor the code but management sees it as "avoiding work" so we do it when we can
>>
>>59210245
Wow this is UML Java tier.
>>
>>59210012

If you write code for anything that uses more than 1 CPU, it's gonna be in something like OpenCL (using an older standard of C) not java. You have to carefully manage memory, pay attention to how much data you are sending across your bus, know about where memory is stored, datatypes, etc.. The computer knows nothing about OOP.

Anything of consequence that runs on a smart phone (a video player, the OS, the protocol stack) is going to be in a real language. Android apps are all written in Java because it gives the app developer Java as an abstraction from the rest of the OS.

and pointers are absolutely necessary to write efficient algorithms.
>>
>>59210245
and you guys make fun of java

Atleast Java is better structured than this
>>
>>59210213
Pretty accurate
>>59210228
Pays the bills so don't really care and I'll probably leave soon for a better job anyway.
>>59210123
No since you need to read the language history part as that's where half of it is... It covers pretty much every language development up until it was published in short. Just read, you'll enjoy the book
>>
>>59210092
> Show me
Go check what clouds and the big web deployments run. You know, the really massive ones.

Check what the majority of phones run, and what programming style is used there,

> muh subpar reuse
Okay, take over the world with your greatly reusable code.

If you look around a bit what is actually used in production, you'll find that even big companies are really rather flexible in what they use.
Just give them this amazing reuse-ability in a way that can be used by their staff and their computers, they *will* bite.

> mathematically nonsensical
Oh, even a bigger project. Making it so people can use actual maths without doing nonsense. Good luck with that one.

Half understanding even a fraction of the whole poorly accessible mess that is accumulated maths easily gives you a chance of being "Paul Erdős, better variant".
>>
>>59210299
No, pointers aren't really required.
A full description with enough detail is however. If I could tell the compiler exactly how much memory it need it would spew out pretty fast code. Also most compilers pretend there's a further abstraction from the machine. C sees everything as memory blocks, Forth sees stacks and memory, Haskell... everything is a function...
>>
>Its my birthday and I am stuck in the office doing overtime to rush a project that wasn't supposed to involve me in the first place
>But I don't mind because all I am going to do is go home and play video games anyway
Where did it go so wrong guys?
>>
>>59210341
In argumentation theory, an argumentum ad populum (Latin for "appeal to the people") is a fallacious argument that concludes that a proposition is true because many or most people believe it.

>Just give them this amazing reuse-ability in a way that can be used by their staff and their computers, they *will* bite.
It's been around for years, it's called procedural and functional programming. They haven't.

>Oh, even a bigger project. Making it so people can use actual maths without doing nonsense. Good luck with that one.
That's not what I mean. Inheritance is fundamentally broken because it combines subtyping with extension. If A inherits from B, A also subtypes B and extends B. But if A subtypes B then A can't extend B since every value of A must be a value of B as well. It's funny that inheritance breaks even with an example as simple as a square class inheriting from a rectangle class. How do you implement setWidth on a square?
>>
>>59210299
> If you write code for anything that uses more than 1 CPU, it's gonna be in something like OpenCL (using an older standard of C) not java.
Wow, you're really far from the actual industry, right?

What data / processing clouds actually run is actually predominantly JVM based.

You know, Cassandra (https://web.archive.org/web/20161029175856/http://planetcassandra.org/companies/ <- crazy, isn't it?), Spark and so on. Nothing is remotely as dominant.

Likewise, banks, social networks etc, Twitter runs its message queue and most other performance critical parts on the JVM. And so on and so forth.

That's not to say the old C/C++ etc. aren't used anywhere, but the JVM is actually winning in the distributed concurrent parallel many-threads world.
>>
>>59210420
Simple, have it return a new rectangle instance with the specified width.
>>
>>59210444
Of course. But now you are going functional rather than object-oriented. In an ideal functional language, a square is just a rectangle coupled with a proof that the sides are of equal length. No encapsulation needed to maintain this, no potential duplication between the square and rectangle definitions that has to be addressed with some kind of boilerplate, etc.
>>
>>59210436
>that posting style
>>>/r/ibbit
>>
>>59210491
>functional rather than object-oriented
This is a good thing
>>
>>59210515
They're both garbage, friend.
>>
>>59210515
Exactly, I was just proving a point about inheritance.
>>
>>59210436
Haskell and other languages like it are catching up due to the ease of making code run in parallel (it's just a compiler flag and a function for forcing it).

>>59210506
calm down little guy

>>59210515
yes
>>
>>59210506

bepis
>>
>>59210420
> It's been around for years, it's called procedural and functional programming.
If either was this reusable then we'd see oodles of monumentally cool projects and the most feature complete libraries all use them.

They almost never are the most feature complete solutions. OOP usually has far more impressive solutions. Despite allegedly not being "as reusable".

> It's funny that inheritance breaks even with an example as simple as a square class inheriting from a rectangle class. How do you implement setWidth on a square?
No, that's not funny - you're just breaking inheritance.

You actually derive both individually from a Polygon or Shape. Or you model this in immutability (in which case a square can be Subtyped from a rectangle - but obviously has no set* methods.)
>>
>>59210551
In argumentation theory, an argumentum ad populum (Latin for "appeal to the people") is a fallacious argument that concludes that a proposition is true because many or most people believe it.

>You actually derive both individually from a Polygon or Shape.
But you should be able to substitute a square for a rectangle.

>Or you model this in immutability (in which case a square can be Subtyped from a rectangle - but obviously has no set* methods.)
Then the rectangle can't have setters either. With the functional approach, you don't lose mutability, which can be important for performance.
>>
>>59210631
opening your mind will surprise you
>>
>>59210536
> Haskell and other languages like it are catching up
Measured just how?

I only see the JVM with these popular libs putting further distance between themselves and the competition.

> it's just a compiler flag and a function for forcing it
Feels quite far from "just".
>>
>>59210631
>With the functional approach, you don't lose mutability, which can be important for performance.
What language?
>>
>>59210712
ATS
>>
Scala is the most advanced statically typed object oriented language today.
>>
>>59210631
> But you should be able to substitute a square for a rectangle.
You can, as a Shape / Polygon. That's how you are allowed to model this.

> Then the rectangle can't have setters either.
Yes.

> With the functional approach, you don't lose mutability, which can be important for performance.
That's a very bad misrepresentation of how it actually is in almost every FP language.

Granted, the problem doesn't occur here exactly, but you almost always systematically need to sacrifice mutability for performance reasons and more.
>>
>>59210748
>You can, as a Shape / Polygon. That's how you are allowed to model this.
Sure, a rectangle is a shape and a square is a shape. But a square is a rectangle.

>Granted, the problem doesn't occur here exactly, but you almost always systematically need to sacrifice mutability for performance reasons and more.
You're confusing mutable state with shared mutable state.
>>
>>59210712
MonadLang
>>
>>59210787
Stop making shit up.
>>
>>59210767
> But a square is a rectangle.
Only if you model the Rectangle detailed to make it allow for the constraints of a square.

You'd need a Rectangle to actually have the provisions for putting constraints on the relation of side lengths (so they may all be 1:1) already.

For this to universally work, you basically could have the whole attributes and methods of an object in Euclidian space like is the case in like, maths, and then make specialized instances. But we generally don't want to program that.
>>
>>59210864
Rectangle : Type
Rectangle = { width : Real, height : Real }

Square : Type
Square = (r : Rectangle) * (r.width == r.height)
>>
>>59210886
Or, to use refinement type syntax:
Square = { r : Rectangle | r.width == r.height }

Then it's more clear that you can coerce any Square to a Rectangle.
>>
what's the best way to recruit help for an open source android app?
>>
>>59210914
Paying people
>>
>>59210914
go to sleep and enter a dreamworld where you already invented your app

then wake up and cry
>>
>>59210886
>>59210907
If you want to do something like this you can also do it in Java with an assertion.

And for more generalization, I guess you could plan for it to be used in HIlbert space from the start, wrecking your performance further and making the whole thing insanely crazy complex on the programmer's end.

Haskell does this kind of shit all over the place. Despite theoretical merit if it were done perfectly, It does not result in many functioning programs, as you can plainly see.
>>
>>59211228
>If you want to do something like this you can also do it in Java with an assertion.
But you need setters to perform the assertion and it happens at run time instead of all being done at compile time.

>And for more generalization, I guess you could plan for it to be used in HIlbert space from the start, wrecking your performance further and making the whole thing insanely crazy complex on the programmer's end.
Same thing, Java only supports all this stuff at run time.

>Haskell does this kind of shit all over the place. Despite theoretical merit if it were done perfectly, It does not result in many functioning programs, as you can plainly see.
I didn't say anything about Haskell.
>>
Alex Mahan is making $5,000 a month for his "game" which he programs like this

http://pastebin.com/raw/hsqba0Pn
>>
>>59209636
Is this book good?
>>
>>59211267
dude his code would be 100000000x better if he just used switch statements lmao
>>
>>59211267
I have no problem with this.
Less OOP, less shit.
>>
>>59211267
literally who?
>>
File: chrome_2017-03-02_13-45-38.png (16KB, 1884x44px) Image search: [Google]
chrome_2017-03-02_13-45-38.png
16KB, 1884x44px
>>59211305
>this is what oop haters actually believe
>>
>>59211353
didn't read to that part
looks pretty OOPy to me
>>
>>59209636
Learn Shen
http://www.shenlanguage.org/learn-shen/index.html
>>
I have to learn c# for a job.
I spent two semesters using java about 2 years ago now. How long should i expect it to take to learn c# reasonably well?
They look pretty similar syntactically, any weird caveats i should know?
>>
File: 1485716723681.jpg (570KB, 1920x1080px) Image search: [Google]
1485716723681.jpg
570KB, 1920x1080px
Fractals!
>>
>>59211464
C# is easier.
Remember to check for null all the time (if you use the newer versions you can just use ?), and learn linq, not the select crap but the methods with anonymous functions
>>
>>59211345
The guy behind yandare simulator.
>>
>>59209636
Trying to better my knowledge of the layout managers in swing. I'm half asleep [spoiler]and I'm dum[/spoiler] so it's going slowly. I've done some java stuff with a GUI for uni but I'm a lazy shit so that was just putting everything on absolute and making it look reasonably neat, so I figure I should understand how to do things "properly".
>>
>>59211502
>methods with anonymous functions

Like lambda functions from python?
>>
>>59211397
>looks pretty OOPy to me
You're kidding, right?
>>
>>59211603
Oh, what?
It's supposed to be

object InPain extends Boolable implements Orable

object TwoOrables extends Orable
>>
>>59211251
> But you need setters to perform the assertion
On correct Java code, there is only one related setter on a Square: Something like setDim(int dim).

> Same thing, Java only supports all this stuff at run time.
No. It's OOP. The objects will deliberately not actually be (/have to be designed to be) that generally applicable.

> I didn't say anything about Haskell.
Then I mixed you up with some other anon. Doesn't really matter. Same problem everywhere..

Once you try to do really general FP, you end up working with WAY too general concepts whose performance can't be judged and that even mathematicians were too lazy to really write down in one coherent book.
>>
>>59211616
Wtf looks OOPy about this >>59211353?
>>
>>59211597
Yes. Python lambdas are intentionally neutered though.
>>
>>59211645
the lack of abstraction, the endless properties
>>
>>59211646
Why? Do they want their language to be useless?
>>
>>59211645
OOPs i fucked your mom last night
>>
>>59211464
Read through https://learnxinyminutes.com/docs/csharp/
Also check out the topics / links at the bottom.
>>
>>59211656
Oh wow. I didn't know OOP dictated you do that.
>>
>>59211664
The creator of Python hates functional programming.
>>
>>59211640
>On correct Java code, there is only one related setter on a Square: Something like setDim(int dim).
But you now can't have setters on the rectangle or else subtyping doesn't work.

>Once you try to do really general FP, you end up working with WAY too general concepts whose performance can't be judged and that even mathematicians were too lazy to really write down in one coherent book.
Dependent types in particular are a purely compile time replacement for run time things like asserted contracts or invariants maintained through privates that require getters and setters with run time checks to function.
>>
>>59211699
Why?
>>
hey yandev are you in this chatroom
>>
>>59211694
Yes, it does. It also eats little children.

>falling for the /g/ OOP bogeyman
OOP is great and that code is as far from OOP as possible, anon.
>>
>>59211694
It does.
OOP is by its nature about objects.
Objects are the opposite of abstraction, they're a concept for imagining the real world - and a very limited part of it.
>>
>>59211267

Is that... JScript.NET? It looks like JavaScript syntax, but there are some parts that suggest a hint of explicit typing...
>>
>>59211705
Guido: "I'm not a fan of religiously taking some idea to the extreme, and I try to be pragmatic in my design choices (but not *too* pragmatic, see the start of this sentence :-). I value readability and usefulness for real code. There are some places where map() and filter() make sense, and for other places Python has list comprehensions. I ended up hating reduce() because it was almost exclusively used (a) to implement sum(), or (b) to write unreadable code. So we added builtin sum() at the same time we demoted reduce() from a builtin to something in functools (which is a dumping ground for stuff I don't really care about :-).

If I think of functional programming, I mostly think of languages that have incredibly powerful compilers, like Haskell. For such a compiler, the functional paradigm is useful because it opens up a vast array of possible transformations, including parallelization. But Python's compiler has no idea what your code means, and that's useful too. So, mostly I don't think it makes much sense to try to add "functional" primitives to Python, because the reason those primitives work well in functional languages don't apply to Python, and they make the code pretty unreadable for people who aren't used to functional languages (which means most programmers).

I also don't think that the current crop of functional languages is ready for mainstream. Admittedly I don't know much about the field besides Haskell, but any language *less* popular than Haskell surely has very little practical value, and I haven't heard of functional languages *more* popular than Haskell. As for Haskell, I think it's a great proving ground for all sorts of ideas about compiler technology, but I think its "purity" will always remain in the way of adoption. Having to come to grips with Monads just isn't worth it for most people."
>>
File: 1486136036070.jpg (42KB, 1079x875px) Image search: [Google]
1486136036070.jpg
42KB, 1079x875px
>>59211756
>But Python's compiler has no idea what your code means, and that's useful too.

At least he recognizes that dynamic types and functional programming don't match. I think that's what he means.
>>
>>59211770
no
>>
>>59211753
I think it's unity 4 JavaScript for some global controller or something.
>>
>>59211726
I see. Could you give me a source or citation on that? Legit request, I want to learn more about it.
>>
>>59211756
I think Python eschews pragmatism and practicality. It's simply not useful for writing reliable software in, the tool support is virtually nonexistent because the language is designed to be intractable. The compiler has no idea what your code means? Completely useless.

Monads... why do so many people get so hung up on monads? They're really not that complicated.

Whoever is funding this guy needs to stop.
>>
>>59210115
Does OCaml could as OOP? If not, Scala has one with https://github.com/julien-truffaut/Monocle and Java sort of does with https://github.com/functionaljava/functionaljava.
>>
>>59211785
>OOP is based on thinking in terms of objects
>thinking in terms of objects is the opposite of abstraction

What needs a citation?
>>
>>59209895
My intro courses were both Java
>>
>>59211810
I don't know OCaml enough to comment on it.

Monocle is a valiant effort, but Scala's type system is just too limited for it to be able to get anywhere near the level of Control.Lens library in Haskell. Scala's a toy language when it comes to functional programming, as soon as you try to move beyond the basics it breaks down.

It's still a lot better than Java, though.
>>
>>59211700
Yea, I already told you that you can't subtype Square from Rectangle without violating absolutely common OOP practices.

Its a hack already if you do subtype something with methods that actually don't apply. No less so than using asserts.

Point really just is that rectangles and squares may inherit from a polygon or shape, but not from each other when they are designed in a way where they have inherited methods or fields that don't apply. That's OOP.
>>
>>59209636
>CLRS
what meem mooc algorithms course should I take?
guessing MIT, yes?
>>
>>59211871
And in conclusion OOP is retarded.
>>
Name one scripting language which is not trash.

Protip: you can't.
>>
>>59211873
Take the courses required for your degree.

If you want to read CLRS, just read CLRS.
>>
>>59211676
Nice. Thanks.
>>
>>59211895
Guile Scheme
>>
>>59209932
trying too hard there anon. this looks like something written by somebody who has never written anything non-trivial in Java
>>
>>59211871
http://laufer.cs.luc.edu/teaching/313/handouts/practice-midterm
>>
>>59211895
Lua
Tcl/Tk
Wren
>>
>>59211811
So you can't? I mean, you know that much and you can't point me even to your thesis dissertation?
>>
>>59211898
my school moves slowly enough that adding another course isn't much of an issue (especially if I can put off a session if work piles up) and I'd rather have lectures for the book than it alone.
I plan on reading it concurrently, so to my eyes it's pure upside (lectures from teachers of presumably decent caliber, context/second perspective, etc.)
>>
>>59211948
If you think that needs a thesis dissertation, then you need to learn some basic philosophy.
>>
>>59211948
>>59211972
>thesis dissertation
>>
>>59211862
>Scala's type system is just too limited
What features does it lack that are necessary to match Haskell's lens library?
>>
>>59211883
You are the one that wants to violate OOP rules for no good reason other than your fixed idea that you should have a generalized concept even when you can already be sure it hurts performance.

But these rules are only meant to be broken when there seems to be no other way.
>>
>>59211998
sanity
>>
>>59211972
I'm just saying you made such a massive discovery, basically everyone out there is wrong except you, and you aren't publishing this? Sounds insane.
>>
>>59212004
What hurts performance about making Square a subtype of Rectangle?
>>
>>59211267
another example of how non-OOP code can be shit too

shit programmers make shit no matter what. it's not OOP that's so fucked up it's you. If you make everything a fucking object, and use tons of inheritance and tight coupling and make lasagna code, that's your fault. Java can be beautiful.
>>
>>59212012
Are you underage?
>>
>>59212016
Nope, it's traditional OOP. Look at CLOS or Smalltalk if you want OOP.
>>
>>59211937
>Lua
>1-based indexing
Still don't know why it bothers, though.
>Wren
>literally who
>>
>>59211931
What are you trying to tell me?
>>
>>59212016
>If you make everything a fucking object, and use tons of inheritance and tight coupling and make lasagna code
you've just described oop
>>
>>59212032
https://github.com/munificent/wren
>>
>>59211998
Good type inference.
>>
>>59212065
Type inference is shit.
>>
>>59212058
lrn2SOLID
lrn2GRASP

You don't know what OOP is. Stop posting, lest you end up misleading the unwary.
>>
>>59212050
You have downs.
>>
>>59212015
The runtime checks for enforcing the rectangle is indeed only ever a square.
>>
>>59212086
I already told you dependent types solve that.
>>
>>59212058
heard of a little thing called composition over inheritance to get some required behavior for an object? also there are many strategies for reducing coupling between objects as much as possible
>>
File: n1.jpg (106KB, 800x600px) Image search: [Google]
n1.jpg
106KB, 800x600px
>>59209923
>>59209707
my school does java for it's main programming curriculum (data structures, algorithms,etc.) and a smaller line of C and Assembly classes for low level / operating systems programming. It's a pretty good way to do it imo, Java is easier to learn for absolute beginners and makes it easier to learn the more low-level shit with C and assembly.
>>
>>59212077
Say that after you've instantiated and plumbed all the instances of typeclasses through by hand.
>>
>>59212123
It is literally undecidable in dependent typing, ergo it's shit.
>>
>>59212113
Composition a shit unless you have lenses
>>
>>59212123
That's not really type inference, that's implicit arguments.

>>59212135
Just because it's undecidable in general doesn't mean it can't be used for some things. For instance, bidirectional dependent typing is perfectly decidable and yet you get a lot of type inference from it.
>>
>>59212092
Solve? No, they indicate such a check is happening, they don't avoid it.
>>
>>59210712
Well, mutability is only important for performance under certain circumstances. If your computations are dominated by rather large objects, then more often than not the additional overhead caused by persistent data structures is relatively small compared to the object size, and can make a lot of sense depending on the application.
>>
>>59209636
is this book worth it? currently on half of SICP and was thinking bout tackling it next
>>
>>59212156
Wrong. Run time checks are one way to obtain a proof of a proposition, but that's only necessary for things like user input. Otherwise you can construct them from scratch or manipulate existing proofs, all with zero run time overhead.
>>
>>59212167
Sure.
>>
>>59209890
Can someone explain what this does, because this is otherwise a prime example why you make your code at least somewhat human readable.
>>
will reading through SICP and learning some lisp help me understand some modern day functional programming concepts? I'm really wanting to one day learn Scala, as I'm pretty much a Java-only dev at the moment.
>>
>>59212223
>Lisp
>modern
>>
>>59212214
Try running it mang
>>
>>59212223
Scala as a functional language is more similar to ML or Haskell than to Lisp or Scheme.
>>
>>59212180
And how do you guarantee your reusable mutable Rectangle that you specialized as square will not depend on things like a compile time unknown relation between width and height?
>>
>>59212223
Not pure functional programming, but CL is a good language anyway.
>>
File: 1470303001763.png (7KB, 1795x709px) Image search: [Google]
1470303001763.png
7KB, 1795x709px
>>59212238
>running arbitrary code off of a website known for malware.
I know its not harmful, but are you seriously this retarded? No, I wont.
>>
>>59212274
It's a pure function, anon. It can't hurt you.

Stop expecting to be spoonfed.
>>
>>59212255
You don't. How you get that proof doesn't matter. A run time check for x == y, instead of giving true/false, gives a proof/nothing. Inside the branch you now have a proof of (x == y) no matter what x and y are, you just know they're equal.

But you can also create a proof of (10 == 10) for free, and you can turn a proof of (x == y) into a proof (x+10 == y+10) or whatever for free.
>>
>>59212234
look, another anon who doesn't know lisp speaking authoritatively about it.
>>
>>59209899

>write shitty code that you ideally never have to change

That doesn't make any sense. You need to plan in order write good code. If the code is good then there's less chance of something bad happening down the road.

> just writing good code that can change without any trouble if it ever needs to.

Customers won't be happy about the constant stream of patches.
>>
File: 56e54ee8c1949.jpg (43KB, 600x600px) Image search: [Google]
56e54ee8c1949.jpg
43KB, 600x600px
>>59212326
>customers
>implying /g/ fizzbuzzers write anything people actually use
>>
>>59212353
What is that, sewage water?
>>
>>59212116

>Java is easier to learn for absolute beginners
>>
C apologists are NSA shills plain and simple. Rust makes it harder to produce vulnerable programs. This is against the interest of the NSA and so they are shilling C so that people continue to produce exploit prone, unsafe and vulnerable programs.

Ignore the NSA/C shills. Programming in C should be banned and outlawed.
Say no to security exploits, say no to the NSA
>>
>>59212392
Rust is a disgusting abomination that deserves to be swept into the dustbin of history. C should be replaced, but Rust is not the solution.
>>
>>59212288
>You don't. How you get that proof doesn't matter.
Yes, how I get that proof matters. If the compiler can't give it to me for free, I sure as fuck don't want to find it myself or restate the problem in a hundred ways until it can find it.

> But you can also create a proof of (10 == 10) for free, and you can turn a proof of (x == y) into a proof (x+10 == y+10) or whatever for free.
I should prove the 128 bit result of all 64 operations, then all my software will be fucking much faster.

You realize your "free" isn't in any way free, right?

Just specializing objects properly works and is cheap, even if you can't put them unaltered into a universe simulation.
>>
>>59212392
>muh C is the only component of computer security
>>
>>59212424
Anon the only thing about any of that that exists at run time is doing the check for some arbitrary value(s) that you only got at run time.

>Just specializing objects properly works and is cheap
Doing it with dependent types has zero overhead. You never have to do more run time checks than absolutely necessary in any language.
>>
>>59212423
Top quality deflection, NSA
>>
>>59212391
I mean maybe if there is a good programming book in C for complete beginners. I know there is for Java and C++. I have a copy of the c programming language but its not suited for absolute beginners at all.
>>
>>59212471
>muh everything that isn't Rust is NSA
>>
>>59212284
Okay, but I dont get it.
>>
>>59212491
oh, now that I looked at it, its supposed to be the fibonacci sequence?
>>
>>59212491
>>59212503
Yes, it's computing the Fibonacci sequence using the matrix formula for it.
>>
>>59212503
Yes.
>>
>>59212456
>Anon the only thing about any of that that exists at run time is doing the check for some arbitrary value(s) that you only got at run time.
Stuff you get at run time is why we actually run programs in almost all cases.

And common practice on OOP avoids that pointless check with a specialization. You had a Square, it didn't allow width and height to be set separately so no check to type it properly according to dependent type was required - one thing less to be computed at runtime and done.
>>
We define the Fibonacci sequence f(n) as
f(n) = f(n-1) + f(n-2)
f(0) = 0
f(1) = 1

Let's defined an additional function g(n) := f(n-1)
As a consequence,
g(1) = 0
g(n-1) = f(n-2)
f(n) = f(n-1) + g(n-1)

We can combine f and g into a function u(n) := (f(n), g(n)) such that
u(1) = (1, 0)
u(n) = (f(n-1) + g(n-1), f(n-1))
The last equation can be defined as a matrix multiplication of u(n-1), like so:
M := [ 1 1 ]
[ 1 0 ]
u(n) = M * u(n-1)
This recursion can be easily generalized into exponentiation:
u(n) = M^(n-1) * (1, 0)

We can now implement the above using "exponentiation by squaring" to calculate arbitrary an arbitrary Fibonacci number f(n) in O(log n) time.
>>
>>59212116
We learn C first at my Uni and then Java
>>
>Have to make something in C++ that functions like SQL tables
> Not sure what data structures to use
what do
>>
>>59212808
Just use a hash table :^)
>>
>>59212392
>C shills are NSA
>says the CIA nigger
>>
>>59212835
so I was thinking a hash table of table names(strings) as keys and then a vector of table pointers. not sure what to put in the actual tables though.
>>
>>59212966
you should design your data structures before your algorithms anon
>>
>>59204314
Frankly with how absolute shit OS's are at going fast when it comes to IO (yes even iocompletionports and epoll). You'd have to fuck up quite bad to actually be slow in this context.
>>
>>59212866
Go away, NSA
>>
>>59212392
>Rust makes it harder to produce vulnerable programs.
True
>Rust makes it harder to produce programs.
Also true
>Rust makes a good tradeoff in terms of safety and productivity
Not true (in my opinion).

And of course if you have low standards you can work with any piece of shit and end up with acceptable results. People who use C generally have higher standards though.
>>
>>59213189
>>Rust makes it harder to produce programs.
>Also true
t. C toddler
>>
>>59213002
>you should design your data structures before your algorithms anon
No. If you have a really good algorithm you want to use you adapt to it.
>>
>>59212392
Not only that, C is a fucking trash by itself
>>
>>59213197
t. person with low standards.
>>
>>59213208
Tell me this is not real kek
>>
>>59212116
>>59212391
Java should never be taught as a first programming language to absolute beginners it is way to confusing.

I recommend students with 0 programming experience try a scripting language like python or javascript so they will understand the more difficult languages
>>
>>59213232
Function parameters don't have a defined execution order.
Which has its reasons. Admittedly they're not great but they're there.
You can find similar flaws in other languages.
>>
>>59213232
Comma doesn't define computation order.
>>
>>59213451
>Function parameters don't have a defined execution order.
Said who? No problem here, Java8
>>
>>59213454
It's not as much of the comma, but the calling convention your compiler is using.
>>
I am about to lose my fucking mind.
Spending the entire afternoon trying to solve a problem I can't even pinpoint the issue.
>>
>>59213486
use a debugger
moar debug logging
use better tools to make debugging easier
>>
>>59213476
Anon you'd have to be retarded to not understand that we're talking about C here. C doesn't define parameter execution order.
>>
>>59213516
>C doesn't define parameter execution order.
Oh, it's a C issue then. Who cares about that crap
>>
>>59212392
Call me back when we'll have C-less systems ruling the internet.
Protip: you won't.
>>
1. Completely outlaw C programming, seize all C books and burn, delete and shred them.
2. Rewrite everything into Rust
3. Kill C, C is communism
>>
Learning the basics of basics of Quantum Cryptography.
>>
>>59213527
>I can't even read and I consider a programming language with many merits crap
>I use java
I'm starting to think maybe Java isn't a bad beginner language.
>>
>>59213536
When you write it like this it feels good to be on the Dark Side of programming. Join me "C"amerad, we shall rule all software.
>>
>>59213552
>merits
Looks like garbage truck when --n and n-- does the same thing, m8
>>
>>59213566
>he didn't even understand the problem
I'm surprised you've managed to open a browser.
>>
>>59213573
You sound like you are upset. Denial?
>>
How much Rust shills are paid on /g/?
I want a quick buck too.
>>
>>59213598
Contact NSA and shill exploit lang C instead
>>
Do I need to be good at math for programming?

What base do I need before getting into it? I don't remember shit from highschool math to be honest.
>>
>>59213652
Why do people think maths and programming is closely releted?
>>
>>59213603
Do you fear to get less money because you won't be alone in rust shilling business?
You know, languages are tools. Whoever needs C, he chooses C. Whoever doesn't need C, he won't be choosing C.
Simple as that.
>>
>>59213579
Denial of what? I'm fully accepting that it's a bit of an issue. But it has its reasons and they're very good reasons that fit C perfectly.

If there was an execution order for parameters you couldn't optimize it as effectively. And if you wanted those optimizations you'd have to have no evaluation inside the parameter list.
If you wanted to give the copiler the same freedom you'd do
int n=15
int b=--n;
printf [...]

To me it makes no sense why you'd prefer this style of programming, which you have to do in the other languages. Now generally those languages don't particularly care about performance. And that's fine, you don't always care about that. But you can't come and point at C and say it's bad because it doesn't fit your concerns well. It makes as much sense as complaining about how inconvenient planes are for your short commute to work.

Now a problem C (and C++ usually) does have is its compilers. They don't warn you when they utilize the undefined behavior always. They don't have sanity preference in cases like these (to my knowledge there's no reason to not have execution order in right to left or left to right here).
But in this case if you compile with wall and werror (like any decent C programmer would) you would have caught this trivially.
>>
>>59213657
Because linear programming isn't coding.
>>
>>59213660
No one needs buffer overflows.
>>
>>59212214
>>59209890

Returns the corresponding value of the fibonacci sequence.
>>
>>59213657
"Coding" and Math aren't closely related.

Programming and Math are closely related.

Read "The Science of Programming" by David Gries and you'll understand the relation.
>>
>>59213657
Because maths and computer science are closely related.

>>59213652
Special areas of programming require special areas of mathematics. For example, if you're doing anything with graphics, linear algebra is a must.
But in general, you don't need anything particularly serious. Basic high-school level algebra should get you pretty far.
>>
>>59213664
>I'm fully accepting that it's a bit of an issue
You absolutely should.
>>
>>59213510
Nah it is a problem when I am trying to freeze a script and the tool used to write the module is fucking it up. Inb4
>Python
It is sadly my job
>>
>>59213688
And you should shut up about things you know nothing about.
I'm glad we agree.
>>
>>59213683
>>59213684
People that call programming "math" are mostly math major rejects. Programming doesn't even touch the near surface of the math autism.
>>
>>59213652
High school level math should be enough.
Learn math on the go when you learn programming and need something specific.
Learning math before learning programming is too much of an encyclopedic approach.
>>
>>59213700
Sure, can you negate this boolean expression for me without using parenthesis?
cond1 && cond2 && cond3 && ... && condN
>>
>>59213699
I don't have to know it because it's unnecessary, is that hard to understand?

Archtoddlers understand how harfbuzz because they have to put up with shitty experience for not knowing it while Winfags don't have to worry about it
>>
>>59213717
Isn't that like high school discrete maths with fancy symbols?
>>
>>59213717

I know /g/ fizz-buzzers won't be able to solve it so here's the answer: the trick is to switch the ANDs to ORs. You didn't know that if you don't know maths.
>>
>>59213717
Where are we drawing the line between logic and maths?
Or are you just considering it one big unit, where maths encompasses all of logic?

>>59213733
>the trick is to switch the ANDs to ORs
That is not all there is to de morgan's law.
>>
>>59213717
boolean temp = cond1 && cond2 && cond3 && ... && condN;
return !temp;
>>
>>59213744
>de morgan's law.
Year 9 called, it wants its introduction to set theory back
>>
File: 1374574532536.jpg (41KB, 493x575px) Image search: [Google]
1374574532536.jpg
41KB, 493x575px
>>59213750
>boolean
Go home, Javashitter.
>>
>>59213720
>I don't have to know it because it's unnecessary
Sure. You don't have to know that it's a concern until you're faced with it but you should be able to understand the problem. Not understanding problems is what makes you ignorant or stupid.
Doesn't matter what context.

Imagine the inverse of this. You change the prototype for a function to take one arguent in front of another and when you've modified the calling code you suddenly see a 20% performance increase/decrease. That's also an issue. One that C programmers would deem unacceptable becase it means you have to test the different orders or add a keyword to the language that says that order doesn't matter. OR make it default and have a "order matters" keyword.
It's not black an white. Fucking idiot.
>>
>>59213760
>change the prototype for a function to take one arguent in front of another and when you've modified the calling code you suddenly see a 20% performance increase/decrease. That's also an issue.
Well, I simply will go down and look at the function to see how to optimize it. Why are C people getting so mad?
>>
>>59213684
>For example, if you're doing anything with graphics, linear algebra is a must.
>But in general, you don't need anything particularly serious. Basic high-school level algebra should get you pretty far.
I remember algebra, for the most part and i'm sure i'd remember more if I had to use it at least once in my life.

>>59213713
Thanks I was wondering if that was an option, learning stuff specific for the task I want to do.

What about logic? they really don't teach us that.
>>
>>59213717
>de morgan's law is considered a challenge by this guy
Regardless. Another perfect example of how you shouldn't associate math with progrmaming so strongly.
You explicitly have to tell him to not use a parenthesis to make this an 'issue'.
>>
>>59213752
What? Are you trying to say it should be called by another name or something?
>>
>>59213744
>That is not all there is to de morgan's law.
haha I know what rules you are referring to. And honestly I was thought all those in year 9-10, prior to college.

Is american education system crippled or something?
>>
>>59213781
Don't worry, just learn programming and enjoy it and then learning math that you need will also be fun. Except for some basics, the needed math will be application specific for the kind of program you want to write.
>>
Trying to organize my desktop.

I'm using tags to organize images by their respective qualities. I recently downloaded the "tag" utility for the Mac terminal, and was wondering, how would I move all the files with a certain tag to a folder?

The command
 tag -m gray 
lists all the files with a gray tag, and I was wondering, given this list, how could I use the "mv" command to move all these files to a folder?
>>
File: 0e9.jpg (27KB, 600x600px) Image search: [Google]
0e9.jpg
27KB, 600x600px
>>59209636
>programming in ANSI C
>linking all fucked up with circular dependencies up the ass
>end up copying entire structs into other files and typecasting
>copy whole functions too
>>
>>59213800
Yeah I think i'll just take it easy, going overboard will only make me hate this.
>>
>>59213780
>I simply will go down and look at the function to see how to optimize it.
Ok so you didn't even understand the issue. I really thought I made it perfectly clear, that was my for dummies explanation.
The problem is that the compiler can have many preferences in order of execution, to figure out what order is the best you should probably try all permutations or write the optimization procedure yourself.
But I realize that this solution doesn't make sense to you because you didn't understand the issue in the first place. So I guess we just have to leave it.
>why u so mad
It bothers me that you come into /dpt/ and think that you should be voicing your opinions when you're this stupid. That's why I'm bickering with you. You know way less than you think you do.
>>
>>59213803
Retarded frogposter.
Learn how to forward declare.
>>
>>59213816
>so you didn't even understand the issue
What makes you think I don't? And why do you keep writing essays that summarizes to "shitpost"?
>>
>>59213812
Happy programming
>>
>>59213827
>What makes you think I don't?
Because you wrote
>I simply will go down and look at the function to see how to optimize it.
That's like saying "oh so it printed the wrong thing in that case, let me just swap the order here".

It's not even a start to solving the problem.
>>
>>59213838
So instead of looking for the reason what caused the function to drop efficiency you got another way?
>>
>http://pastebin.com/raw/hsqba0Pn
>function SenpaiNoticed()
>>
>>59213868
Anon I keep telling you you don't get it.
Maybe it's time to understand that you don't get it?
>>
>>59213868
I'm not aware of any imperative language which arbitrary drop the sequence points between two disparate statements.
Also. restricting the compiler's options isn't going to make it faster.
>>
>>59213890
rephrase your first claim
>>
>>59213913
>>59213913
>which arbitrary
which allows you to arbitrarily.*
I reworked the sentence when writing it and I guess I forgot to put it back in.
>>
>>59213877

May god have mercy on our souls.

Reminds me of this: https://hg.icculus.org/icculus/lugaru/file/97b303e79826/Source/GameTick.cpp
>>
>>59213890
D
>>
>>59211756
do this guy never heard about lisps or even ocaml? how haskell is the most popular functional language? even crappy scala with shitty jvm is more widely used (maybe this script is from before scala existed though)
>>
>>59213968
>he read all these
>>
>>59212004
If you want performance, then go full procedural. POO languages add a lot of overhead is used like they are intended.
>>
The more I understand libuv the nicer it seems. It's very consistent and functional, as far as it seems. Better than any other C/C++ boost-free netlib
>>
New thread:

>>59214040
>>59214040
>>59214040
>>
>>59209895

Most Universities in the late 90's
>>
In C++

void funtion( char *a )
{
//do something using *a
}
int main()
{
char A[] = {0,0,0};
funtion( A );
const char B[] = {1,1,1};
funtion( B );//<----------not work
}

how do I make that work without creating too much code?
>>
>>59213527
It's not a C issue, it's an issue of calling conventions between architectures, and even between OSes.

C defines an abstract machine, everything that is well-defined behavior in C is pretty much what all computers have in common. Calling convention is not, and it is not C goal to impose a style. That means that:
- calling convention is implementation-defined
- since you can't know beforehand how the arguments will be passed, passing arguments with side effects is undefined behavior, which is logical, because results of side-effected arguments will be inconsistent across implementations of calling convention

Of course, modern languages like Rust try to solve every undefined behavior of C by imposing a behavior, but this has one big adverse consequences: if your target environment behaves differently from what the language requires, workaround will have to be implemented either in compiler or in runtime, resulting in a less straightforward implementation than in C, with all that implies in terms of complexity and performance.

No wonder why undefined behavior exists in C. Either deal with it or trade some simplicity of implementation for simplicity of usage.
>>
File: 1485255359174.jpg (20KB, 249x249px) Image search: [Google]
1485255359174.jpg
20KB, 249x249px
>>59213958
holy fuck
>>
>>59214152
>Either deal with it or trade some simplicity of implementation for simplicity of usage.
How far does your head need to be stuck up your ass for you to think that's a battle you can win on the implementation side?
Go on, enlighten me.
I'm not even that guy, and I'm a fan of the c style implementation myself, but goddamn, we fucking lost, get over it
>>
What does the development workflow of a Python developer look like?
Someone who has to mix between Python 2 and 3 a lot, deals with god-awful dependency relationships that cause certain applications to not play well with each other.
Either for Windows or Linux is fine.
>>
>>59210411
Better times will come, anon.
>>
File: images.jpg (8KB, 275x183px) Image search: [Google]
images.jpg
8KB, 275x183px
Do you guys think i should learn C Cross Cross?
Is it approved by Church?
>>
File: pomf~.jpg (192KB, 684x626px) Image search: [Google]
pomf~.jpg
192KB, 684x626px
>>59213958
>>59213877
What the fuck?
>>
When am I supposed to graduate from Python to a real language?
>>
>>59212113
not oop
>>
>>59215880
Why not?
Thread posts: 324
Thread images: 25


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.