/dpt/ - Daily Programming Thread

Froggu edition

What are you workin on, Cred Forums?

Previous thread:

Other urls found in this thread:

youtube.com/watch?v=j84pZM840eI#t=20m45s
qr.ae/drvVS
qr.ae/drvm8
yager.io/programming/go.html
nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
java.dzone.com/news/i-don’t-much-get-go
dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/
lessonsoffailure.com/software/google-go-not-getting-us-anywhere/
lessonsoffailure.com/software/googles-go-not-getting-us-anywhere-part-2/
lessonsoffailure.com/software/google-go-good-for-nothing/
gist.github.com/kachayev/21e7fe149bc5ae0bd878
blog.edx.org/the-3-most-lucrative-programming-skills-you-can-learn-online-for-free
en.wikipedia.org/wiki/Pleonasm
en.wikipedia.org/wiki/Rotation_matrix
en.wikipedia.org/wiki/WebSocket
akaribbs.mooo.com/
isocpp.org/faq/
gotw.ca/gotw/
herbsutter.com/gotw/
twitter.com/NSFWRedditVideo

how do I into portable code with C?

r8 my game Cred Forums, it has a boss now!

Fuck off OP, you posted this thread far too early
Is every fucking frogposter this retarded?
Why did I even fucking ask

I do some ray tracing in C++ but I struggle with refractions...

Writing a forum in pure procedural PHP

> early
> previous thread has 301 posts already
fucking kill you're self, fag

Bump limit is at 310 you absolute fucking retard, now abandon this thread

why don't you go bump the previous thread by yourself then since you're a fucking bitch?

looks cute user!

>pure
>PHP

>pure
>ur waifu

Why would you use PHP for anything other than maintaining legacy software?

I like it, but it isn't JUICY ENOUGH

u'r*

warning: array subscript has type ‘char’ [-Wchar-subscripts]
...
#define escapecode_lut(c) escape_lut[(unsigned char) (c)]


Is it wrong to write C macros for the express purpose of getting rid of compiler warnings?

because the alternative are ruby,python, and node
you're*

If the compiler doesn't warn you when you compile your program, then there's nothing wrong with your program.

It's 1:22am and I'm starving ): Should I order delivery?

reminder that you're a pajeet or normie tier codemonkey if you use a debugger to step through code

I use printf debugging, does that count?

mental+printf debugging is how you should do it

I prove my code before I implement it, does that count?

yes

writing the code properly in the first place > using a debugger to try to band-aid crappy code

Any php fags point my in a good direction on doing PHP on linux?

I can but you must persuade me

Currently Trying to figure out how to manage game states in spples. At the moment I have:
class GameStateManager {
// ...
public:
void Run(); // Does main loop, manages frame rate and tick rate. Calls Update and Render of the current GameState
void SetGameState( GameState *nextState );
GameStateManager& GetInstance() { return instance; }

private:
static GameStateManager instance;
GameStateManager() : currentState( nullptr ) {};
GameState *currentState;
}


class SomeGameState : public GameState
{
// ...
public:
void Render( RenderTarget& rt ) override;
void Update() override;
SomeGameState& GetInstance() { return instance; }

private:
static SomeGameState instance;
}


And I feel extremely Indian becuase it looks like something an """OOP expert""" would do in Java (everything's a fucking singleton!). This is poo. Then again, how else to do it? Having to instantiate GameStateManager or GameState derivates locally seems impractical, since GameStates must be able to transition to other GameStates:
void MyGameState::Update()
{
// ...
if (health

Just use Node. It's faster than PHP, and Javascript, while rather shitty, is less shitty than PHP.

Yeah, I've been going thru benchmarks, I was put in my place I guess. Still I'll try to do it with least libraries. Thanks bby x

>while rather shitty, is less shitty than PHP.

I'm trying to come up with an analogy to it being infinitely shitty, but less shitty than an infinitely shitty alternative.

>Health a part of SomeGameState
Make it a separate object, in fact, make all of the state encapsulated by the GameState a separate object.

You could call it a component.

please be baiting

PHP shittiness is like ω^ω
JS shittiness is like ω^k for some arbitrary finite, but sufficiently large k (for instance, k = Graham's number might be a rough approximation)

youtube.com/watch?v=j84pZM840eI#t=20m45s

What language should I learn if I need to make a little money fast.

JS?

good luck with that

How do I initialize an extern multidimensional vector declaration?
extern std::vector< std::vector > mapData(std::vector);


I'm trying whit this but I get error: ‘std::vector mapData’ redeclared as different kind of symbol
std::vector< std::vector > mapData(MAP_X+1, std::vector(MAP_Y+1));

Java

>Health a part of SomeGameState
Just a flawed example. I wanted to show that the current game state can be changed from really anywhere.

>make all of the state encapsulated by the GameState a separate object
>You could call it a component
Indeed I'm working on a component-based game engine, becuase any other architecture is just doomed to fail at some level of complexity. However, this won't solve my "problem" of managing different game states in a potentially subpar way. For example, I'd still need different states, one for rendering and updating the main menu, one for the "actual game", one when the game is over etc. or nah?

>What language should I learn if I need to make a little money fast.
Well, there is always some company looking for Java devs...

without seeing both the file where its defined and the file where its declared i cant say, however i believe what you're doing is declaring it a 2nd time.

normally you define a variable in someFile.cpp
int foo = 42;

and then in anotherFile.cpp
extern int foo;

void bar(){
std::cout

>refactor
you shouldn't have more than a few game states like pause/playing/intro(when booting the game)

I think that I found the solution, it's supposed to be declared like this:
extern std::vector< std::vector > mapData;

youre right. i should have paid closer attention.

when you declare a symbol as extern, you should NOT be passing it constructor arguments. it has already been constructed in whatever file it was defined.

t. someone who never worked on a project bigger than his micropenis

Responding to bait is a shitpost, too.

So I heard that the reason for the dominance of C and C++ is due to the amount of boomers in the industry.

And that employers actually want young employees to know new languages, like Ruby and Ruby on Rails.

But I have yet to find a single "Junior Ruby developer" position in my field.

t. pajeet who doesn't know loose coupling and encapsulation

The reason is that C/C++ is the default language when it comes to a lot of lower level things, e.g. all Engineers use it or at least learn it.
If it were for boomers we would all program in COBOL and Pascal.

C/C++ is not "dominant" in jobs.

Java has the most by a large margin. C# is the next highest, well above C/C++/Python which are about the same.

Javascript is essentially ubiquitous, as is SQL.

Ruby really doesn't have many jobs in comparison to any of these.

That only works 100% in an ideal world.
In real world someone else makes mistakes(or even just changes) in his code that dont affect him and you will cry on Cred Forums why your code dosent work while analyzing your code for weeks until the other guy fixes the problem.

ok rajeesh

Well maybe someday you will get a job

let's face it, you're a codemonkey

At least he has a job

Holy shit, fuck off retards.

Why do either of you think this conversation is going to go anywhere?

a job as a codemonkey

since when is this thread Cred Forums

Himegoto

is still better than a wannabe something, cant-be-anything-so-im-shitposting-in-wdg

so a good programmer should learn

>C
>HTML/CSS
>PHP
>SQL

right?

>HTML/CSS
>PHP
No.
>SQL
Only if you're working with databases.

even then that'd be too early
new threads should be made at bump limit AND page 10
perfect score if you do manage to kill the old thread when making the new one

Not categorically right, no.

There are good programmers that don't know any of those languages.

There are horrible programmers that can use all of those.

You should figure out what you want to program, and select languages that suit those needs and compliment each other.

>>HTML/CSS
>>PHP
>No

HTML/CSS should be included in every "junior developer starting pack", together with Javascript.
You do need some webbased stuff.

Webdev shit has absolutely nothing to do with being a good programmer.

a lot with being an employable programmer

No, it only has to do with being an employable webdev code monkey.

not using a debugger for everything actually helps with improving your ability to read and understand code
especially when you start dealing with concurrency this ability is invaluable, because a debugger won't help you

change the fucking font bitch

>not following the trends of using html/css/js for user interface layouts
>not knowing that tons of applications already use markup languages
>not knowing how to interop with webservices.
oh user please

I'm gainfully employed in a software development role and I've never touched JS, HTML, or CSS.

That being said, knowing these things absolutely does open up a massive swath of job opportunities, but they really aren't necessary.

"webservices" is vague. What exactly are you trying to say with that?

If you're referring to APIs, then you certainly don't need any of those to interface with them.

what are the essential c++ libraries to learn?
does someone have a link?

the standard ones

Rust or Nim-lang?

even if the program itsef doesn' work?

Rust is stable, nim is still in beta

>wdg
lmao web shitter

What is /dpt/'s opinions of Go and Dart ?

Please no memes, only serious responses.

No "Dart is dead LOL" because you read it someplace

Reply only if you look at the language

brutty gute

I've never even heard of Dart.

/dpt/-chan, daisuki ( *’ω’* )

>go

Go Go: 33.553163084 seconds time elapsed
Go gccgo: 17.438276362 seconds time elapsed
Dart: 2.585097637 seconds time elapsed
Haskell GHC: 0.454930841 seconds time elapsed
Java OpenJDK: 1.189619693 seconds time elapsed


qr.ae/drvVS
qr.ae/drvm8
yager.io/programming/go.html
nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
java.dzone.com/news/i-don’t-much-get-go
dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/
lessonsoffailure.com/software/google-go-not-getting-us-anywhere/
lessonsoffailure.com/software/googles-go-not-getting-us-anywhere-part-2/
lessonsoffailure.com/software/google-go-good-for-nothing/
gist.github.com/kachayev/21e7fe149bc5ae0bd878

Neither.

Boost and Qt.

Yes.

>C# is the next highest, well above C/C++/Python which are about the same.
blog.edx.org/the-3-most-lucrative-programming-skills-you-can-learn-online-for-free

Use a factory.

>does that count?
No, Dijkstra died years ago.

Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?

>because the alternative are ruby,python, and node
ClojureScript

>procedural PHP
en.wikipedia.org/wiki/Pleonasm

>Not a raytracer for DOS, in 16 VGA colors

Please, don't bully.

Not enough projectiles for a danmaku.

By writing strictly conforming programs but good luck with that.

Please use an anime image next time.

HELP what is wrong with my approach to rotating polygons
It's not working atm

Retard here,stuck on two things, any examples/help would be appreciated. I'm trying to use a class simply as an entry point, then a second class performing the task. My problem is, when I'm running the first class, nothing happens. Running the second class by itself works fine.
First class:

public class ModuloEntryPoint {

public static void main(String[] args) {
new ModuloPrint();

}

}


Second class:
public class ModuloPrint {

public static void main(String[] args) {

for (int i=1;i

Thanks for the informative reply.

do you expect anyone to decypher this image

en.wikipedia.org/wiki/Rotation_matrix

In your second class use a constructor rather than two mains. That's when it's instantiated.

As in, call a method or use that for loop in the constructor. Right now the class you're running is the entry poiint, and obviously simply instantiating the second class from the first does nothing.

You could put the loop into a method and call new ModuloPrint().method();

Obviously what I know of isn't the indicator of a language's popularity, but I've been frequenting /dpt/ for over 3 years now.
Hopefully that gives you a context for how little it's discussed here, if it's ever been discussed at all.

You should be able to work with databases though, just like you should know about data structures

Thanks

that's completely wrong, you only need to be able to work with databases if you're gonna work with databases

>fucking ads

android poorfags don't pay for games

And sooner or later you'll end up working with databases, data structures or some other form or Model.

Saying you're never going to work with databases is like saying you're never going to work with trees, and do everything through arrays

idiot

you need to know much more than that if you want to develop on the full stack lol

rate-limiting mysql users and tuning the nginx rate limiter; where is the networking thread???

install apache and php and mysql

baka

c++ method returns shared pointer.
How would you wrap it to be used in C?

...

php isn't so bad you can write html directly into it!

Everything but the explosions look good. Change that shit ASAP.

Make a Totino's Party Pizza™ instead family (^:

i've been playing with go for the last week. i like it despite having run into frustration -- there's a lot of language stuff you expect that isn't there. a lot of this is to do with the lack of generics, i think

but i haven't done anything substantial with it. ask me in a month

you might try /sci/. if i have time later i'll say something

I need one of you wizzes to code up a way to save screen brightness levels in linux from a previous boot. Or carefully explain to me how the fuck I can grab the only line from a file and stick it in another file, because all of my bash scripts have done absolutely nothing in that regard

cat file1 > file2

if you want just the first line use
head -n1 file1 > file2

>vague
true, i was mostly referring to SOAP.
ive found that i needed to read up on it when i needed to look into automatic port remapping on NATs, more specifically IGD and SSDP. i havent found any useful APIs that abstract away the underlying message structures, so for those uses its good to have the knowledge

What are some good emulators/simulators for learning MIPS or ARM assembly?
I'm mainly looking to learn to understand things like the workings of machine cycles, instructions vis a vis clock speed, registers, jumps, I/O controllers, device drivers etc.

Does anyone here code on their smartphone? I was wondering if coding on the go is a thing

how does webdev shit exactly work?

you run a java* backend which does what exactly? isnt everything on the frontend javascript anyway? how does that play together?

*I like it. deal with it.

PHP:
I have an array of various objects and I want to break it apart into several arrays of unique objects.

Is there a better way other than to use array_filter and check using instanceof?

i'm also interested in this

contrary to x86, most of the stuffs (tools, documentation, ...) around arm is not free.

i would say QEMU is the best free emulator for arm.

en.wikipedia.org/wiki/WebSocket

I finally got cinnameg working you guys

cinnameg is literally the future of programming, give me 1 flaw in it

Why are there no good build systems suitable for multi-module C/C++ projects that enable easy cross-compilation?

>Currently only a Unix/Linux version is available. A Windows implementation will be made available later.

Also, I have one question.

Does it support higher-kinded types?

it's more of a last resort, when i don't have an ipad around; i use the ipad when i don't have my laptop

strcpy((char*)out, result.c_str());

using above line of code results in an error in Visual Studio stating strcpy might be unsafe and that i should consider using strcpy_s. but strcpy_s doesn't allow me to use the arguments ive given.

i know i can go into project settings to tell the compiler to ignore the warning, but i just want to know why i cant use strcpy_s.

How can I average two strings in C?

How would you compare productivity ona touch screen compared to a keyboard?
Also what editor/IDE do you use?

i think you can just use is_a

>you run a java* backend which does what exactly?
>isnt everything on the frontend javascript anyway?
are you trolling?? when you log in w/user credentials, where do you think that data goes? when you click on the "About Us" link, where do you think the "About Us" page loads from??

Why not strncpy?

which apps do you use? i sometimes use an ssh client for quick fixes but wouldn't dare do more

what do you mean by that?

Javascript

Like how you can average two signals. Well a discretized signal is just a sequence, and a string is just a sequence too.

i never use the touchscreen beyond launching the ssh client, i have a bluetooth keyboard for my phone and ipad -- and i use vim

Javascript shitter coming through, don't get my filth on you as I ask this peasant-tier question:

Express.js question:

I want to do nested iteration in the pug template engine (formerly known as jade).

I have an array of objects. Each object within that array contains an array of objects. I want to render a specific property from each nested array to the screen. I think my code is correct, and yet nothing is happening. It's not throwing an error, it just doesn't render anything in the div these properties will be inserted into.

- var i = 0
while i < outerArr.length
- var j = 0
while j < outerArr[i].length
.col-xs-12.text-center
span #{outerArr[i].innerArr[j].someProp}
- j++
- i++

...what?

isnt it just the same as strcpy but you pass the number of characters you want copied? VS calls that "unsafe" as well.

anyway that's not my problem, i want to know why i can't use strcpy_s and when using strcpy might be bad.

We don't actually know Javascript.

is your formatting fucked up? what's with the dashes?
as written it looks like that inner while loop will just go forever

lol what the heck is this language how do you even read that

I am so much used to C++ and dont wanna learn Java, but all these Pajeet jobs require iiiit ;___;

>which apps do you use? i sometimes use an ssh client for quick fixes but wouldn't dare do more
see lol, you are literally speaking my language lol

>I am so much used to C++
Doubtful

>C++

java might be a little complicated for you. you should probably dedicated at least a year or two to learn it.

>I am so much
Pajeet fuck off ok

We do know javascript, but that thing sure as hell ain't javascript
Also:
>using while loops where it's obviusly a place for a for loop
>pic related

Here's a weird thing:

I tried reformatting it to use a for loop instead of a while loop. It works to a certain extent. I could print outerArr[i] to the screen. However, if I attempt to access a property on the currently iterated object (e.g. outerArr[i].username), it throws an error: "cannot read property "username" of undefined". Which is nonsense, because it was defined just a second ago.

I dunno why this is such a pain in the ass to get right.

No, the formatting is fine, there is an issue with the way the nesting is copy-pasted in my post, but it's perfect in the editor. The dashes delineate markup from interpolated js.

The inner while loop will terminate.

A mix of javascript and a templating engine (pug/jade).

So Cred Forums is racist to Pajeets?

So it is literally Cred Forums (Hitler?)

while loops are recommended above for loops by the creators of this specific template engine. I typically never use while loops myself.

I don't know Javascript and I don't want to know Javascript. Why do I know this? I know Javascript.

We don't like employers shipping in foreign workers and using them to undercut American workers (because the foreign workers can't quit without facing deportation).

That's some weird templating engine you use.
Why not use the popular choices like angular or react?
I know they are more than templating engines but still..

does that happen often in america?

Depends on what you mean by "often".

About 65000 times a year.

and this is why, when I graduate in a year, I will look for jobs at small to medium sized lesser-known companies away from huge cities. I really don't want to work with / compete with pajeet.

I'm perfectly content with 60k a year.

well, is it an usual experience for a junior software developer? something he has to actively consider when bargaining for a wage, for example, that the employer could bring in pajeet anytime?

which programming language or library is known for having the largest amount of bloat, crap and unnecessary features in general?

sepples

racist

I guess you're just not good enough at programming huh

Any Lisp

STL

calm down, pajeet

>tfw you start to get Prolog

I'm not Pajeet.

Lambda calculus

how do i git gud at programming if i suck at math

Learn Javascript and become the king of the shitpile

>largest amount of bloat, crap and unnecessary features
C++ easily. Both in terms of language and libraries.
The new shit their committee adds every year is basically a running joke at this point. (and before them C++ was actually a relatively lightweight language)

git gud at math

lightweight may also be a synonym for "lacking many convenient features"

life was not all that fun before STL and C++11, you know

sauce

>git: 'gud' is not a git command. See 'git --help'.
Well i guess you can't then

Life still isn't fun for the C++ programmer.

akari-bbs rev. 13 is now live!
akaribbs.mooo.com/

Just a backend update, mostly to fix an issue where you could defeat the whitespace filter by putting spam between 2 pairs of left and right code tags.

>"lacking many convenient features"
Like a compile time over the two hour mark. :^)

just add an alias to your .gitconfig and you're golden.

life is not fun for people that are seriously into programming, anyways

i like ruby a lot, but it is pretty useless.
still learn? maybe there will be less competition for jobs.

lol at best you'll be a delusional codemonkey if you're too retarded to not suck at math

It doesn't show time zone adjusted dates like Cred Forums does.

>tfw too smart for bothering with Java

All the criticism of go is just people re-hashing the same shit over and over again (see pic)

>Does it support higher-kinded types?

That's actually what I was memeing about last night.

No, it does not support HKTs.

you are two smart too live

i suggest killing yourself

Now look at the criticism of the alternative to go, Java

>i want to know why i can't use strcpy_s
AFAIK there are 2 variants of that function. One that takes a statically allocated string (as in char str[1024];, and one with 3 parameters, where the second parameter is the length of the destination string. Since you don't appear to be using statically allocated string, maybe you used the wrong overload. Have you tried strcpy_s(out, out_length, result.c_str());? (Note that you'll need to know the size of 'out')

If you'tr one hundred percent sure that all you do is safe all the time, you could #define _CRT_SECURE_NO_WARNINGS to silence the warnings.

>when using strcpy might be bad
When you don't know the size of your destination string, and you blindly strcpy into it. That's bad because the source string might be longer than the memory block the destination string was allocated for.

Now lets look at C++, I think it's pretty clear that Go is best language between the three.

Isn't strcpy_s literally memcpy?

Or least popular

>needing source for Oregairu
wew

C++, Java, Rust

Java and C++ devs feel emasculated by go.

Nevermind, I fixed it

>Bourg, D.M. & Seemann, G. (2004) AI for Game Developers, O’Reilly
>Braitenberg V, Vehicles Experiments in Synthetic Psychology, 1986, MIT Press, USA
>Russell, S.J. & Norvig, P. (2003) Artificial Intelligence: A Modern Approach, 2/e
which one, /dpt/?

>2.1bn elements is too small of an array

People who think this is a legitimate argument can fuck off.

word go is for alphas only

It's not good for science bro

Artificial Intelligence: A Modern Approach 3e

artificial intelligence by patrick henry winston

Science shmience. Don't load all your data at once.

Java? How so?

why in particular?

Java doesn't have to be a language that fits every usecase.

The point about large files in memory (byte arrays) is valid tho.

>Java doesn't have to be a language that fits every usecase.
It certainly tries to, looking at its standard library.

patrick winston is a really smart mit professor and i think his book is nice

i believe patrick winston's book is a little shorter than the more popular AI a modern approach

either way, it doesnt matter too much which book you pick up

...

How come I can't do bank transfers of the weekend?

How can I access the international banking API to code my own solution for doing transactions on holidays and the weekends?

Java as a language is fine, but the standard library contains shitloads of bloat and redundancy.

How do i stop being an OOP cuck, /dpt/?
What design paradigm should i learn to replace OOP with?

and yet ironically it's missing a bunch of the features that would make it actually useful

>How do i stop being an OOP cuck, /dpt/?
learn assembly

Why Rust?

lol, I thought you would argue otherwise.
Can you please elaborate?
I think java standard library is very good, clean and really well documented

OOP is important, what you want is a language that is both object oriented and functional. I would suggest JavaScript or Go.

Are you serious?

javascript is not a programming language

nice meme

learn functional programming :^):^):^)

Yes, it is.

It's actually one of the best out there.

Go > D > Rust > JavaScript > C > C++ > C# > Java

Fuck off. Language choice is largely irrelevant. I'm talking about design paradigms, not language

Ebin

jajajaja

>C# > Java
>Bill Gates one platform botnet > 3 billion devices

Learn declarative programming

C++ > Java > C# > C > D > Rust > Go > JavaScript > Python > Haskell

lean programming

Don't have a list written down so here are some from top of my head:
>Three different UI platforms
>Most common collections have a second, outdated variant
>Two different enumeration classes
>Two date classes and neither of them is good
Also there's the fact that it tries to have a standard class for every single use case. I don't think that is bad by itself but some people hate it.

If you're not memeing then learn some C.

D > C++

>javascript so far down

You don't understand the language.

Yes and no.
If you want to find out more about why OOP is terrible in many situations and you want to explore alternatives, then there are better ways to do so.
If you want to completely throw every kind of paradigm overboard and want to learn how programs work at the lowest level, then yes (if you don't mind spending one afternoon or another debugging a singgle function occasionally). At times I find assembly quite fun, since I learned a lot just about how things really work, and it definitely made me value performance optimization a lot.

>Java > D

You can just fuck off as well.

Javascript is a mess and the only reason it is popular is because browsers don't support anything else. It might be common and thus often supported but from language design point of view it is a big pile of dogshit.

Wasn't here last night, but I'm glad you're seeing the light. HKTs are the next level of code reusability above first-order generics.

...

>I'm glad you're seeing the light.

I hadn't before? What are you implying, buddy?

Language choice is extremely relevant. A poor language will actively frustrate you and prevent you from using abstractions and writing generic code.

Currently writing C and string manipulation is so tedious it's driving me mad.

>tfw no Lisp-1 language instead of Javascript

It's not really that bad.

Every time I've seen you before, you've been shilling for C# and lambasting FP and its ideas as not useful.

I bet you're a really bad programmer.

Yes it is. It can't even get scoping right.

>le no-argument tiptip

I like C#, but I haven't earnestly suggested that FP is useless for a few years, now.

A person who doesn't understand why language choice matters is more likely than not a bad programmer.

>yuo can of use ptyhon or cobol ro seahash fro thsi projcet
>le chose coblo bcuz lenguaje choize dunt mattr!

Literally all of your points state that you have a choice of two or more things for a certain use case.
And all of them are resolved by just using the newer one.
>Three different UI platforms
yeah, that might actually be a little issue because a lot of people use swing, but JavaFX is very good.
>Most common collections have a second, outdated variant
What?
>Two different enumeration classes
What??
>Two date classes and neither of them is good
What two date classes?
The standard now is Java 8 java.time API, which is inspired by Joda Time, and is very good, and clean. The Date class I think is deprecated or most of its methods are.

>What design paradigm should i learn to replace OOP with?
Not relying on "design paradigms" as crutches in the first place and actually thinking about the problem and the solution without trying to shove them into a dogma.

I actually would like to go deeper and learn assembly some time in the future, but right now i don't have the time, patience nor motivation.
But that's not my issue.

When i started programming they quickly started oop into us, an now i've gotten to a point where every problem i try to tackle looks lika a class diagram in my head. I can't even think if i can't wrap things in a class. It's become ridiculous, and i need to break out of that mindset somehow.

So I learned ALL the basics there are to C++, as my first serious language.

What is next? Should I learn the Java and HTML basics, or should I go DEEP into C++?

I couldn't possibly recommend alcoholism to dull the pain. Not at all.

see
Your advice is entirely true and equally unhelpful.

>So I learned ALL the basics there are to C++
And you'll still write code that's not exception-safe.

Well, yeah, I never received any formal software engineering training, despite studying CS.

Nonetheless, I already wrote small tools in C++.

Should I move on or go really, really deep into one language before applying for entry-level jobs?

What do you mean by "basics"?

You guys are such langcucks, /dpt/.

y = -x;

Basically all the core language.

If I want to learn additional stuff, I would have to go into libraries.

Watch Handmade Hero. The bullshit of "OOP", particularly as espoused by C++ (start with objects and orientate code around them), isn't the focus but occasionally he gives it a logical thrashing and explains why he considers it shit for design flexibility and performance.

not sure what you mean by the basics

but learn java too

have you learned standard library stuff? threading? OOP?

his game looks like shit

Can someone explain me the point of universal/isomorphic web apps?
We render the page on server. We dehydrate app and pass the initial state along with html markup. Then a browser renders the markup, but immediately after browser is done with rendering, react app rehydrates and re-renders everything once again.
What's the point of sending the server-rendered markup if it is immediately replaced?

>OOP
Yes.
>Standard library stuff
Depends on what that is ... STL, Boost and Qt, I suppose?
>Threading
Nope, got it.

...

But do you mean in like collegecuck "I know the syntax" way, or the I'm comfortable with the language and I can pretty much do everything in it (not counting library knowlege), with good quality code?
If the first one then stay in C++ and you can learn those libraries if it helps you
If the second one, then it depends on what you want to write. If you want to write webapps learn python or java.

>Most common collections have a second, outdated variant
Stack, Vector, Hashtable.
>Two different enumeration classes
Enumeration and Iterator.
>Two date classes and neither of them is good
Date and Calendar. Date a) is a wrapper for timestamp rathe than actual date and b) is very basic. Calendar tries to solve every use case with it's multiple time systems which makes it very confusing and heavy for most use cases and it still doesn't work for all date systems around the world.

Also there are some related classes which complicate it further like Instant, LocalTime, LocalDate, MonthDate etc.

>b-but they're deprecated
Yes, but that still isn't a valid excuse for keeping them in after all these years. JDK team really should start doing some spring cleaning in their APIs.

>core features like exceptions and oop are just thrown in to fill a checkbox with no planning for them
>doesnt support multithreading at all
>stupid casting rules
>if it encounters programmer mistake it'd rather output something stupid than give up and throw a proper error

Not an argument!

>implying that /wdg/ topics aren't a subset of /dpt/ topics

His game's design and look isn't important, the stream is about the architecture and coding process, explaining the reason of everything underlying it, and that part is pure craftmanship.

those who can, do; those who can't, teach

>The bullshit of "OOP", particularly as espoused by C++ (start with objects and orientate code around them), isn't the focus but occasionally he gives it a logical thrashing and explains why he considers it shit for design flexibility and performance.

He's a fag and his game sucks.

Language choice is important. So i exercising and eating right.

But none of those things are relevant.

sincerely hope this is a joke
C# is much better than Java, not to mention
>C# compiler is open source
>.NET Core is open source and runs on Windows/Linux/Mac
>Mono runs on the above plus iOS/Android/WinPhone/PS4/XB1 and more

dumb tripposter

If he's implying that then he's correct

What's wrong with it?

He said as an anonymous user on an anonymous imageboard

Just how fucking new are you? OSGTP has been here a lot longer than you, kid. Show some damn respect.

>or the I'm comfortable with the language and I can pretty much do everything in it (not counting library knowlege)

Pretty much this.
But!
C++ without libraries is not that much, actually.
You cannot even make a GUI without libraries, so I guess truly "knowing" C++ includes knowing Qt.

i cringed at this poost

he can't make a good game and he hates OOP

really makes you think

Sure you can. Just make the appropriate syscalls.

Why is it that anti-OOP arguments are, well, actually arguments, while pro-OOP arguments are generally just attacks on the OOP critics or fallacious appeals to authority, tradition, etc.?

Surely the pro-OOP people must have some semblance of self-awareness and realize that they are defending something they don't know how to defend?

You don't have to construct new web page for every visitor. This makes serverside stuff super simple which in return makes pages load much faster.

>but it takes longer to fully render because of all that javascript crap
True, but webdev programmers will never admit that javascript might be bad.

>he hates OOP
He sounds reasonable to me

(You)

dumb sameposter

OSGTP is /dpt/'s mummy. Who the fuck are you?

>I came on Cred Forums and they said to hate OOP so now I hate OOP!

Was there ever a worse bandwagon? Even ardent prequel trilogy fags are not this bad.

i think that still debating about the very concept of OOP, even actively "hating" on it in fucking 2016, when OOP languages make up over 50% of usage, is Tea Party-tier

>"knowing" C++ includes knowing Qt.
No. Qt is whole different beast. Qt code is so fucking non-standard that they even need their own custom pre-compiler to get the code to work.

These fucking arguments though

The thing is that anti-OOP people just don't understand OOP. Look at any of Bjarne's comments. Try reading the GoF book and actually trying to understand why OOP enables you to do more than any other paradigm.

OOP cannot be bad. The huge number of systems written using OOP is an attestation to its great merit.

t. Carl

Yeah, but one is still left with few options in C++. If I want to move past the console application form.

Haskell is a great language.

>Try reading the GoF book and actually trying to understand why OOP enables you to do more than any other paradigm.
Ironic, because the GoF patterns are almost always things that are so trivial that they are not even worth noting if you are in a functional language.

>OOP cannot be bad.
If you consider OOP to be a tool to be used when appropriate instead of a paradigm. Under that definition, my argument is that OOP is almost always inappropriate. Same thing, really.

>Was there ever a worse bandwagon?
Yes, OOP.
>they told the managers it would make programmers more easily replaceable so now we have to adopt these piece of shit languages that are basically crippled C and constrained super-verbose LISP
>years and years later you rely on huge libraries and toolsets to work around the massive failures of the languages and end up with a longer training period for newbies and more entrenched toolset knowledge as a pre-req

>anti-OOP people just don't understand OOP
Retard

>just read GoF
We've had this conversation before
GoF is snake oil for the snake oil
GoF only exists BECAUSE of industry OOP, these problems don't exist in proper languages

>anti-OOP people just don't understand OOP
this

>Stack, Vector, Hashtable
Those are 3 different classes with 3 different use cases
I don't know why hashtable is even here, since it's completely different thing than other two
Stack extend the Vector class and has different synchronization strategy.
Mostly you use Vector, Stack is for something else (I honestly don't even know the use cases, I never needed that class)
>Enumeration and Iterator.
Never heard of Enumeration before, never seen anyone use it anywhere, including standard library.
>Date and Claendar
Both of them are old API and LocalTime, LocalDate, MonthDate are the new one.
I agree that they are bad, but I think it was pretty much standard to use external library for dates like Joda Time. That was before Java 8 of course, which brought very clean date api.
>Yes, but that still isn't a valid excuse for keeping them in after all these years. JDK team really should start doing some spring cleaning in their APIs.
Have you ever heard of backward compatibillity?
Well, that's why all the above classes are still around, but I don't see how a couple of deprecated classess which nobody (except legacy systems) uses is a bloat.

Then you need to look at OS interactive programing. Or system close programming, or whatever the fuck the accepted term is in english.

Or learn Qt, GTK, SDL, FLTK or GLFW+OpenGL.

OOP is increasingly deprecating in game development with leads for large studios like Mike Acton confirming that there's almost no technological advantage to using C++ over C beyond the availability of programmers.
Huge swathes of C++ is outright banned at studios like Ubisoft for similar reasons.

Out of these, which one is available for Java as well?

C++ isn't "C plus OOP". Nothing wrong with templates, lambdas, operator "overloading", etc.

as if ubisoft stands for code quality lmfao

Kek, Muratori was a self-avowed Meyer-reading OOPfag for a long time hence the hate. It's not an opposition born out of merely the theory.

The thing is that anti-OOP arguments are predicated on the purveyor's opinions being axiomatic in some way. For instance a common argument is that inheritance is ill-equipped to model real world hierarchies. Well, says who? Some contrived example isn't good enough. Another frequent argument is that the whole noun-verb model of objects and methods is incapable of modelling interaction BETWEEN objects in the real world. Once again, says who?

It's literally contrived examples all the way down.

I'm not saying that OOP is the greatest thing to ever happen to program. I'm not even saying it's all that great. I think multiparadigm is the way forward, because it blends imperative, OOP, functional, etc. styles when they make SENSE to be used. With that said, he whole "OOP IS GOOD FER NUTHIN!" meme seriously needs to die, because it's stupid and the people who believe in it are universally buttlickers.

What the fuck does C++ vs C have to do with the merits, or lack thereof, of OOP, you langcuck? You can do OOP in C.

Provide some examples of where OOP is the right fit.

>You cannot even make a GUI without libraries, so I guess truly "knowing" C++ includes knowing Qt
truly knowing C++ doesn't technically require knowing any libraries (it definitely doesn't require knowing Qt - there are much leaner/simpler GUI libraries, by the way). not knowing libraries just might limit what you can easily do

>C++ without libraries is not that much, actually
it... kind of is. you might want to try "going deep", as you say. you might find it's a deeper rabbit hole than it looks. make sure you're reading modern material, C++11/14 really changed the game. everything you don't know is either something you're missing out on, or something that's gonna bite you in the ass

Stack is old version of Deque, Vector is old version of ArrayList and Hashtable is old version of HashMap. They were really badly written and you had to use custom code to access them if you wanted decent performance. When adding the new collections Java devs put them as seperate classes and left the old ones intact because of that custom coding which doesnt work with the better designed classes.

>Never heard of Enumeration before, never seen anyone use it anywhere, including standard library.
It was the old version of Iterator with worse method naming and no support for optional add/remove functions.

>because it's stupid and the people who believe in it are universally buttlickers

not an argument.
that said, OOP IS GOOD FER NUTHIN!

>You can do OOP in C.
This simple fact really triggers some people.

goddamn I'm pretty sick of the anti-OOP circlejerk that has been particularly bad the past year or so.

why is it that 99% of enterprise code is object oriented? why...why is that?

If you want to see the problems with OOP, read GoF

None of them.

Java has Swing.

I don't know about the others, but OpenGL is availible in java in form of LWJGL, but it's for 3D graphic, not for GUI.

>C++ isn't "C plus OOP".
Quite right. C actually allows you to write a proper dispatch system that isn't a static table you can't touch for little to no reason for example.
And it doesn't have a bajillion side-effects as a consequence of an utterly retarded design committee.

OOP tutorials
OOP classes
OOP training courses
OOP books

Not examples.

It's easier for stupid people

b-but
muh haskell
muh lambdas
muh higher kinded types

>Well, says who?
The diamond problem.

>make sure you're reading modern material

Mkay.
Mind giving me a book or tutorial link? And an example of what I might be missing out?

I didn't say OOP was infinitely powerful or expressive. I know that design patterns are a result of limitations.

w e w

I can't think of any, and if I did, they would be just as contrived as the arguments AGAINST oop. The simple fact is that real software is more nuanced.

What people mean by OOP varies by language desu.
C++'s "OOP" is quite easily the most cancerous one though.

polymorphism.

you have 100 types of enemies in a game, they all use similar moves.

New thread:

JavaFX is the current API.

OOP is really good for pajeet-tier programming. You have a simple interface that has simple methods. You dont need to think or invent anything new, just connect the dots by moving and returning variables. When you hear about AI replacing programmers it's this kind of work that is being replaced.

>why is it that 99% of enterprise code is object oriented?
Probably because you're working with GUI's and other shit whose libraries force you to resort to a OOP style and whose models aren't utterly brainbreakingly terrible.
The second you have to do something that requires real performance any idiomatic OOP flies out the window fast.

OOP isn't just not infinitely powerful or expressive, it's EXTREMELY LIMITED in its power and expression.
OOP, especially in C derivatives, is extremely brittle and poorly composable.

That's just code reuse, not specifically polymorphism. Do you really think OOP is the only thing that nets you either of those things?

Thanks mummy!

That's not an argument.

>truly knowing C++ doesn't technically require knowing any libraries
I disagree. I would claim you need to be familiar with stl to be able to claim knowledge of C++.

>The second you have to do something that requires real performance any idiomatic OOP flies out the window fast.
not really, you pack related data into structs ("objects") and you have related functions/methods which operate on the data

All of which will be different and should probably reuse code in lieu of setting up retarded hierarchies.
If polymorphism in game development is used it's generally as a huge entity blob which all entities are composited of.

If you can do 3D, you can do D2, and if you can do 2D you can do GUIs.

using opengl for GUI is retarded, only ok for games and games typically have very rudimentary start menus

I don't know what century were last you coding with java but thing like ArrayList are here since java 1.2.
The devs had to leave the old classes because of backward compatibility, but I don't see how that's a bad thing since everyone uses the new classes anyways, which are clean and well documented.
The only case that would be bad is if people were using both, like in case of swing vs JavaFX which was your only valid argument.

What people mean by OOP varies by individual. It seems no one can actually agree on what OOP is, when pressed on the matter.

You also can code a webapp in assembly but you don't do it, because it's fucking stupid.

coding a webapp in assembly is several orders of magnitude more stupid than coding a gui in opengl.

inheritance isn't particularly useful because it allows overriding.
overriding results in a sub type relying on the concrete implementation of the method it's overriding, not just the api and the abstraction
the fragile base class problem, basically.
encapsulation is a useful thing, no doubt.
having a special syntax for stateful functions (methods) isn't that bad either.
what's bad is attempting to throw problems that can be solved without state escaping the function into an object.
you end up with the same syntax for both stateful and stateless computations and the advantage of having two seperate syntaxes is ruined.
if you use OOP within these boundaries (encapsulation to expose a consistent API and to hide both state and implementation, classes + methods instead of functions only when the class needs to encapsulate state, composition instead of inheritace) then oop is completly fine.
i'd also be fine with using a class with no state to use interfaces as a collection of function types, if the language has no construct for that.
the real issue at hand is the way oop is taught at school: a silver bullet to software architecture by supposedly making all code more readable by using objects to turn normal code into code that follows the "subject verb object" structure.
using patterns blindly is also an issue, because it often complicates the necessary abstraction a lot more just to add redundant extension points that'll never be utilized and to make the code look more like english.
the same goes for using inheritance: it's taught that inheritance is a silver bullet to model hierarchies, instead of teaching it as just another type of abstraction with pretty strong limitations.
ruby is an especially contrived example where the idea of code having to look like english went rampant.

bjarne's books are good
read up on anything in these you don't know
isocpp.org/faq/
gotw.ca/gotw/
herbsutter.com/gotw/

you should definitely know the STL, i figured that was a given

then agian, this opinion might be slightly tinted by the the fact that i know a bit of OpenGl, but not assembly.

Do you ever decide to ask a question, but by the time you're done typing up the post you've realized all the replies, sou you just don hit post?

No.

>LOL so hard... break rib.
>Decide to rest from Cred Forums for my health...

U b 4kin killin meh, bwa...

56823905 (You)

Am I ever going to follow a tutorial and have the tutorial code actually compile correctly?

...

>>Rust or Nim-lang?
>Neither.

Why?

Trying to figure out how to remove duplicate service types from this query but keep the latest one. SQL 2008

$tsql = "SELECT * FROM contracts WHERE client='{$_POST['client']}' ORDER BY serviceType";

...

'; TRUNCATE TABLE contracts; --

...

This is awful but it worked :^)

$tsql = "SELECT DISTINCT updated, clientRef, client, serviceType, product, provider, qty, rate FROM contracts WHERE client='{$_POST['client']}' ORDER BY serviceType";