[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - daily programming thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 27
File: 1422360335034.png (49 KB, 1000x716) Image search: [Google]
1422360335034.png
49 KB, 1000x716
The "RIP object oriented memes (1969-1990), it was not a pleasure knowing you, but you made me truly love Haskell, which is nice." Edition

Old: >>54665664
>>
File: jew slayer.png (2 MB, 1920x1080) Image search: [Google]
jew slayer.png
2 MB, 1920x1080
First for fuck the kikes
>>
>>54671233
kill yourself
>>
>>54671233
Oh, a /dpt/ about languages nobody use. Nice.
>>
>>54671247
Why do liberuls only talk about the man-woman pay gap but never about the jew-goyim pay gap?
>>
Stop making threads before we hit the bump limit you fucking attention whore.
>>
File: haskelel2.jpg (745 KB, 1920x1080) Image search: [Google]
haskelel2.jpg
745 KB, 1920x1080
>>
>>54671282
Stop giving attention whores attention you stupid goyim
>>
>>54671280
quit false flagging, idiot

ironic shitposting is still shitposting
>>
>>54671221
Thanks for help, I wasn't aware of this, fixed it right away.
>>
>>54671233
Haskellfags act all enlightened and above it all but rarely do they know lambda calculus. They're basically hipsters who got beyond Javascript.
>>
>>54671340
What CS degree doesn't cover the lambda calculus?
>>
>>54671347

You're assuming that most of the haskell pushers actually have CS degrees.
>>
>>54671347
Pajeet's degree didn't
>>
>>54671276
kek fucking jehovah's witnesses get paid 24k to go door to door?
>>
I still can't figure out where I'm going wrong.

My driver:
#include <iostream>
#include "ArrayList.h"
using namespace std;

int main()
{
ArrayList<int> a;
}


My header:
#ifndef ARRAYLIST_H
#define ARRAYLIST_H

template<class ItemType>
class ArrayList
{
public:
ArrayList();

bool isEmpty() const; // Checks if list is empty.
int getLength() const; // Returns the amount of times in the list.
bool insert(int index, const ItemType& item); // Inserts an item at index.
bool remove(int index); // Removes item at index.
void clear(); // Deletes every item in the list.
void whatIsAtIndex(int index); // Figure out how to throw an exception here.
int findItem(const ItemType& item); // Finds an item, then returns the index it was found.

private:
// Data members
static const int CAPACITY = 100;
ItemType list[CAPACITY]; // Array of items.
int itemCount; // Current amount of items in list.
};
#endif


cpp for just the constructor:
#include "ArrayList.h"
#include <iostream>
using namespace std;

template<class ItemType>
ArrayList<ItemType>::ArrayList()
{
itemCount = 0;
}


And then my error:
g++ driver.cpp
/tmp/ccsx8Q5G.o: In function `main':
driver.cpp:(.text+0x16): undefined reference to `ArrayList<int>::ArrayList()'
collect2: error: ld returned 1 exit status
>>
>>54671384
It's more that the people vulnerable to Jehovah's witnesses tend to be poor. Just like how Jews are at the top because a certain Austrian fellow got rid of the poor ones.
>>
>>54671384
they do it for free
>>
File: 1396234462139.gif (973 KB, 190x149) Image search: [Google]
1396234462139.gif
973 KB, 190x149
Reposting for new thread:

I wrote a blog post about some template metaprogramming shit I did in C++.

http://anthony.noided.media/blog/programming/c++/ruby/2016/05/12/mruby-cpp-and-template-magic.html

Is it understandable? They say that the best way to learn something is to explain it. I think I definitely learned something, but I'm not sure my explanation is quite up to snuff.
>>
File: error.png (37 KB, 713x524) Image search: [Google]
error.png
37 KB, 713x524
So, I couldn't debug my shitty calculator in my new phone.

So, I remade a test new project with the default values the wizard produce, and it gives me this error.

default libgdx project made by wizard.

So don't blame me for it.
>>
>>54671409
Definitons for templates must be in the same file.
>>
>>54671410
jews also have nepotism and are unscrupulous in terms of morals
>>
>>54671410
*bzzzzzzzzt*
>>
>>54671384
Welfare

>>54671376
http://www.strawpoll.me/10272941
>>
>>54671410
They got rid of the Jews because those damn Jews somehow controlled the whole economy
>>
>>54671439
>http://www.strawpoll.me/10272941
you're delusional, you're not smart or superior in any way just because of the programming language you use, it's not like haskell is hard to learn, in fact you're probably stupid as shit for falling for the meme and using such a shitty shit language, even FP nerds agree that haskell is shit
>>
>>54671459
Why are you so triggered Pajeet?
>>
File: 1459865687594.jpg (65 KB, 458x328) Image search: [Google]
1459865687594.jpg
65 KB, 458x328
>>54671276
Good question
>>
>>54671491
why are you so delusional fag?
>>
>>54671456
Fucking /pol/ go >>>/pol/. The establishment will always blame outsiders. The US has done it with Russia and now "terrorists," the conclusive scapegoat that only exists in a limited sense for a postmodern era.

PROGRAMMING.
>>
fuck shillary

vote trump
>>
Is java or javascript better for beginners.

Last time I went to code academy I had a great time with javascript but couldn't finish it because my tablet broke.

Java feels odd for some reason. Or should I learn python first.
>>
File: 1463796563322.png (43 KB, 894x744) Image search: [Google]
1463796563322.png
43 KB, 894x744
Hello stallman, my old friend. You look glorious in my terminal
>>
>>54671603
java

javascript and python are easier to get started with but they're shit for actual programming

java helps you learn more serious programming
>>
File: mqdefault.jpg (17 KB, 320x180) Image search: [Google]
mqdefault.jpg
17 KB, 320x180
>>54671537
I'm not saying Jews deserve to be hated, in fact, they are probably superior to goyims. They are just better at not being worthless pieces of shit, but people have been jelly about this for a long time.
>>
>>54671618
He looks like he got in a bad fight.

>>54671603
Don't use javascript and don't use code academy.

Java is a better choice. I guess it depends on what you want to do, but I'd recommend C though.
>>
>>54671603
Start with Java, then learn haskell, Racket, and Javascript or Ruby
>>
>>54671627
kill yourself
>>
>>54671635
He got in a fight with 256 colors and resolution restrictions
>>
>>54671638
>>54671635
>>54671620
Thanks guys. I guess I will grit my tooth and learn Java.
>>54671635
Is there a better site for an idiot like me?
>>
>>54671664
Don't waste your time with C, only learn it if you need it for something
>>
What the fuck is wrong with this code? From experimental observations it seems it's not.
#define update_descr_addr(descr_list, addr_field, new_addr) do {            \
alt_sgdma_descriptor *cur = descr_list; \
size_t offset = 0; \
while (cur->control & ALTERA_AVALON_SGDMA_DESCRIPTOR_CONTROL_OWNED_BY_HW_MSK) { \
cur->addr_field = (void *) new_addr + offset; \
offset += cur->bytes_to_transfer; \
cur = (alt_sgdma_descriptor *) cur->next; \
} \
} while (0)
>>
>>54671664
https://docs.oracle.com/javase/tutorial/
>>
>>54671618
Hello Stallman my old friend
I've come to interject again.
Because a program softly creeping
Left its source while I was sleeping
And the vision that was planted in my brain
Still remains
Within the sound of freedom
>>
>>54671681
Except C is useful everywhere.
>>
>>54671686
s/not/not idempotent/
>>
>>54671603
Don't learn Java.

Python is better, or C, but I recommend Python.
>>
>>54671707
Everywhere that he needs it, which is hopefully nowhere. It is a terrible, weakly typed language. He should learn a modern systems language like Rust
>>
>>54671719
kill yourself

>>54671707
no it's not, for >99% of applications there are better-suited languages
>>
>>54671686
Why the fuck is that a macro? Are you literally retarded? You don't even have parens around the variable usage
>>
>>54671717
What? What the hell does idempotency have to do with anything? That's a functional property.
>>
Should I be writing macros for small inline-able functions instead of making proper functions?
>>
File: chinese police car rows.jpg (1 MB, 1500x998) Image search: [Google]
chinese police car rows.jpg
1 MB, 1500x998
>>
>>54671681
Everybody should understand how C abstracts system memory from low level, and at least be able to read and understand C.

Then they should never actually use it for anything in <current year> because we have type and memory safe modern languages that have replaced it
>>
>>54671754
Because addr_field. Thanks for parens though.

>>54671764
You're moron.
>>
File: soccer slap.jpg (103 KB, 460x648) Image search: [Google]
soccer slap.jpg
103 KB, 460x648
>>54671340
What does lambda calculus have to do with any specific language? It's an abstraction and it's used everywhere in compilers, interpreters, linters, etc.
>>
>>54671801
Idempotence is a function property and that macro isn't a function. If one were to wrap it into a C function it would have the void type, so it really couldn't be a function.

At the very least you could write in English instead of s/not/not idempotent.

t. Rule 3
>>
Hey /dpt/. I have no idea what to make but I really, really want to make something. Something that can be used, something mildly cool or entertaining, just something.

Any help?
>>
>>54671599
If you go for the microcontrollers, you'd want to learn C. I find it relativily easy to learn since it doesn't have a whole lot of abstraction.

For PLC there is ladder, function block diagrams and sfc. (And STL and SCL.) You have to remember that PLC's were developed for industrial work and the programming reflects that. sfc is fairly easy to learn as a beginner, but ladder and function block aren't al that hard either.
>>
Can someone give me 1 example or reason of why OOP is actually bad? Because I've never seen an actual example. And I'm not talking about ">muh Pajeets inherit everything" meme, I mean an actual reason why the tools are bad and not the people using them.
>>
>>54671917
it's 'latter'
>>
>>54671876
You're still moron, fucking hipster piece of shit.

I mean idempotence as in:
I'll put your neck on the ground and then I'll cut your fucking head off with a sword. And no matter how many times I'll punch the position where your neck was with the sword, your fat body and worthless head will be separated in the same state as they were after the first cut.

Only faggots try to correct usage that perfectly conveys the point.
>>
>>54671936
OOP itself is not bad. It is just misused and abused very often.
>>
>>54671987
It isn't in the Netherlands.
>>
>>54672006
look it up fambly
>>
>>54671936
it drives people to overengineer their programs which leads to them being unmaintainable. OOP is a great concept when used correctly.
>>
>>54671801
>Because addr_field

Just make it a void* parameter and use a function
>>
>>54671916
Make a rope and hang yourself. Only Pajeets lack creativity
>>
>>54671990
>conveys the point
>s/not/not idempotent
That conveys something? That looks like nonsense to me.
>>
>>54672083
I'm not pajeet, and I have ideas but they are all useless
>>
File: images.duckduckgo.com.png (3 MB, 2176x1915) Image search: [Google]
images.duckduckgo.com.png
3 MB, 2176x1915
>> inb4 arduino c isnt a programming language.
I dont care.

Im working on an arduino project, and I need to know if you can call a function from inside another function.

for example:

void loop() {
// stuff happens
functionOne();
// other stuff happens
functionTwo();
// even more stuff happens.
}

void functionOne() {
// insert stuff that happens here
functionTwo();
// more stuff happens
}

void functionTwo() {
// even more stuff happens
}
>>
>>54671429
I tried looking that up: https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl

And I'm still failing to see what I did wrong.
>>
>>54671750
>impying that embedded applications encompass <1% of all applications
>>
>>54672196
Of course you can. How could you call any function other than main if you couldn't call it in main?
>>
Dubs chooses what trivial program I write
>>
I'm going to install lubuntu to make games and there's nothing you can do to stop it.

;)
>>
>>54672196
Are you seriously learning arduino C as your first language? Of course you can you fucking retard.

>>54672225
Because Arduino doesn't use a main, it uses a setup() and a loop() or some shit (which main() calls, but it hides that from you)
>>
I'm working in Javascript and making what is basically a pick-a-path adventure type thing, and I've got each section defined as an object, and the sections the player can head into from that section as an array of variables on the object.

Except now I'm running into the problem where if a section's choice isn't defined above it's just undefined, and given some of them refer back in a circular manner I can't just make sure things are defined in order.

In a simplified example, I'm basically having this issue:
var bob = 
{
name: "Bob",
buddy: alice
}
var alice =
{
name:"Alice",
buddy: bob
}

function test()
{
alert(alice.buddy.name); //gives "Bob"
alert(bob.buddy.name); //gives "Unable to get property 'name' of undefined or null reference" error
}


I can probably replace the actual names with strings and then get them using those, but there isn't another more sensible way to be laying these out, is there?
>>
>>54671999
>>54672037
So OOP itself being bad is just another /g/ meme then? Thanks.
>>
>>54672196
>arduino c
no such thing exists
>>
>>54672237
Well the same argument applies to setup and loop.
>>
>>54672229
have fun
>>
>>54672198
It's best to define and *declare* template classes/functions in the same file, and later include it wherever you need it.
>>
>>54672239
I don't know fucking shit about javascript but is it because bob's buddy is defined as alice before alice exists
>>
>>54672229
What sort of things are you going to make?
>>
>>54672229
I hope you prayed to the video driver gods.
>>
>>54672239
var bob = 
{
name: "Bob"
}
var alice =
{
name:"Alice"
}

bob.buddy = alice;
alice.buddy = bob;


Pretty trival stuff
>>
>>54672229
sent
;)
>>
>>54672225
>>54672237

What that guy said.


>>54672237

And yes, I did learn arduino C as my first language. Since then I have learned "jython" which is supposedly fully compatiable with python, but it isnt. My university's intro CS class is stupid. They should have just taught us python. Jython is great for learning how programming works, but not for actually programming stuff outside of the course...

Its supposed to be python implamented in java, but it isnt exactly.
>>
>>54672279
android shit, libgdx, opengl in python and c++
goo shit
SDL/SFML/Monogame

All the good package.

need now to find an open source alternative to melodyne editor
>>
Best resources for learning C?
>>
>>54672244
its supposedly just regular C but with arduino headers on it. Its not the same thing as learning C though. Cant be used to program an actual computer.
>>
>>54672275
In his defense that's legitimate in lots of situations. It's legitimate in Java.
public Main {
public static void main(String[] args) {
foo();
}
private int foo() {}
}

Scheme:
(define (foo) (bar))
(define (bar) #f)
(foo)


>>54672299
I don't know shit about java but wouldn't it be more idiomatic to do this?
var bob, alice;
bob =
{
name: "Bob",
buddy: alice
}
alice =
{
name:"Alice",
buddy: bob
}

This is similar in form to how letrec is implemented in Scheme.
>>
>>54672348
GCC, a text editor and a reference manual to the C standard library and C syntax.
>>
>>54672351
it's c++
>>
>>54672357
>wouldn't it be more idiomatic to do this?
Yes, that would work too, since it's reference
>>
>>54672348
C Primer Plus
C Programming: A Modern Approach
>>
>>54672299
That's fine for Bob and Alice, but in the 3-event demo I'm working on now I've got 24 different sections, and the proper thing'll be significantly larger, so I want to keep each section's data together as neatly as possible.

>>54672357
>I don't know shit about java but wouldn't it be more idiomatic to do this?

I thought of that one myself, since it'd keep things neat and I thought *should* solve the issue of things being undefined, but nope, it was (and is, tested again to confirm I didnt' just screw up last time) giving me the same error as before.
>>
>>54672239
Just make Alice and Bob elements of an even larger object, and use strings
>>
You could do lazy initialization as in getBuddy: func() { bla bla }
>>
Which IDE do you guys use for general coding, VBS or JetBrains?
>>
>>54672410
>I thought of that one myself, since it'd keep things neat and I thought *should* solve the issue
That's because var a; is still undefined, you have to do var bob = {}; var alice = {} first
>>
>>54672258
Thanks.
>>
Here's what it's like to be a developer in China
https://news.ycombinator.com/item?id=11744736

>9am until 11pm
>6 days a week
>Still make less than the lowest paid developer in the US
>>
File: 68000.jpg (404 KB, 1024x768) Image search: [Google]
68000.jpg
404 KB, 1024x768
So I was at the computer labs at school, and saw in the recently used programs, someone was using some IDE/Compiler/thing for the Motorola 68000. I looked up what the Motorola 68000 is, and it seems archaic.
Would someone be using it to learn assembly? Maybe an intro to embedded systems class or something? Also why do people still use assembly?
>>
>>54672463
I use emacs for C, Lisp, Ruby, and Go. I also use it for code review, and for pair programming across the world where me and some guy in Norway share an emacs buffer

I used eclipse for java when I did some elastic search work and hated it so much I just switch to emacs and scripted my own tests
>>
>>54672522
You wouldn't use a random architecture to learn assembly; you'd learn assembly for the architecture you want to make stuff for.
Either he was just curious and interested and fucking around, or wants to fuck around with an old machine he has
>>
>>54672522
They use machine-level code for performance evaluation and optimization, and to reverse engineer or debug compiled code.

There's a reason the Art of Programming is done in an assembly language which is to learn how optimization works on the machine level.
>>
>>54672522
Assembly is useful to know because it gives you a better sense of what's going on your computer and what exactly your code is turning into.

>>54672463
Vim + Command prompt in a terminal mutexer.
>>
>>54672522
microprocessors class
>>
I had a software dev. job interview recently. The interviewer said that the position wasn't just a "software developer" but "a product developer" and a "product focused company". What did he mean by that? What extra responsibilities should I expect? The job ad most definitely was "software developer". The company is a bank.
>>
>>54672471
Ah. Yeah, that'd work if I replaced the second
bob={stuff};
with
bob.name="Bob";
bob.buddy=alice;
Thanks for explaining where I was goofing there.
>>
>>54672575
>Vim + terminal mutexer
>Emacs
Only two valid answers.
>>
>>54672463
Vim and CLI utils. I have a tiling wm so I don't use a multiplexer
>>
>>54672848
same but I still like using tmux over tiling wm
>>
//Help with Java?

class Node {

int value;

Node left;
Node right;

Public Node {
}
}

// Allegedly this is the structure for a node in a binary tree. When you type 'Node left/right', I know that it represents the sons of this node, But why does it work? How can you write the name of a class inside the same class?
>>
>>54672894
Why?
>>
>>54672913
I really like tmux/screen's windows, tiling WMs can't really provide anything like that (at least in my experience) with static workspaces. Also, tmux integrates really well with vim splits so I can use things like ctrl H/J/K/L to move around vim splits and tmux panes seamlessly
>>
>>54672903

To elaborate. How does 'Node left' helps me to know the address of the left node? It's not even a variable or anything. Is this class going to create a Node object with two node objects inside, and then each one of those will have two inside and so on? If that's the case, Wouldn't having an infinite structure eat all my memory? When does it stop?
>>
>>54672903
long story short , its a recursive implementation

http://www.newthinktank.com/2013/03/binary-tree-in-java/
>>
I think I want to start an offshoot of Thule that supports lookbehind conditionals. Then you could customize certain outcomes on the basis of previous replacements rather than duplicating a ton of text with the only difference being a single replacement rule.
Man, can you believe these *(political_party)? All they care about is *(P ?? "liberal" -> "liberal_issues" : "conservative_issues").


Something like that, where P means previous.
>>
>>54672938
i3 doesn't use static work spaces. I use the vim keys to move around the windows. It's exactly like tmux as far as I can tell except I can do more than just terminal windows
>>
>>54672903
in Java, anything that has a class is a pointer.

think
typedef struct {
int value;
Node* left;
Node* right;
} Node;
>>
>>54672938
Why not use a real tiling WM like Awesome?
>>
File: 1433723486751.png (1001 KB, 1312x2187) Image search: [Google]
1433723486751.png
1001 KB, 1312x2187
Any language that doesn't give you explicit control over the lifetime of an object is complete and utter garbage.
>>
>>54672957
it's a variable, it's a reference to a Node object. it doesn't go on forever, they default to null (no object)
>>
>>54673080
if you keep on allocating and deallocating objects it can be inefficient, it can be more efficient to use a pre-allocated heap and amortize the cost of removing objects so you do it all at once instead of a little a time
>>
>>54673080
You are utter garbage
>>
>>54673184
not to mention memory fragmentation
>>
>>54673184
A better solution would be to allocate on the stack in that case.
>>
>>54673223
not if you have many objects and long lifetimes of objects
>>
>>54671603
lisp
>>
>>54673234
>long lifetimes of objects
Then allocating on the heap shouldn't be a problem.
>>
>>54671603
>>54673247
Common Lisp or Racket.
>>
>>54673250
you can get memory fragmentation and you're constantly taking time to allocate and free objects piecemeal, it can be much better especially for long-running applications like servers and enterprise applications to have a garbage collector to not do anything until it's necessary, then it does everything all in one go and it can move things around to defragment memory
>>
GC langs are among the fastest for long-running applications

https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=query
>>
>>54673080

Everything should have static lifetime.
>>
>>54673381
Kill yourself.
>>
with separate malloc calls you don't get explicit control over the memory layout anyway, you're at the mercy of the operating system
>>
>>54673411
ctards on suicide watch amirite?
>>
File: programming powerlevels.jpg (473 KB, 1400x1341) Image search: [Google]
programming powerlevels.jpg
473 KB, 1400x1341
>>54673277
>Common Lisp
>>
>>54673411
That's got nothing to do with the lifetime of an object.
And who said we were talking about C here? C++ also gives you explicit control over object lifetimes.
>>
Does C have any standard hashtable libraries?
>>
>>54673428
you can really shoot yourself in the foot if you're not super good at managing memory, like if you alloc a """"2d array"""" on the heap with separate malloc calls, it's pig disgusting, now imagine the same kind of thing but on a much larger scale across your entire program
>>
>>54673408

No, for I also have static lifetime. I have been here from the beginning and I will be here until the end.
>>
>>54673456
Yeah sure, I agree that's a shitty way to allocate a 2d array, but only a retard programmer would do that.
I know better than that though.

What the hell is your point? memory management can be dangerous? no fucking shit. Learn to program properly, problem solved.
>>
>>54673490
GC has its uses and is much better than Ctards give it credit for, you don't get optimal performance automatically just because you do manual memory management
>>
>>54673435
The standard C library doesn't include any large, persistent data structures - neither lists, nor trees, nor stacks, nor hashtables.

It's not really possible to give a definitive answer without asking the authors of the original C library. However, a plausible explanation is that the implementation of such data structures involves various tradeoffs, and only the author of the application is in the correct position to make those tradeoffs.

Note that the POSIX standard C library does specify generic hashtable functions: hcreate(), hsearch() and hdestroy(); and note also that their "one size fits all" nature tends to render them inadequate for most real-world use cases, supporting the argument above.
>>
>>54673519
But with GC you lose explicit control over object lifetimes.
That is not a worthwhile trade off for me.

And while you argue that is GC useful for efficiently deallocating objects and lowering memory fragmentation, don't forget that the GC pass itself has overhead that in some languages can be pretty bad.
>>
>>54673435
https://apr.apache.org/
>>
>>54673456
Big malloc()s (>128 kB) usually don't end up on the heap but as anonymous mappings
>>
File: Untitled.png (35 KB, 988x570) Image search: [Google]
Untitled.png
35 KB, 988x570
Why does this shit crash when I run it 'fast'?
Meaning that if I manually debug through this code it works, but when I simply run it, it goes beyond the range limits.

 
// compute fitness of each individual in the population
var fitnesses = Enumerable.Range(0, populationSize).Select(i => computeFitness(currentPopulation[i])).ToArray();


public static double ComputeFitness(Individual individual)
{
return individual.binaryString.Count(character => character == '1');
}


Somehow it's sending a 6th Individual that is null.
I seriously cannot comprehend why this shit is happening.
>>
How do you floor a float to an int in C /dpt/?

This is what I got but maybe there exists better ways:
int floored = lrint(floor(x));
>>
>>54672640
It means the bank is using buzzwords to try to sound relevant.
>>
>>54672640
i'm guessing it's not just a code monkey job, you're taking part in designing the software product, not just programming things according to a predetermined specification
>>
>>54672239
>>54672299
>>54672357

Why is it always Bob and Alice Goddammit, definitely NOT OTP
>>
File: bitch-hold-on.jpg (55 KB, 480x720) Image search: [Google]
bitch-hold-on.jpg
55 KB, 480x720
>>54672327
>jython
>python written in java

what is this super meme and where did it come from?
>>
>>54673977
It's actually good. It doesn't have the GIL
>>
>>54673977
Literally all the gay languages(python, ruby...) have compiler that can compile to .net clr, jvm and probably c.
>>
without resorting to memes, someone please explain why javascript is bad. i think its because you guys just dont understand how to use JS debugging tools properly and think prototypal inheritance is scary (muh oop!!!)

:^)
>>
>>54674071
insert the truth table here
>>
>>54674071
==
>without memes
You aren't the boss of me.
>>
>>54671603

after you get the basics of codecademy out of your way i suggest picking a small toy project like maybe a webscraper or a todo app and then trying to write one - if you get stuck consult the documentation for whatever language you chose or google
>>
>>54674071
Yeah, is Java really that bad?

I planned on using Java to make a social media app in my spare time. I assumed it was time to hop on the hype, but i'm not experienced with servers, and web app development at all, and I don't wanna waste my time.

What do?
>>
>>54674126
>>javascript
>Java
>>
File: anime2016.jpg (12 KB, 200x200) Image search: [Google]
anime2016.jpg
12 KB, 200x200
So I would like to create navigation using a select element on my page. Using the RouterLink directive on an anchor tag is simple, but is there an equivalent for a select dropdown? Or am I required to create my own navigation method on my component to be called when there is a change on my select?

<a [routerLink]="[location]">Location</a>

<select (change)="navigate($event.target.value)">
<option>--Select Option--</option>
<option [value]="[location]">Location</option>
</select>


I am looking for something like this:

<select>
<option>--Select Option--</option>
<option [routerLink]="[location]">Location</option>
</select>
>>
>>54674136
Get with the times, grandpa
>>
File: 1457321273831.png (16 KB, 303x880) Image search: [Google]
1457321273831.png
16 KB, 303x880
>>54674173
>angular
>>
>>54674175
what
i was pointing out that JS and Java are two entirely different things
>>
>>54674173
Just use PHP like a normal human.
>>
>>54674206
REEEEEEEE
>>54674253
EEEEEEEEE
>>
>>54674248
I meant javascript .

I'm just hip, posh, and lazy
>>
>>54674278
you can't do that
>>
>Groovy

Is there a worse meme language?
>>
>>54674305
sorry
>>
>>54672640
>https://news.ycombinator.com/item?id=11744736

the product guys at the last place i worked at did zero coding and spent most of their time talking to the devs, customers and management figuring out a clear path for what features to implement into our products

not something i'd want to do but it seems like it paid about the same as the devs were making
>>
>>54674278
>>54674126

>>>/g/wdg

python with django is the hip new thing for webshit, but if you're serious you should use java or C++
>>
>>54674356
Isn't Go the new 'hip' server programming language
>>
>>54671783
is this fake? my logic says it is fake but can't find a flaw
>>
File: white-kid-dance-club.gif (4 MB, 275x206) Image search: [Google]
white-kid-dance-club.gif
4 MB, 275x206
tfw i spent the last week looking at assembly and reverse engineering parts of a 15k$ commercial software so now i can make save files for the said software in about 50 lines of python code
>>
>>54674392
maybe, these memes come and go pretty quick, like ruby on rails used to be big, then node.js, then python (django/flask), maybe python is on its way out, but i think go might be too hard for most web devs
>>
>>54674126
>i'm not experienced with servers, and web app development at all, and I don't wanna waste my time.

bruh youre gonna waste so much time

things you'll need to know

basic linux shit, basic webserver shit, html, css, templating, whatever lang and framework you want to use for you backend/API then JS and whatever stupid hipster framework you choose for that
>>
>>54672497
Damn, that is bad. Allthough I doubt it is any different than any other expertise in China. At least do they getting paid more than average?
>>
>>54674126
>java
>social media app

kill urself m8
>>
>>54674432
The problem is that you're asking web designers to write code. Just calling themselves web "devs" instead of designers doesn't make them magically better at programming.
They need some meme framework written in a meme language to make sure their horrible written code still works without blowing anything up.
>>
>>54674434
You think i could circumvent JS with C++, considering i know that much better.

and what would be a proper template?
>>
>>54674523
>considering i know that much better
Than just use that. There are frameworks for anything in any language.
>>
>>54674523
i mean go for it but if you think you can develop a modern website/webapp without any frontend code you're gonna be in for a bit of a shock

your app is most likely gonna render info from whatever data source you have (oh totally forgot you should probably understand databases and ORMs too) and then use a template to create HTML for the browser to read. first template/templating engine that comes to mind is Jinja2 but there are tons of them
>>
>>54674515
Web designers are web designers, backend developers are different cup of tea. And since nearly every system nowadays has a web interface most programmers becomes webdevs
>>
>>54674515
>>54674580

the designer and the person who implements the design in angular/react/whatever has almost always been a different person at every place i've worked
>>
>>54674580
>And since nearly every system nowadays has a web interface most programmers becomes webdevs
even i am gonna have to do some web backend shit ;_;

>>54674578
his app could render things natively, doesn't have to go through the browser
>>
>>54674619
true, but most pages these days have JS. not really a fan of JS bloat but that's how it be
>>
>>54674651
i think when he said 'doesn't have to go through the browser' he meant that it doesn't hace to go through the browser
like it doesn't have to be a webapp, but with good old native client
>>
>>54671537
>PROGRAMMING

You mean name-calling, product shilling and asking for help with school assignments? Because that's all /g/ is for.
>>
>>54674578

What if i try to circumvent even further, using a P-T-P method. Can smartphones even do large-scale Peer to peer properly?
>>
File: INNERLOOPOPTIMIZED.png (44 KB, 741x612) Image search: [Google]
INNERLOOPOPTIMIZED.png
44 KB, 741x612
>>54674731
Also, people asking "which language to learn".

Few things bother me as much as that debate.
>>
>>54673456
>i like Rust because it protects my feefees from being hurt by mean patriarchal memory management issues
>>
>>54674830
don't do it
>>
File: 1459484904280.png (5 KB, 414x15) Image search: [Google]
1459484904280.png
5 KB, 414x15
;_;
>>
When do you choose functional programming over object oriented?
When you anticipate a different kind of software evolution:

Object-oriented languages are good when you have a fixed set of operations on things, and as your code evolves, you primarily add new things. This can be accomplished by adding new classes which implement existing methods, and the existing classes are left alone.
Functional languages are good when you have a fixed set of things, and as your code evolves, you primarily add new operations on existing things. This can be accomplished by adding new functions which compute with existing data types, and the existing functions are left alone.
When evolution goes the wrong way, you have problems:

Adding a new operation to an object-oriented program may require editing many class definitions to add a new method.
Adding a new kind of thing to a functional program may require editing many function definitions to add a new case.
This problem has been well known for many years; in 1998, Phil Wadler dubbed it the "expression problem". Although some researchers think that the expression problem can be addressed with such language features as mixins, a widely accepted solution has yet to hit the mainstream.
>>
>>54674934
>When do you choose functional programming
never
>>
>>54672522
he's very likely using it to program a ti-89, heh
>>
What would be the benefit of coding a server in C over C#?
>>
>>54674981
code it in Rust instead
>>
>>54674919
why not?
>>
>>54674981
The benefit would be that you would learn a lot about how servers work.
>>
>>54674981
lower latency
lower memory usage
lower power consumption/CPU usage
>>
>>54674981
C is a programming language, not a coding language.
>>
Reminder that Haskell cannot have good performance or low memory usage because it uses lazy evaluation.
>>
>>54675040
coding and programming are synonyms
>>
>>54675059
no their not
>>
>>54675059
they're not tho
>>
>>54675059
They're not.
HTML is a coding language.
C is a programming language.
Learn the difference and fuck off.
>>
do people still use B to program? I may pick it up
>>
>>54674981
Just like any other C vs. C# dilemma: you have more control in C. Using a higher-level language like C# is great for doing first builds, prototypes, etc My guess is that anything that you make won't need to operate at scale just yet so you could get away with the heavier abstraction of C#. Ultimately it's your choice, but I do believe you will have to write quite a bit of boilerplate if you opt for C. Boilerplate isn't bad. Just do it well the first time so you have it for the future. :^)
>>
>>54675101
C++ is an option because you can much better control how much cost you introduce with abstractions than you can with C#.

Another option might be Rust, which has an emphasis on zero-cost abstractions.
>>
>>54674981
because making a server in a language without threads, networking, hell even a queue structure is ``fun''

We had a C++ server at job. Impossible to debug and very error prone, a great combination indeed.

>inb4 C fags call names

I use C++ at job for client side, but it sure is not a server language. C is even more guilty.
>>
I'm trying to calculate total memory usage using /proc/<pid>/statm and comparing my numbers to the system manager and getting some weird numbers.

I'm basically adding all the numbers I get from statm, is that wrong?
>>
>>54675154
>c
>lacking threads
>networking
>queues
kek

Besides you don't need threads or queues or really networking to program cgi pages.
>>
>>54675059
No.
>>
>>54675096
like 1 person MAYBE
>>
>>54675189
point me to the standard that says anything about networking
>>
>>54675227
>It's not in the standard so you can't use it.
>>
>>54675101
>My guess is that anything that you make won't need to operate at scale just yet so you could get away with the heavier abstraction of <shitlang>
that's what every web startup thinks until they end up with millions/billions in annual losses because of server hosting expenses
>>
>>54675244
Then you will need to depend on possibly platform dependent libraries, which is even more reason not to use C.
>>
>>54675277
>Oh no! I have to use a platform dependent library!
Most libraries are platform independant, unless you're targeting Windows, but who cares about Windows anyway.
>>
>>54675081
>HTML is a coding language.
no it's not, it's a markup language
it's even in the fucking name
>>
>>54675277
Brotip: everything is platform dependent.
Double brotip: servers are designed for particular hardware.
>>
>>54675302
This

Only gay men use Windongs
>>
>>54675309
Markup languages are coding languages.
>>
>>54675302
>Most libraries are platform independant, unless you're targeting Windows
holy fuck it does not get more retarded than that.

I am done C fags.
>>
>>54675251
Note that I said my guess, and my guess is that this is a solo guy just playing around. I pray that no actual entrepreneurial endeavour would come to /g/ for technical advice.
>>
>>54675342
Who the heck uses Windows except your parents and neckbeard gamers?
>>
>>54675328
wtf is a coding language ? there is natural language, programming language, and markup language.
>>
>>54675277
Porting a lightweight network library written in C is a lot easier than porting over the entire .NET framework and runtime.
>>
>>54675369
>muh arbitrary classification
No, there are recursive languages, context-free languages and regular languages
>>
>>54675376
this
>>
File: Untitled.png (236 KB, 1366x768) Image search: [Google]
Untitled.png
236 KB, 1366x768
I'm looking for more websites I can use to gather data about an IP address, Where would I look?
https://en.wikipedia.org/wiki/Special:Contributions/68.173.233.165
^ anything at all, even if it's something stupid like that
pic related, what I'm using it for
>>
>>54675154
>Impossible to debug
that's because you're incompetent
>very error prone
because you're not a real programmer
>>
File: 1450278863418.jpg (86 KB, 935x615) Image search: [Google]
1450278863418.jpg
86 KB, 935x615
Any smart C++ people here?
I have a base class "Body" that has a virtual function "OnCollision(Body* CollidingBody)", pretty self explanatory, happens when the body collides with another, but how do I figure out if CollidingBody is a certain derived class?

Doing
"if(CertainClass* certain = dynamic_cast<CertainClass*>(CollidingBody))"
Comes to mind, but shit's runtime so dynamic_cast might be slow. The only other option is to have an "BodyType" enum that covers all derived classes of Body so I can do
"if(CollidingBody->Type == CERTAIN_CLASS)"
This of course requires a bigass enum declaration and every derived classes constructor setting the Type appropriately.

I just don't know what the right approach here is.
>>
>>54675380
and yet there is still no such thing as a coding language.
>>
>>54675436
But in C there are no exceptions, so you can't catch segfaults and try again. It's a worthless language.
>>
>>54675458
But you're a retard and you're worthless.
>>
>>54675444
Put spaces after control keywords, i.e. favor if ( over if(.
>>
>>54675450
I can make an arbitrary classification that includes it

Any language that codes data is a coding language, bam, HTML is a coding language
>>
>>54675444
It is gonna be runtime no matter what.

Make a virtual function that returns type of object. Or keep 'type' on the most base class and set that on constructors
>>
>>54675470
>no exceptions
>no classes
C is WORTHLESS.
>>
>>54675444
>instanceof
>>
>>54675500
there is no instanceof in C++
>>
>>54675498
see >>54675470

>>54675458
>you can't catch segfaults and try again
holy shit
>>
>>54675399
>activate windows
>>
>>54673778
why not just
 var fitnesses = currentPopulation.Select(computeFitness);
>>
>>54675444
Why not just use dynamic_cast now and worry about optimization later when it becomes relevant? You need to test first, yes?
>>
>>54675498
>no exceptions
Just use goto
>no classes
See the Linux object model or GTK+'s GOM
>>
Stripping files off NOAA FTP site - why is this shit so damn slow? I wish I could connect more than once but they're pretty quick on the IP ban for that shit.
>>
>>54675444
Unfortunately C++ has shit tier dynamic dispatch support, so there's no convenient solution to this.
You have to hand code your own dispatching, using an enum is probably the easiest, could possibly create your own tool for generating them automatically for you.
Thread replies: 255
Thread images: 27

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.