[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: 327
Thread images: 30

File: vectorflow.png (13KB, 400x260px) Image search: [Google]
vectorflow.png
13KB, 400x260px
What are you working on, /g/?

Previous thread: >>61705964
>>
File: A E S T H E T I C.jpg (47KB, 405x500px) Image search: [Google]
A E S T H E T I C.jpg
47KB, 405x500px
First for Pascal!
>>
https://www.youtube.com/watch?v=73lt7Fqo5Yk
>>
asking this again
>100,000++ line 1.5 year old application
>I became the lead developer halfway through
>written entirely by interns
>costing states 100s of thousands of dollars with bugs
>just given permission to write integration tests now
>just getting a decent QA strategy now
>just given permission to introduce PRs now
>code is riddled with duplication and anti patterns and terrible error handling and terrible UX
has anyone had a project that recovered from worse?
>>
File: 1449562585113.jpg (36KB, 540x450px) Image search: [Google]
1449562585113.jpg
36KB, 540x450px
>>
So how am I supposed to use type traits? With static asserts?
>>
>>61711819
Tell your boss that it'll be cheaper to just start from scratch.
>>
>>61711836
t. NEET

100000++ lines is not you fizzbuzz one-liner
>>
>>61711760
im making a pc buzzer midi player
>>
>>61711836
https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
>>
>>61711819
>>61711851
Prefer rewriting from scratch to fixing. This is suckless philosophy.

http://www.drdobbs.com/architecture-and-design/conversation-with-anselm-r-garbe-of-suck/228700066

>>61711865
Fuck off.
>>
Post beautiful code, i'll start:
fn main() {
assert!((|||||||||||||x|true||x)()()()()()()(false));
}
>>
>>61711851
The argument for money is stronger than anything your boss might say against it. Convince them that it will literally be cheaper and they will agree.
>>
>>61711819
Employ TSP (Team Software Process). It's the only process focused primarily on software quality rather than speed of development.
>>
>>61711895
https://pastebin.com/GQPnUi7d
>>
>>61711895
not enough <>{}()
>>
>>61711876
>suckless
Dropped
>>
>>61711836
>>61711876
There are about 20 layers of bureaucracy
I would need to get through just to dream about starting from scratch.
>>
>>61711946
The least you can do is try.
>>
>>61711865
>https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
This is written by a multi-millionaire, StackOverflow founder.
>>61711876
http://www.drdobbs.com/architecture-and-design/conversation-with-anselm-r-garbe-of-suck/228700066
This is an opinion of a German cuck.
>>
>>61711946
Isn't capitalism great?
>>
File: 9284923849324.jpg (20KB, 508x493px) Image search: [Google]
9284923849324.jpg
20KB, 508x493px
>he prefixes his pointers with p
>>
>>61711969
>he has more money, therefore he's right
The fact that the people who wrote shit software like Netscape became millionaires just goes to show how capitalism is shit.

Also, Garbe is very successful himself, so fuck off with your pointless fallacies...

https://www.linkedin.com/in/anselmgarbe
>>
>>61711974
It is. It fucks up idiots who try to rewrite large codebases with little-to-no return.
>>
Working on a nigger emoji chain builder. The program takes length of emoji chain and print random nigger emojis to the stdout.
>>
>>61711997
You're obviously a software engineering midget.
>>
>>61711993
Go to Russia commie fuck. Enjoy new sanctions.
>>
>>61711982
>he doesn't use superior Hungarian notation
>>
>>61712012
there is literally NO point to hung notation in le current year
>>
>>61712008
You're obviously a NEET.
>>61711993
https://www.linkedin.com/in/anselmgarbe
>doesn't own his own company
lol, literally a wagecuck who is working for someone else instead of making his own fortune. Someone has to be there to protect him from his own autism
>>
>>61712019
It is when you work in a dynamically typed language, pal.
>>
>>61711895
can someone break down what this does?
>>
>>61712028
that's why they are garbage languages and all academia that keeps pushing this shit should be rounded up and hanged from lampposts
>>
>>61712049
No, I use Hungarian notation in kernel modules, fight me irl.

>>61712048
They're used in the industry too, stop pretending to know anything, you're obviously a NEET
>>
>>61712027
You must love Bill Gates and Microsoft then, cuck.
>>
>>61712046
Just a bunch of nested closures
>>
>>61711895
Literally anything by Yegor Bugayenko.
>>
>>61712072
I love people who are smart enough to compete in the market and don't need a nanny manager to guide them.
>>
>>61712091
You're laughing now, but soon you will see true, elegant OOP: https://github.com/yegor256/eo
>>
>>61712082
can you break it down for me?
>>
>>61712071
>They're used in the industry too, stop pretending to know anything, you're obviously a NEET

Healthy young student goes to college, gets pumped with massive shot of many shit languages, doesn't feel good and changes - INDUSTRIAL STANDARD. Many such cases!

The fact that every other hip new startup used to (or still is) pumping ruby on rails just because it's hip, it doesn't mean it's good technology
>>
>>61712093
>muh market
You don't have to be smart to compete in the market. You just have to be dishonest, not care about morals and be willing to cheat. Just like Bill Gates and Microsoft did. Capitalism doesn't reward excellence, it rewards foul play.

You have to be smart and competent to create robust quality stuff like Linux, which according to your criteria, isn't as great as Windows because it hasn't made as much money or isn't as popular, even though it is objectively a superior piece of software.

Stay mad.
>>
>>61712132
>writes mad posts
>stay mad
really fires up those neural signals senpai
>>
>>61712131
>Healthy young student goes to college, gets pumped with massive shot of many shit languages, doesn't feel good and changes - INDUSTRIAL STANDARD. Many such cases!
Are we recycling Trump memes now?

>The fact that every other hip new startup used to (or still is) pumping ruby on rails just because it's hip,
I hope you're joking, because Ruby on Rails hasn't been hip in about 10-15 years.Tells how much you know about the industry.
>>
>>61712120
It's equivalent to something like
fn main() {
let clos1 = |x| true || x;
let clos2 = || clos1;
assert!(clos2()(false));
}

just with deeper nesting
>>
>>61712144
Imagine being this much of a corporate bootlicker and unironically believing quality software actually succeeds under capitalism.
>>
>>61712149
True, I don't know shit about webshit. It's just to prove a point
>>
>>61712164
We get it, you dislike Hungarian notation and you invent arguments for defending your view rather than just admitting that you simply don't like it.

I'm not new to 4chan you know.
>>
>>61712132
>You just have to be dishonest, not care about morals and be willing to cheat.
ROFL. The world would be fucking filled with billionaires if that were true.

No. Being dishonest and not caring about morals is being smart enough to realize the nihilistic nature of the world and make full use of it.

>You have to be smart and competent to create robust quality stuff like Linux
You have to be even smarter to see and correctly measure trade-offs between complexity and their worth, to find what people need and do it their way, not what you find easier to implement.

>robust quality stuff
>Linux
LOL. Linux is utter crap. You want a robust kernel? Try SEL4.
>>
>>61712188
>SEL4
You've just proved yourself wrong.

If it's so great, then why is it not widespread?

Keep in mind, I'm not saying it isn't great. I'm dismantling your false premise that the market rewards excellence.

>The world would be fucking filled with billionaires if that were true.
I'm sure all those Wall Street bankers are super righteous people, anon.

>You have to be even smarter to see and correctly measure trade-offs between complexity and their worth, to find what people need and do it their way, not what you find easier to implement.
I'm sure that's what Gates did with DOS and Windows and Office.

Stay deluded.
>>
>>61712072
>>>/pol/
>>
File: philosopher.png (551KB, 886x499px) Image search: [Google]
philosopher.png
551KB, 886x499px
Where is you're wikipedia page?
>>
>>61712259
>philosopher and entrepreneur
AKA an "ideas guy"

Also, what the hell is up with his sweater. I can smell the autism from over here.
>>
>>61712244

You sound like a faggot commie.
>>
>>61712245
>everything i don't like is p/pol/

fuck outta here
>>
>>61712296
Because I judge people based on their technical prowess rather than on how much money they've got?

Top logic, m8.
>>
>>61712244
>If it's so great, then why is it not widespread?
It's great by your standards. You prioritize technical excellence over pragmatism, which is retarded. You should be an artist, not a programmer. Why aren't you using SEL4 instead of Linux? Or did I misunderstand you and you are using Windows?

>I'm sure all those Wall Street bankers are super righteous people, anon.
No they're not and I did not imply they were. They superior people than most other people, though.

>I'm sure that's what Gates did with DOS and Windows and Office.
Yes, he did not write it from scratch. Still a better programmer and a smarter person than you or that German guy.
https://www.quora.com/How-good-is-Bill-Gates-at-math
>>
>>61712330
>It's great by your standards.
I know. And just as I expected, you missed the point. You're not an intelligent person. But I already knew that from the fact that you judge people based on how much money they have.

>Still a better programmer and a smarter person than you or that German guy.
How about we compare him to his contemporary and rival Gary Kildall? Who was obviously more competent than him, but was commercially defeated by Microsoft's foul practices?

You admire the wrong people.

Bill Gates is just one example, but I could mention others like Mark Zuckerberg of Facebook or a plethora of other rich fucks.
>>
>>61711819

>>61711865
I'm usually a fan of Joel on software, but a lot of his points about not rewriting might not apply here.

His main points are that poorly written code is usually bug fixes, and that older code isn't all bad, because it's battle-tested.

From what the original anon said, it sounds like there are still a lot of existing bugs, and 1.5 years isn't that long of a real world presence.

That said, you should be sure that a rewrite is definitely the best option. It might be best to come up with an idea of how the architecture of the program should ideally look. Then consider again whether you really need to rewrite, or whether refactoring the current codebase will produce a similar result in less time.

>>61712019
Hungarian notation can actually be useful (and not just for dynamically typed languages), but basically Microsoftruined it, so that most people use it wrong. Worth a read if you have time:
https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/
>>
does bash support OOP?
>>
>61712369
>And just as I expected, you missed the point.
You missed the point. The point was if you truly appreciated technical excellence, you would be using those "technical excellence" programs. And your previous posts suggested you are using the Linux kernel, which is objectively inferior to SEL4. Why? Because without even realizing it, you prefer commodity over this "technical prowess", as you say. You're just virtue signalling.

>Gary Kildall
Literally who? Probably some fag who doesn't know how marketing and real world knows. That is, someone who is incompetent in selling his product.
>>
>>61712434
>doesn't even know who Kildall was
I'm done with you. Enjoy your delusion.
>>
>>61712434
[cont.]

The point is, that fundamentally, capitalism is *always* right. The *best* product gets the most marketshare. Linux was *objectively* worse from a simple users perspective. Linux is objectively *better* from server's perspective, and the marketshare respects that.
>>
>>61712463
>capitalism is always right
Imagine actually believing this.
>>
>>61712475
>Imagine having money and not being a worthless NEET
>Imagine having sex and not being a virgin

Plenty of shit for you to imagine too.
>>
>>61712259
does he dreams in code too?
https://www.youtube.com/watch?v=DBXZWB_dNsw
>>
File: 1491923364306.png (11KB, 750x530px) Image search: [Google]
1491923364306.png
11KB, 750x530px
>>61712463
>the marketshare respects that
>>
>>61712434
>unironically using the term virtue signaling
>>>/pol/
>>
I'm using python been studying for a few weeks. I am considering making a text adventure game as my first project. The thing that comnfuses me is, code for projects are online but is it right to use bits and pieces from it when making a project? I want to learn how to do it on my own without taking someone's work. Or is it better to learn by just doing this?
>>
>>61712489
This is what you get when mindless corporate drones and MBA retards get to make decisions based on the latest buzzwords
>>
>>61712328

Technocracy is just another word for communism.
>>
File: 1501608221016.png (42KB, 379x366px) Image search: [Google]
1501608221016.png
42KB, 379x366px
>>61712425
http://lab.madscience.nl/oo.sh.txt
>>
>>61712518
>corporate drones
B-but capitalism is always right, anon!

>>61712519
What do you gain from embarrassing yourself online?
>>
>>61712513
>he can't understand basic concepts
>using the word unironically
>>>/highschool/
>>
>>61712539
You sound frustrated.
>>
>>61712533
>What do you gain from embarrassing yourself online?

I could honestly ask you the same question.
>>
>>61712542
You sound buttblasted.
>>
>>61712149
>Ruby on Rails hasn't been hip in about 10-15 years

Get back to paying attention in class, Albert.

RoR is the de-facto start-up standard in SV right now.
>>
>>61712546
I'm not the one tripfagging.
>>
>>61712551
Wow, you sure showed me. How will I ever recover?
>>
>>61712519
not really.
>>
Hey guys!
Janny here. Shut the fuck up because my dad works at 4chan and he's gonna ban you all.
>>
>>61712523
i want to start on the dialogue & negotiation portion of a cyberpunk game and would like to have all the different values and such modularized to different characters instead of all in one massive heap, would i need to use this to do that or is there a better way? i've never programmed in bash
>>
>>61712564
fuck outta here snowflake
>>
>>61712519
>Technocracy is just another word for communism.
Uh, no. Greece is currently a capitalist technocracy because of it's financial crisis, they invoked some kind of clause in their constitution.
>>
>>61712587
why bash?

just another language
>>
>>61712589
>g-go away y-you snowflake!
Corporate shills literally on the verge of tears at this point.
>>
File: image.aspx.jpg (34KB, 400x400px) Image search: [Google]
image.aspx.jpg
34KB, 400x400px
>>
>>61712618
bash because i want to get better at it. i include it on my resume but i'm really not good at it
>>
>>61712650
you can look how other people wrote games in bash for example

http://wp.subnetzero.org/?p=269
>>
Why is unicodes are such a pain in the as in C++?
How am I supposed to print nigger emojis?
>>
>>61712677
Damn, sleep deprivation
>>
does perl 6 have a future since perl has fallen out of favor? at least with 5, there are jobs maintaining already written code
>>
>>61712688
>perl
nobody cares
>>
>>61712259
>>61712268
atleast he's rich, better than most of these other "prodigies"
>>
>>61712688
its small community is now trying to change it's name from perl to rakudo, which would kill it even more since at least peoples names perk up when they hear perl. it'll just be another no name hipster language. so no
>>
>>61712699
not NEETs like you, that's for sure
>>
File: 1491081808903.jpg (56KB, 945x482px) Image search: [Google]
1491081808903.jpg
56KB, 945x482px
>>61712730
RIP
>>
>>61712709
Americans need to go back to their containment board.
>>
>>61712747
>a language needs to be on TIOBE

nigga pls

i don't see FORTRAN there either, yet pays your weight in gold
>>
>>61712709
It's clearly a money laundering scheme
>>
>>61712766
Because no one writes FORTRAN
>>
>>61712798
>no one writes FORTRAN
Lol
>>
>>61712814
It's true, the pay is high because no one does or want to write it any longer
>>
How do you guys start a project when you have absolutely no fucking idea where to start? I want to make an image viewer, which is supposedly a beginner project, but I've only done console stuff so far. I literally have no idea how to get started and I really would like to avoid looking at other people's programs.
>>
>>61712843
Follow a tutorial and make your own adjustments.
>>
>>61712843
"learn by doing" is a meme. read a book on it if you don't know the documentation to read
>>
>>61712843
npm start
>>
>>61711760
I am trying to write a program in C that takes user input and prints a histogram of the lengths of the words.

Here is what I have so far:
https://hastebin.com/ixomedejuq.cpp
This will get me the number of words in the input, but I'm stuck in regards to keeping track of the word lengths and displaying the histogram. Since this exercise is in the array section, i assume I'm supposed to create an array to store this information, but the array length of course depends on the input, and once my while loop reaches EOF, as far as I know, I can't access the beginning of the input again with the getchar() function.

Any advice would be most appreciated.
>>
I don't I understand objects and classes fully. I'm looking at an example involving a shopping list with items on it.

So the shopping list would be the object shoplist and the class would be the thing after it, right? like if I typed shoplist.append('rice') the rice would be my class?
>>
>>61712881
i spent like 2 minutes typing how to solve this but it's better left to you. it's a good beginner project and isn't tricky. read K&R, good luck!
>>
>>61712936
an object is an instance of a class. you are human, and are an instance of a human. human is the metaphysical abstract non-tangible class, you are the tangible instance of that class. you are an object
>>
>>61712843
what is an imageviewier? a program that

- load a image file
- unpack the pixels into a drawing buffer
- render the drawing buffer to the screen

so you have to learn

- about image formats (PNG, BMP, JPG)
- how to create a drawing buffer (SDL, Opengl, GTK, Qt, ...)

only after that, you will then think about adding features and designing a GUI.
>>
>>61712843
you create a window (need somethin to create window sdl, x11, winapi, sfml, whatever)

you load an image (need something to load image, libpng, libjpg, boost:gil)

you need to render an image

you need some kind of gui
>>
>>61712961
So class int(object)?

Like human me(human)?
>>
>>61712961
>an object is an instance of a class.
not necessary.
>>
>>61712948
kek that is what I am reading. I have been able to get through every exercise thus far fairly easily but this one has me stumped.
>>
The power of c pee pee episode 15: Getting a random number:

#include <random>
#include <iostream>

int main()
{
std::mt19937 rng;
rng.seed(std::random_device()());
std::uniform_int_distribution<std::mt19937::result_type> dist6(1,6); // distribution in range [1, 6]

std::cout << dist6(rng) << std::endl;
}


Why is this language so much counter productive?
>>
I've got 3 years to waste should I start learning c20 or c++20?
>>
File: 1501779981610.png (25KB, 645x267px) Image search: [Google]
1501779981610.png
25KB, 645x267px
>>61713073
what do you mean?

thats the correct way do generate pseudo-random numbers with a uniform distribution

i think other languages don't even allow you to choose the distribution
>>
>>61713082
Follow your heart
>>
File: nomnomnom.gif (29KB, 430x650px) Image search: [Google]
nomnomnom.gif
29KB, 430x650px
>when the library interface uses a different naming convention to you
>>
>>61713093
If you are choosing the distribution it's not random
>>
>>61713082
Haskell
>>
>>61713082
C20 will happen in around 2030, the language is a decade behind
>>
>>61713135
>autism
>>
File: 1439061543070.jpg (162KB, 1920x1080px) Image search: [Google]
1439061543070.jpg
162KB, 1920x1080px
>>61713121
>not abstracting that library as a backend to a common frontend interface.
>>
What 's a good quick guide o Perl?
>>
>>61713163
https://qntm.org/files/perl/perl.html
>>
>>61713163
https://www.memrise.com/course/914939/wingdings/
>>
>>61713163
https://learnxinyminutes.com/docs/perl/
>>
>>61713043
What is it then? I'm confused.
>>
>>61713137
It doesn't matter, since K&R is written in C89.
>>
Learning Scala.
>>
>>61713082
If 3 years, c20.
If 3 decades, c++20
>>
>>61713208
is scala scalable?
>>
>>61713226
Nope.
>>
>>61713197
In some languages, objects can be based on other objects (e.g. Javascript).
In most languages, objects are based on classes.
>>
>>61713226
It might scale up my income.
>>
>>61713263
you mean your boss's income but i get it
>>
>>61713252
>>61713197
Oh wait a minute I think I got it, so it's Class(object)

In this case Shoplist being a class would have the objects ('mango', 'banana', 'rice', 'orange') correct?
>>
>>61713197
not all object system are class based

https://en.wikipedia.org/wiki/Prototype-based_programming
https://en.wikipedia.org/wiki/Message_passing
https://en.wikipedia.org/wiki/Actor_model
https://en.wikipedia.org/wiki/Higher-order_programming

an object is a data and implementation abstraction technique where the data is hidden under a procedural interface and where the implementation of that procedural interface is hidden too (which is the main difference between object and abstract data types)
>>
>>61713289
Aw fuck it I'll get it eventually, I don't think I should worry too much about this, i'm still learning Python.
>>
>>61713286
Welcome to capitalism.
>>
>>61713316
Enjoy your stay.
>>
>>61713327
While it lasts.
>>
>>61713316
t. too stupid to make his own kickstarter

I'm LMAOing at your life right now
>>
File: tmp_29436-1488943969820235327988.jpg (497KB, 1280x912px) Image search: [Google]
tmp_29436-1488943969820235327988.jpg
497KB, 1280x912px
>>61713174
>>61713177
Very nice, thanks
>>
>>61713340
Capitalism is eternal.
>>
>too tired to work for rich people
>too dum to open my own shop
ree
>>
>>61713343
where's your kickstarter?
>>
>>61713288
Say you want to model a solar system in your program. You want to describe ho
class Planet
{
var mass;
var radius;
var gravity;
}

The "Planet" class is a blueprint that describes what a planet looks like, what it can do, what information it must contain etc.
When you actually create some planets:
var Mercury = new Planet();
var Venus = new Planet();
var Earth = new Planet();

All of those are objects. They are examples of planets.
>>
>>61713301
a class can be viewed as the description of an object

class Foo:
pass

foo = Foo() # foo is an object instanced from the class Foo
bar = Foo() # Bar is another object instanced from the class Foo

# bar and foo are not the same object but are from the same class
print( foo == bar ) # False
print( type(foo) == type(bar) ) # True
>>
>>61713379
Making my own game engine right now, and I'm just a freshman

Gonna make a full fledged game by the time I graduate

I'm not whining like you while i do it
>>
>>61713354
nfsw (rightmost girl). reported.
>>
>>61713407
nice, just don't make a game like the 1000 others out there, kid
>>
File: cs.jpg (1MB, 1904x4706px) Image search: [Google]
cs.jpg
1MB, 1904x4706px
>>61713407
>Making my own game engine right now, and I'm just a freshman
>>
>>61713418
Indeed. That's why I'm building my own engine.
>>
>>61713440
There's a difference between making a game and writing a game engine.
>>
Why isnt the D programing language picking up, /dpt/?

https://stackoverflow.com/questions/743319/why-isnt-the-d-programming-language-picking-up
>>
>>61713389
okay so an object is basically just branching off the same class? An object can have different characteristics but generally are from the same class, like how each planet has different characteristics but they are all still planets?

I'm new to this so please don't kill me.
>>
>>61713461
Yup. And by using a unique game engine that I will know throughout I will be able to make unique games, penetrating a new market niche.
>>
>>61713480
I feel like it is gaining some traction: https://github.com/Netflix/vectorflow.
>>
>>61713480
it's not very good
>>
>>61713496
This reply shows that you're a freshman.
>>
File: index.jpg (7KB, 350x144px) Image search: [Google]
index.jpg
7KB, 350x144px
>>61713496
>>
>>61713434
>implying you don't need to know math and mechanics when writing your own physics engine
>implying you don't have to know optics when writing your rendering engine
>implying you don't need to have intimate knowledge of how CPU and GPU work to achieve efficiency
>implying I'm not doing it in C11
>implying game engines are a joke

lol
>>
>>61713514
How so? Enlighten me with your wisdom.
>>
File: pyshit.png (16KB, 1398x183px) Image search: [Google]
pyshit.png
16KB, 1398x183px
lads should I learn C before python? I want to eventually learn c++ but also understand how programming works which is not possible with python.
>>
>>61713533
>>implying game engines are a joke
your probably is.
>>
>>61713480
Shittiest of the GC ever
>>
>>61713553
Indeed it is. That's why I'm working on it.
>>
>>61713407
What are you building it on top of? OpenGL?

>>61713434
>GitHub donates private repositories to women learning open source software
Wat. Why would you even need a private repository if you're making open source things?

On the other side, this image seems to really focus on Lisp, and almost nothing else.
>>
>>61713551
>I want to eventually learn c++ but also understand how programming works which is not possible with python.
Get this book, it's written for noobs and the author is pretty reasonable
http://www.cprogramming.com/c++book/?inl=cpptut
>>
>>61713551
don't learn Python at all
>>
>>61713573
>Indeed it is. That's why I'm working on it.
see you in 10 years
>>
>>61713548
If your goal is to write a game, focus on that. Use libraries for everything else. It saves time, effort and bugs.
>>
>>61713601
Wait what's wrong with Python? I was told to use Python when I asked what the easiest language to learn was.
>>
>>61713601
want to get into competitive programming.I can learn python within a month and get on with it. Not gonna happen with C/C++.
>>
>>61713637
Easy doesn't mean good.
Python rots your mind.
Learn a decent language.
>>
>>61713577
C11 for primary language, Python for generating models. OpenGL ES 2.0 as graphics API, GLFW to set up the context and keyboard/mouse input. libsoundio for audio. Nuklear for GUI. For now there are no textures (my first game won't use any), and sounds and music will be raw pcm to avoid needing any additional libraries. Physics for now are not integrated, but later on I will probably bind chipmunk for experience and then try to make my own 3D physics engine (after physics course in uni).
>>
>>61713480
based romanian answers that

https://www.quora.com/Which-language-has-the-brightest-future-in-replacement-of-C-between-D-Go-and-Rust-And-Why
>>
>>61713663
>Python rots your mind.
brainlet detected
>>
>>61713663
okay, I should learn C++ then? Seems like the go-to language.
>>
>>61713577
>On the other side, this image seems to really focus on Lisp, and almost nothing else.
because when cs education reached its peak, lisp was the programming language of choice used by MIT, Berkeley, Caltech, CMU, ...
>>
>>61713663
Maybe I know several languages and Python is just a tool in my tool belt.

Learn more than c++ pajeet
>>
>>61713678
It's awful but most languages are awful
>>
>>61713690
>because when cs education reached its peak, lisp was the programming language of choice used by MIT, Berkeley, Caltech, CMU, ...
Now Python is the norm...
>>
File: vlcsnap-error285.png (2MB, 1920x808px) Image search: [Google]
vlcsnap-error285.png
2MB, 1920x808px
>>61713121
this >>61713152
I rewrote the winapi headers even though most of the time you check msdn anyway
>>
>>61713678
>>61713710
basically i'm saying yes
you could also try C#

just don't learn Python or PHP or Javascript
>>
>>61713678
seriously learn C++ in your free time but dont think its better/worse than anything else.

it has its place just like python does.

I just had to write a script last night that recursively traversed by web domain searching for incorrect URLS and rewrote them with the correct one.

I used python.

Sure, I could have done it in c++ and spent 2-3x as long writing and testing the program, but why?

its like working on machines, sure, you can use channel locks to turn a nut, but you really should be using a wrench.

Every language has its advantages/disadvantages dont listen to the sour autists on here, learn every language that interests you and then you can use the right one for the job when you need to rather than limiting yourself to fixing everything with a single tool
>>
>>61713487
In my class definition I said that a Planet must have a mass, a radius and gravity.
class Planet
{
var mass;
var radius;
var gravity;
}

Any time I have a thing which is a planet, I should be confident that I can get each of those things from it.
earth.mass // 6 × 10^24 kg
venus.mass // 5 x 10^24 kg


In a dynamic language like Python, you can easily add additional variables or functions to an object. In a static language like Java, you can only do to an object what is specified in its class definition. I suggest looking into Java if you're still struggling with the idea of OOP. It's very heavy on keywords and syntax but I think that helps to give you the right idea.
>>
>>61713728
>just dont learn anything that has any place in the WWW or usefulness in a Linux environment
winfag detected
>>
>>61713764
Python, PHP and Javascript are all trash and brain-rotting languages.

Why don't you tell him to learn Bash or C?
>>
>>61713628
There is no free framework I can rely on that I know of (SDL/SFML/Allegro). All work for 2D, not 3D (which I plan on moving to when I'm confident with 2D) and won't be sufficient in control and performance when I want to expand. I use libraries when I can justify them, so not to burden myself with a big dependency for a couple of functions.

With the big engines (free ones being Ogre3D for rendering and Bullet3D for physics), the learning curve is so high it basically vendor-locks you and I doubt they're a good approach when you're learning on your own.

I think my approach of making a small engine for a small game and expanding it over time is a rational approach. I can't make a block-buster making on my own, but I can expand slowly.
>>
>>61713779
>>61713750
im telling him to learn all of the above if you read my posts.

you the one saying "hur dur i dont like these languages"
>>
>>61712259
>younger than I am
It's not fair.
>>
>>61713796
What? Why does that make you better?
They're brain cancer, it's better not to learn them.

Other languages are fine, just not those 3.
>>
>>61713815
>its better not to learn things
ok, hitler
>>
>>61713728
kek
>>
>>61713806
You don't have rich parents that see you as an opportunity for laundering money
>>
>>61713815
> JS is cancer
I don't know it but for now wasm is cancer too. emscripten compiled for 5 hours taking 4GB of RAM and has literally 0 tutorials on how to port libraries/link to WebGL and all that.
>>
>>61713824
It's sort of like that
Hitler thought that certain things were bad, and he decided to get rid of them
Understand?
>>
File: 16634.jpg (24KB, 318x470px) Image search: [Google]
16634.jpg
24KB, 318x470px
>>61713782
It's great to dabble into your own engine as a freshman. Godspeed anon

>the learning curve is so high it basically vendor-locks you
It's sorta true, ye. But it def won't hurt to get familiar with some industry established tools tho. Good record in your cv + some understanding how "big boys" do it
>>
>>61713840
yup.
>>
>>61712132
>You just have to be dishonest, not care about morals and be willing to cheat.
You are the reason why no one takes legitimate criticism from your side of this issue seriously.

Fuck off.

>>61713412
>>>/global/rules/7

>>61713678
>okay, I should learn C++ then?
C++ is a fine choice; there are certainly worse options, but there are also better options depending on what you're expecting and what you really want to do with programming.
>>
>>61713834
>emscripten compiled for 5 hours taking
why
http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html

>has literally 0 tutorials on how to port libraries/link to WebGL and all that.
http://kripken.github.io/emscripten-site/docs/porting/multimedia_and_graphics/OpenGL-support.html
>>
>>61713860
I just want to learn how to program in general, i'm fine with learning different languages but this is my first one. I don't know the advantages/disadvantages to every language and I don't know what i'll do after I learn C++, or what it will be for.
>>
>>61713886
Everything looks easy after learning C++. Go for it anon.
>>
>>61713678
>>61713860
>C++ is a fine choice; there are certainly worse options, but there are also better options depending on what you're expecting and what you really want to do with programming.
this. Dont sell yourself short. Learn it along with whatever else interest you

>>61713886
>I just want to learn how to program in general, i'm fine with learning different languages but this is my first one
C++ will be most applicable to extending your knowledge to a wide area of programming. its syntax is similar to other C's (obviously), java, and others.

It has the disadvantage that if it is your first language the compiler will be unforgiving and give you cryptic error messages. It also has the disadvantage that if you are not actually reading a book on it while you use it you can very quickly develop horrible programming habbits (memory leaks from not releasing memory for example)

if you learn in interpreted language like python it has the advantage that syntax is easy to understand and you can develop programs quicker and easier and there is large community support for it. It also handles most of the heavy lifting for you, like memory. The interpreter is also easy to work than a c compiler.

It has the disadvantage that its syntax and form is extensible only to a few small progamming languages, BUT the basic idea and knowledge of programming and how it works can be taken anywhere.
>>
if you use a low(ish) level graphics library like opengl or sdl do you need another library to create the window and shit or is that included in those?
>>
File: database-parts.jpg (24KB, 512x512px) Image search: [Google]
database-parts.jpg
24KB, 512x512px
I'm writing a small messenger.

What database solution should I use for the server (for storing the global state of all the accounts and chats) and for the clients (for storing the local info of one account)?

Doesn't have to be one solution for both cases. I would prefer both to be pretty low friction, since I don't really want to spend days in database hell during my prototyping phase.
>>
>>61713952
sdl creates windows, handles input and can even play sounds, yes
>>
>>61713952
https://www.khronos.org/opengl/wiki/Related_toolkits_and_APIs#Context.2FWindow_Toolkits
>>
File: 1501704260157.jpg (14KB, 480x360px) Image search: [Google]
1501704260157.jpg
14KB, 480x360px
Why is everyone shitting on python?

I was thinking of learning a first program language and I am really interested in python because I hear its the go to language for neural nets and AI and that's my main interest.
>>
Is there any point in learning C as the first language in the current year?
>>
>>61713662
>Not gonna happen with C
C isn't hard and C is quick to learn.
>>
>>61713995
Because it's garbage and lowers your intelligence
There are plenty of languages that AREN'T Python
>>
>>61713995
Python is great. Use it until you feel like you want more. Then move on to C++ or something.
>>
>>61713995
It's shit.

>>61714004
Yes. Just get a C++ book
>>
I feel like "neural networks" and "AI" are literally memes to get vc moneys. But maybe that's because I remember reading old af Minsky's article btfoin neural networks a while ago
>>
>>61714004
Absolutely not, unless you specifically want to target the small set of applications the language is used for.
>>
>>61713995
Python is a nice scripting language.
If you want to build real applications, go with Java, C# or C++.
>>
>>61713779
>Why don't you tell him to learn Bash
It makes brain rot as well.
>>
>>61713992
>>61713979
thanks
>>
>>61713963
just use a SQL branch. SQL can be a little bit slow for queries on large databases its important you have a RAID array configured.

If RAID isnt an option, and fast queries on large databases are required use Redis.

Sql pros: easy to configure, persistent
SQL cons: can be slow

Redis pros: very fast, resides in memory not disk
Redis cons: only memory persistent (i.e. it loses its databases after a reboot unless if you take precautions)

>>61713995
its just one pajeet in here shitting on it.

imho, one of the first languages people learn should be python and then they should grow from there.
>>
>>61714037
that's probably true desu
>>
>>61714004
Absolutely
It's great
>>
>>61714054
If bash makes makes brain rot, what the hell does perl does
>>
>>61714098
Its terrific
Believe me
>>
>>61714031
>>61714098
uhh..I'm confused.
>>
>>61714118
Perl is better than bash for most of the uses of bash scripts.
>>
>>61714044
I shudder any time I feel like I'm going to be using SQL in a project. But alas, I think I have no choice.
Thanks.
>>
>>61714131
C is a small language, just do it. Even if you never use it, it will be a valuable learning experience.
>>
>>61714004
Learning C well is probably the best primer for learning any other language
>>
>>61714138
s/Perl/Python
>>
>>61714131
Are you going to believe the stance with a caveat that opens an alternative approach given specific situations, or believe the stance that is absolute without any context?
>>
>>61714131
go ahead and learn it but by no means should you limit yourself to it
>>
File: 1479436321428.jpg (147KB, 1280x853px) Image search: [Google]
1479436321428.jpg
147KB, 1280x853px
>>61711767
This guys disagrees with you.
http://doc.cat-v.org/bell_labs/why_pascal/why_pascal_is_not_my_favorite_language.pdf
>>
>>61714131
Make up your own fucking mind you stupid retard. Grow up and learn to make choices that will impact your life.

For now you're probably better of learning Python or Assembly, whichever type of learning you prefer. Both will be beneficial.
>>
>>61714178
Kill him!
>>
So C over python then? should i use k&r? also do sites like topcoder/spoj still support c? I want to get into competitive programming asap.
>>
>>61714178
>why_pascal_is_not_my_favorite_language.pdf
dumb nu-male with hackernews tier clickbait filenames.
>>
>>61714191
then stop fucking asking random assholes online what you should learn, pick a language and fucking learn it

seriously, it doesnt matter what you choose, just pick one, learn it, pick another, learn it, repeat
>>
>>61714191
>comp programming
def c++
or java

https://cses.fi/book.pdf
>>
>>61714193
This was published in 1981.
>>
WIN_API newbie here

how do i handle user pressing 2 keys at once? heres how i currently handle them

case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
case WM_KEYDOWN:
case WM_KEYUP:
{
uint32 vk_code = w_param;

//The (n - 1)th state of the keyboard key
bool was_down = ((l_param & (1 << 30)) != 0);

//The (n)th state of the keyboard key
bool is_down = ((l_param & (1 << 31)) == 0);


if (is_down)
{
/*
Single key
*/
if (vk_code == 'W')
{
OutputDebugStringA("W\n");
}
//bla bla bla
}
}
>>
>>61714191
I'd take C over C++ anytime.
>>
>>61713487
objects are structs with functions
>>
>>61714228
You should only be gathering the input state in the event callback, make an input struct or something and get the state for each key there. Then, after event checking is done, handle it on the application side.
>>
>>61714178
literally WHO
>>
>>61714193
>hackernews tier clickbait filenames
VGIgc2hweCBsYmhlZnJ5cywgbmZmdWJ5ci4K.pdf
How about that for a filename?
>>
File: JF.gif (1MB, 290x221px) Image search: [Google]
JF.gif
1MB, 290x221px
>>61714279

does msdn have reference to this? i dont know what to google
>>
>>61714293
The ‘K’ in “K&R.”
>>
>>61714310
>taking the bait this hard
>>
>>61714310
>Creator of C thinks his language is better
Holy shit, I'm flabbergasted. I wonder what is the opinion of Nicholas Wirth?
>>
>>61714299
literally a bool array you mong
>>
>>61714156
Python is clunky to work with text.
>>
>>61714339
>>Creator of C thinks his language is better
More like “Co-creator of C proves that his language is better.”
>>
File: c++.png (40KB, 1620x774px) Image search: [Google]
c++.png
40KB, 1620x774px
>>61714339
The creator of C++ things his language is even better
>>
>>61714352

how do i catch 2 keys i only receive 1 at a time from vk_code
>>
>>61714357
I'll nit-pick back.

Just because one is a creator of something, doesn't mean he created all of it. So one can be both creator and co-creator. For example, Carmack is a creator and co-creator of the id engine.
>>
>>61714388
pressed
 = true;

if pressed[first_key] and pressed[second_key] then
...

are you literally stupid or what
>>
>>61714299
All you need to know is that you don't do any actual behaviour in there, you just get the state for the keys on that cycle with something like a bool, and then decide what to do with them later.
>>
>>61714371
kek
>>
>>61714407
>mfw my array index got converted
meant to be pressed[key code]
>>
File: 1498855111293.png (207KB, 403x433px) Image search: [Google]
1498855111293.png
207KB, 403x433px
>>61714407
>>
>>61714430
Add spaces around code, problem fixed.
>>
File: 1479883677181.jpg (143KB, 833x696px) Image search: [Google]
1479883677181.jpg
143KB, 833x696px
>>61714407
>>
>>61714444
yeah figured, nice quads btw
>>
>>61714228
if you care about long-term key state as opposed to handling instantaneous presses, you should see if there's a way to get the state of the whole keyboard and check specific parts of it. If not, you may want to write your own (should be simple)

that way, rather than storing little vars, you can just do if keys['w'] && keys['x'] or something like that.
>>
>>61714471
Four number fours. Nice.
>>
>>61712259
he's good looking as well
fuck
>>
>>61714645
kek, he looks like a fag
>>
>>61711443
>Sacrificing the convenience of 99.999% of programmers for the 0.001% of machines that practically nobody uses.
But that's exactly the thing though, Anon; nothing is lost. You are aware, of course, that what the standard specifies as "undefined behavior" doesn't have to mean "crash" or "bad things happen", but also that implementations are free to define well-defined behavior in those cases. On twos-complement machines, signed-integer arithmetic is indeed perfectly free to overflow in well-defined twos-complement ways, so you can write your algorithms that depend on that merely by sacrificing compatibility with the machines that you didn't care about to begin with, while the standard language can remain possible to implement on them as well.

>Like what?
Such things as 8-bit PIC micros and x86 in real mode lack linear memory models, and people still write code for those. Here too, though, you can obviously rely on linear memory models simply by sacrificing compatibility with machines that don't have that, losing exactly nothing.
>Also, what machines don't use 2's complement?
No current ones, probably, but C has run (and probably is still running) on tons of historical machines that didn't.

>Also, it's 2017. #include <threads.h> is not implemented in the most widely deployed libc, the mingw wrapper.
That is a disgrace for glibc, yes, I don't dispute that.
>>
Let's saying I'm working in a language that supports direct pointers, and I have a couple parts of a struct I want to be updated individually by several different methods running in parallel.
They're all modifying unique parts of the struct so them fighting over individual values shouldnt be an issue, right?
What would be a good way to wait for them all to finish before continuing onto the next struct?

Shitty pseudocode
struct test {
int var1;
int var2;
int var3;
}

addToVar(int* var) {
var += 1;
}

main() {
test teststruct = test{};
newThread(addToVar(&var1);
newThread(addToVar(&var2);
newThread(addToVar(&var3);
print(teststruct);
}
>>
>>61714735
atomic counter or conditional variable?
>>
>>61712793
Explain?
>>
>>61712082
Why do people call anonymous functions closures? Fuck!
>>
>>61714783
in what language is an anonymous function not a closure?
>>
>>61714813
lisp
>>
>>61714726
>>Also, what machines don't use 2's complement?
>No current ones, probably, but C has run (and probably is still running) on tons of historical machines that didn't.
Also worth noting, however, is that GCC uses the undefined behavior of signed overflow to implement both its -fstrict-overflow and -ftrapv options, which are Nice Things. In languages like Java or (((Rust))) which don't allow those kinds of freedoms, you literally cannot have such nice things.
>>
How do I get VC debugger to work with Qt Creator on Windows? It's not detected in debuggers/toolchains so I was told to install MS SDK but that didn't solve the issue.
>>
why does windows reverse the bit when loading memory from register??
or something like that, i know for one that windows use GBR instead of RGB exactly for this reason
>>
>>61714755
Atomic counter might be a good choice?
Basically the problem I'm running into is it's not just occurring sequentially. The ideal is to have 1000 test struct struct's, then like 15 "main" methods where all the threads are spawned to send them the struct off in parallel to be modified, then once everything is done send it off elsewhere (the function no longer cares at that point)

Would using atomic counter work for that, or is that more of a "you have one global thread with this and use it to sync many other threads" sort of thing?
>>
>>61714899
Yeah basically what I meant you could do something like this:
atomic<int> counter = 0;

void thread_func()
{
calculation
counter++;
}

void thread_main()
{
while (counter < desired_value) {
yield
}

threads finished work, continue whatever
}
>>
>>61712259
your*
>>
File: zZvD4a8.jpg (41KB, 492x381px) Image search: [Google]
zZvD4a8.jpg
41KB, 492x381px
>>61714939
Yup, just tried something similar to that and it worked great.
Thanks anon. Please feel free to save this image, you have my full permission.
>>
I want to create a repo on GitHub for my website. It only contains static content like HTML, CSS and images.
Is the GPLv3 suitable for that?
>>
>>61714996
Maybe CC is better.
>>
>>61714996
>website
>HTML
>CSS
>>>/wdg/
>>
File: hitler.png (359KB, 457x675px) Image search: [Google]
hitler.png
359KB, 457x675px
>full-time C++ dev since 1 year back
>still subscribed to lots of recruitment firms and online job ad services
>like 60% of jobs (that aren't web) are C#

... should one learn C# and the Microsoft stack just for the sake of it?
>>
>>61715075
It's never a bad thing to learn new languages.
>>
>>61714813
In a language with no support for closures. Usually ones that don't have garbage collection or other ways to prevent automatic variables from popping off the stack.
>>
>>61715075
most C# coders I know are quite happy with it
>>
>>61715085
Microsoft is a very deep hole though (like ur mother's :-D:DD)

Seems most Microsoft tech stack developers have done little else. .NET this, OLE that, Windows Server, etc. etc.
>>
>>61715075
>full-time C++ dev since 1 year back
What do you do?
>>
>>61714996
No, the gplv3 has the SAAS loophole. Use agpl. It was designed for websites.
>>
>>61715027
Do you know which Creative Commons license comes clostest to the GPLv3?
>>
>>61715119
I'll do that. Thanks anon.
I thought that the GPL family could only be applied to software.
>>
>>61715119
>SaaS
More like SaSS (Software as a Service Subtitute) amirite?
https://www.gnu.org/philosophy/words-to-avoid.en.html#SaaS
>>
>>61715117
software for data analysis & presentation of a certain type of measuring system
>>
>>61715197
Disagree with that one too though. I can agree on calling it pure evil though.
>>
>>61715234
What are your qualifications?
>>
>>61715234
What's your linkedin profile and github repo?
>>
>>61715234
I'm looking for a JSON parser in Shortcode. Could you help me out?
>>
>>61715293
>Octave
poorfag uni lmaos
>>
Why's IDA Pro gotta cost so much
>>
>>61713995
>Why is everyone shitting on python?
It's OK provided you don't write classes or modules.
>>
>>61715381
Because it is very niched and they need to get 100% of their income from corporations since everyone else just pirates it


Same reason Photoshop/Creative Suite is super expensive
>>
>>61715316
>Free Software is for poorfags and it sucks and I prefer proprietary shit
>>
>>61715408
And MATLAB.
>>
>>61715293
It's impossible to work while grinding academia, senpai?
>>
>>61715075
another fulltime c++ dev reporting in
just yesterday got tasked fixing shit in C# project of ours

it looks like ms stack is quite useful employment wise desu
>>
new?
>>
>>61715586
I prefer malloc
>>
>>61715589
m'alloc
>>
I'm really sick and tired of people treating C and C++ as one language.
Just fucking stop, they're two different languages, that have been different ever since C++ was created.
Sure, C++ may be “compatible” with C code, and your C++ compiler may be able to compile C code if it wasn't too complicated, but that doesn't mean they're the same.
There's no such language as “C/C++”, yet I find this shit everywhere online. I search for something about C online, and most results have C++ in the title, and then I have to add -"C++" to my search query.
Don't people understand that?
>>
C++, or as I've recently come to call it, C with objects
>>
>>61715676
Please stop.
>>
File: hesspadda.png (16KB, 420x420px) Image search: [Google]
hesspadda.png
16KB, 420x420px
>>61715660
>C/C++

>mfw see this on applicants' resumes
>>
>>61715660
stay mad grandpa
>>
>>61715505
>it looks like ms stack is quite useful employment wise desu
Please share your experiences.
>>
>>61715632
kek
>>
>>61716012
>>61716012
>>61716012
>>
>>61715478
I had to write that post here to realize that in my country, when doing PhD studies... it's fucking too much. I'll stick to my lowest scholarship which is about 400$ per month, finish studies and then think what's next. There's too much work related to research to do some side programming for $$$.
>>
>>61714044
>SQL can be a little bit slow for queries on large databases
Thanks for not providing any information to actually quantify that. You remind me of this http://www.mongodb-is-web-scale.com/.

Work out what questions you want to ask of your data and choose an appropriate data storage format that allows for efficient querying. RDBMs are not 'a little bit slow for queries on large databases'.

>If RAID isnt an option, and fast queries on large databases are required use Redis
Your disk does not make a tiny bit of difference if your working data set plus indices can fit in memory.

> Redis pros: very fast, resides in memory not disk
Redis does provide persistence in the form of regular snapshots, but it might not provide the durability guarantees of a regular RDBMS.
Thread posts: 327
Thread images: 30


[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.