• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

Ke0

Member
If you can't think of something to create, recreate something already out there. We hired a guy with no experience at all just the will to want to learn, his portfolio consisted of Dribbble that he recreated in Django. He had all the features, the different user roles, the social network association (following, followers), the ability to message people if they're available for hire, likes/dislikes, and tagging. And he did them all from scratch.

I've thought about it but I have never gone to one. I always thought it would be a great place to learn and network though. Kind of hesitant to go because I feel like my knowledge is super limited and a novice. Just got my first programming job and its very humbling and eye opening to realize how very little I actually know. lol. But its great learning from so many skilled developers

That's the best reason to go! Hackathons are great for people new to programming. You get to network with experienced programmers who can in turn become a mentor to you and help you become a better programmer.
 

Nelo Ice

Banned
If you can't think of something to create, recreate something already out there. We hired a guy with no experience at all just the will to want to learn, his portfolio consisted of Dribbble that he recreated in Django. He had all the features, the different user roles, the social network association (following, followers), the ability to message people if they're available for hire, likes/dislikes, and tagging. And he did them all from scratch.


That's the best reason to go! Hackathons are great for people new to programming. You get to network with experienced programmers who can in turn become a mentor to you and help you become a better programmer.

Going to echo this. After attending the hackathon the friends I made are more than willing to help me. They've all told me to contact them anytime if I have any questions. And personally for me I know I need a mentor and help to get a project off the ground. Like in my earlier post, the only reason I got a project off the ground was thanks to a friend I made at the hackathon. She mentored and guided me throughout the whole process and in the end we made a silliy pokeball app.

edit: Just saw you other response. Thanks for the tip. Right now I'm my working my way towards being able to reverse engineer something. I tried reverse engineering a site with html and css and got about halfway since fuck css lol.

But damn that would be the dream right now. Getting hired with just the will to learn. That motivates me even more now. Def will make my first major project a recreation of something.
 

vypek

Member
Hm, after reading these posts, I do have to reconsider and think about going to the next hackathon I can. I'm sure there would be a lot I could lean. I've already learned a lot about jUnit testing, using different source control tools and different issue trackers. Working on code that isn't assigned in a class and is used in a professional environment is like an entirely different beast. Have to think and problem solve in different ways. I'm still new to the job so I'm sure I'll get more. Mentorship seems to go a really long way so I'll be looking around for hackathons to join :)

Maybe I'll even pick up an idea to try for some side projects to get more experience.
 

Nelo Ice

Banned
Hm, after reading these posts, I do have to reconsider and think about going to the next hackathon I can. I'm sure there would be a lot I could lean. I've already learned a lot about jUnit testing, using different source control tools and different issue trackers. Working on code that isn't assigned in a class and is used in a professional environment is like an entirely different beast. Have to think and problem solve in different ways. I'm still new to the job so I'm sure I'll get more. Mentorship seems to go a really long way so I'll be looking around for hackathons to join :)

Maybe I'll even pick up an idea to try for some side projects to get more experience.

Glad to hear! Here some sites to check for any in your area.
http://devpost.com/
https://www.eventbrite.com/
https://github.com/japacible/Hackathon-Calendar
http://www.the-hackfest.com/events/
http://angelhack.com/

And someone on reddit made this site to compile most of those hackathon listings into one site.
http://hackathonsnear.me/
 
I've messed around a little bit with Salesforce (just because I see a bunch of job listings with it listed), but yeah found out the Udacity course for it is less about programming than I thought. Now I'm trying Python starting with Learn Python the Hard Way and planning to supplement with whatever else I find useful.

I just got my first programming job as an Android Developer. I also have no formal education and am coming from a completely different field (healthcare).

Personally, I learned from the various online sources available: Udacity, Udemy (good deals at StackSocial.com), YouTube. After I had the basics down, I thought of an app that I'd like to use personally and just started building, learning the things I needed to learn along the way. Obviously there were, and still are, many visits to stackoverflow to figure things out.

I also tried to think of things a business would make use of that I didn't necessarily need in my app (RESTful APIs/json parsing, sqlite databases) and make mini projects using those skills just so I could be familiar with their implementation.

The interview focused on Android platform/tools knowledge and somewhat basic Java knowledge. I was able to show specific features of my app to demonstrate knowledge of some of the questions. I also used many of the same open source libraries that they use, so I'm sure that made them more comfortable with offering me a job.

I haven't started yet and have no idea what to expect.

Good luck!

This is actually a really nice post, coming from someone who has just started picking up programming this past week. I took a high school class but didn't really understand anything and just ended up assuming I was too "stupid" to ever get it (like 90% of the class ended up copying one guy's code to get a passable grade, which now that I think about it probably says more about the class than it did our ability to learn).

Congratulations and good luck at your new job!
 
I decided a few weeks ago to learn Python. It had been awhile since I tried programming (13 years or so). Anyways, I just wanted to get your ideas in what direction I should go with my programming experience. I just keep jumping around from trying to learn different libraries and can never think of a project to work on and get good at. I'll go from plotting out a way to write out Stratego in pygame straight to messing with Django. I've messed with some networking tutorials and books too but it all just seems to advanced for what I really need.

So I guess what I'm looking for is good beginner projects or a place with good exercises to build my familiarity with the programming mindset. I love the coding part but the way I am I just want to learn everything and I need you guys to tell me what to do so I can buckle down on something.
 

Nelo Ice

Banned
I decided a few weeks ago to learn Python. It had been awhile since I tried programming (13 years or so). Anyways, I just wanted to get your ideas in what direction I should go with my programming experience. I just keep jumping around from trying to learn different libraries and can never think of a project to work on and get good at. I'll go from plotting out a way to write out Stratego in pygame straight to messing with Django. I've messed with some networking tutorials and books too but it all just seems to advanced for what I really need.

So I guess what I'm looking for is good beginner projects or a place with good exercises to build my familiarity with the programming mindset. I love the coding part but the way I am I just want to learn everything and I need you guys to tell me what to do so I can buckle down on something.

This article may be of some use.
http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard
 

Ke0

Member
Going to echo this. After attending the hackathon the friends I made are more than willing to help me. They've all told me to contact them anytime if I have any questions. And personally for me I know I need a mentor and help to get a project off the ground. Like in my earlier post, the only reason I got a project off the ground was thanks to a friend I made at the hackathon. She mentored and guided me throughout the whole process and in the end we made a silliy pokeball app.

I suggest bugging that mentor as much as possible to help you. Be selective in what you want help with though, don't go to him/her just for something like CSS help, that can be found online. Ask her to help you with programming basics, less syntax and more getting the mindset to understand a problem and code that will solve that problem. This will usually come in the form of coding exercises/katas.

edit: Just saw you other response. Thanks for the tip. Right now I'm my working my way towards being able to reverse engineer something. I tried reverse engineering a site with html and css and got about halfway since fuck css lol.

But damn that would be the dream right now. Getting hired with just the will to learn. That motivates me even more now. Def will make my first major project a recreation of something.

Honestly, I think the best way to learn CSS is to get examples and break them, and put them back together. Many programmers suggest the same for actual programming, but I don't like to push people to that too hard. Simple code sure, but complex code will start to overwhelm the person learning. You don't need to be a savant in CSS but you'll pick up enough to understand it and from there learning the more intricate stuff becomes cake.

Also, be careful of imposter syndrome, it creeps up very quickly. The number one thing that absolutely slows progress is imposter syndrome. Way too many people who are passionate fall to it sadly. Then they look for an echo chamber and it just spirals from there.

Another good way to learn how to program is testing, I know people who have gone from post beginner (that nebulous area between beginner and intermediate) to competent intermediate.
 

Nelo Ice

Banned
I suggest bugging that mentor as much as possible to help you. Be selective in what you want help with though, don't go to him/her just for something like CSS help, that can be found online. Ask her to help you with programming basics, less syntax and more getting the mindset to understand a problem and code that will solve that problem. This will usually come in the form of coding exercises/katas.



Honestly, I think the best way to learn CSS is to get examples and break them, and put them back together. Many programmers suggest the same for actual programming, but I don't like to push people to that too hard. Simple code sure, but complex code will start to overwhelm the person learning. You don't need to be a savant in CSS but you'll pick up enough to understand it and from there learning the more intricate stuff becomes cake.

Also, be careful of imposter syndrome, it creeps up very quickly. The number one thing that absolutely slows progress is imposter syndrome. Way too many people who are passionate fall to it sadly. Then they look for an echo chamber and it just spirals from there.

Another good way to learn how to program is testing, I know people who have gone from post beginner (that nebulous area between beginner and intermediate) to competent intermediate.

Lol funny you mention bugging a mentor. I just messaged one my friends about being confused about for/in loops in JS. Somehow that lead to using screenhero and now he's showing me how to build a chatroom. Just installed node.
Will def ask him the questions you brought up. Perfect timing!.

edit:Nvm now I'm learning command line stuff now. And he just gave me some hw. Gotta answer some questions and I haven't the faintest clue what's being asked me of lol.

And all I got is this. He went to sleep but was explaining what was happening and I was still lost. Have never used the command line this extensively much less learning node.
t2Dd0v4.png
 
I want to learn some JavaScript frontend programming but I don't know which framework I want to use. I've used jQuery in the past, I'm far from an expert with it. I could probably do what I want with jQuery, but generating HTML elements with it gets kind of cumbersome at some point. So, templates are defintely something I want. I've looked at Ember.js because 2.0 just came out and it looks pretty good, from taking a quick look at the introduction, it feels like a MVC framework. I've heard good things about React.js and Angular also, how are they different?

I installed Ember and Ember-CLI on my machine and I was surprised at how much stuff it packs into a project. I think it has more files than my server-side application currently and it's only the generated project skeleton. Not sure if I like that. It kinda feels like Rails but for the fronted.. I'd prefer an equivalent to Sinatra or Flask (or just any micro-framework) if that makes any sense.
 

grmlin

Member
Ember is a "all in one" solution, it's far more than templating. It is rails for the frontend. Use it for single page apps with an appropriate REST service.

If you know jquery and you want to get things done, use it, and add a templating engine like handlebars into the mix. Nowadays everybody tends to throw giant frameworks onto projects that don't need them (and your live as a frontend dev gets significantly more complex)


If it's only because you want to learn something: I love React, so this would be the framework I would use ;) But it's JS only, if you need a NO-JS solution and/or easy SEO support, things are much more complicated with a framework like React.
 

Ke0

Member
For job potential, learn React and/or Angular, those two will take you the farthest job wise.

I find React to be fun, with that stated Javascript is still the devil. Not sure which language enrages me more JS or PHP, funny enough neither of which will ever die.
 

Nesotenso

Member
I finished reading and doing exercises in the book How To Think Like a Computer Scientist with Python and am now doing exercises on Learn Python the Hard Way.

I am having difficulty understanding the hashmap example he gives in exercise 39.

http://learnpythonthehardway.org/book/ex39.html

can anyone point me to a good resource which explains hashmap or hashing algorithms?
I would like to understand how he implemented it. Looking at a visual explanation of the hashmap, buckets and slots he is talking about might help me.
 
I find React to be fun, with that stated Javascript is still the devil. Not sure which language enrages me more JS or PHP, funny enough neither of which will ever die.

I'm a 15 year and running Java programmer that's been working with Node for a while now. I *hated* JS until I sat down and forced myself to git gud with promises and async instead of constantly stumbling with callback hell, and now when I teach it to others (education is one of the things that I do since I stay technically ahead of a lot of my organization) is hammer the everything-async concept to people and let them know they can't hack their way around it.

JS is still a constant annoyance at times but I deal with it because the prototyping speed and developer ecosystem is unreal.
 
I've posted in this thread before claiming how much I wanted to learn to program.
Finally decided to stop kidding myself and enrolled in a local university for a chance to really learn some stuff.

Took my first summer session full of pre required courses and realized I suck at math. I'm not terrible but going by my final grade I don't have a very strong command of the material. No matter I can get better at this. It's tough but I still find it interesting.

My question to you all is, how much trouble am I in? Will my strengths and weaknesses in math directly reflect my ability to program? While simple arithmetic aren't an issue applying mathematical concepts is where I'm a bit concerned.

Just looking for some perspective, sorry if a bit off topic.
 
Computer science requires a firm undetstanding of a lot of mathematics.
Computer programming does not.

All you really need for most programming tasks is:

- the basics (addition, division, multiplication, subtraction)
- the concept of modulo, which is basically just using the remainder in integer division
- percentages
- negative numbers
- what binary, octal, and hexidecimal are and how to go from base 10 to them and back
- logic constructs and boolean operations

All of this is covered except for binary/hex/octal in college algebra except for logic constructs, for which 99% of usage can be leaned by exposure.

My comp sci program ran us through two semesters of linear alegrba, numerical analysis, three semesters of calculus, etc. None of which is needed for the VAST majority of programming work.

My suggestion is to get a tutor if you need help with the math. Tutoring ranges from free (check the university's math department) to inexpensive, and has a dramatic impact on grades and pass rates.
 

Ke0

Member
I'm a 15 year and running Java programmer that's been working with Node for a while now. I *hated* JS until I sat down and forced myself to git gud with promises and async instead of constantly stumbling with callback hell, and now when I teach it to others (education is one of the things that I do since I stay technically ahead of a lot of my organization) is hammer the everything-async concept to people and let them know they can't hack their way around it.

JS is still a constant annoyance at times but I deal with it because the prototyping speed and developer ecosystem is unreal.

The only reason why I deal with JS myself. Promises don't change much for me, still hate JS with a fiery rage.
 

Antagon

Member
I've posted in this thread before claiming how much I wanted to learn to program.
Finally decided to stop kidding myself and enrolled in a local university for a chance to really learn some stuff.

Took my first summer session full of pre required courses and realized I suck at math. I'm not terrible but going by my final grade I don't have a very strong command of the material. No matter I can get better at this. It's tough but I still find it interesting.

My question to you all is, how much trouble am I in? Will my strengths and weaknesses in math directly reflect my ability to program? While simple arithmetic aren't an issue applying mathematical concepts is where I'm a bit concerned.

Just looking for some perspective, sorry if a bit off topic.

I've been working in software for years and I haven't used anything beyond the absolute basics of math.

The most important thing to become a good programmer is being able to distill abstract and complex problems to smaller pieces. Plus being a bit of a perfectionist helps a lot, if you're working at larger projects it's not enough to just deliver working code. But math is not really important for day to day work.
 

Ke0

Member
It really depends on your area of programming. If you want to get into graphics rendering/programming. You will either be sacrificing blood to the Math Gods, or you get lucky and they bless you.

You might get into machine learning in which you need to talk to that math God

You might get into desktop application development in which it's a tossup on how much is used.

You might get into web application development in which again is a toss up.

It really depends on your focus.

With all that stated, it will never hurt you to read up on data structures and algorithms even if your area of focus rarely uses anything outside of basic math. Who knows, you might find it...fun, despite how school made you hate math by trying to make you memorize it instead of learning the logic of it.

I finished reading and doing exercises in the book How To Think Like a Computer Scientist with Python and am now doing exercises on Learn Python the Hard Way.

I am having difficulty understanding the hashmap example he gives in exercise 39.

http://learnpythonthehardway.org/book/ex39.html

can anyone point me to a good resource which explains hashmap or hashing algorithms?
I would like to understand how he implemented it. Looking at a visual explanation of the hashmap, buckets and slots he is talking about might help me.

Honestly, I'd suggest something like Computer Science Programming Basics to supplement LTHW. Granted that particular one is using Ruby as the language, I'm sure there's something similar for Python. You could just use the Ruby book, the two languages are so damn similar anyway. It's like British English vs American English.

While I think LTHW does a good job at introducing someone to programming, like most other things aimed at beginners, there's this nebulous area between "I got the syntax" and "competent beginner who just needs experience" that no one seems to have quite been able to identify and help.
 

Nesotenso

Member
Honestly, I'd suggest something like Computer Science Programming Basics to supplement LTHW. Granted that particular one is using Ruby as the language, I'm sure there's something similar for Python. You could just use the Ruby book, the two languages are so damn similar anyway. It's like British English vs American English.

While I think LTHW does a good job at introducing someone to programming, like most other things aimed at beginners, there's this nebulous area between "I got the syntax" and "competent beginner who just needs experience" that no one seems to have quite been able to identify and help.

Thanks for the suggestion. I will look into the book. is there an online resource which explains the hashmap algorithm to beginners? I think I can get the CLRS algorithms book from a friend. Does that have a good breakdown? I do understand most of the Python syntax I have encountered but being self taught, I don't have any background in how algorithms like the hashing one are constructed.
 

Ke0

Member
Thanks for the suggestion. I will look into the book. is there an online resource which explains the hashmap algorithm to beginners? I think I can get the CLRS algorithms book from a friend. Does that have a good breakdown? I do understand most of the Python syntax I have encountered but being self taught, I don't have any background in how algorithms like the hashing one are constructed.

CLRS is a great book if you can understand it.

The bold is pretty much part of that nebulous area I spoke of that no one's online site has really figured out how to address.

Honestly how I would approach it is, enter the code line for line regardless if any of it makes any sense to you or not. Write down in the comments what does make sense to you and/or what you think that particular piece will do. Step back and look at the code as a whole, taking a guess on what it's suppose to do. For the portions that make no sense to you, go back and read up on it and do exercises focused on it (Example, if you don't really understand hashes, find another source that focuses on hashes at an introductory level).

I think the problem many websites/books have self taught people run into is the idea that programmers know everything about programming and when they sit down they will code into existence. It's why I recommended that Computer Science Basic Programming book to you. It helps build the mindset of looking at the problem you're trying to solve, writing the steps in plain English, then pseudo code, then real code.

You basically have to break out of the "human" mindset on how to do things/write instructions and realize computers need literal instructions for every step.

Example, if I asked you how to make peanut butter and jelly sandwich. You'd probably say something like "get two pieces of bread, spread PB on one, and jelly on the other, combine them then eat". If you gave those instructions to a computer nothing would be done. What is Peanut Butter? It needs to be defined, as does Jelly, as does bread these are objects, spreading the jelly onto the bread, how? That's a function (one or more), etc.

One thing I always hear people suggest is writing down your activities step by step as a way of practicing. Breaking down the object, the parameters/arguments, the functions needed etc.

I also suggest doing code katas in ever increasing difficulty. It might be hard as hell, but once you get one or two you'll start to figure things out. Things will start to click, and at that point you're slowly exiting that nebulous area I spoke of earlier.

These two are TDD based so you're not going in blind.

exercism.io
codewars
 

Haly

One day I realized that sadness is just another word for not enough coffee.
Learning Javascript.

I can't tell what's a variable or an object or a property or a function anymore.

Send help.
 

upandaway

Member
Learning Javascript.

I can't tell what's a variable or an object or a property or a function anymore.

Send help.
Had an interview a couple of weeks ago where the guy gave me a small assignment for home in node.js, never messed with javascript before.

I had no idea what I was doing. It felt glued together with tape. Everything looks the same
 

Nelo Ice

Banned
Learning Javascript.

I can't tell what's a variable or an object or a property or a function anymore.

Send help.


Had an interview a couple of weeks ago where the guy gave me a small assignment for home in node.js, never messed with javascript before.

I had no idea what I was doing. It felt glued together with tape.

I'm learning javascript as well. As an exercise my friend asked me to run an app as node server.js and it involves process.argv. I was also asked to make a command line tool. All using node and the command line of which I have no knowledge of. Even after we used screen hero and he controlled my pc lol. I was sitting in brackets wondering what in the blue hell am I supposed to do?!. The only thing I kinda got was putting node in the command line and server.js is the file name. Naming it that made things confusing since I thought we were making a server or something until he mentioned it was a bad idea for a file name.

I barely know the syntax of the javascript as it is so I've been sitting here all day ignoring it since I have no idea what any of it means haha.
 
Computer science requires a firm undetstanding of a lot of mathematics.
Computer programming does not.

All you really need for most programming tasks is:

- the basics (addition, division, multiplication, subtraction)
- the concept of modulo, which is basically just using the remainder in integer division
- percentages
- negative numbers
- what binary, octal, and hexidecimal are and how to go from base 10 to them and back
- logic constructs and boolean operations

All of this is covered except for binary/hex/octal in college algebra except for logic constructs, for which 99% of usage can be leaned by exposure.

My comp sci program ran us through two semesters of linear alegrba, numerical analysis, three semesters of calculus, etc. None of which is needed for the VAST majority of programming work.

My suggestion is to get a tutor if you need help with the math. Tutoring ranges from free (check the university's math department) to inexpensive, and has a dramatic impact on grades and pass rates.

Yeah, I started learning C# last month and spend about 2 hours a day in the week and 4-5 on weekend learning it. My first language. Man, I would have done this in my 20s if I had know how much fun it would be. Some discouraged me from learning it for years. I decided to take the jump on my own and see how it is.
 

Ke0

Member
Yeah, I started learning C# last month and spend about 2 hours a day in the week and 4-5 on weekend learning it. My first language. Man, I would have done this in my 20s if I had know how much fun it would be. Some discouraged me from learning it for years. I decided to take the jump on my own and see how it is.

Good to see/read you're getting into it. Never too late to learn, this time next year you'll be dropping knowledge on the new crop of Gaffers who want to learn how to program. :)
 

Nelo Ice

Banned
So nearly finished with codecademy's JS course and well nothings really sticking. I can see why it's not the greatest since most of the time I ended up looking at the solution on their forums. Then I read explanations and usually end up figuring out how everything connects and what the code is doing from there.

I know I have friends and mentors to ask but besides that I'm trying to learn how I can be productive on my own time. And on that end I'm scouring like every resource I can and hoping something sticks.

Besides codecademy, I've gone through some Treehouse. And the reason I was on codecademy was due to following freecodecamp. I briefly tried doing one of their bonfires and was completely lost on how to even start :(. The learning curve is real. I really just need to find a method of learning that'll stick with me.

Aside from all the frustration, I'm having a blast trying to learn. Unlike when I was in school, I actually find myself wanting to learn programming. I just keep telling myself every time I hit a wall it's normal and I'm not stupid, just learning programming is incredibly difficult.. Well here's to hoping the 2nd hackathon I'm going to today will help me out.
 
I decided a few weeks ago to learn Python. It had been awhile since I tried programming (13 years or so). Anyways, I just wanted to get your ideas in what direction I should go with my programming experience. I just keep jumping around from trying to learn different libraries and can never think of a project to work on and get good at. I'll go from plotting out a way to write out Stratego in pygame straight to messing with Django. I've messed with some networking tutorials and books too but it all just seems to advanced for what I really need.

So I guess what I'm looking for is good beginner projects or a place with good exercises to build my familiarity with the programming mindset. I love the coding part but the way I am I just want to learn everything and I need you guys to tell me what to do so I can buckle down on something.

https://github.com/karan/projects

This is a decent list. The problems vary greatly in difficulty (optimizing a SQL query string vs calculating Fibonacci numbers for example) but you should be able to find something interesting in there.
 

Nesotenso

Member
So nearly finished with codecademy's JS course and well nothings really sticking. I can see why it's not the greatest since most of the time I ended up looking at the solution on their forums. Then I read explanations and usually end up figuring out how everything connects and what the code is doing from there.

I know I have friends and mentors to ask but besides that I'm trying to learn how I can be productive on my own time. And on that end I'm scouring like every resource I can and hoping something sticks.

Besides codecademy, I've gone through some Treehouse. And the reason I was on codecademy was due to following freecodecamp. I briefly tried doing one of their bonfires and was completely lost on how to even start :(. The learning curve is real. I really just need to find a method of learning that'll stick with me.

Aside from all the frustration, I'm having a blast trying to learn. Unlike when I was in school, I actually find myself wanting to learn programming. I just keep telling myself every time I hit a wall it's normal and I'm not stupid, just learning programming is incredibly difficult.. Well here's to hoping the 2nd hackathon I'm going to today will help me out.

Have you looked at Udacity? I think they have a free tier but to unlock everything you have to be a subscriber.
 
Javascript becomes far more usable as a large-scale programming language when you impose restrictions on yourself with some sort of compilation framework. I work with it in Google Closure and when done correctly, turns your code base into a thing of beauty compared to 8 layer nested closure hell with god knows what types and scoping that you see elsewhere.

For anyone interested, take a peek at the Openlayers 3 codebase on Github to get a sense for what Javascript can look like when you enforce strict formatting and typing:
https://github.com/openlayers/ol3/blob/master/src/ol/map.js

Compare it to something like the jQuery codebase to get a sense of the difference in readability and structure:
https://github.com/jquery/jquery/blob/master/src/core.js
 

Krejlooc

Banned
Return to an old project for the first time in over a year, start doing a little house cleaning.

Run into bug - an object selector I built wasn't choosing the correct objects after being seeded a randomized value from entropy.

Worked fine in debug build, wouldn't work at all in release build

7 hours debugging - had to resort to cave man messy printf methods - only to eventually realize I had manually disabled uninitialized integer warnings like 2 years ago on this project. Debug build set memory correctly, so the value of the uninitialized integer just so happened to align correctly for my needs. Release build obviously was not.

This is why you never disable compiler warnings, lol
 

wolfmat

Confirmed Asshole
For anyone interested, take a peek at the Openlayers 3 codebase on Github to get a sense for what Javascript can look like when you enforce strict formatting and typing:
https://github.com/openlayers/ol3/blob/master/src/ol/map.js

Compare it to something like the jQuery codebase to get a sense of the difference in readability and structure:
https://github.com/jquery/jquery/blob/master/src/core.js

I don't understand why you're comparing these two. One of them is an organizational structure that integrates into a complete framework, the other defines a workflow interface for Javascript to trivialize common operations and data structures.

I guess the number of spaces they use for tabs differ, and that is a factor in terms of readability. (I like 4 spaces personally.)
Apart from that, I don't really feel comfortable reading the map code from Openlayers. I feel like I have to jump around a lot in the code to completely understand what's going on there.
jQuery code is a lot of "here we're gonna check if the assumption we've associated with this-and-that function name is correct" and "this data is now organized and interfaced like so" stuff. That's always uncool code.
 

Nelo Ice

Banned
Actually helped contribute to my team in my 2nd hackathon with an html page and some basic css. Feelsgoodman.jpg. Excited for results but even better made more friends and people willing to help me on my programming journey.
 

upandaway

Member
Reading up on C# using this guide and came across this:

j2BBtLK.png


Am I missing something? Why is this okay? The constructor is supposed to enforce that all instances of the struct will be in a valid state, right?

In Java if you write a constructor it invalidates the implicit default constructor.
 

hateradio

The Most Dangerous Yes Man
Am I missing something? Why is this okay? The constructor is supposed to enforce that all instances of the struct will be in a valid state, right?

In Java if you write a constructor it invalidates the implicit default constructor.
Structs are different than objects based on classes.

Java doesn't actually have structs. You have to make a class.

Parameters in C# can be set to a default value, in this case I assume that all the values are set to their defaults (null or 0) when creating a "new" struct.
 

Water

Member
What are structs supposed to be used for then?

For efficiency. An array of them is laid out in one contiguous memory space, which is impossible for classes. Also, the C# compiler can keep temporary structs on the stack instead of the heap so they don't cause pressure on the GC.
 

hateradio

The Most Dangerous Yes Man
What are structs supposed to be used for then?
Well, structs appeared in C (and other languagse) to group related values as part of a single value.

Eg, you can make a person structure which has an age, name, id.

Classes are, I would say, more advanced concepts than structs. They are typically reference types that have inheritance, methods, and operate on restrictions (private, public).
 

upandaway

Member
Okay I see, then I guess it's better to use structs for small "immutable" objects (as I would use them). Still though - why is it necessary to enforce the implicit constructor? Isn't it better if you have a guarantee that every struct instance is in a valid (non-default) state?

I see you can't even force the behavior by throwing an exception in the default no-arguments constructor, because the compiler won't let you write such a constructor at all.
 

Water

Member
Okay I see, then I guess it's better to use structs for small "immutable" objects (as I would use them). Still though - why is it necessary to enforce the implicit constructor? Isn't it better if you have a guarantee that every struct instance is in a valid (non-default) state?
Interesting question. Clearly it's convenient for the programmer to have the option to write a custom parameterless constructor for a struct, and that feature is present in C++ where it doesn't seem to be a problem. Maybe it wasn't originally put in C# for reasons of simplicity, dunno. Looks like language developers were looking to add it to C# 6.0, but decided against it due to issues that surfaced: https://github.com/dotnet/roslyn/issues/1029

From what I'm reading, this obstacle is simply a matter of inertia and cost, and there's no technical reason why the feature couldn't be added into the language while maintaining performance in all cases where a custom constructor is not used. Compilers could look at individual structs to determine whether a custom constructor is present and an optimization can be done, instead of clumping all structs together.
 
I'm not sure this is the right place but...anyone here used Osmosis to create map files?
Basically, I need to implement an offline map in my android application, and apparently I need to use a java applet called Osmosis+a plugin from mapsforge.
The problem is that this applet doesn't seem to like Java 8, which is the only version I have installed on both my computers.
this is the error I get on Windows:
Code:
C:\Windows\system32>osmosis
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

has value '1.8', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
On mac I get a missing plugin error (NOT the mapsforge one)
Where can I download a version of java 7?

Sorry if this the wrong place to ask.
edit: ok nvm I found the download page, crossing fingers...
 
Have an interview for a .net job this week. incredibly nervous since I don't have much c# or .net experience. Although I guess they wouldn't have even bothered to interview me if they thought some of my projects weren't at least somewhat applicable to the job?

The job description seemed more inline with wanting someone who can learn and adapt moreso than anything else.
 
After 4 tries, I successfully trained my first LSTM recurrent neural network last night! Getting the CUDA part up and running felt like an achievement, the rest is just waiting...

Now for more than 3 input samples. Maybe I can get some magic to happen.
 
Top Bottom