• We are delighted to introduce GiftBot 2.0, the next generation of our popular gifting feature. To celebrate, we'll be giving away some incredible prizes over the coming weeks in one big Giveaway Extravaganza!

Programming |OT| Functional, Imperative, OOP, Cargo-Cult,... all are welcome!

MotiD

Member
Oct 26, 2017
785
I finally took the exam for my Java course a couple of days ago.
The course actually ended back at the end of June, but I felt like I wasn't ready for the 2 previous dates I could've taken the exam at.

I answered all the questions and left with a pretty good feeling, although the 2 questions where I have to actually write my own code (a recursion problem and a problem that has to be solved with the lowest time and space complexity possible) were pretty hard.
They almost always are, but I've managed to solve a lot of previous exams successfully but the combination of this being the actual exam and the first one I took in a while at that made me nervous and I spent the first hour on the first question exclusively.
They might be brutal scoring the first 2 questions but I’m pretty sure I’ll pass either way, but even so I want a good score so I might take the exam when it’s available again in February or March.

Anyways, in the meantime I want to keep getting better at programming and tip my toes into Unity and game programming.
I want to transition from Java to C#, which from what I understand shouldn’t be that difficult.
For how busy this course was there’s still a lot of things we didn’t touch on, so I'd appreciate any good resources for transitioning from Java to C# specifically, and C# in general.

I would also appreciate some general advice on what I could do to advance my knowledge in this field, maybe even dabble in other languages.
 

Post Reply

Member
Aug 1, 2018
1,934
Anyways, in the meantime I want to keep getting better at programming and tip my toes into Unity and game programming.
I want to transition from Java to C#, which from what I understand shouldn’t be that difficult.
For how busy this course was there’s still a lot of things we didn’t touch on, so I'd appreciate any good resources for transitioning from Java to C# specifically, and C# in general.

I would also appreciate some general advice on what I could do to advance my knowledge in this field, maybe even dabble in other languages.
C# and Java are very similar in how they're structured. Going from Java to C# shouldn't be too hard especially since (at least to me) Java is the more painful of the 2 to deal with.

I would say the best way to figure out C# from where you're at is to start taking programs that you've already written in Java and try writing them in C#. You'll probably be able to write like 70-80% of the same code with no problems, but that 20-30% that you don't know will tell you what kind of stuff you should be looking up and reading up on in regards to C#. And even then, most of the new stuff is just going to be learning the different keywords and learning C#'s namespaces vs Java's packages.
 

Pokemaniac

Member
Oct 25, 2017
2,083
I finally took the exam for my Java course a couple of days ago.
The course actually ended back at the end of June, but I felt like I wasn't ready for the 2 previous dates I could've taken the exam at.

I answered all the questions and left with a pretty good feeling, although the 2 questions where I have to actually write my own code (a recursion problem and a problem that has to be solved with the lowest time and space complexity possible) were pretty hard.
They almost always are, but I've managed to solve a lot of previous exams successfully but the combination of this being the actual exam and the first one I took in a while at that made me nervous and I spent the first hour on the first question exclusively.
They might be brutal scoring the first 2 questions but I’m pretty sure I’ll pass either way, but even so I want a good score so I might take the exam when it’s available again in February or March.

Anyways, in the meantime I want to keep getting better at programming and tip my toes into Unity and game programming.
I want to transition from Java to C#, which from what I understand shouldn’t be that difficult.
For how busy this course was there’s still a lot of things we didn’t touch on, so I'd appreciate any good resources for transitioning from Java to C# specifically, and C# in general.

I would also appreciate some general advice on what I could do to advance my knowledge in this field, maybe even dabble in other languages.
I've only dabbled a bit in C# myself, but one thing you might find useful coming from Java is this library

Compared to Java's, the built in collection classes in .NET are honestly pretty bad in my opinion. That library contains a more Java-like alternative that's broadly compatible with the standard implementations.
 

Rush_Khan

Member
Oct 26, 2017
526
During my time programming in C++ outside of work, I found that it's a massive pain to measure the execution time in my code. It seemed like the only option was Google Benchmark, but the amount of setup and boilerplate code to get it working when all I want to do is measure the time between two points in a single source file seemed like overkill. The other option was to use the <chrono> library from scratch, but the namespaces and struct names in there are so long that it's a pain to constantly typedef them in every separate project.

Like, seriously, all I wanted to do was to measure the time taken from one point in the code to another. In as few lines as possible.

That's why I've created a single header file that does this as simply as possible. It's called Clock++ and all you have to do is call:
CLOCK_START();
...
CLOCK_STOP();

That's it. Making this thing has made my hobbyist programming life so much easier. It's also helping me to time my code when doing coding challenges in C++, as I can quickly measure the execution times of two solutions and choose the best one.

I'm currently looking for feedback on the library as well as anyone willing to contribute to it. It's completely open-source and free for anyone to use, duplicate and improve. TBH, I only spent about two days on it, so I'm sure there's ways of improving it.

Clock++ on GitHub

One interesting thing I learned from making this is the template parameter pack in C++. It is really powerful and allowed for the measurement of the execution time of any function. It basically allows for variadic templates (similar to variadic arguments). This blog post is a good read on it.

OK, I made sure re-read the ToS of the site before posting this and it seems fine to post this given that it's open-source and I make no money from it, but if not, I can delete this post.
 

metaprogram

Member
Oct 28, 2017
965
It doesn't really seem that hard?

C++:
#include <chrono>
#include <iostream>

void foo()
{
    using namespace std::chrono;
    
    auto start = system_clock::now();
    do_something_expensive();
    auto end = system_clock::now();
    
    std::cout << "It took " << duration_cast<milliseconds>(end - start).count() << " milliseconds\n";
}
 

Rush_Khan

Member
Oct 26, 2017
526
It doesn't really seem that hard?

C++:
#include <chrono>
#include <iostream>

void foo()
{
    using namespace std::chrono;
    
    auto start = system_clock::now();
    do_something_expensive();
    auto end = system_clock::now();
    
    std::cout << "It took " << duration_cast<milliseconds>(end - start).count() << " milliseconds\n";
}
That last line makes me feel sick... And this is the bare minimum for millisecond precision (what about when using the high_resolution_clock?).

Now imagine doing all of that in multiple places in your code :D Fun.
 

metaprogram

Member
Oct 28, 2017
965
/shrug. It's nice because you can get the time in different units depending on how you want it reported.

C++:
// Hide this code away in some header file
template<typename Duration>
static auto ms(const Duration &d)
{
    return duration_cast<std::chrono::milliseconds>(d).count();
}

template<typename Duration>
static auto us(const Duration &d)
{
    return duration_cast<std::chrono::microseconds>(d).count();
}

void foo()
{
    auto start = system_clock::now();
    bar();
    auto end = system_clock::now();
    std::cout << "Time: " << ms(end - start) << "ms\n";
    std::cout << "Time: " << us(end - start) << "us\n";
}
I guess I don't really see how the macro version is much better, and it might actually be worse, because now a person reading the code can't actually tell what it's doing. It doesn't even look like you're saving any characters with the macro version, and this way you can do something else with the time other than whatever the macro decides to do with it (log it to a file, to stdout, do a calculation with it, etc).
 

Rush_Khan

Member
Oct 26, 2017
526
I guess I don't really see how the macro version is much better, and it might actually be worse, because now a person reading the code can't actually tell what it's doing. It doesn't even look like you're saving any characters with the macro version, and this way you can do something else with the time other than whatever the macro decides to do with it (log it to a file, to stdout, do a calculation with it, etc).
No, I don't agree with that, sorry. There are many reasons why encapsulating and abstracting away the complexity of something can be beneficial, and that's exactly what the aim of this library is. Regarding your last point, you get the execution time from the return value of CLOCK_STOP() to do whatever you want with, and that's the only data you really need.

But yes, it would be nice to get the time in different precisions (s, ms, ns) so thanks for the feedback.
 

MotiD

Member
Oct 26, 2017
785
C# and Java are very similar in how they're structured. Going from Java to C# shouldn't be too hard especially since (at least to me) Java is the more painful of the 2 to deal with.

I would say the best way to figure out C# from where you're at is to start taking programs that you've already written in Java and try writing them in C#. You'll probably be able to write like 70-80% of the same code with no problems, but that 20-30% that you don't know will tell you what kind of stuff you should be looking up and reading up on in regards to C#. And even then, most of the new stuff is just going to be learning the different keywords and learning C#'s namespaces vs Java's packages.
I've only dabbled a bit in C# myself, but one thing you might find useful coming from Java is this library

Compared to Java's, the built in collection classes in .NET are honestly pretty bad in my opinion. That library contains a more Java-like alternative that's broadly compatible with the standard implementations.
Thanks a bunch.
'Translating' programs I've written in Java to C# is actually brilliant, really like this idea.
 

lupin23rd

Member
Oct 27, 2017
71
Question for Java folks, is there something specific about Java 8 that is what you might call a "paradigm shift" such that it would be called out as something specific to know?

Recently got word from a recruiter that a company rejected my resume, and he wants to push me again, but is asking about my knowledge on Java 8, and also called out stream API and lambda expressions. Note this is for a QA automation role, so I'm kind of amused they are really digging to this level. I have Java experience writing test automation but not specifically with those latter two features (although I've seen them used).

Over the summer I've been taking a course to brush up on my Java and I have yet to hit this section, but I feel like these are areas where you can spend a few hours and figure it out if you are already familiar with the core Java functionality. Or am I mistaken, and there is a lot of new Java 8 stuff that makes Java a whole new world that I need to spend some time to review?
 
Oct 25, 2017
2,418
Question for Java folks, is there something specific about Java 8 that is what you might call a "paradigm shift" such that it would be called out as something specific to know?

Recently got word from a recruiter that a company rejected my resume, and he wants to push me again, but is asking about my knowledge on Java 8, and also called out stream API and lambda expressions. Note this is for a QA automation role, so I'm kind of amused they are really digging to this level. I have Java experience writing test automation but not specifically with those latter two features (although I've seen them used).

Over the summer I've been taking a course to brush up on my Java and I have yet to hit this section, but I feel like these are areas where you can spend a few hours and figure it out if you are already familiar with the core Java functionality. Or am I mistaken, and there is a lot of new Java 8 stuff that makes Java a whole new world that I need to spend some time to review?
Nah you pretty much got it already. Improved collections, functional api and lambdas, and streams are the major shifts with java 8.
 

Dave.

Member
Oct 27, 2017
1,329
What is the best way to learn Javascript and React? I'm trying to get a job as a front end developer and need to learn it. I know html, css, sql, bootstrap and seo. Any suggestions are greatly appreciated.
I knew JS already, but Wes Bos' course "React for Beginners" I found to be excellent. I would recommend it after you've got your head around basic JS, which shouldn't be too tough given what you know already.
 
Last edited:

Bacon

Member
Oct 26, 2017
988
Does anyone think it's strange how much recruiters tend to focus on what languages you know / don't know? Being disqualified from a role because they need Java and I know C++ better than Java is so weird because like, I can pick up Java really easily lol.

I can understand it for really specific frameworks and stuff but for high level languages knowing the fundamentals is way more important than knowing syntax.
 

Zevenberge

Member
Oct 27, 2017
351
Yes, it is. I was phoning with a recruiter this week and they were asking for my "competence in C# on a scale of 1-10". And if I knew ".NET framework" by heart. I was quite flabbergasted that people still focus on the least important aspect of programming.

Then again, many recruiters are just looking for a large enough checklist to be able to sell you as quickly as possible.
 

deprecated

Member
Apr 15, 2019
120
To be fair to .Net (I'm sure others are similar) there's an entire ecosystem of libraries, build systems, and idiosyncrasies that I'm sure they want somebody to at least be familiar with. Sucks getting somebody new in and they're writing in an Ada style or complaining about how build system doesn't do X from Y framework.
 

Namorange

The Fallen
Oct 31, 2017
2,735
Does anyone think it's strange how much recruiters tend to focus on what languages you know / don't know? Being disqualified from a role because they need Java and I know C++ better than Java is so weird because like, I can pick up Java really easily lol.

I can understand it for really specific frameworks and stuff but for high level languages knowing the fundamentals is way more important than knowing syntax.
Usually, based off my experience, recruiters aren't typically technically sound. I think they just go through a checklist. They do not really understand that although Java and C++ are different, the core concepts of programming are similar.
 

metaprogram

Member
Oct 28, 2017
965
Yes, it is. I was phoning with a recruiter this week and they were asking for my "competence in C# on a scale of 1-10". And if I knew ".NET framework" by heart. I was quite flabbergasted that people still focus on the least important aspect of programming.

Then again, many recruiters are just looking for a large enough checklist to be able to sell you as quickly as possible.
It depends where you are in the hiring pipeline.

I think knowing language minutiae is an important sign of your general ability and attention to what i call “product excellence”. But it need not be for a specific language. You should know *some* language in detail. If it’s asked by a non technical recruiter it’s obviously worthless, but once you’re onsite and the interviewer wants to see how deep your knowledge goes, it’s fair game

Personally, I’m a C++ person, so i do occasionally ask questions about C++ minutiae. But it’s always gated behind an initial question “What are you strongest in? C++, algorithms, or systems programming”. I then ask a question on whatever you pick. And if you pick C++, considering you personally said this is your best skill, you had better be impressive in that area. That said, trivia is different and not terribly useful. Like I’ve been asked what the mutable keyword is before. That’s a terrible question. Practical usage of difficult language features is a different story though
 
Last edited:

Somnid

Member
Oct 25, 2017
2,425
I think it depends. Some places only work in a single language and in that case they just want someone who is very proficient there. Nothing wrong with that, it just might not be the right fit. As I do a lot of interviewing for front-end web I ask a lot of specific javascript questions. Not so much about APIs but on how the language works, common CSS properties are also fair game. This is mainly because you cannot have proficiency in front-end web without these. Maybe as WASM features fill in that will change, but then I'd probably start asking about that.
 

Zevenberge

Member
Oct 27, 2017
351
This was my first conversation with the recruiter. I guess they were trying to get an impression on my general skill level. Still, I would consider development practices like agile, DDD and BDD way more important than language proficiency.

Earlier this year I was invited for a first chat at a company, and they let me do an assessment on C# and related frameworks. I can understand that approach.
 

marmalade

Member
Nov 28, 2018
156
Starting a frontend job tomorrow. Previously did something like full stack development, but my new boss asked what sites I read to keep on top of front end development? I don't really read any. Can someone recommend some sites/Twitter feeds I can add to a Twitter list?
 
Oct 25, 2017
2,418
Starting a frontend job tomorrow. Previously did something like full stack development, but my new boss asked what sites I read to keep on top of front end development? I don't really read any. Can someone recommend some sites/Twitter feeds I can add to a Twitter list?
I don’t really either. I read updates to the ECMAScript(proposed and finalized) quarterly as well as CSS standard updates. Anything beyond that is excessive. I also follow latest releases of Vue, Node, and React.
 

Chakoo

Member
Oct 27, 2017
562
Toronto, Canada
Question for Java folks, is there something specific about Java 8 that is what you might call a "paradigm shift" such that it would be called out as something specific to know?

Recently got word from a recruiter that a company rejected my resume, and he wants to push me again, but is asking about my knowledge on Java 8, and also called out stream API and lambda expressions. Note this is for a QA automation role, so I'm kind of amused they are really digging to this level. I have Java experience writing test automation but not specifically with those latter two features (although I've seen them used).
lambda I would say is the biggest, imo, which moves java closer to functional programming. Specially if it's targeting automation.

Does anyone think it's strange how much recruiters tend to focus on what languages you know / don't know? Being disqualified from a role because they need Java and I know C++ better than Java is so weird because like, I can pick up Java really easily lol.

I can understand it for really specific frameworks and stuff but for high level languages knowing the fundamentals is way more important than knowing syntax.
While I agree on the learning languages, it really depends what roll the recruiter is targeting and how soon they need you to be ready to contribute to the project. It's one thing when work itself ask you to say learn Kotlin but I wouldn't go looking at android java developers if I was needing an Obj-C iOS engineer (or vice-versa). A good dev can learn any language in good time but each language has their own quirks and throwing someone new at it can create some really bad technical debt or delays to the project.

Starting a frontend job tomorrow. Previously did something like full stack development, but my new boss asked what sites I read to keep on top of front end development? I don't really read any. Can someone recommend some sites/Twitter feeds I can add to a Twitter list?
Find some good Medium groups to follow maybe? Hackernoon as well?
 

marmalade

Member
Nov 28, 2018
156
Can share a decent dumbed-down tutorial for CSS Grid? learncssgrid.com lost me at the grid-column-end stuff.
 

Ninja_Hawk

Member
Oct 27, 2017
414
//Displays The Latest 20 Years In The Select
HTMLUI.prototype.displayYears = function() {
^Something right here is messing everything up, any ideas? Because as soon as I take the line out, I get my list of dates. I'm following a tutorial learning javascript, which makes it all the more frustrating, i'm following the example exactly, none of my dates is showing up when this line is in play.


//Max & Minimum Years

const max = new Date().getFullYear(),
min = max -20;

//Generate The List With The Latest 20 years
const selectYears = document.getElementById('year');

//Print The Values
for(let i = min; i < max; i++)
{const option = document.createElement('option');
option.value = i;
option.textContent = i;
selectYears.appendChild(option);}
}
 
Oct 25, 2017
2,418
//Displays The Latest 20 Years In The Select
HTMLUI.prototype.displayYears = function() {
^Something right here is messing everything up, any ideas? Because as soon as I take the line out, I get my list of dates. I'm following a tutorial learning javascript, which makes it all the more frustrating, i'm following the example exactly, none of my dates is showing up when this line is in play.


//Max & Minimum Years

const max = new Date().getFullYear(),
min = max -20;

//Generate The List With The Latest 20 years
const selectYears = document.getElementById('year');

//Print The Values
for(let i = min; i < max; i++)
{const option = document.createElement('option');
option.value = i;
option.textContent = i;
selectYears.appendChild(option);}
}
It’s because you’re declaring the method versus calling the code.

Add this after the closing curly brace.

Code:
var htmlui = new HTMLUI();
htmlui.displayYears();
 

spootime

The Fallen
Oct 27, 2017
1,229
Hey everyone, I'm hoping you guys could give me some book recommendations. I'm looking for a book that explains machine learning basics at a high level without getting too deep into implementation. Basically, I'm looking to understand the jargon / basics.
 

Post Reply

Member
Aug 1, 2018
1,934
Hey everyone, I'm hoping you guys could give me some book recommendations. I'm looking for a book that explains machine learning basics at a high level without getting too deep into implementation. Basically, I'm looking to understand the jargon / basics.
This isn't a book, but I took a class on AI and machine learning and my professor used these videos to supplement the lessons we went over in class:


They start off high level when a new subject is introduced and then dig down further into implementation, so you could skip around and look for things that seem interesting
 

spootime

The Fallen
Oct 27, 2017
1,229
This isn't a book, but I took a class on AI and machine learning and my professor used these videos to supplement the lessons we went over in class:


They start off high level when a new subject is introduced and then dig down further into implementation, so you could skip around and look for things that seem interesting
Thank you, I'll check these out
 

Chakoo

Member
Oct 27, 2017
562
Toronto, Canada
Hey everyone, I'm hoping you guys could give me some book recommendations. I'm looking for a book that explains machine learning basics at a high level without getting too deep into implementation. Basically, I'm looking to understand the jargon / basics.
This mostly focuses on deep learning but I like how this series explains it.
 

Kwigo

Avenger
Oct 27, 2017
2,733
Hey ProgrammingEra,

I somehow managed to get a job as SysAdmin/Dev for an application that uses a proprietary language. Now I'm not a dev myself, but I'm lucky enough to have a boss that let's me take time to learn while the senior consultants to most of the work atm.

Now while I've already learned a lot, I still see a huge gap between the consultants and myself. They are able to open up any script in this language and directly understand and fix it, while I first need to read it through 20 times before even understanding what it's even supposed to do.

Now since this language is proprietary and embedded so deeply in this application, I can't quite learn by doing, so I was thinking about learning java on the side while on the job, just to deepen my know how and get a better grasp of programming, OOP, logic, etc...

My boss isn't against this idea per se, but he was wondering if there was any kind of online course I could do like 4-5 hours a week where we could actually somehow track my progress. I don't mind having to pay for it myself as well, and we don't care about any certification. It would just be good to be able to see how much progress I'm doing.

Do you folks happen to know about such an online course?

Thank you very very much for any help on this!
 

deprecated

Member
Apr 15, 2019
120
Codecademy is a good start if you're coming from no background in programming. That'll at least get you into the rhythms of structuring your code and they have a computer science course you can do now that uses Python if you want an extended intro.

I've used EdX for an embedded course and a data science course and really enjoyed it both times. You can get certificates from their courses for finishing classes and everything. Coursera and Udemy are two others in the same vein, but I've never tried them personally.
 

Skittles

Member
Oct 25, 2017
4,020
What are some good python and C# books? I've worked on and off with them for years but looking to strengthen my fundamentals with them since those seem to be the most popular languages in my area.
 

phisheep

Member
Oct 26, 2017
742
What are some good python and C# books? I've worked on and off with them for years but looking to strengthen my fundamentals with them since those seem to be the most popular languages in my area.
I'd certainly recommend the Python Cookbook (the latest edition - it's the one by Dave Beazley). It explores a lot of the language that you might have got rusty at or forgotten.