|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
I finally understood what dynamic typing means from that article and now I'm so mad about college. Three semesters of inane problems where I could either waste time designing a solution beforehand, or waste time going back to declare variables. With C, if I don't remember to initialize them I get seg faults (if I have an array, seg faults are guaranteed). With Java, I get NullPointerException, wait, isn't the point of Java that we're too stupid to deal with pointers? Oh, I declared two variables on the same line and the "= new Whatever()" only applies to one! At that rate I was expecting that by graduation I'd have to write an essay to the compiler about how I want to use each variable.
Now I'm here and people are like "j/k dynamic typing exists, PHP has it and somehow it's a problem"? PHP is momentarily my favourite language!
But seriously, it seems I need to decide whether to learn PHP or JS, which are ugly but make me money, or Python, which is pretty but would starve me because business people know it as a highly venomous language. (unless I find a entrepreneur rich buddy who 1) knows enough programming to let other people enjoy it; 2) delivers complete enough stuff so the clients don't care about how.)
I read on old blogs from Patrick McKenzie (damn GTA always making me remember him as Patrick McReary) about Ruby and from Paul Graham about Lisp, but the problem with following old trends is it not only implies one is influenceable but also that lacks a sense of time.
|
On May 11 2015 06:33 Deathmanbob wrote: Hey all, I am pretty noob to this but had a few questions. What is a good way to learn C? I have been just kind of dicking around with HTML, CSS, Java script, Ruby, and been playing around in Unity. I want to stop dicking around and actually learn this for real, and from what I have heard from people, that means learning C.
Though it should be obvious, writing code in HTML, CSS and Javascript will literally teach you nothing about programming in C. You can try and argue that languages like Javascript will since their syntax is somewhat similar at times, but 10 years from now, if you become good at C, you will never in your life admit that knowing Javascript was a factor in learning C. Not only do you need to learn C syntax, but this language requires you to understand what your compiler is doing if you are planning on doing anything serious. Getting the hang of program loading and linking is something you also must master. C also comes more naturally if you learn how to use a debugger. Having said this, I strongly recommend you skip learning the arcane C language and get more experience with C++; that is, if you intend on seeking an actual career in a development field outside of kernel hacking. Maybe you don't. Nevertheless, since they are so closely related , learning about the C compiler and C syntax will be useful for learning C++ much faster.
Hacking in C is how I really learned about the esoteric secrets of C programming starting about a decade ago. Places like http://io.smashthestack.org/ helped me really start understanding how C works. Reading papers such as the Malloc Maleficarum (http://dl.packetstormsecurity.net/papers/attack/MallocMaleficarum.txt) blew my mind after reaching the point where the concepts could be comprehended and appreciated.
I learned infinitely more about C from gdb than I did any textbook; but really, to learn the basics, I can't recommend any one in specific.
|
On May 13 2015 06:00 Soap wrote: I finally understood what dynamic typing means from that article and now I'm so mad about college. [...] Static typing does not have to be annoying. In Haskell, you don't have to declare the types if you don't want to. The compiler does magic and just guesses them for you. The types are then used to tell you that you are making mistakes, for example calling a function that can't work on your data.
|
On May 13 2015 06:00 Soap wrote: I finally understood what dynamic typing means from that article and now I'm so mad about college. Three semesters of inane problems where I could either waste time designing a solution beforehand, or waste time going back to declare variables. With C, if I don't remember to initialize them I get seg faults (if I have an array, seg faults are guaranteed). With Java, I get NullPointerException, wait, isn't the point of Java that we're too stupid to deal with pointers? Oh, I declared two variables on the same line and the "= new Whatever()" only applies to one! At that rate I was expecting that by graduation I'd have to write an essay to the compiler about how I want to use each variable.
Now I'm here and people are like "j/k dynamic typing exists, PHP has it and somehow it's a problem"? PHP is momentarily my favourite language!
But seriously, it seems I need to decide whether to learn PHP or JS, which are ugly but make me money, or Python, which is pretty but would starve me because business people know it as a highly venomous language. (unless I find a entrepreneur rich buddy who 1) knows enough programming to let other people enjoy it; 2) delivers complete enough stuff so the clients don't care about how.)
I read on old blogs from Patrick McKenzie (damn GTA always making me remember him as Patrick McReary) about Ruby and from Paul Graham about Lisp, but the problem with following old trends is it not only implies one is influenceable but also that lacks a sense of time.
Dude if you complain about static typing, you should probably reconsider being a programmer. Static typing is one of the most wonderful things because you know what's up, where it's declared (some random variable doesn't appear out of no where) and what you can expect from it.
If you're too lazy to declare stuff, think of the type safety it provides in return. Do you want some code that you can't explain and that may screw up at any time just because you start using some implicit data type incorrectly?
|
On May 13 2015 06:35 darkness wrote:Show nested quote +On May 13 2015 06:00 Soap wrote: I finally understood what dynamic typing means from that article and now I'm so mad about college. Three semesters of inane problems where I could either waste time designing a solution beforehand, or waste time going back to declare variables. With C, if I don't remember to initialize them I get seg faults (if I have an array, seg faults are guaranteed). With Java, I get NullPointerException, wait, isn't the point of Java that we're too stupid to deal with pointers? Oh, I declared two variables on the same line and the "= new Whatever()" only applies to one! At that rate I was expecting that by graduation I'd have to write an essay to the compiler about how I want to use each variable.
Now I'm here and people are like "j/k dynamic typing exists, PHP has it and somehow it's a problem"? PHP is momentarily my favourite language!
But seriously, it seems I need to decide whether to learn PHP or JS, which are ugly but make me money, or Python, which is pretty but would starve me because business people know it as a highly venomous language. (unless I find a entrepreneur rich buddy who 1) knows enough programming to let other people enjoy it; 2) delivers complete enough stuff so the clients don't care about how.)
I read on old blogs from Patrick McKenzie (damn GTA always making me remember him as Patrick McReary) about Ruby and from Paul Graham about Lisp, but the problem with following old trends is it not only implies one is influenceable but also that lacks a sense of time. Dude if you complain about static typing, you should probably reconsider being a programmer. Static typing is one of the most wonderful things because you know what's up, where it's declared (some random variable doesn't appear out of no where) and what you can expect from it. If you're too lazy to declare stuff, think of the type safety it provides in return. Do you want some code that you can't explain and that may screw up at any time just because you start using some implicit data type incorrectly?
I (as a PHP programmer primarily) concur. It's annoying as hell to retrace some variable being passed to the function back to the point of its origin, checking it every step of the way just to make sure that it is what it should be. Fucking waste of time.
I'm a strong promoter of not ever changing the type of the variable if you can avoid it (if you can't, just create another variable). This way, if the entire team is on the same page, we save a lot of time and nerves.
|
Javascript is probably the language that I find the most trending up right now. You can basically do everything with it, it has really interesting extensions (like TypeScript), cool libraries, developing tools are becoming increasingly rich, it's powerful, it's fast and optimized (thanks Google for starting that trend ;D), to a point where it's a legitimate target language for a compiler. It's not the cleanest language around though (maybe in an ideal world one of its numerous extension attempts would be used).
|
Keep in mind I'm talking about college. I don't think students should be insured against mistakes, the same way they shouldn't insure their beater cars. It costs too much time going back and forth to manage variables when you design on the fly, relative to how much the code is worth (nothing). And if they crash it, it better cost them so they don't do it again.
Instead they're handed a BMW, spend time setting up the GPS instead of learning how to drive, and then rely on the car features to keep them on the road. They pass for good drivers, but it's so uneventful they eventually get bored, and buy an aircraft (take on managing projects), expecting piloting to be not that different from driving, and then they crash and take a bunch of people with them. Because they only know how easy things are.
Note that's the rhetoric people use to say programmers should learn C. I say C is too easy. Fine, if you forget to release memory you'll just see it being gobbled up for no good reason, or it crashes by trying to access stuff it doesn't own in the weirdest ways. But dynamic typing forces to keep the code in your mind, to not have "code that you can't explain". If there is one thing I wanna have a student be able to do is that.
In a production environment which feeds a design for programmers to turn it into something that works in testing, it doesn't pay enough for people to care. Then static typing all the way, so it's harder to break. But that's a lower bound on skill.
|
|
On May 13 2015 09:42 Soap wrote: Keep in mind I'm talking about college. I don't think students should be insured against mistakes, the same way they shouldn't insure their beater cars. It costs too much time going back and forth to manage variables when you design on the fly, relative to how much the code is worth (nothing). And if they crash it, it better cost them so they don't do it again.
Instead they're handed a BMW, spend time setting up the GPS instead of learning how to drive, and then rely on the car features to keep them on the road. They pass for good drivers, but it's so uneventful they eventually get bored, and buy an aircraft (take on managing projects), expecting piloting to be not that different from driving, and then they crash and take a bunch of people with them. Because they only know how easy things are.
Note that's the rhetoric people use to say programmers should learn C. I say C is too easy. Fine, if you forget to release memory you'll just see it being gobbled up for no good reason, or it crashes by trying to access stuff it doesn't own in the weirdest ways. But dynamic typing forces to keep the code in your mind, to not have "code that you can't explain". If there is one thing I wanna have a student be able to do is that.
In a production environment which feeds a design for programmers to turn it into something that works in testing, it doesn't pay enough for people to care. Then static typing all the way, so it's harder to break. But that's a lower bound on skill. This seems confused! Shouldn't you get the same amount of errors in both cases, and the same amount of spots to fix in your code? You do still get an error in Lisp etc., except at runtime instead of from the compiler.
When you do the small toy programs for school, implementing algorithms and stuff, you can then dick around with the function that had the error from the Lisp interpreter's command line while the program is kept running. With something neat like that, I'm sure you can easily patch things up without learning much about what your original mistake in your thinking was.
In any case... it's all a bit beside the point with regards to Java and students? It's not chosen for a good reason. I bet the only reason it's used is just because the students would all cry if you show up with Lisp etc., because that's not useful preparation for the "real world" and for work. I think there was an example not long ago in this thread here. There was someone bitching about having to do something in Lisp because of his professor or something.
|
On May 13 2015 09:42 Soap wrote: Keep in mind I'm talking about college. I don't think students should be insured against mistakes, the same way they shouldn't insure their beater cars. It costs too much time going back and forth to manage variables when you design on the fly, relative to how much the code is worth (nothing). And if they crash it, it better cost them so they don't do it again.
Instead they're handed a BMW, spend time setting up the GPS instead of learning how to drive, and then rely on the car features to keep them on the road. They pass for good drivers, but it's so uneventful they eventually get bored, and buy an aircraft (take on managing projects), expecting piloting to be not that different from driving, and then they crash and take a bunch of people with them. Because they only know how easy things are.
Note that's the rhetoric people use to say programmers should learn C. I say C is too easy. Fine, if you forget to release memory you'll just see it being gobbled up for no good reason, or it crashes by trying to access stuff it doesn't own in the weirdest ways. But dynamic typing forces to keep the code in your mind, to not have "code that you can't explain". If there is one thing I wanna have a student be able to do is that.
In a production environment which feeds a design for programmers to turn it into something that works in testing, it doesn't pay enough for people to care. Then static typing all the way, so it's harder to break. But that's a lower bound on skill. I don't think you're looking at it the right way. Difficulty in programming isn't bound to your programming language. Most of the mainstream languages are still fairly reasonable (regardless of what some of us, myself a prime example, may say) and easy to pick up. What and how you attempt to code is when you'll set the bar on skill, if anything your programming language is your skill floor, definitely not the skill ceiling (and who is interested in the skill floor when you plan to make a career out of it? ^^). I don't think I've ever read anywhere that static typing brings a lower bound on skill (and it doesn't make sense to me). Remember, a programming language is just a tool, it's not your end game, that's not like "Starcraft 2 with automine vs BW with dragoon AI" (because it seems a bit like it's the type of analogy you're getting at :D). Regarless of what choice you make, PHP, Javascript or C are all fine options.
|
It actually doesn't matter what they teach you at school. What matters is that what they teach you is in no way related to what you'll be doing in the real world. Where I work now we have 16 developers, of whom only 2 have CS education and both of them are saying that they only did it to get the paper because they don't use any of the programming skills acquired during 5 years of university.
It's pretty sad though. You spend a lot of time trying to learn something, fresh out of school you review some job offers and you have absolutely no idea what 90% of the requirements mean because no one ever told you that. You're no longer in the world of "write a small app to get your degree", you're in the world of "are you proficient with this framework that uses about a million lines of code to build even the simplest of applications?". You get to work on projects spanning thousands of files, using frameworks, tools and libraries that you haven't heard about before etc.
People who had Java during their CS courses, please tell me - did they teach you anything about stuff like Maven, Spring, Hibernate, JDBC? Because that are just few of the tools you'll be using out in the real world and knowing them well is pretty much a prerequisite for getting a job.
|
|
Teaching programming is hard if you intend to keep up with every single new flavor-of-the-month tool. Tools, libraries and frameworks evolve so fast in the industry (well, faster than professors can update their class material at least :D) and there are so many alternatives that you can't really choose to teach one and leave the others out. And your limited amount of class hours often are barely enough to talk about the language itself in the first place. Not saying that what is tought is adequate, I agree that it's not, but I'm saying that it's also not easy to teach something evolving as fast as software engineering :D. It's not like teaching math or regular engineering, which are pretty stable.
|
On May 13 2015 19:47 Manit0u wrote: It actually doesn't matter what they teach you at school. What matters is that what they teach you is in no way related to what you'll be doing in the real world. Where I work now we have 16 developers, of whom only 2 have CS education and both of them are saying that they only did it to get the paper because they don't use any of the programming skills acquired during 5 years of university.
It's pretty sad though. You spend a lot of time trying to learn something, fresh out of school you review some job offers and you have absolutely no idea what 90% of the requirements mean because no one ever told you that. You're no longer in the world of "write a small app to get your degree", you're in the world of "are you proficient with this framework that uses about a million lines of code to build even the simplest of applications?". You get to work on projects spanning thousands of files, using frameworks, tools and libraries that you haven't heard about before etc.
People who had Java during their CS courses, please tell me - did they teach you anything about stuff like Maven, Spring, Hibernate, JDBC? Because that are just few of the tools you'll be using out in the real world and knowing them well is pretty much a prerequisite for getting a job. Im at the end of my first year of my CS bachelor. One of my courses now is called software quality and testing. The practical consists of testing a small pacman game framework with the help of maven (and eclemma).
|
On May 13 2015 20:33 ZenithM wrote: Teaching programming is hard if you intend to keep up with every single new flavor-of-the-month tool. Tools, libraries and frameworks evolve so fast in the industry (well, faster than professors can update their class material at least :D) and there are so many alternatives that you can't really choose to teach one and leave the others out. And your limited amount of class hours often are barely enough to talk about the language itself in the first place. Not saying that what is tought is adequate, I agree that it's not, but I'm saying that it's also not easy to teach something evolving as fast as software engineering :D. It's not like teaching math or regular engineering, which are pretty stable.
Personally I think that teaching CS should not be teaching about the basic language but picking one framework for it - not necessarily the most bleeding edge, something that's stable enough, has been around for some time and has reasonable LTS versions. You then teach people about the language by teaching them to use said framework. This way they get hands on experience with at least one of them and it'll be easier for them to learn others.
I learned PHP this way, knew barely anything about it before my first internship (had only minor experience with C, LPC and C#) and I was thrown straight away into the development team working on a big project from scratch (web app deployed in 11 countries). First month was pretty hard, but after that I got the gist of it and it all suddenly made sense and work became very enjoyable.
That's pretty much how CS courses should go. First year - some basic programming in something simple like Python, so that people get the hang of the basic programming-related concepts. Second and subsequent years - throw them in the deep end of some framework (like Spring for Java) and actually make them create a working application in teams, including managing git repositories, doing actual research (it's surprising how many people lack basic googling/stackoverflowing skills) and what not.
I know this would make the course much harder, but people who complete it would actually have some useful experience and could find a job in the field much easier. Purely academic approach simply isn't doing anything for most of the people attending those courses and trying to learn all that yourself is nigh impossible.
|
There's also the complete opposite, you know. I actually regret that the academic side of "computer science" wasn't there enough.
I've looked at this here today: http://ncatlab.org/nlab/show/polynomial functor
It is related to object-oriented programming. I don't understand.
You need to give room for something like this as well, or you won't find people that want to work on it in depth. Also, if people can't even vaguely get what the stuff is about, they won't really know if this is actually an interesting topic for them or not. You need to show the basics that would enable people to start approaching those kinds of topics. I felt that was missing.
|
I actually think that you can't teach programming in 3 years of college education like we do over here. Good programmers are not the ones who learned in class the meager things tought in there, they're the ones who were interested in it since they were 12 :D. Myself I never had actual programming classes, and I followed a heavy math curriculum, then a super theoretical computer science master whose structure kinda implies that if you're interested in programming, you already know it, and if you're not interested you don't need to be taught and will become a computer science researcher, most likely.
Maybe in the US you're better at teaching CS and software engineering in a few years, but I doubt the top prospects coming out of college are people who knew nothing about it after high school :D
|
Anecdotal evidence disagrees with the assertion that you cannot teach programming is just 3 years. Many people have learned how to be effective programmers in much less time than that.
+ Show Spoiler +I'd certainly be interested in experimental data, but I don't really keep up on education journal :-/
It's easy to have a revisionist view of your own background after realizing that you are a programmer. Many programmers will say they have been interested since they were 12, but so were a lot of non-programmers who just never "realized" it.
Probably the only thing that programmers have in common is that they like to program.
|
On May 13 2015 19:47 Manit0u wrote: People who had Java during their CS courses, please tell me - did they teach you anything about stuff like Maven, Spring, Hibernate, JDBC? Because that are just few of the tools you'll be using out in the real world and knowing them well is pretty much a prerequisite for getting a job.
Nope. Used Hadoop, but apart from that didn't use any frameworks.
You don't go to school to learn how to work though, you go to school to learn how to learn. One of the greatest disconnects we have right now is between schools and employers.
|
So Im very new to C++ and don't know anything about the language's intricacies yet. I've implemented this algorithm which computes the sum of values on the even levels of a tree. Given that I have to use lists (and not vectors or what have it), is this a good implementation?
+ Show Spoiler + void visitTreeEvenLevels(std::list<Tree> treelist, int i, float& total){ if (treelist.size() == 0){ return; } std::list<Tree>::const_iterator ptr = treelist.begin(); std::list<Tree> cont; for (; ptr != treelist.end(); ptr++){ std::list<Tree> temp = ptr->children; std::list<Tree>::const_iterator ptr2 = temp.begin(); for (; ptr2 != temp.end(); ptr2++){ cont.push_front(*ptr2); if (i % 2 == 0){ total += ptr2->value; } } } ++i; visitTreeEvenLevels(cont, i, total); }
Just looking for criticism from experienced C/C++ people
|
|
|
|